ChangeLog
[mono.git] / mcs / mcs / ChangeLog
1 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2
3         A fix for bug #81979
4         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5         I am really not sure whether this is the best fix.
6         
7         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
8         only once.
9         
10 2007-08-14  Marek Safar  <marek.safar@gmail.com>
11
12         ** C# 3.0 Object and collection initializers (major re-write)
13         
14         * assign.cs (DoResolve): Initializers are not assign related.
15         
16         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
17         used during collection or object initialization.
18         
19         * expression.cs (Error_InvalidArguments): Add initializers specific
20         messages. More will come later because it requires some general
21         refactoring.
22         (New.DoResolve): Better error handling for unsafe types.
23         (EmptyExpressionStatement): New class.
24         (ElementInitializer): An object initializer expression.
25         (CollectionElementInitializer): A collection initializer expression.
26         (CollectionOrObjectInitializers): A block of object or collection
27         initializers.
28         (NewInitialize): New expression with element/object initializers.
29         
30         * statement.cs: Reverted object/collection initializer hacks.
31         
32         * typemanager.cs (CSharpName): Filter __arglist type.
33         
34 2007-08-09  Marek Safar  <marek.safar@gmail.com>
35
36         ** C# 3.0 Anonymous Types (update to the latest standard)
37         
38         * expression.cs (Binary.ResolveOperator): Threat all null based types
39         same.
40         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
41         (AnonymousTypeParameter): Updated.
42         
43         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
44         (AnonymousTypeClass): New anonymous type container.
45         
46         * class.cs (AddField): Return operation result.
47         
48         * generic.cs: Another empty TypeArguments overload.
49         
50         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
51         are stored at top of normal hierarchy.
52         
53         * typemanager.cs (CSharpName): Filter anonymous types.
54         
55 2007-08-09  Marek Safar  <marek.safar@gmail.com>
56
57         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
58         as single Concat call. How could we miss that :-(
59         
60 2007-08-08  Marek Safar  <marek.safar@gmail.com>
61
62         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
63         
64 2007-08-07  Miguel de Icaza  <miguel@novell.com>
65
66         * expression.cs: Fix the previous commit, the creation of the
67         arguments array list needs also to be conditional on the arguments
68         not being null.
69
70         * class.cs: Add a little bit of help to help narrow down problems.
71
72         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
73         not try to copy in that case. 
74
75         * driver.cs: When building SMCS, include a new different set of
76         default assemblies here.   Do this here so we can control whether
77         to include the default assemblies with /noconfig.
78
79 2007-08-03  Marek Safar  <marek.safar@gmail.com>
80
81         A fix for bug #81979
82         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
83         only.
84
85 2007-08-03  Marek Safar  <marek.safar@gmail.com>
86
87         A fix for bug #82300
88
89         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
90         we are in probing scope.
91
92 2007-08-03  Marek Safar  <marek.safar@gmail.com>
93
94         A fix for bug #82301
95
96         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
97         (Statement.CloneTo): Clone and not map children blocks.
98
99 2007-08-03  Marek Safar  <marek.safar@gmail.com>
100
101         A fix for bug #82299
102
103         * expression.cs (LocalVariableReference.CloneTo): Remap local info
104         variable too.
105         
106         * statement.cs (Statement.CloneTo): Clone variables before statements
107         to allow remaping of local variables.
108
109 2007-08-03  Marek Safar  <marek.safar@gmail.com>
110
111         A fix for bug #82296
112
113         * anonymous.cs,
114         * report.cs: Log crash details for future clone problems.
115         
116         * statement.cs (Return.Clone): Don't clone non-existent expression.
117
118 2007-08-03  Raja R Harinath  <harinath@gmail.com>
119
120         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
121         (Class.AddBasesForPart): Move CS0537 check here from ...
122         * cs-parser.jay (class_declaration): ... here.  Move calling of
123         'AddBasesForPart' to ...
124         (class_bases): ... here.
125         (struct_declaration, interface_declaration): Update to changes.
126
127 2007-08-02  Marek Safar  <marek.safar@gmail.com>
128
129         A fix for bug #81923
130
131         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
132         conversion is allowed.
133
134 2007-08-02  Marek Safar  <marek.safar@gmail.com>
135
136         A fix for bug #81564
137
138         * ecore.cs (EventExpr): Add IsBase handling.
139
140         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
141         too.    
142         
143 2007-08-02  Raja R Harinath  <harinath@gmail.com>
144
145         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
146         * cs-parser.jay: Some whitespace cleanups.
147         (current_delegate): New.
148         (type_name): New.
149         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
150         a dummy code block, and use 'type_name' instead of 'member_name'.
151         (interface_declaration, class_declaration): Likewise.
152         (delegate_declaration): Likewise.  Rearrange slightly and use
153         'current_delegate'.
154         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
155         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
156
157 2007-08-02  Marek Safar  <marek.safar@gmail.com>
158
159         A fix for bug #82039
160
161         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
162         available.
163
164         * typemanager.cs (CSharpName): Split to string overload.
165
166 2007-08-02  Marek Safar  <marek.safar@gmail.com>
167
168         * expression.cs,
169         * report.cs: Updated warning CS0472.
170
171 2007-08-01  Marek Safar  <marek.safar@gmail.com>
172
173         A fix for bug #82181
174         * cs-parser.jay,
175         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
176
177 2007-08-01  Marek Safar  <marek.safar@gmail.com>
178
179         A fix for bug #82277
180         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
181
182 2007-08-01  Marek Safar  <marek.safar@gmail.com>
183
184         ** C# 3.0 Type Inference (major bits are working)
185         
186         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
187         (.ImplicitStandardConversionExists): Uses compatible.
188         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
189         (.InferReturnType): New method.
190         (.Compatible): Refactored.
191         (.ResolveParameters): Uses factory to create resolved parameters.
192         (.CompatibleMethod): Add probing mode support.
193         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
194         clearly distinguish between 2 different operations.
195         (LambdaMethod): Moved to lambda.cs.
196         (AnonymousMethod): Removed unused fields and methods.
197         (AnonymousDelegate): Simplified.
198         
199         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
200         
201         * convert. cs (ImplicitConversionStandard): Compatible works differently.
202         
203         * delegate.cs (Delegate): New mehods to reduce code duplication.
204         (.GetConstructor): New method.
205         (.GetInvokeMethod): New method.
206         (DelegateCreation): Updated.
207         
208         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
209         does not exist.
210         (OverloadResolve): Made probing little bit faster.
211         
212         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
213         when probing is on.
214         
215         * generic.cs (TypeInferenceContext): Dummy implementation.
216         
217         * iterators.cs: Updated after Resolve/Define rename.
218         
219         * lambda.cs (LambdaExpression)
220         (.ResolveParameters): Handles both type of arguments and type inference too.
221         
222         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
223         (InflateTypes): Updated.
224         
225         * support.cs (InflateTypes): Changed signature and updated.
226         
227         * typemanager.cs (LookupMemberCache): Better dynamic type check.
228         (MemberLookup_FindMembers): More MS tricks.
229         (GetParameterData): Ditto.
230         (GetDelegateParameters): Uses quick path for dynamic types.
231         
232 2007-08-01  Marek Safar  <marek.safar@gmail.com>
233
234         * class.cs (MethodData.Define): EmitContext is required for generic stuff
235         only.
236
237 2007-07-31  Marek Safar  <marek.safar@gmail.com>
238
239         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
240         syntax.
241         
242 2007-07-26  Jb Evain  <jbevain@novell.com>
243
244         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
245         which takes a boolean 'report_errors', similar to the GetMethod.
246         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
247         in .net 2.1, do not report errors here.
248
249         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
250         System.Runtime.CompilerServices.RequiredAttributeAttribute and
251         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
252         in .net 2.1.
253
254         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
255         of the type InternalsVisibleToAttribute before the first call
256         to CoreLookupType which is allowed to fail (third boolean parameter
257         to true). Because, during the resolution for a type that is not
258         immediately found, we try to check if the type is not defined in
259         a friend assembly, and to do so, we need the
260         InternalVisibleToAttribute.
261
262 2007-07-23  Miguel de Icaza  <miguel@novell.com>
263
264         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
265         feature that allows structs to be compared against null and inline
266         the result as true or false.
267
268         Notice that the same code is not permitted inside a generic block
269         of code that would do:
270
271         class Foo<T> where T : struct {
272             bool Eval (T x)
273             {
274                  return x == null;
275             }
276         }
277
278         It is only allowed if the type of T is not bound (no where
279         clause).   In my opinion, this CSC 2 behavior is broken but people
280         seem to be using it (IronRuby does, a few bug reports on bugzilla
281         have it and some people have complained about it).
282
283         All of the users that depend on this behavior have code that is
284         very likely broken. 
285         
286         * report.cs (Warning, Error): make these take object arguments,
287         not strings, as that allows us to take advantage of Format.
288
289 2007-07-20  William Holmes  <billholmes54@gmail.com>
290
291         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
292           Left member variable for the Count.
293         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
294           MemberName.CountTypeArguments to avoid a NRE. 
295
296         This code is contributed under the MIT X11 license
297
298 2007-07-18  Marek Safar  <marek.safar@gmail.com>
299
300         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
301
302 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
303
304         * doc.cs : generic method arguments are written as ``x while generic
305           type arguments are `x. Combined with the previous change, fixed bug
306           #79706.
307
308 2007-07-18  Raja R Harinath  <rharinath@novell.com>
309
310         Fix #82120
311         * expression.cs (Binary.ResolveOperator): When converting
312         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
313
314 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
315
316         * doc.cs : when T: or whatever x: is specified, it does not really
317           check the doc comment's syntax correctness. Fixed bug #82006.
318
319 2007-07-18  Marek Safar  <marek.safar@gmail.com>
320
321         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
322         LambdaExpression better.
323         
324         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
325         
326         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
327         
328         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
329         as it can be generated.
330         
331         * expression.cs (Invocation.Error_InvalidArguments): Show correct
332         modifiers.
333         
334         * lambda.cs (LambdaExpression): Refactored to share same code with
335         AnonymousMethodExpression.
336         
337 2007-07-17  Marek Safar  <marek.safar@gmail.com>
338
339         * anonymous.cs (MakeName): Include host name for easier debugging.
340         (LambdaMethod): New class for lambda spcecific stuff.
341         
342         * attribute.cs: Set EmitContext return type.
343
344         * class.cs: Set EmitContext return type.
345         
346         * codegen.cs (EmitContext): Return type cannot be null to stop messing
347         with null/void meaning.
348         
349         * iterators.cs (ContainerType): Implemented.
350         
351         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
352         
353         * statement.cs (Return): Updated to lambda expressions.
354         (Block.CloneTo): Parent can be null.
355                 
356 2007-07-13  Marek Safar  <marek.safar@gmail.com>
357
358         A fix for bug #81917
359         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
360         
361         * class.cs (FixedField): Check whether field is in unsafe scope.
362
363         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
364         (FieldExpr.Emit): Fixed buffers cannot be volatile.
365
366         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
367         FieldExpr.
368         
369         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
370                 
371 2007-07-13  Marek Safar  <marek.safar@gmail.com>
372
373         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
374         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
375         from Report class.
376
377 2007-07-13  Marek Safar  <marek.safar@gmail.com>
378
379         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
380         
381 2007-07-13  Marek Safar  <marek.safar@gmail.com>
382
383         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
384         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
385         
386         * codegen.cs(EmitContext): Add ProbingMode flag.
387         
388         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
389         
390         * driver.cs: For now set both warning values.
391         
392         * ecore.cs (SimpleName): Name is readonly.
393         (MethodGroup.OverloadResolve): One quick path for probing.
394         
395         * expression.cs (Unary): Set Oper r/o.
396         (Binary): Set Oper r/o.
397         (ParameterReference): Set few instance variables as r/o.
398         (ParameterReference.DoResolveBase): Don't capture aruments when 
399         the probing is on.
400         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
401         (Arglist): arguments are private.
402         (SizeOf): type is private and r/o.
403         (MemberAccess): arguments are private.
404
405         * report.cs: Enhanced reporting on/off capabilities.
406         
407         * lambda.cs: Uses ec.IsInProbingMode.
408         (ContextualReturn): Derives from return.
409         
410         * rootcontext.cs: For now set both warning values.
411         
412         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
413         copy if one exists.
414         (Return.Resolve): Don't die immediately.
415         (Block.Resolve): Speed-up probing.
416         (Block.CloneTo): Clone only child blocks.
417
418 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
419
420         * iterators.cs: reverted Miguel's latest change (r81925) as it
421         breaks the build in System.
422
423 2007-07-13  Miguel de Icaza  <miguel@novell.com>
424
425         * iterators.cs (Yield.CheckContext): Check for the iterator type
426         also here as we can call into Yield even in codepaths that are not
427         directly checked by
428         (MethodOrOperator is the only path that was checked).
429
430         In addition to the standard check, use a more specific check for
431         constructors to report a more verbose error. 
432
433 2007-07-12  Miguel de Icaza  <miguel@novell.com>
434
435         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
436         report the warning and continue 
437
438         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
439         values on the stack on the call to Emit.   Use EmitStatement if
440         possible, or using Emit + Pop if not possible.   Fixes #82064
441
442 2007-07-12  Raja R Harinath  <rharinath@novell.com>
443
444         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
445         avoid try...finally in some cases.
446
447 2007-07-10  Marek Safar  <marek.safar@gmail.com>
448
449         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
450         
451         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
452         instead of method. Re-use standard error handling.
453         (ConstructorInitializer.Emit): Simplified.
454         
455         * delegate.cs: Updated after Invocation.EmitCall change.
456         
457         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
458         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
459         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
460         method and don't permanently changing input arguments.
461         (MethodGroupExpr): Introduced resolved best_candidate, when method group
462         is resolved it has one of the candidates is the best one which is later
463         used to emit. Removed a few unused method.
464         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
465
466         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
467         (Binary.ResolveOperator): Ditto.
468         (ConditionalLogicalOperator.DoResolve): Ditto.
469         (Invocation): Uses method group.
470         (Invocation.DoResolve): Simplified.
471         (Invocation.EmitCall): Removed useless is_static.
472         (Invocation.Emit): Delegate to method group.
473         (Invocation.EmitStatement): Simplified.
474         (New): Uses method group.
475         (MemberAccess.DoResolve): Don't destroy original expression.
476         
477         * statement.cs (ForEach.Resolve): Use null for no method arguments.
478         
479 2007-07-04  Marek Safar  <marek.safar@gmail.com>
480
481         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
482         
483         * anonymous.cs,
484         * lambda.cs: Add custom error message type.
485
486 2007-07-03  Marek Safar  <marek.safar@gmail.com>
487
488         * lambda.cs: Simplified little bit.
489         
490         * parameter.cs: Introduced ImplicitLambdaParameter.
491         (Parameters.CreateFullyResolved): New factory instead of ctor.
492         
493         * anonymous.cs,
494         * class.cs,
495         * delegate.cs: Updated parameter creation.
496         
497 2007-07-03  Marek Safar  <marek.safar@gmail.com>
498
499         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
500         arguments.
501         
502         * generic.cs: Synchronized with gmcs.
503         
504 2007-07-03  Marek Safar  <marek.safar@gmail.com>
505
506         * class.cs (Indexer): Check return type as soon as possible.
507         
508         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
509         members too.
510         
511         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
512         
513         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
514         
515         * parameter.cs (Parameter): Use expression type when it is available.
516         
517         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
518         method modifier for the first parameter only.
519
520 2007-06-24  Marek Safar  <marek.safar@gmail.com>
521
522         A fix for bug #81938
523         * typemanager.cs (ChangeType): Fixed couple of char conversions.
524         
525         * constant.cs: Tide up an exception message.
526
527 2007-06-22  Marek Safar  <marek.safar@gmail.com>
528
529         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
530         an uninitialized variable is used.
531         
532         * expression.cs (LocalVariableReference.DoResolve): Ditto.
533
534 2007-06-22  Marek Safar  <marek.safar@gmail.com>
535
536         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
537         not found error handling.
538
539         * expression.cs (ArrayCreation): Removed redundant fields and little bit
540         simplified.
541         (ArrayCreation.ResolveArrayElement): To be ready to customization.
542         (ArrayCreation.DoResolve): Simplified.
543         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
544         its own resolve process.
545         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
546
547 2007-06-20  Marek Safar  <marek.safar@gmail.com>
548
549         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
550         more error details.
551         
552 2007-06-20  Marek Safar  <marek.safar@gmail.com>
553
554         * cs-tokenizer.cs: Removed var related stuff.
555         
556         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
557         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
558         a type and a keyword at same time.
559         
560         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
561         matches to "var".
562         
563         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
564         implicitly typed arrays, more changes will follow.
565         
566         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
567         
568 2007-06-19  Marek Safar  <marek.safar@gmail.com>
569
570         * ecore.cs (VarExpr): Removed Handled field.
571         
572         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
573         build-in assign functionality.
574         (ForEach.Resolve): Removed all implicitly typed local variable code and
575         simplified.
576         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
577         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
578
579 2007-06-18  Marek Safar  <marek.safar@gmail.com>
580
581         * assign.cs: Removed implicitly typed local variable check.
582         
583         * expression.cs (LocalVariableReference.DoResolve): Add check for self
584         referencing implicitly typed local variable.
585         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
586         variable here.
587         
588         * statement.cs (Fixed): Removed unsupported implicitly typed local
589         variable code.
590
591 2007-06-15  Marek Safar  <marek.safar@gmail.com>
592
593         * decl.cs (MemberName): Moved all Unbound stuff to parser.
594
595 2007-06-14  Marek Safar  <marek.safar@gmail.com>
596
597         A fix for bugs #81855 and #76274
598         * attribute.cs (AttachTo): Always set owner for global attributes to
599         prefined owner.
600         
601         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
602         usefull too.
603         
604         * cs-parser.jay: Assembly and module attributes must precede all other
605         elements except using clauses and extern alias declarations.
606
607 2007-06-13  Marek Safar  <marek.safar@gmail.com>
608
609         A fix for bug #81748
610         * cs-tokenizer.cs,
611         * expression.cs: More checks for non ISO-1 features.
612
613 2007-06-12  Marek Safar  <marek.safar@gmail.com>
614
615         A fix for bug #81807
616         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
617         present inside switch statement and it is required by nullable check.
618
619 2007-06-12  Marek Safar  <marek.safar@gmail.com>
620
621         A fix for bug #81840
622         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
623         when type matching fails.
624         
625         * namespace.cs: Tiny error message change.
626
627 2007-06-12  Marek Safar  <marek.safar@gmail.com>
628
629         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
630         reporting. Added automatic property check.
631         
632         * class.cs: Updated after CheckAbstractAndExtern relocation.
633         (AEventPropertyAccessor.GetSignatureForError): Customized.
634         
635 2007-06-11  Marek Safar  <marek.safar@gmail.com>
636
637         * class.cs (DefineBaseTypes): Base type can be undefined.
638         
639         * ecore.cs (TypeLookup): Minor refactoring.
640         (DoResolveAsTypeStep): Removed redundant check.
641
642         * namespace.cs (Lookup): Removed redundant check.
643                 
644         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
645         ResolveAsTypeTerminal step.
646         (BootstrapCorlib_*): Simplified.
647         (PopulateCoreType): Core types can be now external.
648
649 2007-06-07  Marek Safar  <marek.safar@gmail.com>
650
651         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
652          verification only.
653          (InferTypeArguments): Infers anonymous expression type arguments.
654          (Compatible): Split to Compatible and InferTypeArguments. 
655         
656         * lambda.cs: Updated.
657
658 2007-06-08  Marek Safar  <marek.safar@gmail.com>
659
660         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
661
662 2007-06-07  Raja R Harinath  <harinath@gmail.com>
663
664         Fix #80477, cs0135-2.cs, cs0135-3.cs
665         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
666         names to the "known" variables list.
667         (Block.CheckInvariantMeaningInBlock): Handle the fact the
668         parameter names are also "known".
669         (Block.CheckError136): Remove.
670         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
671         null.
672
673 2007-06-07  Marek Safar  <marek.safar@gmail.com>
674
675         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
676
677 2007-06-06  Marek Safar  <marek.safar@gmail.com>
678
679         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
680         internal error not an user error.
681          
682         * expression.cs (IsApplicable): Refactored to make debugging easier.
683
684         * support.cs: More tricks for non-mono runtimes.
685         
686         * typemanager.cs (CoreLookupType): Made public.
687         (InitSystemCore): All linq specific stuff moved to linq.cs
688
689 2007-06-05  Marek Safar  <marek.safar@gmail.com>
690
691         * typemanager.cs (CSharpSignature): One more missing build-in types
692         replacement.
693         More tricks for non-mono runtime.
694
695 2007-06-05  Raja R Harinath  <harinath@gmail.com>
696
697         * statement.cs (Block.CheckError136_InParents): Remove.
698         (Block.AddVariable): Use GetParameterInfo instead.
699         (ToplevelBlock.ProcessArguments): Likewise.
700
701 2007-06-04  Raja R Harinath  <rharinath@novell.com>
702
703         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
704         information too.
705         (ToplevelBlock.GetParameterInfo): Split out of ...
706         (ToplevelBlock.GetParameterRefernce): ... this.
707         (ToplevelBlock.ParameterMap): Remove.
708         * expression.cs (ParameterReference): Update to use
709         ToplevelParameterInfo.
710
711         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
712         regression.
713
714         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
715         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
716
717         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
718         (ToplevelBlock.ProcessParameters) ... here.
719         (ToplevelBlock..ctor): Invoke it.
720
721         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
722         new parameters.
723
724         * statement.cs (IKnownVariable): New interface.
725         (LocalInfo): Implement it.
726         (ToplevelParameterInfo): New class.
727         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
728         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
729         GetKnownVariableInfo.
730
731 2007-06-03  Raja R Harinath  <harinath@gmail.com>
732
733         Partly speed up CS0136 error checks.
734         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
735         'recurse' parameter.
736         (Block.DoCheckError136): Only check errors in parameters.  Move
737         local variable checks ...
738         (Block.AddVariable): ... here, and ...
739         (ToplevelBlock.ResolveMeta): ... here.
740
741 2007-06-02  Raja R Harinath  <harinath@gmail.com>
742
743         * statement.cs (Block.IsChildOf): Remove.
744
745         * statement.cs (Statement.Clone): Move special case code ...
746         (Block.CloneTo): ... here.
747
748 2007-05-29  Raja R Harinath  <rharinath@novell.com>
749
750         * statement.cs (ToplevelBlock.container): Remove field.  It's
751         redundant with 'Parent'.
752         (ToplevelBlock.ContainerBlock): Remove accessor.
753         (ToplevelBlock..ctor): Update to changes.  Register anonymous
754         child with parent here, ...
755         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
756         current_block.
757         (start_anonymous): Don't save current_block.
758         (top_current_block): Remove.
759
760         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
761         (Block.Resolve): Update to changes.
762         (Block..ctor): Move setting of "correct" 'Toplevel'
763         and 'Explicit' fields to ...
764         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
765
766 2007-05-27  Raja R Harinath  <harinath@gmail.com>
767
768         Kill Block.Implicit
769         * statement.cs (Block.Implicit): Remove.
770         (Block): Update to changes.
771         * flowanalysis.cs: Likewise.
772
773         Mildly speed up CheckInvariantMeaningInBlock
774         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
775         Recursively call AddKnownVariable to all enclosing blocks.
776         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
777         Remove recursive calls.
778         (Block): Update to changes.
779
780         New ExplicitBlock invariants
781         * statement.cs (Block.Explicit): New field.  It points to the
782         immediately enclosing non-implicit block.
783         (Block..ctor): Maintain the invariant.
784         * cs-parser.jay: Take advantage of invariant.
785
786         Introduce ExplicitBlock
787         * statement.cs (ExplicitBlock): New.
788         (ToplevelBlock): Derive from it.
789         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
790         sense of flag.
791         (Block.Implicit): Update to changes.
792         * cs-parser.jay: Update to changes.
793
794         Remove unused field
795         * codegen.cs (EmitContext.IsLastStatement): Remove.
796         * statement.cs (Block.DoEmit): Update to changes.
797
798 2007-05-25  Raja R Harinath  <rharinath@novell.com>
799
800         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
801         modifying current_block directly.
802
803 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
804         
805         * class.cs: Implemented automatic properties (C# 3.0)
806           Thanks to Marek for the help.
807
808 2007-05-23  Raja R Harinath  <rharinath@novell.com>
809
810         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
811         variable as assigned, note also that all its components are
812         assigned too.
813         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
814
815 2007-05-19  Marek Safar  <marek.safar@gmail.com>
816
817         * anonymous.cs, class.cs: Emit Compiler generated attribute when
818         member is marked as compiler generated.
819         
820         * decl.cs (MemberCore): Refactored ModFlags into property.
821
822         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
823         (Check): Check only accessibility modifiers.
824
825 2007-05-18  Raja R Harinath  <rharinath@novell.com>
826
827         Track all assignable slots in one bit array
828         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
829         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
830         logic from VariableMap constructor here.  Use the same 'offset'
831         variable that's later used for computing offsets of local
832         variables.
833         * flowanalysis.cs (UsageVector.parameters): Remove.
834         (UsageVector): Update to changes.
835         (VariableMap): Remove.
836
837         Avoid creating ParameterMap in every block
838         * statement.cs (Block.ParameterMap): Move ...
839         (ToplevelBlock.ParameterMap): ... here.
840         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
841         only once.
842         * flowanalysis.cs (FlowBranching.param_map): Remove.
843         (FlowBranching.UsageVector): Update to changes.
844         (FlowBranchingToplevel.CheckOutParameters): Likewise.
845
846         * statement.cs (Block.CloneTo): Clone Toplevel field too.
847
848         * expression.cs (ParameterReference): Distinguish between block
849         where parameter was referenced and declared.
850
851 2007-05-18  Marek Safar  <marek.safar@gmail.com>
852
853         * flowanalysis.cs, statement.cs: Put back improved error handling.
854
855 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
856         
857         * assign.cs:
858         * expression.cs:
859           Imporved object and collection initialization (C# 3.0).
860
861 2007-05-15  Marek Safar  <marek.safar@gmail.com>
862
863         A fix for bug #81380
864         * expression.cs (Is.DoResolve): Only value types have constant `is'
865         behaviour.
866
867 2007-05-15  Raja R Harinath  <rharinath@novell.com>
868
869         * statement.cs (ToplevelBlock.child): Remove.
870
871 2007-05-15  Raja R Harinath  <harinath@gmail.com>
872
873         Rationalize ResolveMeta: refactoring
874         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
875         out constant handling code into ...
876         (Block.DoResolveConstants): ... this.
877
878         Rationalize ResolveMeta: kill local_map
879         * statement.cs (Block.local_map, Block.LocalMap): Remove.
880         (Block.AssignableSlots): New.
881         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
882         for locals -- move code from VariableMap here.  Avoid unnecessary
883         allocations.
884         * flowanalysis.cs (FlowBranching.local_map): Remove.
885         (FlowBranching..ctor): Use Block.AssignableSlots.
886         (VariableMap): Remove unused constructors.
887
888 2007-05-11  Raja R Harinath  <rharinath@novell.com>
889
890         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
891
892 2007-05-11  Marek Safar  <marek.safar@gmail.com>
893
894         * typemanager.cs (IsFriendAssembly): Should not be called for building
895         assembly.
896
897 2007-05-09  Marek Safar  <marek.safar@gmail.com>
898
899         * literal.cs (NullConstant): Print null in all cases.
900         
901         * expression.cs (Binary.ResolveOperator): Implemented delegate
902          comparison based on C# 2.0 changes.
903
904 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
905
906         This code is contributed under the MIT X11 license
907         
908         The following enables support for several C# 3.0 language features:
909         
910         * cs-tokenizer.cs: Added support for the "var" keyword.
911         
912         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
913           Added VarExpr class to facilitate type inferencing.
914         
915         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
916           to support anonymous types.
917         
918         * assign.cs: Added support for type inferencing and initialization.
919         
920         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
921         
922         * expression.cs: Added implicit array support to ArrayCreation.
923           Added 5 types and 1 interface:
924           
925           IInitializable                Implementing classes can inject initializing
926                                         statements after object instantiation.
927           
928           Initializer                   Stores data for object initialization.
929           
930           AnonymousType                 An expression for anonymous types.
931           
932           AnonymousTypeParameter        Stores data about an anonymous type's field.
933           
934           NewInitialize                 An expression for object initialization.
935           
936           CollectionInitialize          An expression for collection initialization.
937         
938         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
939           statements.
940
941 2007-05-06  Marek Safar  <marek.safar@gmail.com>
942
943         A fix for bug #81500
944         * cs-tokenizer.cs: Add special handling for coalescing operator.
945
946 2007-05-06  Marek Safar  <marek.safar@gmail.com>
947
948         A fix for bug #81529
949         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
950         its value from base class until it is redefined.
951
952 2007-05-02  Raja R Harinath  <rharinath@novell.com>
953
954         Fix regression in cs0631-3.cs
955         * cs-parser.jay (operator_declarator): Add opt_attributes to error
956         fallback.  Make error fallback catch more cases.
957
958 2007-05-01  Miguel de Icaza  <miguel@novell.com>
959
960         * cs-parser.jay: Allow parameters in operator declarations to have
961         attributes. 
962
963 2007-04-27  Miguel de Icaza  <miguel@novell.com>
964
965         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
966         exists. 
967
968         * lambda.cs (ContextualReturn.Resolve): An expression is valid
969         inside the ContextualReturn, it does not have to be an
970         ExpressionStatement. 
971
972 2007-04-24  Miguel de Icaza  <miguel@novell.com>
973
974         * lambda.cs (ContextualReturn.Resolve): if the return type is not
975         set, set it.
976
977 2007-04-23  Miguel de Icaza  <miguel@novell.com>
978
979         * anonymous.cs (AnonymousContainer): split the virtual Resolve
980         method in two methods: ResolveNoDefine and Resolve.
981
982         ResolveNoDefine will stop just after ResolveTopBlock has been
983         called.   
984
985         Resolve will then continue by creating a method and issuing the
986         call to method.Define ().
987
988         (AnonymousMethod): Split and implement the new Resolve and
989         ResolveNoDefine as well.
990
991         * lambda.cs (LambdaExpression): Split the anonymous method
992         resolution code into a separate routine (CoreCompatibilityTest)
993         from DoCompatibleTest.
994
995         (LambdaExpression.TryBuild): New method, this method tries to
996         build the LambdaExpression with the given set of types to be used
997         as the types for the various parameters of the lambda expression. 
998
999         If the compilation succeed with the given types, the infered type
1000         of the Anonymous method is returned, otherwise null is returned.
1001
1002 2007-04-23  Marek Safar  <marek.safar@gmail.com>
1003
1004         A fix for bug #81414
1005         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
1006
1007 2007-04-22  Miguel de Icaza  <miguel@novell.com>
1008
1009         * cs-tokenizer.cs: Change various identifiers here from the
1010         camelCasing to the recommended Linux-like style for instance
1011         variables from the Coding Guidelines. 
1012
1013 2007-04-19  Martin Baulig  <martin@ximian.com>
1014
1015         * convert.cs
1016         (Convert.ImplicitReferenceConversionCore): Allow conversions from
1017         System.Enum to System.ValueType.
1018
1019 2007-04-13  Martin Baulig  <martin@ximian.com>
1020
1021         Rewrote implicit reference conversions.  We need to distinguish
1022         between implicit reference conversions (13.1.4) and implicit
1023         boxing conversions (13.1.5).
1024
1025         According to the spec, there's an an implicit conversion
1026         "From a one-dimensional array-type S[] to IList<T> and base
1027         interfaces of this interface, provided there is an implicit
1028         reference conversion from S to T."  Note that this does not
1029         include boxing conversions.
1030
1031         * convert.cs
1032         (Convert.ImplicitTypeParameterBoxingConversion): New method.
1033         (Convert.ImplicitReferenceConversion): Split into
1034         ImplicitReferenceConversionCore() and
1035         ImplicitBoxingConversionExist().
1036         (Convert.ImplicitReferenceConversionExists): Use the new
1037         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
1038
1039 2007-04-12  Martin Baulig  <martin@ximian.com>
1040
1041         * convert.cs (Convert.ImplicitReferenceConversion): Move the
1042         `TypeManager.null_type' checks up to the top of the method.
1043
1044 2007-04-11  Marek Safar  <marek.safar@gmail.com>
1045
1046         A fix for bug #81350
1047         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
1048         extension methods.
1049
1050 2007-04-11  Martin Baulig  <martin@ximian.com>
1051
1052         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
1053         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
1054         to make this work for generic classes; fixes #79561.
1055
1056 2007-04-11  Martin Baulig  <martin@ximian.com>
1057
1058         * expression.cs (As): Add support for nullable types; fixes #79371.
1059
1060 2007-04-11  Martin Baulig  <martin@ximian.com>
1061
1062         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
1063         `type.FullName' is null; fixes #80243.
1064
1065 2007-04-11  Martin Baulig  <martin@ximian.com>
1066
1067         * expression.cs (Invocation.IsApplicable): Don't modify the method
1068         if type inference succeeded, but the method was not applicable.
1069         Fixes #81250.
1070
1071 2007-04-10  Marek Safar  <marek.safar@gmail.com>
1072
1073         A fix for bug #81324
1074         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
1075         internal and external namespaces containers.
1076
1077 2007-04-10  Martin Baulig  <martin@ximian.com>
1078
1079         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
1080         TypeManager.DropGenericMethodArguments() so we also call
1081         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
1082
1083 2007-04-10  Martin Baulig  <martin@ximian.com>
1084
1085         * iterators.cs (Iterator.CreateIterator): Don't crash if
1086         `method.ReturnType' is null.  This happens if something went wrong
1087         while resolving that typ (we already reported an error in this case).
1088
1089 2007-04-10  Martin Baulig  <martin@ximian.com>
1090
1091         * expression.cs (New.DoResolve): Don't call CheckComImport() on
1092         generic interfaces; report the CS0144 directly.
1093
1094 2007-04-10  Martin Baulig  <martin@ximian.com>
1095
1096         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
1097         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
1098
1099 2007-04-10  Martin Baulig  <martin@ximian.com>
1100
1101         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
1102
1103 2007-04-09  Raja R Harinath  <rharinath@novell.com>
1104
1105         A better fix
1106         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
1107         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
1108
1109         Fix #81338
1110         * statement.cs (For.Resolve): If resolution fails, use
1111         KillFlowBranching.
1112
1113 2007-04-08  Marek Safar  <marek.safar@gmail.com>
1114
1115         * anonymous.cs (MakeName): Make faster and zero-based.
1116         (VerifyExplicitParameterCompatibility): Back to mode where generic
1117         parameter is ignored.
1118         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
1119
1120         * class.cs (EmitType): Method can emit another new method.
1121
1122         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
1123
1124         * driver.cs: Updated.
1125
1126         * lambda.cs: Reuse predefined empty parameters.
1127
1128         * parameter.cs: Updated
1129
1130         * support.cs: Implemented InflateTypes.
1131
1132         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
1133         (InitSystemCore): Introduced to isolate 3.0 dependencies.
1134
1135 2007-04-03  Martin Baulig  <martin@ximian.com>
1136
1137         Fix #80632.
1138
1139         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
1140         version of TypeManager.IsOverride() which also works with generic
1141         types.  
1142
1143 2007-04-03  Martin Baulig  <martin@ximian.com>
1144
1145         Fix #81044.
1146
1147         * convert.cs
1148         (Convert.ExplicitReferenceConversion): We need to cast when
1149         converting from IList<T> to S[].
1150
1151 2007-04-01  Marek Safar  <marek.safar@gmail.com>
1152
1153         * decl.cs (FindExtensionMethods): Consider all candidates with same name
1154         at this level.
1155         
1156         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
1157
1158 2007-03-31  Marek Safar  <marek.safar@gmail.com>
1159
1160         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
1161         argument and return type inferring.
1162
1163         * codegen.cs (InferReturnType): Flag whether return can be inferred.
1164         (ReturnType): Turned to property.
1165
1166         * statement.cs (Return): Implemented return type inferring.
1167
1168         * support.cs (ReflectionParameters): Use local types if possible.
1169
1170 2007-03-30  Raja R Harinath  <rharinath@novell.com>
1171
1172         * flowanalysis.cs (FlowBranching.Reachability): Remove.
1173         (FlowBranching.UsageVector): Update to changes.
1174
1175         Prepare to kill 'Reachability'
1176         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
1177         argument of constructor.
1178
1179 2007-03-29  Raja R Harinath  <rharinath@novell.com>
1180
1181         Prepare to kill 'Reachability'
1182         * flowanalysis.cs (UsageVector.is_unreachable): New.
1183         (UsageVector): Update to maintain 'is_unreachable' in parallel to
1184         'reachability', and verify they're consistent.
1185
1186         Fix #81121
1187         * expression.cs (New.EmitStatement): Handle type parameters here too.
1188
1189 2007-03-29  Martin Baulig  <martin@ximian.com>
1190
1191         Fix #79148.
1192
1193         * anonymous.cs
1194         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
1195         CompilerGeneratedClass.
1196         (ScopeInfo.EmitScopeInstance): Make this protected.
1197         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
1198         `ec.CurrentAnonymousMethod.Scope == Scope'.
1199
1200         * statement.cs (Block.ScopeInfo): Make this a property.
1201
1202 2007-03-27  Raja R Harinath  <harinath@gmail.com>
1203
1204         Prepare to kill 'Reachability'
1205         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
1206         (FlowBranching.UsageVector.Reachability): Remove property.
1207         (FlowBranching.UsageVector.IsUnreachable): New property.
1208         (FlowBranching.UsageVector.ResetBarrier): New.
1209         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
1210         * codegen.cs, statement.cs: Update to changes.
1211
1212 2007-03-27  Martin Baulig  <martin@ximian.com>
1213
1214         Fix #81209.
1215
1216         * decl.cs
1217         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
1218         generic types.
1219
1220 2007-03-26  Raja R Harinath  <rharinath@novell.com>
1221
1222         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
1223         instead of TriState.  Remove all mention of TriState.
1224
1225         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
1226         replaced by a boolean.  Add boolean 'is_unreachable' field, check
1227         and maintain invariants.
1228
1229 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1230
1231         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
1232
1233 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1234
1235         * expression.cs: Stop using obsolete 2.0 opcodes.
1236
1237 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1238
1239         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
1240         one of the latests Martin's fixes.
1241
1242 2007-03-23  Miguel de Icaza  <miguel@novell.com>
1243
1244         * expression.cs: On BigEndian systems, swap the bytes, temporary
1245         solution until we get a new bitconverter class.
1246
1247 2007-03-23  Martin Baulig  <martin@ximian.com>
1248
1249         Fix #81158.
1250
1251         * decl.cs (MemberCache.AddMembers): Add generic methods both as
1252         "Method" and "Method`1".  Normally, a cache lookup is done on the
1253         "Method" form (ie. without the generic arity), but this one makes
1254         lookups on the full form work as well.
1255
1256 2007-03-22  Raja R Harinath  <rharinath@novell.com>
1257
1258         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
1259         unused properties.
1260
1261 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
1262         * class.cs: 
1263         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
1264         ordered_member_list, to TypeBuilder to store members to be defined
1265         in the order they were parsed in.
1266         - ordered_explicit_member_list contains all properties indexers
1267           and methods that are defined as explicit implementation of an
1268           interface or base class.
1269         - ordered_member_list contains all properties indexers and methods
1270           that are not defined as explicit implementation of an interface
1271           or base class.
1272
1273         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
1274         functionality in these removed classes has been replaced with 
1275         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
1276         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
1277
1278         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
1279         to CheckForDuplications inside GetMethod and SetMethod Define Method
1280         to handle method property and indexer name conflicts.
1281
1282         Fixes #79434
1283
1284         All code is contributed under the MIT/X11 license.
1285
1286 2007-03-20  Martin Baulig  <martin@ximian.com>
1287
1288         * class.cs (TypeContainer.Interfaces): Removed; they're now
1289         included in `TypeContainer.Types'.
1290
1291 2007-03-20  Martin Baulig  <martin@ximian.com>
1292
1293         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
1294
1295         * class.cs (TypeContainer.CreateType): New public method.  This is
1296         now called before DefineType() to create the TypeBuilders.
1297         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
1298         has already been created by CreateType().
1299         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
1300         don't resolve our base classes here; this has been moved into
1301         DefineBaseTypes().  We're now called from CreateType().
1302         (TypeContainer.DefineBaseTypes): New private method; resolve our
1303         base classes here.  We're now called from DefineType().
1304
1305         * rootcontext.cs
1306         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
1307         our types first to create all the TypeBuilders.  After that, call
1308         TypeContainer.DefineType() on all the types which'll resolve their
1309         base classes and setup the resolve order.
1310
1311 2007-03-20  Martin Baulig  <martin@ximian.com>
1312
1313         * class.cs (TypeContainer.Enums): Removed; they're now included in
1314         `TypeContainer.Types'.  
1315
1316 2007-03-20  Martin Baulig  <martin@ximian.com>
1317
1318         * class.cs
1319         (TypeContainer.DefineType): Don't call ResolveMembers() here.
1320         (TypeContainer.DoResolveMembers): Call DefineType() on our
1321         `compiler_generated' classes; moved here from DefineNestedTypes().
1322
1323         * rootcontext.cs
1324         (RootContext.ResolveTree): Call ResolveMembers() on all
1325         TypeContainer's in the `type_container_resolve_order'.
1326
1327 2007-03-19  Marek Safar  <marek.safar@gmail.com>
1328
1329         * class.cs: Use corlib to handle InternalMethodImplAttribute.
1330
1331 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1332
1333         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
1334         implementation flags.
1335
1336 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1337
1338         * class.cs: More optimizations for type parameters.
1339
1340 2007-03-15  Marek Safar  <marek.safar@gmail.com>
1341
1342         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
1343
1344         * ecore.cs, parameter.cs: More common code for both corlibs.
1345
1346         * typemanager.cs (IsGenericMethod): Simplified.
1347
1348 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1349
1350         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1351         'returns'.
1352         * statement.cs, iterators.cs, lambda.cs: Update to changes.
1353
1354         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
1355         unconditionally.  Simplify explanation.
1356         (Try.Resolve, Using.Resolve): Likewise.
1357
1358 2007-03-15  Martin Baulig  <martin@ximian.com>
1359
1360         Fix #80731.
1361
1362         * decl.cs (DeclSpace): If we're a partial class, use our
1363         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
1364
1365 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1366
1367         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1368         'throws'.
1369         (FlowBranching.UsageVector): Update to changes.
1370         (FlowBranching.MergeSiblings): Likewise.
1371         * statement.cs: Likewise.
1372
1373 2007-03-15  Martin Baulig  <martin@ximian.com>
1374
1375         Fix #79302.
1376
1377         * decl.cs
1378         (MemberCache): Added a special .ctor for type parameters.
1379
1380         * typemanager.cs
1381         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
1382         `MemberCache'.  
1383
1384 2007-03-09  Martin Baulig  <martin@ximian.com>
1385
1386         * enum.cs (Enum): Make this a TypeContainer.
1387         (EnumMember): Derive from `Const'.
1388
1389         * const.cs
1390         (Const.DoResolveValue): New protected virtual method; move most of
1391         the functionality of ResolveValue() here so we can override it in
1392         `EnumMember'.
1393         (Const.CreateConstantReference): Make this virtual.
1394
1395         * class.cs (Kind): Add `Kind.Enum'.
1396         (TypeContainer.Emit): Don't emit the enums here; they're already
1397         in the `RootContext.typecontainer_resolve_order'.
1398
1399         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
1400         here; they're already in the `typecontainer_resolve_order'.
1401
1402         * ecore.cs (EnumConstant.ConvertImplicitly): Add
1403         TypeManager.DropGenericTypeArguments().
1404
1405         * typemanager.cs
1406         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
1407         (TypeManager.IsEnumType): Likewise.
1408         (TypeManager.EnumToUnderlying): Likewise.
1409         (TypeManager.IsEqual): Add support for enums.
1410
1411 2007-03-12  Raja R Harinath  <rharinath@novell.com>
1412
1413         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
1414         DefaultParameterValueAttribute to be undefined, say if System.dll
1415         is not referenced.
1416
1417 2007-03-11  Marek Safar  <marek.safar@gmail.com>
1418
1419         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
1420         any mscorlib.
1421
1422 2007-03-10  Marek Safar  <marek.safar@gmail.com>
1423
1424         * class.cs, parameter.cs: Unified parameters verification.
1425
1426 2007-03-08  Martin Baulig  <martin@ximian.com>
1427
1428         * cs-parser.jay (constructor_header): Pass the location to the
1429         newly created TopLevelBlock.
1430
1431 2007-03-07  Martin Baulig  <martin@ximian.com>
1432
1433         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
1434
1435 2007-03-06  Miguel de Icaza  <miguel@novell.com>
1436
1437         * convert.cs (ExplicitReferenceConversionExists): Sync this method
1438         with the changes from David, fixes the build.
1439
1440 2007-03-05  David Mitchell  <dmitchell@logos.com>
1441
1442         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
1443         and its base interfaces to a one-dimensional array type S[],
1444         provided there is an implicit or explicit reference conversion
1445         from S to T.
1446
1447 2007-03-03  Marek Safar  <marek.safar@gmail.com>
1448
1449         * cs-tokenizer.cs: Implemented basic linq grammar.
1450
1451         * driver.cs: Set linq lang version on demand.
1452
1453 2007-02-26  Marek Safar  <marek.safar@gmail.com>
1454
1455         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
1456
1457 2007-02-25  Marek Safar  <marek.safar@gmail.com>
1458
1459         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
1460         (Fixes #80455)
1461
1462         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
1463         here.
1464         Check property and event extern attributes.
1465
1466         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
1467         charset.
1468
1469 2007-02-24  Marek Safar  <marek.safar@gmail.com>
1470
1471         A fix for bug #80407
1472         * ecore.cs: Don't report ambiguity error when methods have same parent.
1473
1474 2007-02-23  Marek Safar  <marek.safar@gmail.com>
1475
1476         A fix for bug #80878
1477         * class.cs, cs-parser.jay: Event property can host anonymous methods.
1478
1479 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1480
1481         * attribute.cs: Enable ExtensionAttribute presence test.
1482
1483 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1484
1485         * class.cs: Warn about missing GetHashCode only when Equals is override.
1486
1487         * decl.cs: Check accessibility of type arguments.
1488
1489         * typemanager.cs: Correctly report nullable array.
1490
1491 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1492
1493         * class.cs, report.cs: Capture more details when things go wrong.
1494
1495 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1496
1497         A fix for bug #80650
1498         * cs-parser.jay: Anonymous container starts at constructor declaration
1499         and not at block beginning because it has to be usable in constructor
1500         initializer.
1501
1502         * statement.cs: Use context location and not block one for error reporting.
1503
1504 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1505
1506         A fix for bug #78712
1507         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
1508         too.
1509
1510 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1511
1512         A fix for bug #80493 by Atsushi Enomoto
1513         * cs-parser.jay: Ignore invalid attribute target.
1514
1515 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1516  
1517         * cs-tokenizer.cs: Ignore '\0' as white space character.
1518
1519 2007-02-17  Miguel de Icaza  <miguel@novell.com>
1520
1521         * cs-parser.jay: Add support for lambda expressions to the mcs
1522         compiler as well.
1523
1524         * lambda.cs: Only clone when we are probing, not on the final call
1525         (Compatible is the final call). 
1526
1527         * statement.cs (CloneContext): Introduce class to provide block
1528         remapping during clone.
1529
1530         All statements Clone themselves now.
1531
1532         (Clone): special handling for blocks, when we clone a block, we
1533         register the block inside this routine, as children of the block
1534         might trigger a lookup. 
1535         
1536         * expression.cs: Add support for CloneContext in all expressions. 
1537         
1538 2007-02-17  Marek Safar  <marek.safar@gmail.com>
1539  
1540         A fix for bug #80493
1541         * statement.cs: Report ambiguous warning when interfaces are not related.
1542
1543 2007-02-15  Marek Safar  <marek.safar@gmail.com>
1544
1545         C# 3.0 extension methods.
1546
1547         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
1548         cannot be used directly.
1549
1550         * class.cs (Class.Emit): Emit extension attribute if any class method
1551         is extension method.
1552         (Method.Define): Add basic extension method validation conditions.
1553         (Method.Emit): Emit extension attribute for method.
1554
1555         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
1556         extension method exists. Currently we follow same approach as Microsoft
1557         does, emit even if a method or a class are private but this can change
1558         later.
1559
1560         * cs-parser.jay: Add handling of `this' keyword in method parameters
1561         context.
1562
1563         * decl.cs (DeclSpace.IsStaticClass): New property.
1564         (MemberCache.FindExtensionMethods): Looks for extension methods with
1565         defined name and extension type.
1566
1567         * doc.cs: Updated after OverloadResolve changes.
1568
1569         * driver.cs: Add new soft reference to System.Core.dll.
1570
1571         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
1572         (ExtensionMethodGroupExpr): Represents group of extension methods.
1573
1574         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
1575         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
1576         to MethodGroupExpr and made non-static for easier customization.
1577         (Invocation.DoResolve): Add extension method lookup when no standard
1578         method was found.
1579         (MemberAccess.DoResolve): Try extension methods if no member exists.
1580
1581         * modifiers.cs: Add METHOD_EXTENSION modifier.
1582
1583         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
1584         as well as candidate extension type.
1585         (ComputeNamespaces): When assembly constains extension methods registers
1586         them.
1587         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
1588         extension method lookup.
1589         (Namespace.LookupExtensionMethod): Looks for extension method in this
1590         namespace.
1591         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
1592         find a method which matches name and extensionType.
1593
1594         * parameter.cs (Parameter): Add This modifer.
1595         (HasExtensionMethodModifier): New property.
1596         (Resolve): Add extension parameter check.
1597         (ModFlags): turned to property to exclude this modifier as it is not real
1598         parameter modifier.
1599         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
1600
1601         * support.cs (ParameterData): Add ExtensionMethodType.
1602         (ReflectionParameters): Implemented ExtensionMethodType interface property.
1603
1604         * typemanager.cs: Add type and ctor extension attribute type.
1605
1606 2007-02-15  Miguel de Icaza  <miguel@novell.com>
1607
1608         * report.cs (DisableErrors, EnableErrors): used to prevent error
1609         output when we are "trying" to compile various methods with
1610         different types. 
1611
1612         * ecore.cs (Expression): Add Clone method that calls the virtual
1613         CloneTo method.  The current CloneTo method in Expression throws
1614         an exception so we can track down all the places where this must
1615         be implemented (not using abstract, because that would be a lot of
1616         up-front-work before we can start testing the implementation
1617         idea). 
1618
1619         Important: we only need Clone capabilities for expressions created
1620         by the parser, as the expressions we will be cloning are
1621         expressions in the pre-resolved state.   This vastly simplifies
1622         the work required. 
1623         
1624         (SimpleName): Add CloneTo that does nothing.
1625         (EmptyCast): Add CloneTo.
1626         
1627         * expression.cs (Binary): Implement CloneTo.
1628         (Invocation.IsApplicable): Store the current ec in
1629         EmitContext.TempEc and restore it on return.  This is used so we
1630         do not have to sprinkle hundres of methods with an extra
1631         EmitContext, we know that the only user is the lambda expression
1632         ImplicitConversionExists code. 
1633         
1634         (Argument): Add Cloning capabilities.
1635         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
1636         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
1637         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
1638         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
1639         IndexerAccess): Add Clone capability.
1640
1641         (LocalVariableReference, This): TODO: needs cloned Block mapping.
1642
1643         (Argument): Add cloning capability.
1644
1645         * assign.cs (Assign): Implement CloneTo.
1646
1647         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
1648         
1649         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
1650         version by calling Convert with the EmitContext (that we are
1651         currently storing in ec, this is not great, but will do for now,
1652         to avoid passing EmitContext parameters to hundreds of functions
1653         that do not need them now).
1654
1655         (SetExpression): Remove, it is not needed.
1656         
1657         (ContextualReturn): Implement CloneTo.
1658
1659         * statement.cs (Statement): Implement cloning infrastructure,
1660         similar to expressions.
1661
1662         (Block): Partial implementation of Clone for statements.
1663
1664         (Return): Implement clone.
1665         
1666         * constant.cs (Constant.CloneTo): New method, does nothing.
1667
1668         * codegen.cs (TempEc): Add a static EmitContext as a temporary
1669         solution, until we decide how to exactly do this.  
1670         
1671 2007-02-14  Marek Safar  <marek.safar@gmail.com>
1672  
1673         A fix for bug #80493
1674         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
1675         a property is override we need to use second accessor.
1676
1677 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1678  
1679         A fix for bug #80418
1680         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1681         methods.
1682
1683 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1684
1685         Another fix for bug #80749
1686         * pending.cs: Abstract class has priority over interfaces.
1687
1688 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1689
1690         Another fix for bug #80749
1691         * pending.cs: Abstract class has priority over interfaces.
1692
1693 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1694
1695         Another fix for bug #80749
1696         * pending.cs: Abstract class has priority over interfaces.
1697
1698 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1699
1700         Another fix for bug #80749
1701         * pending.cs: Abstract class has priority over interfaces.
1702
1703 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1704
1705         * class.cs Better error message.
1706
1707         * driver.cs: Add shorter versions of -optimize option.
1708
1709 2007-02-13  Martin Baulig  <martin@ximian.com>
1710
1711         * class.cs (Constructor.Emit): Check the return value of
1712         ec.ResolveTopBlock() and return on error.
1713
1714 2007-02-13  Raja R Harinath  <rharinath@novell.com>
1715
1716         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1717         message to fix error message regression.
1718
1719 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1720
1721         * delegate.cs: Delegate creation expression cannot be of Nullable type.
1722
1723 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1724
1725         A fix for bug #80749
1726         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1727         its parent container.
1728
1729         * class.cs (DefineFieldInitializers): Each initializer can has different
1730         resolve context.
1731
1732         * const.cs: Updated.
1733
1734 2007-02-11  Miguel de Icaza  <miguel@novell.com>
1735
1736         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1737         now all the heavy lifting to check that embedded statements or
1738         expressions have the right form is done in the ContextualReturn.
1739
1740         (ContextualReturn): New class.  
1741
1742         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1743         method that can be invoked to report 201, so we do not replicate
1744         this everywhere.
1745
1746         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1747         
1748         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1749         treating tabs as spaces. 
1750
1751 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1752
1753         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1754         * assign.cs: Use full implicit conversion for right side check.
1755
1756 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1757
1758         * statement.cs (Switch): Switch over boolean type is not standardized.
1759
1760 2007-02-08  Marek Safar  <marek.safar@gmail.com>
1761
1762         A fix for bug #80755
1763         * decl.cs (FindBaseEvent): Don't use method cache for events.
1764
1765 2007-02-07  Marek Safar  <marek.safar@gmail.com>
1766
1767         * cs-parser.jay: Better syntax error handling.
1768
1769         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1770         instead of underlying type value.
1771
1772 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1773
1774         * driver.cs: Check define identifier before is registered.
1775
1776         * namespace.cs: Use existing error message.
1777
1778         * report.cs: New warning.
1779
1780 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1781
1782         A fix for bug #80742
1783         * expression.cs: Delegate Invoke method can be called directly.
1784
1785 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1786
1787         A fix for bug #80676
1788         * class.cs (IsEntryPoint): The Main method can have params modifier.
1789
1790 2007-02-04  Miguel de Icaza  <miguel@novell.com>
1791
1792         * parameter.cs (Parameter, Parameters): Add Clone method.
1793
1794         * anonymous.cs (Compatible): Turn method into virtual method, so
1795         LambdaExpression can implement a different behavior.
1796
1797         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1798         out the basic checking here, so it can be used by
1799         LambdaExpressions.
1800         
1801         * lambda.cs: Introduce "Compatible" function that will do the
1802         heavy lifting.
1803
1804 2007-02-02  Marek Safar  <marek.safar@gmail.com>
1805
1806         * attribute.cs: Unified one error message.
1807
1808         * class.cs (Class): Use type attributes and not properties to test static
1809         class.
1810         (IsEntryPoint): Don's pass local variable.
1811
1812         * convert.cs: Removed duplicate check.
1813
1814         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1815
1816         * driver.cs: Don't crash when soft reference does not exist.
1817
1818         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1819         (UsingEntry): Removed redundant allocation.
1820
1821         * parameter.cs: Add fast path for type parameters.
1822
1823         * support.cs: Don't allocate attribute when it's not used.
1824
1825 2007-01-30  Miguel de Icaza  <miguel@novell.com>
1826
1827         * anonymous.cs
1828         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1829         this into a virtual method, so we can override it in LambdaExpression.
1830
1831         * driver.cs: Improve diagnostics in case of failure. 
1832
1833         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1834         write a function that is slightly more complex and that parses:
1835
1836         type identifier [, type identifier]* )
1837
1838         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1839         this expression:
1840
1841                 (canEmpty ? i >= 0 : i > 0)
1842
1843 2007-01-30  Raja R Harinath  <rharinath@novell.com>
1844
1845         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1846         exception on possibly valid code.
1847
1848 2007-01-29  Raja R Harinath  <rharinath@novell.com>
1849
1850         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1851         Push/PopPosition.
1852         (parse_opt_type_arguments): Remove.  It's almost the same as
1853         parse_less_than.
1854         (parse_namespace_or_typename): Use parse_less_than.
1855
1856 2007-01-28  Miguel de Icaza  <miguel@novell.com>
1857
1858         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1859         this bug took a few hours to find, because the state saved and
1860         restored by PushPosition and PopPosition was ignoring the state of
1861         parse_generic_less_than.
1862
1863         I can also now remove the handling of OP_LT and OP_GT, this solves
1864         the big mistery.
1865         
1866         * cs-tokenizer.cs: store the location for the ARROW token, we use
1867         that in the parser.
1868
1869         (PushPosition, PopPosition): save/restore also `current_token',
1870         restore `parse_generic_less_than' (was missing).
1871
1872         (parse_opt_type_arguments): use parse_type, not
1873         parse_namespace_or_typename to parse types.
1874
1875         * lambda.cs: Empty new file, will eventually have the lambda
1876         expression implementation.
1877
1878         * lambda.test: used to test the internal tokenizer. 
1879
1880         * report.cs (FeatureIsNotISO1): Rename from
1881         FeatureIsNotStandardized, because it was about the language level
1882         (1 vs 2) it was not about standarization.
1883
1884         (FeatureRequiresLINQ): New.
1885
1886         * support.cs (SeekableStreamReader): Only require that the reader
1887         is a TextReader, not a StreamReader, so we can plug StringReader. 
1888
1889         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1890         given position in the input stream the following tokens can be
1891         parsed as a type followed by an identifier.
1892
1893         (is_punct): after a '(' if parse_type_and_parameter returns true,
1894         then return a special token OPEN_PARENS_LAMBDA which is used to
1895         avoid reduce/reduce errors in the grammar for the
1896         lambda_expression rules.
1897
1898         (parse_type): implement a type parser inside the
1899         tokenizer, the parser only returns true or false depending on
1900         whether the input at a given position can be parsed as a type.
1901
1902         (peek_token): new method used during type parsing.
1903
1904 2007-01-28  Raja R Harinath  <rharinath@novell.com>
1905
1906         Fix #80531
1907         * anonymous.cs (ScopeInfo.InflateParameters): New.
1908         (AnonymousContainer.Resolve): Use it to redirect types of
1909         delegate parameters.
1910
1911 2007-01-27  Raja R Harinath  <rharinath@novell.com>
1912
1913         Fix #80530
1914         * expression.cs (Error_InvalidArguments): Don't use two different
1915         messages for CS1503.  Use ExtraInformation and
1916         SymbolRelatedToPreviousError instead.
1917
1918         Fix #80358
1919         * decl.cs (DeclSpace.initialize_type_params): Don't access
1920         'type_params' of a partial class directly.
1921
1922 2007-01-26  Miguel de Icaza  <miguel@novell.com>
1923
1924         * constant.cs: Removed a handful of out-of-range checks that were
1925         not necessary. 
1926
1927 2007-01-25  Marek Safar  <marek.safar@gmail.com>
1928
1929         * expression.cs (CheckUselessComparison): Add additional check for char
1930         constants.
1931
1932         * namespace.cs: Fixed typo.
1933
1934 2007-01-23  Miguel de Icaza  <miguel@novell.com>
1935
1936         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1937         gone, instead we inline the test, preventing the needless casts to
1938         longs, ulongs and doubles for the parameters, avoiding calls to
1939         methods that overchecked stuff, and instead inlined things
1940         nicely. 
1941
1942 2007-01-20  Marek Safar  <marek.safar@gmail.com>
1943
1944         * cs-parser.jay: Better parameter error handling.
1945
1946 2007-01-17  Marek Safar  <marek.safar@gmail.com>
1947
1948         A fix for bug #80368, #80522
1949         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1950         whether array initializer contains constants only.
1951         (ArrayCreation.Emit): Use better formula to decide when
1952         are array initializers for static initialization.
1953         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1954         have to emit even constants otherwise they are pre-initialized.
1955
1956 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
1957             Raja R Harinath  <rharinath@novell.com>
1958
1959         Fix emit order of 'get' vs. 'set'.
1960         * support.cs (Accessors): New.
1961         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1962         Note the order in which accessors are declared in the source.
1963         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1964         Refactored from Property.Define and Indexer.Define.
1965         (PropertyBase.DefineAccessors): New helper that calls the above in
1966         appropriate order as noted by the parser.
1967         (Property.Define, Indexer.Define): Update to changes.
1968         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1969
1970 2007-01-17  Raja R Harinath  <rharinath@novell.com>
1971
1972         Fix cs0029-6.cs and gcs0029-2.cs (regression)
1973         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1974         there's an implicit conversion from the current type to the target
1975         type before converting the underlying constant.
1976
1977 2007-01-16  Marek Safar  <marek.safar@gmail.com>
1978
1979         * const.cs (ResolveValue): Updated after constant conversion was made more
1980         generic.
1981
1982         * constant.cs (GetAttributableValue): constant to object conversion is
1983         used for attributes only.
1984         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1985         constant conversions.
1986         (LongConstant.ConvertImplicitly): Ditto.
1987
1988         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1989         (ImplicitConversionStandard): Handle constant conversion as extra step.
1990         It solves the issue when constant conversion was called indirectly like
1991         inside array initializer and constant folding was skipped.
1992
1993         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1994         this change.
1995
1996         * statement.cs(ImplicitConversionStandard): Updated after constant
1997         conversion was made more generic.
1998
1999 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
2000
2001         * expression.cs (As.DoResolve): Use GenericConstraints instead of
2002         Constraints, solves the problem where the compiler incorrectly
2003         reported that a type parameter was not constrained to a class (Bug
2004         80518)
2005
2006 2007-01-14  Marek Habersack  <grendello@gmail.com>
2007
2008         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
2009
2010 2007-01-14  Marek Safar  <marek.safar@gmail.com>
2011
2012         A fix for bug #80368
2013         * assign.cs (FieldInitializer): New class implements field
2014         initializer statement.
2015
2016         * attribute.cs: Update after FieldMember rename.
2017
2018         * class.cs (PropertyBasedMember): New common class for property based
2019         types.
2020         (InterfaceMemberBase): New base class for all members which can be used as
2021         an interface members.
2022         (MethodCore): Moved really common code to InterfaceMemberBase.
2023         (Method.Define): Equal and GetHasCode detection is relevant for methods
2024         only.
2025         (MethodData.Define): Don't assume that public event implements an
2026         interface automatically.
2027         (MethodData.DefineMethodBuilder): Issue an error even if only extern
2028         modifier is used.
2029         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
2030         (FieldMember): Merged with FieldBase.
2031         (EventProperty.AEventPropertyAccessor): New specialization to check whether
2032         event extern modifier can be used.
2033         (EventField.EventFieldAccessor): Moved event field specific code here.
2034         (Event.AllowedModifiers): Even event can be extern.
2035         (Event.FindOutBaseMethod): New override specific to events.
2036         (Indexer.parameters): Reintroduce parameters because base class holds
2037         only properties common data.
2038         (Indexer.CheckForDuplications): Indexers are threated as methods so we
2039         need do extra parameters check.
2040
2041         * const.cs: Update after FieldMember rename.
2042
2043         * decl.cs (MemberCache.FindBaseEvent): New method.
2044
2045         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
2046         to reflect that indexer is now derived from PropertyBased.
2047
2048         * ecore.cs (GetMemberType): Made public.
2049         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
2050         obsolete event.
2051
2052         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
2053         
2054         * typemanager.cs (CSharpSignature): Correctly print event accessors.
2055         (RegisterEvent): Removed.
2056         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
2057         (GetPrivateFieldOfEvent): Renamed to GetEventField.
2058
2059 2007-01-11  Raja R Harinath  <rharinath@novell.com>
2060
2061         Fix #80249
2062         * statement.cs (CollectionForeach.TryType): Prefer generic
2063         GetEnumerator over non-generic variant.  Fix code to follow comments.
2064
2065 2007-01-09  Raja R Harinath  <rharinath@novell.com>
2066
2067         Fix #80446
2068         * support.cs (ReflectionParameter): Don't use an invalid index on
2069         the generic parameter data.
2070
2071 2007-01-08  Miguel de Icaza  <miguel@novell.com>
2072
2073         * driver.cs: Just add a tiny bit of infrastructure.
2074
2075 2007-01-02  Marek Safar  <marek.safar@gmail.com>
2076
2077         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
2078         where field type is struct from current assembly.
2079         
2080         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
2081         it is possible.
2082
2083 2007-01-02  Marek Safar  <marek.safar@gmail.com>
2084
2085         A fix for bug #80381
2086         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
2087         the core types.
2088
2089         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
2090         messages.
2091         (Namespace.LookupType): Always use core types from corlib when speficied.
2092
2093         * report.cs: A new warning.
2094
2095         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
2096         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
2097         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
2098
2099         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
2100         (InitCoreTypes): Set expression type of object_type and value_type
2101         immediately after lookup.
2102
2103 2007-01-01  Miguel de Icaza  <miguel@novell.com>
2104
2105         * cs-tokenizer.cs: Accept Pc class characters (Connector
2106         Punctuation) as valid identifiers.  Fixes #78259
2107
2108         * expression.cs (Invocation.DoResolve): Moved the check for the
2109         use of `this' for doing method calls to the Invocation resolution
2110         step, after overload resolution has taken place instead of doing
2111         the check at the low-level `This.DoResolve' level.
2112
2113         The `This.DoResolve'(appens before overload resolution, so it has
2114         no way of knowing if the method that will be called will be
2115         instace or static, triggering an erroneous report for cs0188 (Bug
2116         78113).
2117
2118         We now do the check for instance method invocations after we know
2119         what method will be called.
2120
2121         (This.CheckThisUsage): Move the actual use of this structure
2122         checking into its own method and expose it. 
2123
2124         * Everywhere that called Error_ValueCannotBeConverted: pass a new
2125         EmitContext.
2126
2127         Exceptions: Null.ConvertImplicitly,
2128         Constant.ImplicitConversionRequired as there are too many call
2129         sites for passing the ec. 
2130
2131         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
2132         EmitContext, if the value is null, then we do not try to provide
2133         the extra information from the error (If a userdefined conversion
2134         exists, as UserDefinedConversion requires a non null-EmitContext).
2135
2136         Fixes: #80347
2137
2138 2006-12-30  Raja R Harinath  <rharinath@novell.com>
2139
2140         * flowanalysis.cs (MyBitVector): Document some invariants.
2141         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
2142         introduced below, and add a couple of others, 
2143
2144 2006-12-30  Marek Safar  <marek.safar@gmail.com>
2145
2146         * attribute.cs (GetMethodObsoleteAttribute): Uses new
2147         GetPropertyFromAccessor and GetEventFromAccessor.
2148         
2149         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
2150         overrides non-obsolete one.
2151         (Indexer.Define): Error message has been moved to the parser.
2152
2153         * cs-parser.jay: Better syntax errors handling.
2154
2155         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
2156         when an invocation has no arguments.
2157
2158         * ecore.cs: Removed not used caching.
2159
2160         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
2161         implementation.
2162
2163         * report.cs: Add a new warning.
2164
2165         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
2166
2167         * typemanager.cs (enumeration_type): Removed.
2168         (CSharpSignature): Reuses IsSpecialMethod.
2169         (IsEqual): Hack for MS BCL.
2170         (GetPropertyFromAccessor): New method.
2171         (GetEventFromAccessor): New method.
2172         (IsSpecialMethod): Fixed to handle more cases.
2173
2174 2006-12-30  Marek Safar  <marek.safar@gmail.com>
2175
2176         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
2177         Made white spaces array static.
2178
2179         * ecore.cs (RemoveGenericArity): Optimized.
2180
2181         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
2182         10 times faster).
2183         (MyBitVector.initialize_vector): Simplified.
2184
2185 2006-12-22  Miguel de Icaza  <miguel@novell.com>
2186
2187         * ecore.cs: Am not entirely happy with this hack, but it seems to
2188         address the issue in 80257 (a small test case for
2189         CreativeDocs.NET). 
2190
2191         I set the MethodGroupExpr.Type to an internal compiler type
2192         (itself in this case) to force the resolution to take place.   Why
2193         it does not take place with a null is beyond me.
2194
2195 2006-12-20  Marek Safar  <marek.safar@gmail.com>
2196
2197         A fix for bug #80288
2198         * expression.cs (ResolveOperator): Consider user defined conversion for
2199         logical and operator too.
2200         (EmitBranchable): Optimization for logical and when full constant folding
2201         could not be applied but one operand is constant.
2202
2203 2006-12-19  Marek Safar  <marek.safar@gmail.com>
2204
2205         * class.cs (GetClassBases): Write 5 times every day, will never use
2206         FullName for error reporting.
2207
2208         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
2209
2210 2006-12-19  Martin Baulig  <martin@ximian.com>
2211
2212         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
2213         the symbol file info here.
2214
2215 2006-12-18  Marek Safar  <marek.safar@gmail.com>
2216
2217         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
2218         of `elseif' is taking then following sections are not taking.
2219         Fixes an issue reported on mono mailing list.
2220
2221 2006-12-18  Marek Safar  <marek.safar@gmail.com>
2222
2223         A fix for bug #80300
2224         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
2225         a caller is not taking.
2226
2227 2006-12-18  Raja R Harinath  <rharinath@novell.com>
2228
2229         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
2230         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
2231         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
2232         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
2233         * class.cs: Update to changes.
2234
2235 2006-12-17  Marek Safar  <marek.safar@gmail.com>
2236
2237         A fix for bug #79934
2238         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
2239         partial container.
2240
2241         * class.cs (ResolveMembers): Register an iterator in current container and
2242         not in shared one.
2243
2244 2006-12-16  Raja R Harinath  <rharinath@novell.com>
2245
2246         Fix test-543.cs
2247         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
2248         satisfy a params annotated parameter.
2249
2250 2006-12-16  Marek Safar  <marek.safar@gmail.com>
2251
2252         A fix for bug #77014
2253         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
2254         paramters correctly and not rely on hacks in Parameters class.
2255         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
2256         at any possition.
2257         (Invocation.VerifyArgumentsCompat): Ditto.
2258         (Invocation.EmitArguments): Changed to correctly emit params arguments at
2259         any possition.
2260
2261         * parameter.cs (HasParams): Don't assume that params is the last one.
2262
2263         * support.cs (ReflectionParameters.ctor): Look for params attribute
2264         correctly.
2265         (ReflectionParameters.ParameterType): Removed hack when we returned last
2266         parameter for out of range parameters.
2267         (ParameterName, ParameterModifier): Ditto.
2268
2269 2006-12-14  Marek Safar  <marek.safar@gmail.com>
2270
2271         A fix for bug #79987
2272         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
2273         when assembly is not CLS compliant but type is. I have no idea why is this
2274         allowed.
2275
2276         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
2277
2278 2006-12-13  Miguel de Icaza  <miguel@novell.com>
2279
2280         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
2281         in struct constructors, they are basically no-ops.
2282
2283 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2284
2285         * cs-tokenizer.cs (Position): Save preprocessor status too.
2286
2287 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2288
2289         A fix for bug #77794
2290         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
2291
2292 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2293
2294         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
2295         Fixes #69299.
2296         (pp_expr): Report error for an invalid expression.
2297         (handle_preprocessing_directive): Simplified; add more error checking.
2298
2299 2006-12-11  Marek Safar  <marek.safar@gmail.com>
2300
2301         A fix for bug #74939
2302         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
2303         directives handling.
2304
2305 2006-12-10  Marek Safar  <marek.safar@gmail.com>
2306
2307         A fix for bugs #80093, and #75984
2308         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
2309         logic, it seems to me as it worked before "by coincidence".
2310         (xtoken): Simplified to use reworked handle_preprocessing_directive.
2311         (cleanup): Enabled endif check.
2312
2313 2006-12-09  Marek Safar  <marek.safar@gmail.com>
2314
2315         A fix for bug #80162
2316         * statement.cs (CollectionForeach.TryType): Generics and non-generics
2317         enumerators are never ambiguous.
2318
2319 2006-12-08  Raja R Harinath  <rharinath@novell.com>
2320
2321         Fix #80060
2322         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
2323
2324 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2325
2326         A fix for bug #80144
2327         * class.cs (EventProperty.Define): Explicit implementation means
2328         that an even is used.
2329
2330 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2331
2332         Fixes the operators implementation (part II)
2333
2334         * cfold.cs (DoConstantNumericPromotions): Renamed to
2335         DoBinaryNumericPromotions and simplified.
2336         (BinaryFold): Couple of conversion fixes; simplified.
2337
2338         * constant.cs, ecore.cs, literal.cs
2339         (ToType): Renamed to ConvertImplicitly.
2340         (Reduce): Renamed to ConvertExplicitly.
2341
2342         * class.cs, convert.cs: Updated.
2343
2344         * expression.cs: TryReduce doesn't throw an exception.
2345
2346 2006-12-01  Marek Safar  <marek.safar@gmail.com>
2347
2348         A fix for bug #80108
2349         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
2350         compatible.
2351
2352 2006-11-30  Marek Safar  <marek.safar@gmail.com>
2353
2354         Fixes unary operators implementation (part I)
2355         Also fixes #80026
2356
2357         * cfold.cs (Error_CompileTimeOverflow): Made internal
2358
2359         * const.cs (IConstant): Changed to use reference to constant and
2360         not constant itself.
2361         Updated IConstant implementations.
2362
2363         * constant.cs (CreateConstant): New factory method.
2364         Updated IConstant implementation.
2365
2366         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
2367
2368         * ecore.cs: Updated to use CreateConstantReference.
2369
2370         * enum.cs: Reflects IConstant changes.
2371
2372         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
2373
2374         * literal.cs (NullConstant): Change to be independently usable.
2375
2376 2006-11-29  Martin Baulig  <martin@ximian.com>
2377
2378         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
2379         we need to emit the scope initializer before calling the base .ctor.
2380
2381         * anonymous.cs: Merged back from the new anonymous methods branch.
2382         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
2383
2384         * expression.cs (ParameterReference.DoResolveBase): Create a
2385         "normal" ScopeInfo when capturing parameters rather than using the
2386         root scope; this makes things work with anonymous methods having
2387         parameters.
2388
2389         * statement.cs
2390         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
2391
2392 2006-11-22  Marek Safar  <marek.safar@gmail.com>
2393
2394         A fix for bug #79987
2395         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
2396         check to a base class.
2397         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
2398         only when assembly has missing attribute.
2399         * report.cs: Update.
2400
2401 2006-11-21  Marek Safar  <marek.safar@gmail.com>
2402
2403         * cs-tokenizer.cs: Merged with gmcs version.
2404
2405 2006-11-20  Marek Safar  <marek.safar@gmail.com>
2406
2407         * cs-tokenizer.cs,
2408         * cs-parser.jay: Better error message when partial keyword is misplaced.
2409
2410 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
2411
2412         A fix for bug #79810
2413         report.cs: CS1058 only applies to 2.0 profile (gmcs).
2414         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
2415         a RuntimeWrappedException by default.
2416
2417 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2418
2419         A fix for bug #79843
2420         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
2421         implementation.
2422         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
2423
2424 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2425
2426         * driver.cs, namespace.cs: Uses faster IndexOf version.
2427
2428 2006-11-17  Marek Safar  <marek.safar@gmail.com>
2429
2430         A fix for bug #79941
2431         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
2432         operators.
2433         (Operator.Define): Implicit/Explicit operator of same type is duplicate
2434         even if internal name is different.
2435         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
2436         (UserDefinedConversion): Simplified as the operators cannot be internal.
2437         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
2438         conversions.
2439         (MethodLookup): Replaced EmitContext with parentType.
2440         * expression.cs: Updated.
2441
2442 2006-11-09  Raja R Harinath  <rharinath@novell.com>
2443
2444         * driver.cs (BadAssembly): Handle all the ugliness of
2445         DefineDynamicAssembly.
2446
2447 2006-11-08  Raja R Harinath  <rharinath@novell.com>
2448
2449         Address parts of #58244 -- most of what's left is in the runtime
2450         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
2451         CS1509 error checks, and handle them for all assembly loads, not
2452         just the first invocation.
2453         (LoadModule): Likewise.  Move handling of 'adder_method' ...
2454         * codegen.cs (AssemblyClass.AddModule): ... here.
2455
2456 2006-11-02  Marek Safar  <marek.safar@gmail.com>
2457
2458         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
2459         IEnumerable<T> is ambiguous.
2460
2461 2006-10-31  Marek Safar  <marek.safar@gmail.com>
2462
2463         A fix for bug #67689
2464         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
2465         GetEnumerator is ambiguous.
2466
2467         * report.cs: Add new warning.
2468
2469 2006-10-29  Marek Safar  <marek.safar@gmail.com>
2470
2471         A fix for bug #78602
2472         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2473         to protected member can be nested type.
2474
2475 2006-10-28  Marek Safar  <marek.safar@gmail.com>
2476
2477         A fix for bug #78965
2478         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2479         to protected member must derive from current type.
2480
2481 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2482
2483         assign.cs: Reuses error method.
2484
2485         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
2486         instead of type for constants.
2487         (Expression.Error_ValueAssignment): Common error method.
2488
2489         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
2490         for any assignment.
2491
2492 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2493
2494         A fix for bug #79081
2495         * expression.cs (MemberAccess.DoResolve): Check nested type
2496         accessibility.
2497
2498 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
2499
2500         * doc.cs : nested delegates were not handled. Fixed bug #79754.
2501
2502 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2503
2504         A fix for bug #76591
2505         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
2506
2507 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2508
2509         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
2510         type forwarder of the same type multiple times.
2511
2512 2006-10-26  Raja R Harinath  <rharinath@novell.com>
2513
2514         Fix #78820
2515         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
2516         instance as an rvalue, even when we later resolve as an lvalue.
2517
2518 2006-10-25  Martin Baulig  <martin@ximian.com>
2519
2520         * anonymous.cs: Fix #79673.
2521
2522 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
2523
2524         A fix for bug #79666
2525         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
2526         ignored when is optimized (= default value) as its value is already set.
2527
2528 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2529
2530         A fix for bug #79724
2531         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
2532         TypeContainer for type lookup.
2533
2534 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2535
2536         A fix for bug #79231
2537         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
2538         * expression.cs (OverloadResolve): Always convert type name for
2539         an error message.
2540         (ResolveNamespaceOrType): Don't confuse a nested type with any 
2541         other member.
2542
2543 2006-10-18  Martin Baulig <martin@ximian.com>
2544
2545         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
2546
2547 2006-10-17  Miguel de Icaza  <miguel@novell.com>
2548
2549         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
2550         an int32, but requesting an int64 from the conversion
2551
2552 2006-10-12  Martin Baulig  <martin@ximian.com>
2553
2554         * anonymous.cs
2555         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
2556         
2557 2006-10-12  Martin Baulig  <martin@ximian.com>
2558
2559         * statement.cs
2560         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
2561
2562 2006-10-11  Miguel de Icaza  <miguel@novell.com>
2563
2564         * convert.cs: Remove broken code: I was doing the "Existance"
2565         tests for Implicit conversions.
2566
2567 2006-10-10  Miguel de Icaza  <miguel@novell.com>
2568
2569         * convert.cs: Added one missing case in
2570         ImplicitStandardConversionExists uint64 to intptr.
2571
2572         Fixes #59800
2573         
2574         * typemanager.cs (uintptr_type): another core known type.   
2575
2576         * ecore.cs (OperatorCast): routine used to do cast operations that
2577         depend on op_Explicit.  We could change some of the Decimal
2578         conversions to use this.
2579
2580         This one has a probe mechanism that checks both types for an op_
2581         which it coudl be used to eliminate two classes: CastToDecimal
2582         and CastFromDecimal.
2583
2584         * convert.cs: Implement the conversions documented in #59800
2585         
2586 2006-10-10  Martin Baulig  <martin@ximian.com>
2587
2588         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
2589         before RootScope.ResolveMembers().
2590
2591         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
2592         `CurrentType' if appropriate.
2593
2594 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
2595
2596         A fix for bug #78568
2597         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
2598         when contains binary operators.
2599         * cs-parser.jay: Updated.
2600
2601 2006-10-09  Martin Baulig  <martin@ximian.com>
2602
2603         * delegate.cs
2604         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
2605         moved that into Define() and also do the other type parameter
2606         checks there.  Fixes #79094.  Added gtest-292.cs.
2607
2608         * expression.cs
2609         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
2610         since that doesn't include type parameters; don't use `Ldelema'
2611         for type parameters.  Fixes #78980.  Added gtest-293.cs.
2612
2613 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
2614
2615         A fix for #77796
2616         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
2617         conversion is allowed.
2618
2619 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2620
2621         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
2622         error reporting when no error occurs.
2623
2624 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2625
2626         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
2627         does not exist.
2628
2629 2006-10-06  Raja R Harinath  <rharinath@novell.com>
2630
2631         Fix #79584
2632         * class.cs (DefineTypeBuilder): Check circular dependencies before
2633         setting the parent of the TypeBuilder.
2634         (CheckRecursiveDefinition): Don't use 'BaseType', since
2635         it may not be valid until after DefineTypeBuilder.  Use
2636         'base_type' instead.
2637
2638 2006-10-04  Martin Baulig  <martin@ximian.com>
2639
2640         Merged the Anonymous Methods patch.
2641
2642         * anonymous.cs, iterators.cs: The new anonymous methods code.
2643
2644         * statement.cs (Variable): New public abstract class.
2645         (LocalInfo.Variable): New public property.
2646         (LocalInfo.ResolveVariable): New public method.
2647         (Block.Flags): Add `IsIterator'.
2648         (Block.AddVariable): Improved the CS0136 check.
2649         (Block.AnonymousChildren): New public property.
2650         (Block.AddAnonymousChild): New public method.
2651         (ToplevelBlock): Update to use the new anonymous method framework.
2652         (ToplevelBlock.ctor): `container' is now a `Block' and not a
2653         `ToplevelBlock'; this is required to correctly implement the
2654         CS0136 check.
2655         (Fixed, Using): Use `TemporaryVariable' instead of directly
2656         creating the `LocalBuilder'.
2657
2658         * parameter.cs (Parameter.ResolveVariable): New public method.
2659         (Parameters.ResolveVariable): Likewise.
2660
2661         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
2662
2663         * class.cs (TypeContainer): Replaced the `iterators' list and
2664         corresponding methods with a list of `CompilerGeneratedClass'es.
2665         (TypeContainer.ResolveMembers): New public method.
2666         (Method): `IIteratorContainer' has been replaced by
2667         `IAnonymousHost'.
2668
2669         * expression.cs (VariableReference): New public abstract base
2670         class for `LocalVariableReference', `ParameterReference' and
2671         `This'.
2672
2673         * codegen.cs (EmitContext): Removed `capture_context',
2674         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
2675         (EmitContext.EmitThis): Removed.
2676
2677         * cs-parser.jay: Replace `iterator_container' with
2678         `anonymous_host'.       
2679
2680 2006-10-04  Martin Baulig  <martin@ximian.com>
2681
2682         * generic.cs (GenericMethod): Don't make this abstract.
2683         (Constraints.Clone): Added dummy implementation.
2684
2685 2006-10-04  Raja R Harinath  <harinath@gmail.com>
2686
2687         Fix #79577
2688         * namespace.cs (LookForAnyGenericType): Avoid nullref on
2689         'declspaces'.  Avoid allocating arrays willy-nilly.
2690
2691         Fix #79553
2692         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2693         cases out of the switch.
2694
2695 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2696
2697         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2698         message when non-generic type is used with the type arguments.
2699         * expression.cs: Updated.
2700
2701 2006-09-28  Raja R Harinath  <rharinath@novell.com>
2702
2703         Fix #79013
2704         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2705         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2706         Change semantics slightly.  Don't insist on having only one
2707         temporary EmptyExpression -- just throttle the creation of new ones.
2708
2709         Fix #79451
2710         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2711         non-interfaces too.  If no methods are found, don't try to create
2712         a MethodGroupExpr.
2713
2714 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2715
2716         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2717         generic type.
2718
2719         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2720         us produce better error message.
2721
2722 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
2723
2724         * expression.cs (Binary.ResolveOperator): Warn about a side effect
2725         of the `|' operator.
2726
2727         * report.cs: A new warning added.
2728
2729 2006-09-27  Martin Baulig  <martin@ximian.com>
2730
2731         * generic.cs (GenericMethod): Don't make this abstract.
2732
2733 2006-09-27  Martin Baulig  <martin@ximian.com>
2734
2735         * report.cs
2736         (InternalErrorException): Added overloaded ctor taking a params array.
2737
2738 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
2739
2740         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2741         Fixed the cases when same error was reported twice.
2742
2743         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2744         now report symbol information.
2745
2746 2006-09-25  Martin Baulig  <martin@ximian.com>
2747
2748         * class.cs: Completely unified with the gmcs version.
2749
2750 2006-09-25  Martin Baulig  <martin@ximian.com>
2751
2752         * typemanager.cs (TypeManager.IsNullableType): New public function.
2753         (TypeManager.IsNullableTypeOf): Likewise.
2754         (TypeManager.IsNullableValueType): Likewise.
2755
2756         * class.cs (MethodCore): Added the `GenericMethod' argument from
2757         gmcs and also unified all classes derived from `MethodCore' with gmcs.
2758
2759 2006-09-24  Raja R Harinath  <harinath@gmail.com>
2760
2761         * convert.cs: Unify with gmcs version.
2762
2763 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2764
2765         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2766         verify them as well.
2767
2768         * report.cs: New warning.
2769
2770 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2771
2772         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2773         for anonymous block with out argument.
2774
2775 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2776
2777         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2778         not used private events only.
2779
2780 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
2781
2782         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2783
2784         * const.cs (Const.Define): Check for constant type.
2785         (Const.IsConstantTypeValid): Looks for valid constant types.
2786
2787         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2788
2789         * ecore.cs (EmptyConstantCast): New common class for all constant based
2790         EmptyCast(s).
2791
2792         * expression.cs (Is.DoResolve): Handle null constant especially.
2793         (New.DoResolve): Check for new void().
2794         (MemberAccess.DoResolve): Cope with all kind of nulls.
2795
2796         * literal.cs (NullConstant): Uses EmptyConstantCast.
2797         (NullDefault): Based on EmptyConstantCast.
2798         (NullLiteral): Uses EmptyConstantCast.
2799
2800         * statement.cs (Block.ResolveMeta): Check for constant type.
2801
2802 2006-09-22  Martin Baulig  <martin@ximian.com>
2803
2804         * delegate.cs, attribute.cs: Merged with the gmcs versions.
2805
2806 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2807
2808         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2809         not the null type.
2810
2811         Fix part of #79451
2812         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2813         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
2814         code slightly.
2815
2816 2006-09-22  Martin Baulig  <martin@ximian.com>
2817
2818         * ecore.cs: Merged with the gmcs version.
2819
2820         * generic.cs (ConstructedType): New dummy class.
2821         (TypeArguments): Don't make this abstract.
2822
2823         * typemanager.cs
2824         (TypeManager.IsGenericTypeDefinition): New method.
2825         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2826
2827 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2828
2829         * expression.cs (ComposedCast): Check for arrays of TypedReference
2830         before creating the type, not after.
2831
2832 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
2833
2834         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2835         after ToType change.
2836
2837         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2838         when constant must be implicitly convertible.
2839
2840         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2841
2842         * ecore.cs (NullCast): Derives from NullConstant.
2843
2844         * expression.cs (Is.DoResolve): Removed useless variables.
2845         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2846         (New.Constantify): Add enum support.
2847         (MemberAccess.DoResolve): Add warning when accessing null constant or
2848         variable.
2849
2850         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2851         property.
2852
2853         * literal.cs (NullConstant): New abstract class with common
2854         functionality for all null specializations.
2855         (NullDefault): Represents default(X) when result can be
2856         reduced to null.
2857         (NullLiteral): Updated.
2858
2859         * report.cs: Add new warning.
2860
2861 2006-09-21  Martin Baulig  <martin@ximian.com>
2862
2863         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2864
2865 2006-09-21  Martin Baulig  <martin@ximian.com>
2866
2867         * generic.cs (GenericConstraints): New dummy class.
2868         (Constraints): Likewise.
2869         (TypeParameter): Likewise.
2870         (TypeParameterName): Likewise.
2871         (GenericMethod): Likewise.
2872
2873         * typemanager.cs (TypeManager.GetGenericArguments): New method.
2874
2875         * decl.cs: Merged with the gmcs version.
2876
2877 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2878
2879         * generic.cs (TypeParameter): Implement IMemberContainer.
2880         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
2881
2882         * rootcontext.cs: Unify with gmcs version.
2883
2884         * report.cs: Unify with gmcs version.
2885         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2886         from gmcs/generics.cs.
2887         * generics.cs (TypeParameter): New dummy class.
2888
2889         * support.cs: Unify with gmcs version.
2890
2891 2006-09-20  Raja R Harinath  <rharinath@novell.com>
2892
2893         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2894         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2895
2896         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2897         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2898         * mcs.exe.sources: Add generic.cs.
2899
2900         * codegen.cs: Unify with gmcs version.
2901
2902         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2903         (EmitContext): Add GenericDeclContainer implementation.
2904         * decl.cs (MemberCore, DeclSpace): Likewise.
2905         * namespace.cs: Remove #ifdef GMCS_SOURCE.
2906
2907         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2908         MCS TypeManager has a corresponding dummy method.
2909
2910 2006-09-19  Martin Baulig  <martin@ximian.com>
2911
2912         * expression.cs: Completely merged with the gmcs version.
2913
2914 2006-09-19  Martin Baulig  <martin@ximian.com>
2915
2916         * expression.cs (Invocation): Merged with the gmcs version.
2917         (ArrayAccess.GetStoreOpcode): Likewise.
2918
2919 2006-09-19  Martin Baulig  <martin@ximian.com>
2920
2921         * typemanager.cs
2922         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2923         (TypeManager.IsGenericMethodDefinition): Likewise.
2924
2925 2006-09-19  Martin Baulig  <martin@ximian.com>
2926
2927         * typemanager.cs
2928         (TypeManager.IsEqual): Moved the gmcs implementation here.
2929         (TypeManager.DropGenericTypeArguments): Likewise.
2930         (TypeManager.DropGenericMethodArguments): Likewise.
2931         (TypeManager.GetTypeArguments): Moved here from gmcs.
2932         (TypeManager.HasGenericArguments): Likewise.
2933
2934 2006-09-19  Martin Baulig  <martin@ximian.com>
2935
2936         * expression.cs (Binary): Merged with the gmcs version.
2937
2938 2006-09-19  Martin Baulig  <martin@ximian.com>
2939
2940         * expression.cs (Probe, As, Is): Merged with the gmcs version.
2941
2942 2006-09-19  Martin Baulig  <martin@ximian.com>
2943
2944         * typemanager.cs: Merged with the gmcs version.
2945
2946 2006-09-16  Raja R Harinath  <rharinath@novell.com>
2947
2948         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2949         * driver.cs: Likewise.
2950
2951 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
2952
2953         A fix for #79401
2954         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2955         only if parent type is class.
2956         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2957         update.
2958
2959 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
2960
2961         * cs-parser.jay,
2962         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2963         keywords are used.
2964         * typemanager.cs(CSharpName): Converts NullType to null.
2965
2966 2006-09-15  Martin Baulig  <martin@ximian.com>
2967
2968         * typemanager.cs
2969         (TypeManager.GetMethodName): Added mcs implementation.
2970         (TypeManager.IsEqual): Likewise.
2971
2972         * ecore.cs
2973         (SimpleName.RemoveGenericArity): Added dummy implementation.
2974
2975         * pending.cs: Merged with the gmcs version.     
2976
2977 2006-09-15  Martin Baulig  <martin@ximian.com>
2978
2979         * statement.cs: Merge with the gmcs version.
2980
2981 2006-09-15  Martin Baulig  <martin@ximian.com>
2982
2983         * statement.cs (Switch): Merge with the gmcs implementation
2984         (without nullables), which is newer.
2985
2986 2006-09-15  Martin Baulig  <martin@ximian.com>
2987
2988         * statement.cs (Block.Variables): Make this public.
2989         (ToplevelBlock.Parameters): Make this a property.
2990         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2991
2992 2006-09-15  Martin Baulig  <martin@ximian.com>
2993
2994         * namespace.cs: Merge with the gmcs version.
2995
2996 2006-09-15  Martin Baulig  <martin@ximian.com>
2997
2998         * decl.cs (MemberName): Minor code cleanups.
2999
3000 2006-09-15  Martin Baulig  <martin@ximian.com>
3001
3002         * parameter.cs: Merge with the gmcs version.
3003
3004 2006-09-15  Martin Baulig  <martin@ximian.com>
3005
3006         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
3007         and an error in mcs.
3008
3009 2006-09-15  Martin Baulig  <martin@ximian.com>
3010
3011         * flowanalysis.cs: Merged from GMCS; added the generics code into
3012         a `GMCS_SOURCE' conditional so we can share this file.
3013
3014 2006-09-08  Martin Baulig  <martin@ximian.com>
3015
3016         * typemanager.cs (TypeManager.interlocked_type): New public field.
3017         (TypeManager.int_interlocked_compare-exchange): New public field.
3018         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
3019         enumerator types here and call InitGenericCoreTypes().
3020         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
3021         after calling InitEnumUnderlyingTypes().
3022
3023         * rootcontext.cs
3024         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
3025         `classes_second_stage'. 
3026
3027 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
3028
3029         * assign.cs, ecore.cs, expression.cs: Share error message text.
3030         * class.cs (FieldMember.Define): Check for varible of static type.
3031         * driver.cs (LoadAssembly): Uses error output for errors.
3032         * statement.cs: Updated.
3033
3034 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
3035
3036         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
3037         type instance.
3038
3039 2006-09-07  Martin Baulig  <martin@ximian.com>
3040
3041         * driver.cs
3042         (MainDriver): Revert r62663 from Marek; see #70506 for details.
3043
3044 2006-08-29  Miguel de Icaza  <miguel@novell.com>
3045
3046         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
3047         
3048 2006-08-17  Miguel de Icaza  <miguel@novell.com>
3049
3050         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
3051         #52019 and #79064, the use of the \uXXXX sequence in source code
3052         to represent unicode characters.
3053
3054 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
3055
3056         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
3057         support.
3058         * class.cs, ecore.cs, statement.cs: Merged to one error message.
3059
3060 2006-08-13  Miguel de Icaza  <miguel@novell.com>
3061
3062         * assign.cs: Catch attempts to assign to a method groups in += and
3063         report as 1656
3064
3065 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
3066
3067         A fix for #79056
3068         * cs-parser.jay: Don't destroy current array type by typeof of array's.
3069
3070 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
3071
3072         * class.cs (Method.Define): Issue a warning when generic method looks like
3073         an entry point.
3074         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
3075         as well.
3076
3077 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
3078  
3079         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
3080         looking for ctor.
3081         * decl.cs (MemberCache.FindMembers): When container is interface we need to
3082         search all base interfaces as a member can be ambiguous.
3083         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
3084         Constructor member type filter. 
3085         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
3086         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
3087         reporting for returned memberinfos.
3088         * report.cs: Updated.
3089         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
3090         version to work on all runtimes.
3091         (TypeManager.RealMemberLookup): Removed members filtering.
3092
3093 2006-08-08  Raja R Harinath  <rharinath@novell.com>
3094
3095         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
3096         (PropertyExpr.EmitAssign): Likewise.
3097         * expression.cs (Indirection.EmitAssign): Likewise.
3098         (LocalVariableReference.EmitAssign): Likewise.
3099         (ParameterReference.EmitAssign): Likewise.
3100         (Invocation.EmitArguments): Likewise.
3101         (ArrayAccess.EmitAssign): Likewise.
3102         (IndexerAccess.EmitAssign): Likewise.
3103         (This.EmitAssign): Likewise.
3104         (ConditionalLogicalOperator.Emit): Likewise.
3105
3106         Fix #79026
3107         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
3108         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
3109         leave it in after returning it.
3110         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
3111
3112 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
3113
3114         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
3115         message.
3116
3117 2006-08-03  Raja R Harinath  <rharinath@novell.com>
3118
3119         Fix cs0146-3.cs and cs0146-4.cs.
3120         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
3121         enclosing types don't depend on the current type.
3122
3123 2006-08-02  Raja R Harinath  <rharinath@novell.com>
3124
3125         Fix #77963
3126         * class.cs (TypeContainer.DoDefineMembers): Use
3127         FindBaseMemberWithSameName on Parent, since we're interested in
3128         whether we hide inherited members or not.
3129         (FindBaseMemberWithSameName): Make slightly more robust.
3130
3131         Fix the non-generic testcase from #77396
3132         * decl.cs (DeclSpace.DeclContainer): Remove override.
3133
3134         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
3135         declspaces for doppelgangers too.
3136         (UsingEntry): Implement IResolveContext.
3137         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
3138         'this' as the resolve context.
3139         (LocalAliasEntry): Likewise.
3140
3141         Implement parts of #77403
3142         * roottypes.cs (RootDeclSpace): New.  Used to represent the
3143         toplevel declaration space.  Each namespace declaration introduces
3144         a "partial" root declaretion space.
3145         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
3146         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
3147         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
3148         from 'current_namespace.SlaveDeclSpace'.
3149         (namespace_declaration): Likewise.
3150         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
3151         check.  It can't happen now.
3152         * decl.cs (DeclSpace.LookupType): Likewise.
3153         * driver.cs (MainDriver): Sanity check.
3154
3155 2006-08-01  Raja R Harinath  <rharinath@novell.com>
3156
3157         * decl.cs (DeclSpace.FindNestedType): Remove.
3158         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
3159         LookupTypeContainer to get the container of the nested type.
3160         * class.cs (TypeContainer.FindNestedType): Make non-override.
3161
3162 2006-07-31  Raja R Harinath  <rharinath@novell.com>
3163
3164         * decl.cs (DeclSpace.PartialContainer): Move field from ...
3165         * class.cs (TypeContainer.PartialContainer): ... here.
3166         (TypeContainer.AddBasesForPart): New helper.
3167         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
3168         instead.
3169         * cs-parser.jay (current_class): Convert to DeclSpace.
3170         (struct_declaration, interface_declaration, class_declaration):
3171         Use AddBasesForPart instead of .Bases directly.
3172         * const.cs, iterators.cs: Update to changes.
3173
3174 2006-07-28  Raja R Harinath  <rharinath@novell.com>
3175
3176         * class.cs (TypeContainer.AddMemberType): Rename from
3177         AddToTypeContainer.
3178         (TypeContainer.AddMember): Rename from AddToMemberContainer.
3179         (AddTypeContainer): New.  Combine AddClassOrStruct and
3180         AddInterface.
3181         (AddPartial): Update.  Add 'is_partial' argument.
3182         * roottypes.cs: Update to changes.
3183         * cs-parser.jay (push_current_class): New helper for handling
3184         current_container and current_class.
3185         (struct_declaration, interface_declaration, class_declaration):
3186         Use it.
3187
3188 2006-07-26  Raja R Harinath  <rharinath@novell.com>
3189
3190         * roottypes.cs: Rename from tree.cs.
3191
3192         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
3193         * tree.cs (Tree, ITreeDump): Remove types.
3194         * rootcontext.cs (tree, Tree): Remove fields.
3195         (root, ToplevelTypes): New.
3196         * *.cs: Update to rename.
3197
3198         * tree.cs (Tree.RecordDecl): Remove.
3199         (RootTypes.AddToTypeContainer): Record the toplevel type in its
3200         namespace here.
3201         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
3202
3203 2006-07-23  Raja R Harinath  <harinath@gmail.com>
3204
3205         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
3206         DoFlowAnalysis and OmitStructFlowAnalysis here.
3207         (ec.With): Rename from WithUnsafe and generalize.
3208         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
3209         (ec.WithFlowAnalyis): New.
3210         * ecore.cs, expression.cs, statement.cs: Update.
3211
3212 2006-07-22  Raja R Harinath  <harinath@gmail.com>
3213
3214         * statement.cs (Block.ResolveMeta): Simplify slightly.
3215
3216         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
3217         multiple boolean fields.  Convert InUnsafe, constant_check_state,
3218         check_state to flags.
3219         (CheckState, ConstantCheckState): Update.
3220         (InUnsafe): New read-only property.
3221         (FlagsHandle): Rename from CheckStateHandle and convert to handle
3222         arbitrary flags.
3223         (WithUnsafe): New helper similar to WithCheckState.
3224         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
3225         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
3226
3227 2006-07-21  Raja R Harinath  <rharinath@novell.com>
3228
3229         Make comparisons use the same IL irrespective of whether they're
3230         in a 'checked' or 'unchecked' context: one of the issues in #78899
3231         * codegen.cs (EmitContext.CheckState): Make read-only property.
3232         (EmitContext.ConstantCheckState): Likewise.
3233         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
3234         helper that implement a save/restore stack for CheckState
3235         values.  This is the only way to change check-state.
3236         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
3237         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
3238         (CheckedExpr.EmitBranchable): New forwarding method.
3239         (UnCheckedExpr): Likewise.
3240         * statement.cs (Block.ResolveMeta): Use WithCheckState.
3241         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
3242         (Checked.Resolve, checked.DoEmit): Likewise.
3243
3244 2006-07-20  Miguel de Icaza  <miguel@novell.com>
3245
3246         * anonymous.cs: Cache the resolved anonymous delegate, and return
3247         this so that the ResolveTopBlock is only triggered once, not
3248         twice.
3249
3250         Currently we trigger ResolvetopBlock twice due to a first pass of
3251         argument check compatibility, and a second pass that does the
3252         actual resolution.   
3253         
3254 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
3255
3256         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
3257         modifiers.
3258         * rootcontext.cs (Reset): Add helper_classes.
3259
3260 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
3261
3262         A fix for #78860
3263         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
3264         correctly.
3265
3266 2006-07-13  Miguel de Icaza  <miguel@novell.com>
3267
3268         * statement.cs (Lock): Handle expressions of type
3269         TypeManager.null_type specially.  Fixes #78770
3270
3271 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
3272
3273         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
3274         to an event.
3275
3276 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
3277
3278         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
3279         for accessors as well.
3280         * ecore.cs (EventExpr): Add AccessorTable.
3281
3282 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
3283
3284         A fix for #78738
3285         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
3286         for CS0122 where appropriate.
3287         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
3288         level attributes.
3289         (Filter): Assembly can be null in the case of top level attributes.
3290
3291 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
3292
3293         A fix for #78690
3294
3295         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
3296         is done at global level.
3297
3298 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3299
3300         A fix for #77002, Implemented TypeForwarder support.
3301
3302         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
3303         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
3304         * typemanager.cs (): Add type_forwarder_attr_type.
3305
3306 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3307
3308         * report.cs: Add CS0469 warning.
3309
3310 2006-06-21  Martin Baulig  <martin@ximian.com>
3311
3312         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
3313         the `try'-block, so we also report CS0016 etc. there.
3314
3315 2006-06-21  Martin Baulig  <martin@ximian.com>
3316
3317         * delegate.cs
3318         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
3319
3320 2006-06-21  Martin Baulig  <martin@ximian.com>
3321
3322         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
3323         also report CS1686 for parameters.
3324
3325 2006-06-21  Martin Baulig  <martin@ximian.com>
3326
3327         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
3328         instead of an error if the value is not implicitly convertible to
3329         the switch types; fixes #77964.
3330
3331 2006-06-21  Raja R Harinath  <rharinath@novell.com>
3332
3333         Fix #78673
3334         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
3335         FieldBuilder is null.
3336
3337         Fix #78662
3338         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
3339         'left' and 'right' before error-checking.
3340
3341 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
3342
3343         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
3344         Fixed bug #78601.
3345         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
3346         (FieldExpr.DoResolve): likewise.
3347         (PropertyExpr.InstanceResolve): likewise.
3348         (EventExpr.InstanceResolve): likewise. 
3349
3350 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
3351
3352         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
3353         attribute applicable tests for attribute argument.
3354
3355 2006-06-02  Raja R Harinath  <rharinath@novell.com>
3356
3357         Fix #78079
3358         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
3359         (Binary.OverloadResolve_PredefinedIntegral): New.
3360         (Binary.OverloadResolve_PredefinedFloating): New.
3361         (Binary.OverloadResolve_PredefinedString): New.
3362         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
3363         Follow the standard more closely, and treat numeric promotions in
3364         terms of overload resolution.
3365         (Binary.CheckShiftArguments): Simplify.
3366
3367 2006-06-01  Raja R Harinath  <rharinath@novell.com>
3368
3369         * flowanalysis.cs (MyBitVector): Simplify representation.
3370         (MyBitVector.Clone): Avoid allocating BitArray.
3371         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
3372         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
3373         (*): Update.  Change all references to MyBitVector.And and
3374         MyBitVector.Or to &= and |=.
3375
3376 2006-05-29  Raja R Harinath  <rharinath@novell.com>
3377
3378         Fix cs0231-[34].cs.
3379         * cs-parser.jay (formal_parameter_list): Extend the pattern below
3380         to param arguments too.
3381
3382 2006-05-26  Miguel de Icaza  <miguel@novell.com>
3383
3384         * cs-parser.jay: Catch another parsing form for arglist being
3385         followed by other arguments.  Fixes #78313.
3386
3387 2006-05-24  Raja R Harinath  <rharinath@novell.com>
3388
3389         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
3390         checking of out parameters to ...
3391         (FlowBranchingToplevel.Merge): ... here.
3392         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
3393         set, propagate the origin upward, and only complain if there was
3394         no other error.
3395         (FlowBranchingException.AddContinueOrigin): Likewise.
3396         (FlowBranchingException.AddReturnOrigin): Likewise.
3397         (FlowBranchingException.AddGotoOrigin): Likewise.       
3398
3399 2006-05-23  Raja R Harinath  <rharinath@novell.com>
3400
3401         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
3402         unreachable, skip it.
3403         (FlowBranchingException.Merge): Always propagate jumps, even if
3404         the finally block renders subsequent code unreachable.
3405
3406 2006-05-18  Raja R Harinath  <rharinath@novell.com>
3407
3408         Fix #77601
3409         * statement.cs (Goto.Resolve): Move responsibility for resolving
3410         'goto' to FlowBranching.AddGotoOrigin.
3411         (Goto.SetResolvedTarget): New.  Callback to set the
3412         LabeledStatement that's the target of the goto.
3413         (Goto.DoEmit): Use Leave instead of Br when crossing an
3414         unwind-protect boundary.
3415         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
3416         LookupLabel and adjust to new semantics.
3417         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
3418         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
3419         Goto.SetResolvedTarget to update target.
3420         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
3421         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
3422         AddBreakOrigin & co.  Delay propagation until ...
3423         (FlowBranchingException.Merge): ... this.
3424
3425         * statement.cs (Block.Resolve): Always depend on flow-branching to
3426         determine unreachability.  Kill workaround that originally emitted
3427         only one statement after an "unreachable" label (see infloop in
3428         test-515.cs).
3429
3430         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
3431         This is still "wrong", but anything better would probably need a
3432         multi-pass algorithm.
3433         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
3434         usage vector.  Force current usage vector to be reachable, to
3435         optimistically signify backward jumps.
3436         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
3437         detected.
3438         (FlowBranchingLabeled.Merge): New.  If no backward jump was
3439         detected, return the original salted-away usage vector instead,
3440         updated with appropriate changes.  Print unreachable warning if
3441         necessary.
3442         * statement.cs (Block.Resolve): Don't print unreachable warning on
3443         a labeled statement.
3444
3445 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
3446
3447         * driver.cs: Pass filename without path to AssemblyBuilder's 
3448         AddResourceFile. Fixes bug #78407.
3449
3450 2006-05-17  Raja R Harinath  <rharinath@novell.com>
3451
3452         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
3453         * flowanalysis.cs (FlowBranchingLabeled): ... here.
3454         (FlowBranching.MergeChild): Overwrite
3455         reachability information from Labeled branchings too.
3456
3457 2006-05-16  Raja R Harinath  <rharinath@novell.com>
3458
3459         * statement.cs (Goto.Resolve): Merge jump origins here ...
3460         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
3461
3462         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
3463         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
3464         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
3465         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
3466         here, ...
3467         * statement.cs (Goto.Resolve): ... not here.
3468         (Goto.Emit): Remove CS1632 check.
3469
3470 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
3471
3472         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
3473         error message.
3474
3475 2006-05-11  Raja R Harinath  <rharinath@novell.com>
3476
3477         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
3478         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
3479         (FlowBranchingException.Label): Likewise.
3480
3481         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
3482         given value.
3483         (MyBitVector.Or): Use it to avoid losing information (Count).
3484         (FlowBranching.MergeOrigins): Likewise.
3485
3486         * flowanalysis.cs (UsageVector.IsDirty): Remove.
3487         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
3488         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
3489         (UsageVector.ToString): Simplify.
3490         (UsageVector.MergeSiblings): Move here from ...
3491         (FlowBranching.Merge): ... here.
3492         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
3493         not a MyBitVector.
3494
3495 2006-05-10  Raja R Harinath  <rharinath@novell.com>
3496
3497         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
3498         null bitvector is treated as all-true.
3499
3500         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
3501         (MyBitVector): Rationalize invariants.  'vector != null' implies
3502         that we have our own copy of the bitvector.  Otherwise,
3503         'InheritsFrom == null' implies all inherited bits are true.
3504
3505 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
3506
3507         * statement.cs (LocalInfo): Add IsConstant.
3508         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
3509         local variable for constants.
3510
3511 2006-05-09  Raja R Harinath  <rharinath@novell.com>
3512
3513         * flowanalysis.cs (MyBitVector.Empty): New.
3514         (MyBitVector): Don't allow InheritedFrom to be null.
3515         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
3516         (UsageVector, FlowBranching): Update to changes.
3517
3518         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
3519         recursion.  The 'Parent == null' condition isn't sufficient for
3520         anonymous methods.
3521         (FlowBranching.AddBreakOrigin): Likewise.
3522         (FlowBranching.AddContinueOrigin): Likewise.
3523         (FlowBranching.AddReturnOrigin): Likewise.
3524         (FlowBranching.StealFinallyClauses): Likewise.
3525         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
3526         (FlowBranching.CheckOutParameters): Likewise.
3527         (FlowBranchingToplevel): Terminate all the above recursions here.
3528         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
3529         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
3530
3531         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
3532         toplevel block.
3533         (FlowBranchingToplevel): New.  Empty for now.
3534         (FlowBranching.MergeTopBlock): Update.
3535         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
3536         branching for the anonymous delegate.
3537         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
3538
3539         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
3540         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
3541         information at the start of the merge.  Reorganize.
3542
3543 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3544
3545         * class.cs (MethodData.Define): Method cannot implement interface accessor.
3546
3547 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3548
3549         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
3550         to newly introduced ctor.
3551
3552         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
3553         message to one place.
3554         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
3555         global namespace.
3556
3557 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3558
3559         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
3560
3561         * ecore.cs (Expression.ResolveAsConstant): Updated.
3562
3563         * statement.cs (ResolveMeta): Updated.
3564
3565 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3566
3567         * cs-parser.jay: __arglist cannot be used in initializer.
3568
3569 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3570
3571         A fix for #77879
3572         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
3573         private types.
3574
3575 2006-05-05  Raja R Harinath  <rharinath@novell.com>
3576
3577         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
3578         (LabeledStatement): Add 'name' parameter.
3579         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
3580         (Block.AddLabel): Update to changes.
3581         * cs-parser.jay (labeled_statement): Likewise.
3582
3583         * flowanalysis.cs (BranchingType.Labeled): New.
3584         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
3585         (FlowBranchingLabeled): New.  Does nothing for now, but will
3586         eventually handle 'goto' flows.
3587         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
3588         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
3589         that's terminated ...
3590         (Block.Resolve): ... here.
3591
3592         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
3593         (UsageVector.MergeFinallyOrigins): Likewise.
3594         (FlowBranching.InTryOrCatch): Likewise.
3595         (FlowBranching.AddFinallyVector): Likewise.
3596         (FlowBranchingException): Update to changes.
3597
3598         Fix #78290
3599         * statement.cs (Return.Resolve): Move error checking to ...
3600         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
3601         (FlowBranchingException): Handle return origins like break and
3602         continue origins.
3603         (FlowBranching.UsageVector.CheckOutParameters): Remove.
3604
3605 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3606
3607         A fix for #76122
3608         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
3609         filter.
3610
3611 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3612
3613         A fix for #77543
3614         * class.cs (MethodData.Define): Do public accessor check only when method
3615         implements an interface.
3616
3617 2006-05-04  Raja R Harinath  <rharinath@novell.com>
3618
3619         Remove special handling of 'break'
3620         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
3621         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
3622         (UsageVector.Break): Remove.
3623         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
3624         reachability.
3625         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
3626
3627         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
3628         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
3629
3630 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3631
3632         A fix for #75726
3633         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
3634         be the interface member.
3635
3636 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3637
3638         A fix for #60069
3639         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
3640         for emitting small (int) values.
3641
3642 2006-05-03  Raja R Harinath  <rharinath@novell.com>
3643
3644         Fix #59427
3645         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
3646         control-flow passes through the 'finally' after merging-in all the
3647         control-flows from 'try' and the 'catch' clauses.
3648
3649         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
3650         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
3651         always true at the only non-recursive entry point.
3652         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
3653         FlowBranchingBreakable.
3654         (FlowBranchingLoop): Remove.
3655         * statement.cs (Return.DoResolve): Update to changes.
3656
3657         Fix #76471, #76665
3658         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
3659         (FlowBranching.CreateBranching): Handle it: create a
3660         FlowBranchingContinuable.
3661         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
3662         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
3663         except that it handles the 'continue' command.
3664         (FlowBranching.UsageVector.MergeOrigins): Rename from
3665         MergeBreakOrigins.
3666         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
3667         except that it overrides AddContinueOrigin.
3668         (FlowBranchingException): Override AddContinueOrigin, similar to
3669         AddBreakOrigin.
3670         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
3671         Create a new branching around the embedded statement.
3672         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
3673         control flow after the embedded statement.
3674         (Continue.Resolve): Move all error checking to AddContinueOrigin.
3675
3676         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3677         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3678         FlowBranchingBreakable.
3679         (FlowBranchingSwitch): Remove.
3680
3681         Fix test-503.cs
3682         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
3683         error reporting to ...
3684         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3685         Rename from 'AddBreakVector'.  Add new location argument.  Return
3686         a bool indicating whether the 'break' crosses an unwind-protect.
3687         (FlowBranchingException.AddBreakOrigin): Add.
3688         (FlowBranchingException.Merge): Propagate 'break's to surrounding
3689         flowbranching after updating with the effects of the 'finally'
3690         clause.
3691         (FlowBranchingBreakable): New common base class for
3692         FlowBranchingLoop and FlowBranchingSwitch.
3693
3694         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3695         embedded statement.
3696         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3697
3698 2006-05-02  Raja R Harinath  <rharinath@novell.com>
3699
3700         * statement.cs (Do.Resolve): If the loop is infinite, set the
3701         barrier.
3702         (While.Resolve, For.Resolve): Set a barrier after the embedded
3703         statement.  There's no direct control flow that goes from the end
3704         of the embedded statement to the end of the loop.
3705         * flowanalysis.cs (FlowBranching.Infinite): Remove.
3706         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
3707         above ensure that the reachability is correctly computed.
3708
3709         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3710         (UsageVector.MergeBreakOrigins): If the current path is
3711         unreachable, treat it as if all parameters/locals are initialized.
3712         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
3713         infinite loops before merging-in break origins.
3714
3715         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3716         (Reachability.Reachable): Split part into ...
3717         (Reachability.Unreachable): ... this.  Simplify.
3718         (Reachability.IsUnreachable): Use 'Unreachable' instead.
3719
3720         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3721         (Reachability.SetThrowsSometimes): Likewise.
3722         (FlowBranchingBlock.MergeTopBlock): Don't compare against
3723         TriState.Always, use corresponding property.
3724         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3725         (Block.Resolve): Likewise.  Remove some redundant checks.
3726
3727 2006-05-02  Raja R Harinath  <harinath@gmail.com>
3728
3729         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3730         (Reachability.Meet): Don't bother checking AlwaysThrows --
3731         barrier is always set.
3732         (FlowBranchingBlock.Merge): Likewise.
3733
3734 2006-05-01  Raja R Harinath  <harinath@gmail.com>
3735
3736         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3737         checks for unreachable.
3738
3739 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
3740
3741         A fix for #77980
3742         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3743
3744         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3745         whether field is really assigned.
3746
3747 2006-04-30  Raja R Harinath  <harinath@gmail.com>
3748
3749         * flowanalysis.cs (Reachability): Make 4-argument constructor
3750         private.
3751         (Reachability.Meet): Rename from 'And'.  Remove static variant.
3752         (Reachability.Always): Rename from the highly misleading
3753         'Reachability.Never'.
3754         (FlowBranching.Merge): Update to changes.  Mark an impossible
3755         situation with a 'throw'.
3756         (*): Update to changes.
3757
3758 2006-04-29  Raja R Harinath  <harinath@gmail.com>
3759
3760         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3761         Remove 'Undefined'.
3762         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3763         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3764         (*): Update to changes.
3765         * statement.cs: Update to changes.
3766
3767 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
3768
3769         A fix for #78049
3770         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3771
3772 2006-04-28  Raja R Harinath  <harinath@gmail.com>
3773
3774         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3775         dummy UsageVector.
3776
3777         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3778         argument to two arguments: an usage-vector and a bool.  Move call
3779         to FlowBranching.Merge () ...
3780         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3781
3782         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3783         handling of loop and switch reachability to ...
3784         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3785
3786 2006-04-27  Raja R Harinath  <harinath@gmail.com>
3787
3788         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3789         handling to FlowBranchingLoop.InLoop.
3790         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3791
3792 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
3793
3794         A fix for #78115
3795         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3796         anonymous method is allowed from AnonymousContainer here.
3797
3798         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3799
3800 2006-04-24  Raja R Harinath  <rharinath@novell.com>
3801
3802         Fix #78156
3803         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3804
3805 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
3806
3807         A fix for #49011.
3808         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3809         (DoubleConstant.Reduce): Ditto.
3810
3811 2006-04-23  Raja R Harinath  <rharinath@novell.com>
3812
3813         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3814         Remove 'lvalue_right_side' argument.  Move parts to ...
3815         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3816         (LocalVariable.DoResolveLValue): ... these.
3817
3818 2006-04-21  Raja R Harinath  <rharinath@novell.com>
3819
3820         Fix cs1655.cs
3821         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3822         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3823         (LocalVariableReference.DoResolveBase): Use it to implement new
3824         CS1655 check.
3825         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3826         (Argument.Resolve): Simplify.  Move CS1510 check ...
3827         * ecore.cs (Expression.ResolveLValue): ... here.
3828         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3829         (PropertyExpr.DoResolveLValue): Likewise.
3830         (FieldExpr.Report_AssignToReadonly): Likewise.
3831         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
3832         LValueMemberAccess or LValueMemberOutAccess on instance depending
3833         on it.
3834         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3835         DoResolve as appropriate.
3836
3837 2006-04-20  Raja R Harinath  <rharinath@novell.com>
3838
3839         Fix #75800
3840         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3841         implicit conversions on 'out' and 'ref' arguments.
3842
3843         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3844         improve clarity.  Remove dead code.
3845
3846         Fix #66031
3847         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3848         (Catch.Resolve): Resolve VarBlock if it exists.
3849
3850 2006-04-19  Miguel de Icaza  <miguel@novell.com>
3851
3852         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3853         twice, this was some residual code, the enumerator was emitted
3854         properly in the two branche of if later.
3855
3856 2006-04-19  Raja R Harinath  <rharinath@novell.com>
3857
3858         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
3859         cast is never an lvalue.
3860         (Cast.DoResolve, Cast.ResolveRest): Combine.
3861         (Argument.Emit): Simplify slightly.  Move 'Expr is
3862         IMemoryLocation' check ...
3863         (Argument.Resolve): ... here.
3864         (Argument.Error_LValueRequired): Remove.  Inline into only user.
3865
3866         Simplifications.  Fix cs0191-2.cs
3867         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3868         CS1649 and CS1651 to ...
3869         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
3870         the actual selection of the error code and message to a lookup
3871         table.  Add a dummy return value to simplify callsites.
3872         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3873         readonly fields of other instances of the same type.  Move CS0197
3874         warning from ...
3875         * expression.cs (Argument.Resolve): ... here.  Simplify code.
3876         Ensure that ec.InRefOutArgumentResolving is only set during LValue
3877         resolution of an out or ref argument.  The code simplification
3878         above uses this invariant.
3879
3880 2006-04-18  Raja R Harinath  <rharinath@novell.com>
3881
3882         Possibly fix #77752.  Fix cs1690-[4-7].cs.
3883         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3884         CheckMarshallByRefAccess.  Drop parameter.
3885         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
3886         warning.
3887         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3888         InstanceExpression.
3889         * report.cs (AllWarnings): Add CS1690.
3890         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3891         for ref access too.
3892         (LocalVariableReference.DoResolveBase): Update.
3893
3894 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3895
3896         * class.cs (MethodOrOperator): Moved common parts from method class.
3897         detect obsolete attributes.
3898         (Method.Define): Simplified as it reuses code from base.
3899         (Constructor.ValidAttributeTargets): Fixed issue found during
3900         refactoring.
3901         (Destructor.ValidAttributeTargets): Fixed issue found during
3902         refactoring.
3903         (Operator): Finished refactoring set off by #78020. Operator class is now
3904         ordinary method class.
3905
3906         * anonymous.cs: Updated.
3907
3908         * decl.cs (DeclSpace): Add IsGeneric
3909
3910 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3911
3912         * class.cs (Constructor.Emit): Don't emit the attributes twice.
3913
3914 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3915
3916         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3917         detect obsolete attributes.
3918         (Method.CreateEmitContext): Moved to MethodOrOperator.
3919
3920 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3921
3922         A fix for #78048.
3923         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3924         customized exception to make crash detection easier.
3925         (MethodOrOperator): Started to work on new base class for methods and
3926         operators.
3927         (Method): Derives from MethodOrOperator.
3928         (Constructor.Emit): Emits its own attributes.
3929         (AbstractPropertyEventMethod.Emit): Ditto.
3930         (Operator): Derives from MethodOrOperator, will refactor fully in extra
3931         patch.
3932         (Operator.Emit): It's temporary more tricky than should be.
3933         
3934         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3935
3936         * report.cs (InternalErrorException): Add ctor with inner exception.
3937
3938 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
3939
3940         A fix for #76744.
3941         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3942         only not visible.
3943
3944 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
3945
3946         A fix for #77916.
3947         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3948         array.
3949
3950 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3951
3952         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3953         attribute is present and Guid not.
3954         (Interface.ApplyAttributeBuilder): Ditto.
3955
3956         * attribute.cs: Add error message.
3957
3958 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3959
3960         A fix for #78020.
3961
3962         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3963         sources (it's composite) so hold them in extra array as they are used in
3964         Emit phase only. It worked in the previous versions by mistake.
3965         (Attribute.Emit): Emit attribute for more owners when exist.
3966
3967         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3968         it has now different behaviour.
3969
3970 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
3971
3972         * constant.cs (Constant.IsDefaultInitializer): New method.
3973
3974         * class.cs: Updated.
3975
3976         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3977         re-initialize default values. It saves KBs almost for every assembly.
3978         Thanks Zoltan for the idea.
3979         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3980         (ArrayCreation.DoResolve): Resolve only once.
3981         (ArrayCreation.Emit): Emit static initializer only when it is faster.
3982         (ArrayCreation.GetAttributableValue): Cope with optimized values.
3983
3984 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
3985
3986         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3987         From #77961.
3988
3989 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3990
3991         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3992         in an embedded statement too.
3993
3994 2006-04-01  Raja R Harinath  <rharinath@novell.com>
3995
3996         Fix #77958
3997         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3998
3999 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
4000
4001         A fix for #77966.
4002
4003         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
4004         was not specified.
4005
4006         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
4007
4008 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
4009
4010         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
4011         phase.
4012
4013         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
4014         LocalTemporary change.
4015
4016         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
4017         TypeContainer.
4018         (ClassOrStruct.DefineFieldInitializers): Implemented static field
4019         initializers optimization.
4020         (ClassOrStruct.TypeAttr): Moved from modifiers.
4021         (Constructor.CheckBase): Don't crash when static ctor has parameters.
4022         (FieldBase.ResolveInitializer): Resolves initializer.
4023         (FieldBase.HasDefaultInitializer): New property.
4024
4025         * cs-parser.jay: Removed message.
4026
4027         * expression.cs (CompilerGeneratedThis): New specialization.
4028
4029         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
4030
4031 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
4032
4033         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
4034
4035 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
4036
4037         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
4038         be now EnumConstants only.
4039
4040 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
4041
4042         * attribute.cs, driver.cs: Reset more caches.
4043
4044 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4045
4046         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
4047
4048 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4049
4050         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
4051         for easier reuse. Updated all overrides.
4052         (IntegralConstant): New base class for all integral constants.
4053         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
4054         of the constant range, report custom error.
4055         (UIntConstant.Reduce): Fixed uint conversion.
4056
4057         * ecore.cs, literal.cs: Reduce updates.
4058
4059 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4060
4061         A fix for #75813.
4062
4063         * class.cs (Constructor.Define): Removed extra if for default ctors.
4064         A patch from Atsushi Enomoto.
4065
4066 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4067
4068         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
4069         GetAttributableValue.
4070
4071         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
4072         when required.
4073
4074         * convert.cs (ImplicitConversionRequired): Error message moved to
4075         DoubleLiteral.
4076
4077         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
4078         automatic implicit conversion of an output value.
4079         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
4080
4081         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
4082         conversion.
4083         (TypeOf.GetAttributableValue): Add extra handling for object type.
4084
4085         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
4086         special error message.
4087
4088 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
4089
4090         * class.cs (Constructor.Emit): Don't crash when struct ctor is
4091         InternalCall.
4092         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
4093         compatible with MS runtime.
4094
4095 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
4096
4097         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
4098         attribute arguments here.
4099
4100         * class.cs (Indexer.Define): The check was moved to attribute class.
4101
4102 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
4103
4104         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
4105         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
4106         easier.
4107
4108 2006-03-22  Raja R Harinath  <rharinath@novell.com>
4109
4110         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
4111         mcs to keep code differences small.
4112         * attribute.cs (Attribute.GetParameterDefaultValue): New.
4113         * typemanager.cs (parameter_default_value_attribute_type): New.
4114         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
4115         CS1908 check.
4116
4117 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
4118
4119         * expression.cs (StringConcat.Append): Reverted back to no warning state.
4120
4121 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
4122
4123         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
4124
4125         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
4126         the blocks too.
4127
4128 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
4129
4130         * doc-bootstrap.cs : fix build.
4131
4132 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
4133
4134         * expression.cs (StringConcat.Append): Issue a warning when empty string
4135         is going to append.
4136
4137 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * assign.cs (CompoundAssign.ResolveSource): Removed.
4140
4141         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
4142         clean up.
4143
4144         * class.cs (TypeContainer.FindMethods): Removed.
4145         (TypeContainer.CheckMemberUsage): Made static.
4146
4147         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
4148
4149         * constant.cs (CheckRange): Removed unused type argument.
4150         (CheckUnsigned): Removed unused type argument.
4151
4152         * cs-parser.jay: Updated after MemberAccess clean up.
4153         Uses Length for empty string test.
4154
4155         * cs-tokenizer.cs: Uses Length for empty string test.
4156         (IsCastToken): Made static.
4157         (is_hex): Made static.
4158         (real_type_suffix): Made static.
4159
4160         * decl.cs (SetupCache): Made static.
4161         (OnGenerateDocComment): Removed unused ds argument.
4162
4163         * delegate.cs (VerifyDelegate): Removed unused argument.
4164
4165         * doc.cs: Uses Length for empty string test.
4166
4167         * driver.cs: Uses Length for empty string test.
4168
4169         * enum.cs (IsValidEnumType): Made static
4170
4171         * expression.cs (EnumLiftUp): Removed unused argument.
4172         (ResolveMethodGroup): Ditto.
4173         (BetterConversion): Ditto.
4174         (GetVarargsTypes): Ditto.
4175         (UpdateIndices): Ditto.
4176         (ValidateInitializers): Ditto.
4177         (MemberAccess.ctor): Ditto.
4178         (GetIndexersForType): Ditto.
4179
4180         * flowanalysis.cs: (MergeFinally): Removed unused argument.
4181
4182         * iterators.cs: Updated after MemberAccess clean up.
4183
4184         * location.cs: Uses Length for empty string test.
4185
4186         * namespace.cs: Uses Length for empty string test.
4187
4188          * report.cs (CheckWarningCode): Made static.
4189
4190         * statement.cs (LabeledStatement): Removed unused argument.
4191
4192         * typemanager.cs (FilterNone): Removed.
4193
4194 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4195
4196         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
4197         obsolete.
4198
4199         * class.cs: Updated.
4200
4201 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4202
4203         * cs-parser.jay.cs: __arglist is not allowed for delegates.
4204
4205 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4206
4207         A fix for #77822.
4208
4209         * expression.cs (VerifyArgumentsCompat): Reverted to double error
4210         reporting, it's more tricky than I thought.
4211
4212 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4213
4214         A fix for #77816.
4215
4216         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
4217         host container.
4218         (AnonymousMethod.ImplicitStandardConversionExists): New method.
4219         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
4220         Add more error reporting; Fixed issue with params.
4221
4222         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
4223
4224         * cs-parser.jay: AnonymousMethod requires host container.
4225
4226         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
4227
4228 2006-03-18  Raja R Harinath  <harinath@gmail.com>
4229
4230         * class.cs: Change 'TypeContainer ds' constructor argument to
4231         'DeclSpace parent'.  Some classes were missed below due to
4232         different naming convention.
4233
4234         * class.cs (MemberCore.Parent): Delete.  This makes the
4235         ParentContainer changes below enforceable by the compiler.
4236
4237         Treat pointers to enclosing declaration space as 'DeclSpace', not
4238         'TypeContainer'.
4239         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
4240         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
4241
4242         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
4243         of TypeContainer.
4244         (Block.AddThisVariable): Likewise.
4245         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
4246         (AbstractPropertyEventMethod.Emit): Likewise.
4247         (AbstractPropertyEventMethod.EmitMethod): Likewise.
4248         (GetMethod.Define, SetMethod.Define): Likewise.
4249         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
4250         (DelegateMethod.EmitMethod): Likewise.
4251
4252         Fix regression test-partial-13.cs.
4253         Rationalize use of PartialContainer.  Ensure that the partial
4254         class semantics can be tied to type-correctness, i.e., any
4255         violation will cause a compile error.
4256         * class.cs, const.cs: Access all fields that belong to class
4257         TypeContainer via ParentContainer.  Arguments of EmitContexts and
4258         Resolve()-like functions still use 'Parent'.
4259
4260         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
4261         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
4262         (PropertyMethod.CheckModifiers): Remove unused argument.
4263         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
4264         DeclSpace.
4265
4266 2006-03-17  Raja R Harinath  <harinath@gmail.com>
4267
4268         Make semantics of PartialContainer simpler.
4269         * decl.cs (DeclSpace.IsPartial): Remove.
4270         * class.cs (TypeContainer.IsPartial): Likewise.
4271         (TypeContainer..ctor): Set PartialContainer to point to self.
4272         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
4273         (TypeContainer.FindNestedType): Likewise.
4274         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
4275
4276 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
4277
4278         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
4279
4280 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
4281
4282         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
4283         classes.
4284
4285 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
4286
4287         * class.cs (Operator.Define): An error for base conversion was not
4288         reported correctly.
4289
4290 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
4291
4292         * iterator.cs : yield break is allowed in try statement which has
4293           catch clauses. Fixed bug #77767.
4294
4295 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
4296
4297         A fix for #77593, #77574.
4298
4299         * class.cs (MethodCore.CheckBase): Another if for operator.
4300
4301 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
4302
4303         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
4304         were not resolved
4305
4306         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
4307         (DelegateCreation.ImplicitStandardConversionExists): New method for just
4308         conversion test.
4309         
4310         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
4311         not needed.
4312
4313         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
4314         Updated after another emitcontext usage was clean up. It should help us to
4315         synchronize with gmcs easier.
4316
4317 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
4318
4319         A fix for #77353.
4320
4321         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
4322         (Event.Define): ditto
4323         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
4324
4325         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
4326         Removed redundant code and set NewSlot for Invoke method too.
4327
4328         * parameter.cs (Parameters.ctor): Add custom, type ctor.
4329         (Parameters.MergeGenerated): New method. Use this method when you merge
4330         compiler generated argument with user arguments.
4331
4332 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
4333
4334         * attribute.cs (ResolveAsTypeTerminal): Removed.
4335
4336         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
4337         specialization for predefined types; 30% speed up.
4338         Finally placed obsolete check to right place.
4339         (Expression.ResolveType): Removed.
4340
4341         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
4342         Updated after ResolveType was removed.
4343
4344         * expression.cs (Cast.ctor): Check void cast.
4345         (Binary.ResolveAsTypeTerminal): Is never type.
4346         (Conditional.ResolveAsTypeTerminal): Is never type.
4347
4348         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
4349
4350 2006-03-01  Raja R Harinath  <rharinath@novell.com>
4351
4352         Fix #77679.
4353         * expression.cs (ParameterReference.DoResolveBase): Change return
4354         type to bool.
4355         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
4356         Update.
4357
4358         Fix #77628.
4359         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
4360
4361         Fix #77642.
4362         * typemanager.cs (GetFullNameSignature): Don't nullref on
4363         protected accessors.
4364
4365 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
4366
4367         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
4368         these two separated members to simplify the code.
4369         (Attribute.Resolve): Refactored to use new fields and methods.
4370         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
4371         implemented obsolete attribute checking.
4372         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
4373         implemented obsolete checking again. It look line never ending quest ;-)
4374         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
4375
4376         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
4377
4378         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
4379
4380         *class.cs (Property.Define): Add RegisterProperty call.
4381
4382         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
4383         argument groups (only 2).
4384
4385         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
4386         encoding expression to arguments.
4387         (Expression.ExprClassToResolveFlags): Just turned to property.
4388
4389         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
4390         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
4391         optimized as well as implemented support for zero-length attributes.
4392
4393         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
4394         Add caching of PropertyInfo's.
4395
4396 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4397
4398         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
4399         error multiple times.
4400
4401 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4402
4403         New partial class implementation.
4404         A fix for #77027, #77029, #77403
4405
4406         * attribute.cs (Attributable): Made attributes protected.
4407
4408         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
4409         the replacements of ClassPart and PartialContainer.
4410         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
4411         (TypeContainer.AddInterface): Ditto.
4412         (TypeContainer.AddPartial): The main method for partial classes. It checks
4413         for errors and merges ModFlags and attributes. At the end class is added to
4414         partial_parts list.
4415         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
4416         required here.
4417         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
4418         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
4419         from the rest of partial classes.
4420         (TypeContainer.GetClassBases): Simplified.
4421         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
4422         DefineType.
4423         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
4424         (TypeContainer.HasExplicitLayout): Uses Flags now.
4425         (PartialContainer): Removed.
4426         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
4427         (StaticClass): Was merged with Class.
4428         (Class.GetClassBases): class and static class bases are verified here.
4429         (Class.TypeAttr): Added static attributes when class is static.
4430         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
4431         (MemberBase): In some cases we need to call parent container for partial
4432         class. It should be eliminated but it's not easy now.
4433
4434         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
4435
4436         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
4437         partial classed to accumulate class comments.
4438         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
4439
4440         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
4441
4442         * driver.cs (MainDriver): Tree.GetDecl was removed.
4443
4444         * modifiers.cs (Modifiers): Add partial modifier.
4445
4446         * tree.cs (Tree.decl): Removed.
4447         (RootTypes): Started to use this class more often for root types
4448         specializations.
4449
4450 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4451
4452         A fix for #77615
4453
4454         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
4455         external interface does not have an attribute.
4456
4457 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4458
4459         Another prerequisites for new partial classs implementation.
4460         
4461         * attribute.cs (Attribute.Equal): Implemented.
4462         (Attribute.Emit): Changed as attributes can be applied more than twice.
4463         (Attributes.Emit): Check for duplicate attributes here.
4464
4465         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
4466         as a parameter, clean-up.
4467
4468 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4469
4470         A fix for #77485
4471
4472         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
4473         contains obsolete attribute check which can in some cases look for base
4474         type of current class which is not initialized yet.
4475         (TypeContainer.BaseType): Replacement of ptype.
4476
4477         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
4478
4479 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4480
4481         First of prerequisites for new partial classs implemention.
4482         
4483         * attribute.cs (Attributable): Extended by ResolveContext;
4484         Attributes finally have correct context for resolving in all cases.
4485         (AttachTo): Attribute owner is assigned here.
4486
4487         * codegen.cs (IResolveContext): Introduce new interface to hold
4488         all information needed in resolving phase.
4489         (EmitContext): Implements IResolveContext; more clean-up needed here.
4490         
4491         * decl.cs (MemberCore): Implemented IResolveContext.
4492
4493         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
4494         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
4495         parameter.cs, statement.cs, tree.cs, typemanager.cs:
4496         Refactored to use new IResolveContext instead of EmitContext; cleanup
4497
4498 2006-02-06  Miguel de Icaza  <miguel@novell.com>
4499
4500         * codegen.cs (EmitScopeInitFromBlock): check here the
4501         capture_context, there is no need to make two calls to the
4502         EmitContext. 
4503
4504         * anonymous.cs: Add some debugging messages that might help me
4505         track other instances of this problem in the future (the
4506         regression of test 467).
4507
4508         * cs-parser.jay: track the variable block, as we need to initalize
4509         any captured variables declared in this block for the "catch"
4510         portion of the "Try" statement.
4511
4512         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
4513         scope initialization for captured variables. 
4514
4515         Also, move the emit for the variables after the block location has
4516         been marked.
4517
4518 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
4519
4520         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
4521
4522 2006-02-02  Miguel de Icaza  <miguel@novell.com>
4523
4524         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
4525         commit yesterday, the initialization for the roots is necessary.
4526         What is not necessary is the scope activation.
4527
4528 2006-02-02  Raja R Harinath  <rharinath@novell.com>
4529
4530         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
4531         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
4532         CS0206 checks.
4533         (Argument.Resolve): Remove CS0206 checks.
4534
4535 2006-02-01  Miguel de Icaza  <miguel@novell.com>
4536
4537         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
4538         scopes for all the roots, the scopes will now be emitted when the
4539         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
4540
4541         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
4542         code.  This reduces a lot of existing cruft.
4543         
4544         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
4545         that the ScopeInfo is generated as we enter the scope, not at the
4546         time of use, which is what we used to do before.
4547
4548         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
4549         every time a Block is about to be emitted if we have a
4550         CaptureContext. 
4551
4552 2006-02-01  Raja R Harinath  <rharinath@novell.com>
4553
4554         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4555         (Reset): Update.
4556         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
4557
4558         * typemanager.cs (cons_param_array_attribute): Make private.
4559         (Reset): Set it to null.
4560         (InitCoreHelpers): Don't initialize it.
4561         (ConsParamArrayAttribute): New.  Initialize it as needed.
4562         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
4563
4564 2006-01-31  Miguel de Icaza  <miguel@novell.com>
4565
4566         * expression.cs: There might be errors reported during the
4567         selection of applicable methods.  If there are errors, do not
4568         continue execution as it will lead the compiler to crash.
4569
4570 2006-01-30  Miguel de Icaza  <miguel@novell.com>
4571
4572         * expression.cs: Member access is not allowed on anonymous
4573         methods.  Fixes #77402.
4574
4575 2006-01-30  Raja R Harinath  <rharinath@novell.com>
4576
4577         Fix #77401
4578         * cs-parser.jay (VariableDeclaration): Don't set
4579         current_array_type to null.
4580         (field_declaration, event_declaration, declaration_statement):
4581         Set it to null here.
4582
4583 2006-01-28  Raja R Harinath  <harinath@gmail.com>
4584
4585         * typemanager.cs (GenericParameterPosition): New.
4586         * doc.cs: Use it.
4587
4588 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
4589
4590         * doc.cs : To process "include" elements, first we should create
4591           another list than XmlNodeList, because it could result in node
4592           removal, which could result in that the XmlNodeList gives up
4593           yielding next node.
4594
4595           (Also made code identical to gmcs again.)
4596
4597 2006-01-25  Miguel de Icaza  <miguel@novell.com>
4598
4599         * ecore.cs: Introduce an error report that we were not catching
4600         before, if not silent, we must report the error.  Gonzalo ran into
4601         it.
4602
4603 2006-01-23  Miguel de Icaza  <miguel@novell.com>
4604
4605         A fix for bug: #76957
4606         
4607         * iterators.cs (MoveNextMethod.CreateMethodHost): call
4608         ComputeMethodHost before creating the method, this is a new
4609         requirement. 
4610
4611         * anonymous.cs (AnonymousContainer): Now we track all the scopes
4612         that this method references (RegisterScope).  The actual scope
4613         where the method is hosted is computed with the ComputeMethodHost
4614         before we create the method.
4615
4616         Moved the Deepest routine here.
4617
4618         (AnonymousContainer.ComputeMethodHost): New routine used to
4619         compute the proper ScopeInfo that will host the anonymous method.
4620
4621         (ScopeInfo): Deal with multiple roots.  The problem was that we
4622         did not have a unique root where all ScopeInfos could be hanged
4623         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
4624         of roots.  
4625
4626         Remove AdjustMethodScope which is now computed at the end.  Remove
4627         LinkScope which did a partial link, instead link all ScopeInfos
4628         before code generation from the new "LinkScopes" routine. 
4629
4630         Simplify all the Add* routines as they no longer need to maintain
4631         the tree, they just need to record that they are using variables
4632         from a ScopeInfo.
4633
4634         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
4635         routines to produce the forest of ScopeInfo trees.
4636
4637         * class.cs (TypeContainer.AppendMethod): This is just like
4638         AddMethod, but ensures that an interface implementation method
4639         (IEnumerable.XXX) is not inserted at the beginning of the queue of
4640         methods, but at the end.
4641
4642         We use this functionality to ensure that the generated MoveNext
4643         method in the iterator class is resolved/emitted before the
4644         enumerator methods created.   
4645
4646         This is required because the MoveNext method computes the right
4647         ScopeInfo for the method.  And the other methods will eventually
4648         need to resolve and fetch information computed from the anonymous
4649         method. 
4650
4651 2006-01-21  Raja R Harinath  <harinath@gmail.com>
4652             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
4653
4654         Fix rest of #76995.
4655         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
4656         the 'aliases' hash.
4657         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
4658         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
4659
4660 2006-01-18  Raja R Harinath  <rharinath@novell.com>
4661
4662         Fix #76656, cs0231-2.cs.
4663         * cs-parser.jay (formal_parameter_list): Make error case catch
4664         more issues.
4665         (parenthesized_expression_0): Add CS1026 check.
4666         (invocation_expression): Remove unused { $$ = lexer.Location }.
4667
4668 2006-01-17  Raja R Harinath  <rharinath@novell.com>
4669
4670         Fix #76824.
4671         * cs-parser.jay (statement_expression): Don't list out the
4672         individual statement-expressions.  Convert syntax error into
4673         CS0201 check.
4674
4675 2006-01-16  Raja R Harinath  <rharinath@novell.com>
4676
4677         Fix #76874.
4678         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4679         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
4680         CheckIntermediateModification.
4681         (FieldExpr.DoResolve): Add new two-argument version that
4682         allows us to resolve the InstanceExpression as an lvalue.
4683         The one-argument variant is now just a wrapper.
4684         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4685         Resolve the lhs as an lvalue if the it has a value type.
4686         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4687         from Assign.DoResolve.
4688         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4689         resolved as an lvalue.
4690         (PropertyExpr.DoResolve): Update.
4691         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4692         has a value type.  Move CS1612 check here from
4693         CheckIntermediateModification.
4694         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4695         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
4696         'right_side' of a ResolveLValue on an 'out' argument.
4697         (EmptyExpression.LValueMemberAccess): New.  Used as the
4698         'right_side' of a propagated ResolveLValue on a value type.
4699         (LocalVariableReference.DoResolveBase): Recognize
4700         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4701         Add CS1654 check.
4702         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4703         EmptyExpression.Null.
4704
4705 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
4706
4707         * typemanager.cs : added IsGenericParameter(). In mcs it always
4708           return false.
4709         * doc.cs : for generic parameters, use GenericParameterPosition,
4710           not FullName.
4711
4712 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
4713
4714         * expression.cs: Fix Console.WriteLine ((this = x).foo);
4715
4716 2006-01-12  Miguel de Icaza  <miguel@novell.com>
4717
4718         This fixes the problem where we used ldfld instead of ldflda to
4719         load the "THIS" pointer on captured parameters, when THIS is a
4720         value type.  See bug #77205.
4721         
4722         * iterators.cs (CapturedThisReference.Emit): Pass false to
4723         EmitThis (we do not need the address).
4724
4725         * codegen.cs (EmitThis): it needs to know whether we need the
4726         address of `this' or not.  This is used by value types.  
4727
4728         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4729         every other call passes false.
4730
4731 2006-01-12  Raja R Harinath  <rharinath@novell.com>
4732
4733         Fix #77221.
4734         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4735         GetOverride.
4736         * expression.cs (Invocation.OverloadResolve): Update.
4737         (Invocation.DoResolve): Avoid double resolution of invocation.
4738
4739 2006-01-11  Raja R Harinath  <rharinath@novell.com>
4740
4741         Fix #77180.
4742         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4743         unary negation of floating point types as 0-expr; negation cannot
4744         overflow in floating point types.
4745
4746         Fix #77204.
4747         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4748         on operands of 'void' type.
4749
4750         Fix #77200.
4751         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4752         and ExclusiveOr for boolean constants too.
4753
4754 2006-01-09  Raja R Harinath  <rharinath@novell.com>
4755
4756         Fix #75636.
4757         * expression.cs (Invocation.OverloadResolve): Replace reflected
4758         override methods with their base virtual methods, rather than
4759         skipping over them.
4760         * typemanager.cs (TypeManager.GetOverride): New.
4761
4762 2006-01-05  Jb Evain  <jbevain@gmail.com>
4763
4764         * class.cs (Property.Define, Indexer.Define): do not tag the
4765         properties as SpecialName | RTSpecialName.
4766
4767 2006-01-04  Miguel de Icaza  <miguel@novell.com>
4768
4769         * class.cs (MethodCore.IsDuplicateImplementation): This method was
4770         doing a low-level comparission of parameter types.  It was lacking
4771         a check for __argslist. 
4772
4773 2005-12-30  Miguel de Icaza  <miguel@novell.com>
4774
4775         * expression.cs (ParameterReference.DoResolveBase): Allow
4776         reference parameters if they are local to this block. 
4777
4778         This allows the ref and out parameters of a delegate to be used in
4779         an anonymous method, for example:
4780
4781         delegate void set (out int x);
4782
4783         set s = delegate (out int x){
4784                 x = 0;
4785         };
4786
4787         This is used by functionality introduced late in the C# language.
4788         
4789         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4790         method that take ref and out parameters. 
4791
4792         Fixes #77119 which was a late change in the spec.
4793
4794 2005-12-23  Miguel de Icaza  <miguel@novell.com>
4795
4796         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4797         parent if its the same scope.  Fixes #77060.
4798
4799 2005-12-21  Miguel de Icaza  <miguel@novell.com>
4800
4801         * driver.cs: Report the case of no source files and no -out:
4802         argument provided.
4803
4804 2005-12-20  Raja R Harinath  <rharinath@novell.com>
4805
4806         Fix #77035.
4807         * expression.cs (ComposedCast.GetSignatureForError): Define.
4808
4809 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4810
4811         Fix #76995
4812
4813         * namespace.cs (NamespaceEntry): Add extern_aliases as a
4814         ListDictionary, to contain the ExternAliasEntry entries (in
4815         addition to the NamespaceEntry.aliases hashtable). This field is
4816         shared between the original entry and its doppelganger (bodyless 
4817         copy of it).
4818         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4819         extern_aliases field.
4820         (NamespaceEntry.Lookup): Move the IsImplicit check after the
4821         lookup in extern_aliases.
4822
4823 2005-12-16  Raja R Harinath  <rharinath@novell.com>
4824
4825         Fix #77006.
4826         * class.cs (TypeContainer.Mark_HasEquals): New.
4827         (TypeContainer.Mark_HasGetHashCode): New.
4828         (ClassPart): Override them.
4829         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4830
4831         Fix #77008.
4832         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4833         'parent' argument to the base constructor.
4834
4835         Remove all mention of TypeContainer from decl.cs.
4836         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4837         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4838         (DeclSpace.DeclSpace): Likewise.
4839         (DeclSpace.DefineMembers): Remove unused argument.
4840         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
4841         debugging check -- we don't care if the debug code throws an
4842         InvalidCastException instead of an InternalErrorException.
4843         * class.cs (TypeContainer.DefineMembers): Update to changes.
4844         (TypeContainer.DoDefineMembers): Likewise.
4845         (TypeContainer.GetMethods): Likewise.
4846         (PropertyMember.Define): Likewise.
4847         (MemberBase.Parent): New property that forwards to
4848         MemberCore.Parent, but ensures that we get a TypeContainer.
4849         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4850         (RootContext.PopulateTypes): Likewise.  Remove special case code
4851         for !RootContext.StdLib: DefineMembers is idempotent.
4852
4853 2005-12-14  Miguel de Icaza  <miguel@novell.com>
4854
4855         * convert.cs (ExplicitConversionCore): Check the return value from
4856         ExplicitConversionCore which can return null on failure.  Fixes #76914
4857
4858 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
4859
4860         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4861
4862 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
4863
4864         * doc.cs : The search for referenced namespace was insufficient to
4865           get global one as it used to do. Fixed bug #76965.
4866
4867 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
4868
4869         * doc.cs : check name in cref in the last phase that whether it is
4870           namespace or not.
4871
4872 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4873
4874         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4875           Mono.C5.
4876
4877 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4878
4879         * doc.cs : so it turned out that we cannot skip override check for 
4880           interface members. Fixed bug #76954.
4881
4882 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4883
4884         * cs-tokenizer.cs : fixed bug #75984:
4885           - #warning and #error should not be handled when the source line
4886             is disabled.
4887           - #line is not checked strictly when the source line is disabled.
4888           - #define and #undef is on the other hand checked strictly at any
4889             state.
4890
4891 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
4892
4893         * cs-tokenizer.cs : missing Location (actually, filename) in one of
4894           CS1027 report.
4895
4896 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4897
4898         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4899
4900         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4901         event initializers.
4902         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4903         (FieldBase.Initializer): Initializer is now optional.
4904         (EventField.Define): Only event field can have initializer.
4905
4906         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4907
4908         * const.cs (Const): Reuse initializer.
4909
4910         * cs-parser.jay: Updated after FieldBase changes.
4911         Added current_array_type to simplify array initializers.
4912
4913         * ecore.cs (NullCast.IsDefaultValue): Implemented.
4914
4915         * expression.cs, iterators.cs: Updated.
4916
4917         * namespace.cs (NamespaceEntry): Made UsingFound private.
4918
4919 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4920
4921         * parameterCollection.cs: Obsolete, removed.
4922         * parser.cs: Obsolete, removed.
4923
4924 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4925
4926         Fix #76849.
4927         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4928
4929         * enum.cs (Enum.Define): Set obsolete context here.
4930
4931 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4932
4933         * doc.cs :
4934           - FindDocumentedMember() now expects 1) paramList as null
4935             when "we don't have to check the number of parameters" and
4936             2) Type.EmptyTypes when "there is no arguments".
4937           - Introduced FoundMember struct to hold the exact type which was
4938             used to find the documented member (the above change broke
4939             test-xml-044; it might be better just to use DeclaringType than
4940             what MS does, like this change does, but it depends on usage.)
4941
4942 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4943
4944         * doc.cs : documented member might be from DeclaringType for nested
4945           types. Fixed bug #76782.
4946
4947 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
4948
4949         * anonymous.cs: Have the param code handle leaving copies on the
4950         stack etc. Allows anonymous params to take part in the assignment
4951         code (++, +=, etc). Fixes bug #76550
4952
4953         * expression.cs: Handle the prepare_for_load/leave_copy by passing
4954         it down to the anon code.
4955
4956         * iterators.cs: Use dummy var here
4957
4958         * codegen.cs: Handle new vars
4959
4960 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4961
4962         Fix #76849.
4963         * class.cs (MethodData.Define): Set proper Obsolete context.
4964
4965         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4966         obsolete context.
4967         (FieldExpr.DoResolve): Ditto.
4968
4969 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4970
4971         Fix #76849.
4972         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4973         parent is not obsolete.
4974
4975 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
4976
4977         * doc.cs : (FindDocumentedMember) find parameterless members first
4978           and get CS0419 in the early stage. Fixed first case of bug #76727.
4979
4980 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
4981
4982         Fix #76859.
4983         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4984         no error was reported.
4985
4986         *expression.cs (Binary.DoResolve): left can be null.
4987
4988 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
4989
4990         Fix #76783.
4991         * class.cs (MethodData.Emit): Parameters should be labeled first.
4992
4993 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
4994
4995         Fix #76761.
4996         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4997
4998 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
4999
5000         * attribute.cs (AreParametersCompliant): Moved to Parameter.
5001
5002         * class.cs (MethodCore): Parameter clean up.
5003         (IMethodData): Added ParameterInfo.
5004         (MethodData): Parameter clean up.
5005         (Indexer.Define): Parameter clean up.
5006
5007         * anonymous.cs,
5008         * codegen.cs,
5009         * cs-parser.jay,
5010         * decl.cs,
5011         * doc.cs,
5012         * ecore.cs,
5013         * flowanalysis.cs,
5014         * iterators.cs,
5015         * pending.cs,
5016         * statement.cs,
5017         * typemanager.cs: Parameter clean up.
5018
5019         * delegate.cs (Define): Get rid of duplicated code.
5020
5021         * expression.cs (ParameterReference): Removed useless parameters
5022         and simplified.
5023         (Invocation): Ditto.
5024
5025         * parameter.cs (ParamsParameter): New class, params specialization.
5026         (ArglistParameter): Attemp to separate arglist.
5027         (Parameter): Refactored to be reusable and faster.
5028         (Parameter.Modifier): Made understandable.
5029         (Parameters): Changed to be used as a class for `this' assembly
5030         parameters. Refactored to use new specialized classes.
5031
5032         * support.cs (ParameterData): Added Types property.
5033         (InternalParameters): Deleted.
5034
5035 2005-08-20  Martin Baulig  <martin@ximian.com>
5036
5037         Merging this patch from GMCS to fix #75867.
5038
5039         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5040         scope if we don't already have it.
5041
5042 2005-11-17  Martin Baulig  <martin@ximian.com>
5043
5044         * anonymous.cs
5045         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
5046         inherit the scope from our parent.  Fixes #76653.
5047
5048 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
5049
5050         * doc.cs : the previous patch does not actually fix the bug.
5051           PropertyInfo override check is now implemented and really fixed it.
5052         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
5053
5054 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
5055
5056         * doc.cs : apply "override filter" also to properties.
5057           Fixed bug #76730.
5058
5059 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
5060
5061         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
5062           no need to check overrides. For classes, omit those results from 
5063           interfaces since they must exist in the class. Fixed bug #76726.
5064
5065 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5066
5067         * typemanager.cs : (GetFullNameSignature) differentiate indexers
5068           with different parameters. Fixed the second problem in #76685.
5069
5070 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5071
5072         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
5073           get expected 'protected' access in CheckValidFamilyAccess()).
5074           Fixed bug #76692.
5075
5076 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5077
5078         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
5079           Fixed bug #76705.  CS1569 was incorrectly commented out.
5080
5081 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
5082
5083         * doc.cs : use Invocation.IsOverride() to do real override check.
5084         * expression.cs : made Invocation.IsOverride() internal.
5085
5086 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
5087
5088         * doc.cs : use TypeManager.FindMembers() instead of (possible)
5089           TypeBuilder.FindMembers() and filter overriden base members out.
5090           Fixed bug #76990.
5091
5092 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5093
5094         * doc.cs : ref/out parameters are represented as '@' (instead of
5095           '&' in type FullName). Fixed bug #76630 (additionally crefs).
5096
5097 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5098
5099         * doc.cs : when there was no '.' in cref to methods in doc comment,
5100           then parameters were missing in the output. Fixed bug #76691.
5101
5102 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5103
5104         * driver.cs : don't output docs when there is an error.
5105           Fixed bug #76693.
5106
5107 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5108
5109         * doc.cs :
5110           Now it should detect indexers. Fixed primary concern in bug #76685.
5111           Fixed CS0419 message to not show the identical member signature in
5112           the message.
5113
5114 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5115
5116         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
5117           instead of Type.FindMembers() since it does not handle events.
5118           Fixed bug #71604.
5119
5120 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
5121
5122         * codegen.cs: Fixed typo (speficied -> specified).
5123
5124 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
5125
5126         Fix #76369.
5127         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
5128
5129 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
5130
5131         * attribute.cs: Changed error message.
5132
5133         * cs-tokenizer.cs: One more check.
5134
5135 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
5136
5137         * statement.cs (Block.Resolve): Ignore empty statement.
5138
5139 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
5140
5141         * report.cs: Made error/warning methods more strict to avoid
5142         their misuse.
5143
5144         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
5145         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
5146         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
5147         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
5148
5149 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
5150
5151         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
5152         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
5153
5154         * class.cs (TypeContainer.IsComImport): New property.
5155         (Constructor.Define): Create proper ctor for ComImport types.
5156
5157         * expression.cs (New.CheckComImport): Fixed.
5158
5159 2005-11-07  Miguel de Icaza  <miguel@novell.com>
5160
5161         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
5162         that a parameter has been captured does not mean that we do not
5163         have to do the rest of the processing.  This fixes the second part
5164         of #76592.  If there was another anonymous method capturing
5165         values in the past, the Scope would never be set for the second
5166         method that captured the same parameter.
5167
5168         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
5169         properly manipulate the stack.   Second part of fix for #76592.
5170
5171         * expression.cs (New): Add support for invoking "new" on
5172         interfaces that have been flagged with the ComImport attribute and
5173         the CoClass.  Fixes #76637 
5174
5175         * statement.cs (Try.DoEmit): When a variable is captured, do not
5176         try to emit the vi.LocalBuilder variable as it has been captured.
5177         Create a temporary variable and store the results on the
5178         FieldBuilder.  Fixes #76642
5179
5180 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
5181
5182         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
5183
5184         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
5185
5186         * expression.cs (Binary.DoResolve): Added && optimalization.
5187     
5188         * typemanager.cs (AddUserType): Removed useless argument.
5189
5190 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
5191
5192         * statement.cs (Block.variables): Uses ListDictionary.
5193
5194 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
5195
5196         Fix #75969.
5197         * class.cs (PartialContainer.EmitType): Customized to emit
5198         security attributes.
5199         (ClassPart.ApplyAttributeBuilder): Transform security attribute
5200         for partial classes.
5201
5202 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
5203
5204         Fix #76599.
5205         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
5206         access has to be fixed.
5207         
5208         * typemanager.cs (IsUnmanagedType): Wrong common field type.
5209
5210 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
5211
5212         Fix #76590.
5213         * ecore.cs (NullCast.Reduce): Implemented.
5214
5215         * expression.cs (ArrayCreation.CheckIndices): Correcly check
5216         constant type.
5217         
5218         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
5219         properly.
5220         (Foreach.Resolve): Catch null properly.
5221
5222 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
5223  
5224         * cs-tokenizer.cs: Warning text fix.
5225
5226         * driver.cs: AllWarningNumbers exposed on public interface.
5227
5228         * report.cs (): Reviewed warning numbers.
5229         (IsValidWarning): Use binary search.
5230
5231 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
5232  
5233         * driver.cs: Implemeted resource visibility.
5234         (Resources): New class for code sharing between /res: and
5235         /linkres:
5236  
5237 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
5238
5239         Fix #76568.
5240         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
5241         folding.
5242         
5243         * convert (Convert.ImplicitReferenceConversion): NullCast holds
5244         contants only.
5245         
5246         * ecore.cs (NullCast): Child is contant only.
5247         
5248         * literal.cs (NullLiteral.Reduce): null can be converted to any
5249         reference type.
5250
5251 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
5252
5253         * driver.cs: Use Encoding.Default as default code page instead
5254           of ISO-28591.
5255
5256 2005-10-27  Raja R Harinath  <rharinath@novell.com>
5257
5258         Fix #76085.
5259         * expression.cs (Invocation.Error_InvalidArguments): Handle
5260         __arglist parameters.
5261         (Invocation.VerifyArgumentsCompat): Likewise.
5262         * support.cs (ReflectionParameters.GetSignatureForError): Print
5263         __arglist parameters.
5264         (InternalParamters.GetSignatureForError): Likewise.
5265         * parameter.cs (Parameters.GetSignatureForError): Likewise.
5266
5267 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
5268
5269         * attribute.cs (GetPropertyValue): Made public.
5270
5271         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
5272         Resolve.
5273         Add new property WrapNonExceptionThrows to handle 2.0 assembly
5274         attribute.
5275         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
5276         is not defined.
5277         
5278         * driver.cs: Reflect method name change.
5279         
5280         * statement.cs (Try.Resolve): Warn when try has both general
5281         exception handlers.
5282         
5283         * typemanager.cs: runtime_compatibility_attr_type new predefined
5284         type.
5285
5286 2005-10-26  Raja R Harinath  <harinath@gmail.com>
5287
5288         Fix #76419.
5289         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
5290         treat it as an empty parameter list.
5291
5292 2005-10-26  Raja R Harinath  <rharinath@novell.com>
5293
5294         Fix #76271.     
5295         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
5296         ResolveAsTypeStep silent.
5297         * statement.cs (Block.AddConstant): Mark block as used.
5298         (Block.ResolveMeta): Avoid piling on error messages
5299         if a constant initializer resolution fails.
5300
5301 2005-10-25  Raja R Harinath  <rharinath@novell.com>
5302
5303         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
5304         Remove.
5305         (NamespaceEntry.VerifyAllUsing): New.
5306         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
5307         behaviour.  Delegates actual resolution of alias to ...
5308         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
5309         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
5310         Update.
5311         * driver.cs (Driver.MainDriver): Update.
5312         
5313         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
5314         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
5315         property.
5316         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
5317         Remove.
5318         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
5319         RootNamespace.DefineNamespacesForAll.
5320
5321 2005-10-24  Raja R Harinath  <harinath@gmail.com>
5322
5323         * typemanager.cs (assemblies, external_aliases, modules)
5324         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
5325         (ComputeNamespaces, GetRootNamespace): Remove extra staging
5326         overhead.  Move resposibility ...
5327         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
5328         * driver.cs, attribute.cs, codegen.cs: Update to changes.
5329
5330 2005-10-23  Raja R Harinath  <harinath@gmail.com>
5331
5332         * namespace.cs (RootNamespace.all_namespaces): Renamed from
5333         cached_namespaces.  Improve usage.
5334         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
5335         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
5336         Move from GlobalRootNamespace and simplify.
5337         (RootNamespace.Global): Make instance variable.
5338         (RootNamespace.RootNamespace): Add "alias name" parameter.
5339         (GlobalRootNamespace): Simplify drastically.
5340         (Namespace.Lookup): Don't use GetNamespace.
5341         * typemanager.cs (GetRootNamespace): Rename from
5342         ComputeNamespaceForAlias.
5343         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
5344
5345 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5346
5347         * anonymous.cs (AnonymousContainer): Don't crash when container
5348         doesn't exist.
5349
5350 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5351
5352         * expression.cs (Binary.DoResolve): Warn when comparing same
5353         values.
5354
5355 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5356
5357         Fix #76486.
5358         * expression.cs (Binary.DoResolve): It looks like there are no
5359         convetsion rules in enum context.
5360
5361 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5362
5363         Add support for extern alias qualifiers.
5364         * typemanager.cs: Move some LookupTypeReflection code
5365         to namespace.cs, to have cleaner code. Added some methods
5366         to help us keep track of the extern aliased references.
5367         * driver.cs: Add suport for extern alias assemblies on command
5368         line and check for their warnings/errors. Also keep track of the
5369         extern aliased assemblies.
5370         * namespace.cs: Move the global functionality of Namespace
5371         to GlobalRootNamespace/RootNamespace. Now the global namespace
5372         is GlobalRootNamespace.Globa. Also the code moved from 
5373         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
5374         Finally added LocalAliasEntry (AliasEntry before) and
5375         ExternAliasEntry, to handle alias statements.
5376         * cs-parser.jay: Add support in the grammar for extern alias
5377         statement.
5378         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
5379         Update callings to Namespace (now in GlobalRootNamespace).
5380
5381 2005-10-18  Raja R Harinath  <rharinath@novell.com>
5382
5383         Fix #76371.
5384         * class.cs (TypeContainer.DefineType): Move updating of
5385         topological sort earlier in the code.
5386         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
5387
5388 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
5389
5390         Fix #76273.
5391         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
5392         
5393         * constant.cs (Constant.TryReduce): Moved from Cast class.
5394         (Reduce): Made little bit more OO and fixed missing conversions.
5395         
5396         * ecore.cs (Reduce): Implemented.
5397         (Binary.EnumLiftUp): New method to upgrade values to enum values.
5398         
5399         * literal.cs (Reduce): Implemented.
5400         
5401         * class.cs: Reverted Miguel's wrong commit.
5402
5403 2005-10-14  Miguel de Icaza  <miguel@novell.com>
5404
5405         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
5406
5407 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
5408
5409         * cs-parser.jay, expression.cs : CS0214 was missing error location
5410           for constants. Fixed bug #76404.
5411
5412 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
5413
5414         Fix #76370.
5415         * convert.cs (ExplicitConversionCore): Fixed object->enum
5416         conversion.
5417
5418 2005-10-10  Raja R Harinath  <rharinath@novell.com>
5419
5420         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5421         InstanceExpression.
5422         (PropertyExpr.EmitCall): Likewise.
5423         * expression.cs (Invocation.EmitArguments): Handle case where
5424         arguments == null.
5425         (Invocation.EmitCall): Avoid allocating temporary variable if
5426         there are no arguments.
5427
5428 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5429
5430         Fix #76323.
5431         * convert.cs (ImplicitConversionStandard): Move conversion of
5432         void* to arbitrary pointer types ...
5433         (ExplicitConversionStandard): .. here.
5434         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
5435         error to always print typenames.
5436
5437 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5438
5439         * convert.cs (GetConversionOperator): Rename from
5440         GetConversionOperators.  Move operator selection code from ...
5441         (UserDefinedConversion): ... here.
5442
5443 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
5444
5445         * convert.cs (ExplicitConversionCore): Removed duplicate enum
5446         conversion.
5447
5448 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
5449
5450         * assign.cs (Assign.DoResolve): Error method changed.
5451
5452         * cfold.cs (DoConstantNumericPromotions): Error method changed.
5453         
5454         * const.cs (ResolveValue): Reset in_transit immediately.
5455         
5456         * constant.cs: Error method changed.
5457         
5458         * convert.cs: Removed useless location parameter.
5459         (ExplicitNumericConversion): Don't do double enum check.
5460         (ExplicitConversionCore): Renamed from ExplicitConversion.
5461         (ExplicitUnsafe): Extracted from ExplicitConversion.
5462         (ExplicitConversion): Uses for error reporting.
5463         
5464         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
5465         error messages.
5466         (ResolveBoolean): Uses common error method.
5467         (CastToDecimal): Get rid of ec.
5468         (CastFromDecimal): Optimized.
5469         (ConvCast): Get rid of ec.
5470         
5471         * enum.cs (ResolveValue): Reset in_transit immediately.
5472         (Emit): Return after first error.
5473         
5474         * expression.cs: Convert changes.
5475         
5476         * literal.cs: Error method changed.
5477         
5478         * statement.cs: Error method changed.
5479
5480 2005-10-03  Raja R Harinath  <rharinath@novell.com>
5481
5482         * support.cs (SeekableStreamReader.Position): Don't error out when
5483         the requested position is just beyond the end of the current
5484         buffered data.
5485
5486 2005-09-28  Raja R Harinath  <rharinath@novell.com>
5487
5488         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
5489         try to keep in sync with the byte count of the underlying Stream.
5490         However, this limits us to a window size of 2048 characters: i.e.,
5491         the maximum lookahead of our lexer/parser can be 2048 characters.
5492
5493 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
5494
5495         Fix #76255.
5496         * driver.cs: Fix compilation files with full root path.
5497
5498 2005-09-25  Miguel de Icaza  <miguel@novell.com>
5499
5500         * report.cs (SymbolRelatedToPreviousError): Format the output so
5501         it does not use an open parenthesis that is never closed. 
5502
5503         * driver.cs: Follow coding guidelines
5504
5505 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5506
5507         Fix #72930.
5508         * const.cs (Const.ResolveValue): Check for assigning non-null
5509         value to reference type.
5510
5511 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5512
5513         * anonymous.cs: Implemented ExprClassName.
5514         
5515         * assign.cs (Assign.DoResolve): Don't chrash when type is not
5516         delegate.
5517         
5518         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
5519         check.
5520         
5521         * class.cs (StaticClass.DefineContainerMembers): Report protected
5522         members as error.
5523         
5524         * codegen.cs: if(ed) PRODUCTION.
5525         
5526         * convert.cs (Error_CannotImplicitConversion): Better error
5527         distinction.
5528         
5529         * cs-parser.jay: More error checks.
5530         
5531         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
5532         
5533         * driver.cs (CSCParseOption): Enabled wrong option check.
5534         
5535         * ecore.cs (Expression.ExprClassName): Turned to property.
5536         (MemberExpr.CheckIntermediateModification): For checking boxed
5537         value types     modification.
5538         
5539         * statement.cs (Fixed.Resolve): Expression type must be
5540         convertible to fixed type.
5541         (CollectionForeach.GetEnumeratorFilter,TryType):
5542         Small refactoring for easier error checking.
5543
5544 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
5545
5546         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
5547         attributes.
5548         
5549         * class.cs (GeneratedBaseInitializer): New class for customization
5550         compiler generated initializers.
5551         (MemberBase.DoDefine): Check Obsolete attribute here.
5552         (FieldMember.DoDefine): Ditto.
5553         
5554         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
5555         constants.
5556         
5557         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
5558         (MemberCore.GetObsoleteAttribute): Removed argument.
5559         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
5560         (MemberCore.CheckObsoleteType): New helper.
5561         
5562         * delegate.cs,
5563         * enum.cs,
5564         * statement.cs: Updates after MemberCore changes.
5565         
5566         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
5567         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
5568         
5569         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
5570         obsolete attribute for compiler construct.
5571         (As.DoResolve): Cache result.
5572         
5573         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
5574
5575 2005-09-26  Raja R Harinath  <rharinath@novell.com>
5576
5577         Fix #76133.
5578         * expression.cs (This.VerifyFixed): In a value type T, the type of
5579         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
5580         value type R, 'this' is treated as a value parameter.
5581
5582 2005-09-22  Miguel de Icaza  <miguel@novell.com>
5583
5584         * statement.cs (Lock): Use the TemporaryVariable class instead of
5585         manually using local variables as those do not work when variables
5586         are captured.
5587
5588         * ecore.cs: Moved the TemporaryVariable class from being a nested
5589         class inside Foreach to be a public class that can be employed in
5590         other places. 
5591
5592 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
5593
5594         * cs-parser.jay: interface_accessors replaced by
5595         accessor_declarations.
5596
5597         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
5598         location.
5599         
5600         * statement.cs (GotoCase.Resolve): Convert null constant to
5601         null case.
5602         (SwitchLabel.ResolveAndReduce): Ditto.
5603         (SwitchLabel.NullStringCase): Custom null stamp.
5604         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
5605         
5606         typemanager.cs (CSharpSignature): Don't skip first argument
5607         for full names.
5608
5609 2005-09-18  Miguel de Icaza  <miguel@novell.com>
5610
5611         * driver.cs: Set InEmacs based on the environment variable EMACS. 
5612
5613         * location.cs (InEmacs): in this mode, do not report column
5614         location as it confuses Emacs.
5615
5616 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
5617
5618         * cfold.cs, constant.cs, convert.cs, ecore.cs,
5619         expression.cs, iterators.cs, literal.cs: Store constants and
5620         literals location.
5621         
5622         * class.cs (MemberBase.ShortName): Pass location.
5623         
5624         * cs-parser.jay: Some location fixes.
5625         
5626         * ecore.cs (Expression.Location): Made virtual.
5627
5628 2005-09-05  Miguel de Icaza  <miguel@novell.com>
5629
5630         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
5631         if the underlying types are the same, otherwise we need to produce
5632         code that will do the proper cast.
5633
5634         This was exposed by Marek's constant rewrite which produced
5635         invalid code for the call site:
5636
5637         enum X : long { a }
5638         void Method (X v) {}
5639
5640         Method ((X) 5)
5641
5642         This fixes test-49.cs
5643
5644 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5645
5646         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
5647           Type/Object should be allowed as well. Fixed bug #75968.
5648
5649 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5650
5651         * expression.cs : (Binary.DoResolve): when one is enum constant and
5652           another is constant 0, then return enum one *as enum type*.
5653           Fixed bug 74846.
5654
5655 2005-09-02  Raja R Harinath  <rharinath@novell.com>
5656
5657         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
5658         internal.
5659
5660         Fix #75941.
5661         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
5662         flow-branching for LocalVariableReferences in case we were invoked
5663         from a MemberAccess.
5664         * expression.cs (LocalVariableReference.VerifyAssigned): New.
5665         Carved out of ...
5666         (LocalVariableReference.DoResolveBase): ... this.
5667         (MemberAccess.Resolve): Do the check that was disabled during
5668         SimpleNameResolve.
5669
5670 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5671
5672         * class.cs :
5673           (PartialContainer.Create): check abstract/sealed/static strictly
5674           but abstract/sealed can exist only at one side. Fixed bug #75883.
5675
5676 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
5677
5678         Fix #75945.
5679         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5680         specified, don't default to UnmanagedType.I4.
5681
5682 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5683
5684         * expression.cs : conditional operator should check possibly
5685           incorrect assign expression. Fixed bug #75946.
5686
5687 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5688
5689         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5690           Reverting the change. gmcs is much complex than mcs on this matter.
5691
5692 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5693
5694         * cs-tokenizer.cs : To read another token ahead of the actual 
5695           consumption, use new SavedToken and cache token instead of moving
5696           back the stream with SeekableStreamReader (it seemed problematic).
5697         * cs-parser.jay,
5698           driver.cs : Thus use StreamReader directly.
5699         * support.cs : Thus removed SeekableStreamReader.
5700
5701 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5702
5703         Fix #75934.
5704         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5705         (ScopeInfo.EmitScopeType): Use it to construct field names from
5706         names of captured locals.
5707
5708         Fix #75929.
5709         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5710         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5711         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
5712         (ExplicitConversion): Remove enum cases already handled by
5713         implicit conversion.  Move implicit conversion check to the beginning.
5714         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5715         * expression.cs (ArrayCreation.EmitDynamicInitializers):
5716         Don't treat System.Enum as a struct.
5717
5718 2005-08-30  Jb Evain  <jbevain@gmail.com>
5719
5720         * attribute.cs: handles as expression in parameters.
5721
5722 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5723
5724         Fix #75802.
5725         * class.cs (TypeContainer.VerifyClsName): Don't use a
5726         PartialContainer when verifying CLS compliance.
5727         (AbstractPropertyEventMethod): Set Parent here, ...
5728         (PropertyMethod): ... not here.
5729
5730 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
5731
5732         * attribute.cs : escaped attribute name should not be allowed to be
5733           resolved (e.g. @class as classAttribute). Fixed bug #75930.
5734
5735 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5736
5737         Fix #75927.
5738         * convert.cs (ImplicitStandardConversionExists): Allow zero also
5739         when converting a long constant to unsigned long.
5740         * expression.cs (Invocation.OverloadResolve): Add sanity check to
5741         detect where IsApplicable and VerifyArgumentsCompat disagree.
5742
5743 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5744         and Carlos Alberto Cortez  <carlos@unixmexico.org>
5745
5746         Fix #75848.
5747         * class.cs (TypeContainer.CanElideInitializer): New helper.
5748         (TypeContainer.EmitFieldInitializers): Use it to determine if we
5749         can safely emitting the initializer of a field.
5750
5751 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5752
5753         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5754           allowed inside a switch (without loop). Fixed bug #75433.
5755
5756 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
5757
5758         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5759         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5760
5761 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5762
5763         * driver.cs : kinda reverting the default encoding changes (not exact 
5764           revert since I noticed that "codepage:reset" might not work fine).
5765
5766 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5767
5768         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5769           Location. Now getter and setter store location correctly.
5770           (errors/cs0111-12.cs now reports the expected location.)
5771
5772 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5773
5774         * driver.cs : Use default encoding on the environment.
5775           Removed (now that) extra parameter for SeekableStreamReader.
5776         * support.cs : (SeekableStreamReader) third .ctor() argument for
5777           StreamReader is not required (always true). preamble size could
5778           be acquired in simpler and safe way.
5779
5780 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5781
5782         * cs-parser.jay: report CS0642 at warning level 3
5783           and report CS0642 for an if else statement also
5784           fixes bug #74745. Patch by John Luke (and a bit
5785           modified by me).
5786           Removed extra CS0642 warning check for "while",
5787           "for" and "fixed".
5788         * statement.cs: In Block.Resolve(), CS0642 check
5789           is reimplemented to check a sequence of an empty
5790           statement and a block.
5791
5792           Both fix bug #66777.
5793
5794 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
5795
5796         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5797         detection until I fix it.
5798         
5799         * cs-tokenizer.cs: Changed error message.
5800         
5801         * cs-parser.jay: Fixed 2 error locations.
5802         
5803         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5804         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5805         properties.
5806         
5807         * enum.cs (GetSignatureForError): Fixed.
5808         
5809         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5810         method detection.
5811         
5812         * class.cs,
5813         * typemanager.cs (RegisterProperty): Removed.
5814         
5815         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5816
5817 2005-08-24  Raja R Harinath  <rharinath@novell.com>
5818
5819         Fix #75874.
5820         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5821         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5822
5823 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5824
5825         * expression.cs : tiny fix is required for not warning positive ulong.
5826           See test-441.cs.
5827
5828 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5829
5830         * expression.cs : add CS0652 check for constant and integral
5831           expression. Fixed bug #53974.
5832
5833 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5834
5835         * expression.cs : in DoNumericPromotions(), check if there is implicit
5836           conversion overload for string (to check CS0034). Fixed bug #52492.
5837
5838 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5839
5840         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5841
5842 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5843
5844         * ecore.cs : report location when it is *not* Null.
5845
5846 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5847
5848         * codegen.cs,
5849           ecore.cs,
5850           flowanalysis.cs,
5851           expression.cs:
5852           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5853           correctly. Fixed bug #75721.
5854
5855 2005-08-23  Raja R Harinath  <rharinath@novell.com>
5856
5857         * support.cs (SeekableStreamReader.Position): Avoid an expensive
5858         loop that performs 'min (pos, char_count)'.
5859
5860         Fix #75862.
5861         * expression.cs (Unary.ResolveOperator): Don't discard implicit
5862         converted value in Operator.OnesComplement.
5863
5864 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
5865
5866         * anonymous.cs: If the anon method is pulled into a helper class,
5867         it needs to be `internal' not `private'. Fixes runtime behavior on
5868         msft. bug #75704
5869
5870 2005-08-20  Martin Baulig  <martin@ximian.com>
5871
5872         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5873         scope if we don't already have it.
5874
5875         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5876         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5877         fixes #75867.
5878
5879 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
5880
5881         Fix #75803
5882         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5883         is a partial class.
5884
5885 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
5886
5887         The big constants rewrite
5888         Fix #75746, #75685 and more
5889         As a side effect saved 1MB for MWF ;-)
5890         
5891         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5892         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5893         enum based for corlib compilation.
5894         
5895         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5896         subtractions.
5897         
5898         * class.cs (FixedField.Define): Use ResolveAsConstant.
5899         
5900         * const.cs (IConstant): Interface constants and enums.
5901         (Const.ResolveValue): New method for constant resolvning.
5902         (ExternalConstant): Constants from imported assemblies.
5903         
5904         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5905         conversion; like enums.
5906         (Constant.ToType): Converts this constant to different type.
5907         (Constant.Increment): Adds 1.
5908         
5909         * convert.cs (ImplicitConversionRequired): Simplified.
5910         
5911         * cs-parser.jay: Create EnumMember directly.
5912         
5913         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5914         
5915         * doc.cs (GenerateEnumDocComment): Removed.
5916         
5917         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5918         (ConvertIntLiteral): Removed.
5919         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5920         
5921         * enum.cs (EnumMember): Implement IConstant.
5922         (Enum.IsValidEnumConstant): Removed.
5923         (Enum.GetNextDefaultValue): Removed.
5924         (Enum.FindMembers): Updated.
5925         (Enum.GenerateDocComment): Iterate enum members.
5926         
5927         * expression.cs (Cast.TryReduce): Handle enums correctly.
5928         (New.Constantify): Made public.
5929         (MemberAccess.DoResolve): Removed contant specific if(s).
5930         
5931         * literal.cs (NullLiteral): Implement new abstract methods.
5932         
5933         * statement.cs (GotoCase.Resolve): Use new constant methods.
5934         (SwitchLabel.ResolveAndReduce): Use new constant methods.
5935         
5936         * typemanager.cs (LookupEnum): Removed.
5937         (IsEnumType): Fixed to work with corlib.
5938         (RegisterConstant): Removed.
5939         (LookupConstant): Removed.
5940         (GetConstant): Changed to work with IConstant.
5941
5942 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
5943
5944         * location.cs : Fixed overflown (>255) column number.
5945
5946 2005-08-03  Raja R Harinath  <rharinath@novell.com>
5947
5948         First cut of the qualified-alias-member feature.
5949         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5950         token.
5951         * cs-parser.jay (DOUBLE_COLON): New token.
5952         (namespace_or_type_name): Add rule for recognizing
5953         qualified-alias-members.
5954         (primary_expression): Likewise.
5955         (element_access): Allow QualifiedAliasMember as a possible
5956         type-bearing expression.
5957         (local_variable_type, local_variable_pointer_type): Likewise.
5958         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
5959         aliases in the current and enclosing namespace declarations.
5960         (NamespaceEntry.UsingAlias): Add CS0440 warning.
5961         * decl.cs (MemberName.is_double_colon): New.
5962         (MemberName.MemberName): Add new constructor for alias-member.
5963         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5964         * expression.cs (QualifiedAliasMember): New expression type.
5965
5966 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5967
5968         * location.cs : it borked when no argument was specified.
5969
5970 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5971
5972         * location.cs : tiny ToString() format fix.
5973
5974 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5975
5976         * statement.cs : oops, it was missing.
5977
5978 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5979
5980         A set of fixes for precise line/column location.
5981
5982         * location.cs :
5983           "token" field now holds a file/line "delta", a line number offset 
5984           from the segment, and a column number. See also:
5985           http://lists.ximian.com/pipermail/mono-devel-list/2004-
5986           December/009508.html
5987           Removed static IsNull. Use instance IsNull property instead.
5988         * cs-tokenizer.cs :
5989           For some tokens it stores Location. For Identifier it stores
5990           LocatedToken which is a pair of string name and location.
5991           Column numbers are adjusted only at getChar().
5992         * report.cs :
5993           Use Location.ToString() for reporting (it now contains column).
5994         * cs-parser.jay :
5995           Largely modified to use LocatedToken instead of
5996           string (IDENTIFIER), and to acquire Location from some tokens.
5997         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5998           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5999           codegen.cs :
6000           Now MemberName holds Location. DeclSpace.ctor() receives Location
6001           as a parameter. Removed extra parameters to all derived classes.
6002           Replaced Location.IsNull() with instance property.
6003         * assign.cs, expression.cs :
6004           Added .ctor() overload that omits Location.
6005         * attribute.cs :
6006           Added "nameEscaped" flag that indicates the identifier was escaped
6007           in the source file. This fixes bug #57047.
6008
6009 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
6010
6011         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
6012         New method, looking for lo-case imported cls type.
6013
6014         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
6015         here.
6016
6017         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
6018
6019         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
6020
6021         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
6022         all_imported_types.
6023         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
6024
6025         Optimized to save 3.5 MB for SWF compilation.
6026
6027 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
6028
6029         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
6030         (PartialContainer.Create): Moved logic AddToContainer.
6031         (PartialContainer.MarkForDuplicationCheck): Shares name.
6032         
6033         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
6034         place.
6035         
6036         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
6037         initialization.
6038         (Namespace.GetSignatureForError): New method.
6039         
6040         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
6041         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
6042
6043 2005-08-01  Raja R Harinath  <rharinath@novell.com>
6044
6045         Fix #75669.
6046         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
6047         member lookup rather than qualifier_type, since qualifier_type can
6048         be null.
6049
6050 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
6051
6052         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
6053         enum member.
6054
6055 2005-07-31  Miguel de Icaza  <miguel@novell.com>
6056
6057         * statement.cs: Copy the local exception into the exception
6058         captured local.  Fixes 75674
6059
6060 2005-07-31  Raja R Harinath  <harinath@gmail.com>
6061
6062         Fix #75658.
6063         * expression.cs (Invocation.OverloadResolve): Don't report error
6064         CS1501 if error CS1502 has been reported.
6065         (New.DoResolve): Delegate CS1501 reporting to
6066         Invocation.OverloadResolve.
6067
6068         Fix #75656.
6069         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
6070         invariant-meaning-in-block property in an enclosing block if
6071         necessary.
6072
6073 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
6074
6075         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
6076         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
6077         (Switch.CheckSwitch): Just save 50kb for SWF.
6078
6079 2005-07-27  Martin Baulig  <martin@ximian.com>
6080
6081         * anonymous.cs (CaptureContext.AddField): Added
6082         `AnonymousContainer am' argument; compute its toplevel scope if
6083         it's not already computed.  Fixes #75649.
6084
6085 2005-07-26  Raja R Harinath  <rharinath@novell.com>
6086
6087         Fix #75628.
6088         * class.cs (Constructor.Emit): Reset block to null if the block
6089         resolve fails.
6090
6091 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
6092
6093         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
6094
6095 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
6096
6097         * class.cs (MethodData.Define): Check whether accessor implementing
6098         interface is public.
6099
6100         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
6101
6102 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
6103
6104         Fix #57245
6105         * namespace.cs (LookupType): Moved same type check to...
6106         
6107         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
6108         with the same name.
6109
6110 2005-07-21  Raja R Harinath  <rharinath@novell.com>
6111
6112         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
6113         already found a typebuilder.
6114         * class.cs (MethodCore.IsDuplicateImplementation): Compare
6115         MemberNames, not strings.
6116
6117         * const.cs (Error_ExpressionMustBeConst): 
6118         Rename from Error_EpressionMustBeConst.
6119         * const.cs, class.cs, statement.cd: Update.
6120
6121 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
6122
6123         Fix #65573
6124
6125         * const.cs (Const.LookupConstantValue): Report missing contant expression
6126         everytime.
6127         (Error_EpressionMustBeConstant): Only one error method.
6128
6129         * class.cs, statement.c: Updated.
6130
6131 2005-07-20  Raja R Harinath  <rharinath@novell.com>
6132
6133         * statement.cs (Block.Flags): Add back HasVarargs.
6134         (Block.flags): Make protected.
6135         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
6136
6137         * typemanager.cs (types, typecontainers, user_types): Remove.
6138         (UserTypes, TypeContainers): Likewise.
6139         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
6140         (CleanUp, Reset): Update.
6141         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
6142         (GetNestedType): Use Type.GetNestedType.
6143         (CoreLookupType): Take two arguments, the namespace and the
6144         basename of the type.  Update to use the Namespace.Lookup
6145         mechanism.
6146         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
6147         (RealMemberLookup): Use IsNestedChildOf instead of playing with
6148         string concatenation and substring matches.
6149         * class.cs, enum.cs, delegate.cs: Update to changes.
6150
6151 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
6152
6153         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
6154         Expression and made virtual.
6155
6156         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
6157         (ImplicitStandardConversionExists): Fixed `byte' typo ?
6158
6159         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
6160
6161         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
6162         error message.
6163
6164         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
6165         change.
6166
6167 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
6168
6169         Fix #57707
6170         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
6171         AssemblyCultureAttribute is not used on executable.
6172
6173         * rootcontext.cs,
6174         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
6175
6176 2005-07-16  Raja R Harinath  <rharinath@novell.com>
6177
6178         Fix #60638.
6179         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
6180         New.  Reports CS0252/CS0253.
6181         Mostly taken from preliminary patch by Duncak Mak.
6182         (Binary.DoResolveOperator): Store results of operator lookup.
6183         Use them to detect if we need to warn about unintended reference
6184         comparisons.
6185
6186 2005-07-15  Raja R Harinath  <rharinath@novell.com>
6187
6188         Fix #72969.
6189         * namespace.cs (Namespace.Lookup): Add back location parameter.
6190         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
6191         * delegate.cs, ecore.cs, expression.cs: Update to changes.
6192
6193         * codegen.cs (EmitContext.DeclSpace): Make readonly.
6194         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
6195         (Namespace.LookupType): ... this.
6196         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
6197         of namespaces.
6198         * typemanager.cs (LookupTypeReflection): Remove buggy code that
6199         purported to handle pointers.
6200         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
6201         CoreLookupType.
6202
6203 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
6204
6205         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
6206         type as namespace.
6207
6208 2005-07-15  Raja R Harinath  <rharinath@novell.com>
6209
6210         * namespace.cs (Namespace.Lookup): Drop location parameter.
6211         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
6212         (NamespaceEntry.Lookup): ... this.
6213         (NamespaceEntry.Error_AmbiguousTypeReference):
6214         Move here from DeclSpace.
6215         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
6216         names ...
6217         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
6218         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
6219         Move to NamespaceEntry.
6220         * delegate.cs, expression.cs: Update to changes.
6221
6222 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
6223
6224         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
6225         CheckAttributeType and refactored.
6226         (Attribute.ResolvePossibleAttributeType): Changed to reuse
6227         ResolveAsTypeTerminal error handling.
6228         (ResolveAsTypeTerminal): Introduced because of global attributes extra
6229         handling.
6230         (GetSignatureForError): Print errors in same way.
6231
6232         * class.cs,
6233         * codegen.cs: Reflect attribute GetSignatureForError change.
6234
6235         * ecore.cs,
6236         * expression.cs: Add silent parameter to ResolveAsTypeStep.
6237
6238         * namespace.cs (UsingEntry): Refactored to make fields private.
6239
6240         * assign.cs,
6241         statement.cs: Error_UnexpectedKind has extra parameter.
6242
6243 2005-07-14  Raja R Harinath  <rharinath@novell.com>
6244
6245         * ecore.cs (IAlias): Remove.
6246         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
6247         that implement the interface.
6248         * namespace.cs (Namespace): Likewise.
6249         (Namespace.declspaces): Renamed from 'defined_names'.
6250         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
6251         DeclSpace instead of an IAlias.
6252         * tree.cs (Tree.AddDecl): Update.
6253
6254 2005-07-12  Raja R Harinath  <rharinath@novell.com>
6255
6256         * statement.cs (Block.Flags); Remove HasVarargs.
6257         (Block.HasVarargs): Move to ToplevelBlock.
6258         (Block.ThisVariable, Block.AddThisVariable): Likewise.
6259         (Block.Variables): Make protected.  Initialize variable hashtable
6260         if necessary.
6261         (Block.AddVariable): Update.
6262         (Block.Resolve): Update to changes.
6263         (ToplevelBlock.HasVarargs): New boolean.
6264         (ToplevelBlock.ThisVariable): Move here from Block.
6265         (ToplevelBlock.AddThisVariable): Likewise.
6266         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
6267         * expression.cs (This.ResolveBase): Update to changes.
6268         (ArglistAccess.DoResolve): Likewise.
6269
6270 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
6271
6272         Fix #75321
6273         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
6274
6275         * class.cs (TypeContainer.VerifyMembers): Distinguish between
6276         not used and not used & assigned.
6277         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
6278
6279 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
6280
6281         Fix #75053
6282         * expression.cs (Is.DoResolve): null is never provided type.
6283
6284 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
6285
6286         Fix #52496
6287         * cs-parser.jay: Less strict event error rule to catch more errors.
6288
6289 2005-07-08  Martin Baulig  <martin@ximian.com>
6290
6291         Fix test-iter-10.cs - distinguish whether we `yield' in a property
6292         gettter (allowed) or setter (not allowed).
6293
6294         * class.cs (Accessor): Implement IIteratorContainer.
6295         (Accessor.Yields): New public field.
6296         (PropertyBase.PropertyMethod.Define): Handle iterators on a
6297         per-accessor basis.
6298
6299         * cs-parser.jay
6300         (get_accessor_declaration, set_accessor_declaration): Set the
6301         `yields' flag on the accessor, not the property.
6302         (property_declaration): Do the iterators check on a per-accessor
6303         basis and not for the whole property.
6304
6305 2005-07-08  Martin Baulig  <martin@ximian.com>
6306
6307         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
6308         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
6309
6310 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
6311
6312         Fix #74975
6313         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
6314         (ExtractSecurityPermissionSet): Cope with self referencing security
6315         attributes properly.
6316
6317         * driver.cs (SetOutputFile): Made public property OutputFile.
6318
6319 2005-07-07  Raja R Harinath  <rharinath@novell.com>
6320
6321         Fix #75486.
6322         * class.cs (TypeContainer.first_nonstatic_field): Rename from
6323         has_nonstatic_fields.  Make into a FieldBase pointer.
6324         (TypeContainer.AddField): Add CS0282 check.
6325         (TypeContainer.EmitType): Update.
6326
6327 2005-07-06  Miguel de Icaza  <miguel@novell.com>
6328
6329         * cs-tokenizer.cs (consume_identifier): Do not create strings to
6330         compare if they start with __.
6331
6332 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6333
6334         * statement.cs (Switch.SwitchGoverningType): Only look at
6335         UserCasts that don't need implicit standard conversions to one of
6336         the allowed switch types (Fixes test-322.cs).
6337         (LocalInfo.Resolve): Re-enable sanity-test.
6338
6339 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
6340
6341         * cs-tokenizer.cs (consume_identifier): Detect double undescores
6342         
6343         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
6344         
6345         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
6346
6347 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6348
6349         Fix #75472.
6350         * ecore.cs (SimpleName.GetSignatureForError): Add.
6351         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
6352         (MemberAccess.GetSignatureForError): Add.
6353
6354 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
6355  
6356         The big error and warning messages review.
6357         
6358         * anonymous.cs,
6359         * assign.cs,
6360         * attribute.cs,
6361         * class.cs,
6362         * codegen.cs,
6363         * convert.cs,
6364         * cs-parser.jay,
6365         * cs-tokenizer.cs,
6366         * decl.cs,
6367         * delegate.cs,
6368         * doc.cs,
6369         * driver.cs,
6370         * ecore.cs,
6371         * enum.cs,
6372         * expression.cs,
6373         * flowanalysis.cs,
6374         * iterators.cs,
6375         * literal.cs,
6376         * location.cs,
6377         * modifiers.cs,
6378         * namespace.cs,
6379         * parameter.cs,
6380         * pending.cs,
6381         * report.cs,
6382         * rootcontext.cs,
6383         * statement.cs,
6384         * support.cs,
6385         * tree.cs,
6386         * typemanager.cs: Updated.
6387         
6388         * class.cs: (MethodCore.SetYields): Moved here to share.
6389         (PropertyMethod.Define): Moved iterator setup here.
6390         
6391         * iterators.cs: Add orig_method to have full access to parent
6392         container.
6393
6394 2005-07-05  Raja R Harinath  <rharinath@novell.com>
6395
6396         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
6397         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
6398         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
6399         variable of struct type.
6400         * expression.cs (Unary.ResolveOperator): Update to change.
6401         (Indirection.VerifyFixed): Likewise.
6402         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
6403         (ParameterReference.VerifyFixed): Value parameters are fixed.
6404         (This.VerifyFixed): Treat 'this' as a value parameter.
6405         * statement.cs (LocalInfo.IsFixed): Remove.
6406
6407 2005-07-01  Martin Baulig  <martin@ximian.com>
6408
6409         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
6410         `ec.EmitThis ()' to get the correct scope.
6411
6412 2005-07-01  Martin Baulig  <martin@ximian.com>
6413
6414         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
6415         instance is a ParameterReference; fixes #75299.
6416
6417 2005-07-01  Martin Baulig  <martin@ximian.com>
6418
6419         Reverted Marek's latest patch (r46725):
6420         - it contains structural changes which are neither mentioned in
6421           the ChangeLog nor explained anywhere; for example the additional
6422           argument of EmitContext's and Iterator's .ctor's and the
6423           TypeContainer.DefineMembers() change.
6424         - structural changes like this should go in in seperate patches
6425           and not be hidden in a huge patch which just seems to affect
6426           warnings and errors.
6427           a big and hard to understand patch.
6428         - it breaks iterators and causes regressions, for instance in
6429           test-iter-03.cs.      
6430
6431 2005-06-30  Raja R Harinath  <rharinath@novell.com>
6432
6433         Fix #75412.
6434         * expression.cs (Indexers.map): Remove.
6435         (Indexers.Append): Filter out inaccessible setters and getters.
6436         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
6437
6438         Fix #75283.
6439         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
6440         Refactored from ...
6441         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
6442         (FieldExpr.Emit, PropertyExpr.Emit): Update.
6443         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
6444         * expression.cs (Invocation.EmitCall): Add CS0120 check.
6445
6446 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
6447
6448         Fix #75322
6449         * class.cs (FieldBase.GetInitializerExpression): One more field
6450         for backup.
6451
6452 2005-06-28  Miguel de Icaza  <miguel@novell.com>
6453
6454         * pending.cs: Do not define a proxy if the base method is virtual,
6455         it will be picked up by the runtime (bug 75270).
6456
6457 2005-06-08  Martin Baulig  <martin@ximian.com>
6458
6459         The big Iterators rewrite :-)
6460
6461         * iterators.cs: Rewrite this to use the anonymous methods framework.
6462
6463         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
6464         before the TypeContainers; see 2test-21.cs.
6465
6466         * class.cs
6467         (TypeContainer.DefineType): Don't create a new EmitContext if we
6468         already have one (this only happens if we're an Iterator).
6469         (TypeContainer.Define): Also call Define() on all our iterators.
6470         (Method.CreateEmitContext): Added support for iterators.
6471
6472         * anonymous.cs
6473         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
6474         (AnonymousContainer.CreateMethodHost): Moved here from
6475         AnonymousMethod and made abstract.
6476         (AnonymousContainer.CreateScopeType): New abstract method.
6477         (AnonymousContainer.IsIterator): New public property.
6478         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
6479         get the ScopeTypeBuilder rather than manually defining it here. 
6480         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
6481         iterators here.
6482
6483         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
6484         before RootContext.DefineTypes().
6485
6486         * codegen.cs (EmitContext.RemapToProxy): Removed.
6487         (EmitContext.CurrentAnonymousMethod): Changed type from
6488         AnonymousMethod -> AnonymousContainer.
6489         (EmitContext.ResolveTopBlock): Protect from being called twice.
6490         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
6491         (EmitContext.EmitThis): Removed the iterators hacks; use the
6492         anonymous methods framework for that.
6493
6494         * statement.cs
6495         (ToplevelBlock.Container): Make this a property, not a field.
6496         (ToplevelBlock.ReParent): New public method; move the
6497         ToplevelBlock into a new container.
6498         (Foreach.TemporaryVariable): Simplify.
6499
6500 2005-06-05  Martin Baulig  <martin@ximian.com>
6501
6502         * statement.cs (LocalInfo.CompilerGenerated): New flag.
6503         (Block.AddTemporaryVariable): New public method; creates a new
6504         `LocalInfo' for a temporary variable.
6505         (Block.EmitMeta): Create the LocalBuilders for all the temporary
6506         variables here.
6507         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
6508         non-iterator variables.
6509
6510 2005-06-05  Martin Baulig  <martin@ximian.com>
6511
6512         * statement.cs (Foreach.TemporaryVariable): Create the
6513         LocalBuilder in the Emit phase and not in Resolve since in some
6514         situations, we don't have an ILGenerator during Resolve; see
6515         2test-19.cs for an example.
6516
6517 2005-06-04  Martin Baulig  <martin@ximian.com>
6518
6519         **** Merged r45395 from GCS ****
6520
6521         The big Foreach rewrite - Part II.
6522
6523         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
6524         with `PropertyInfo ienumerator_getcurrent'.
6525
6526         * codegen.cs (VariableStorage): Removed.
6527
6528         * statement.cs
6529         (Foreach): Derive from Statement, not ExceptionStatement.
6530         (Foreach.CollectionForeach): New nested class.  Moved all the code
6531         dealing with collection foreach here.
6532         (Foreach.ForeachHelperMethods): Removed.
6533         (Foreach.TemporaryVariable): Implement IMemoryLocation.
6534
6535 2005-05-23  Martin Baulig  <martin@ximian.com>
6536
6537         * statement.cs (Try.DoResolve): Don't create a `finally' if we
6538         don't need to.  Fix #75014.
6539
6540 2005-05-20  Martin Baulig  <martin@ximian.com>
6541
6542         Merged r44808 from GMCS.
6543
6544         * class.cs (TypeContainer.CircularDepException): Removed.
6545         (TypeContainer.DefineType): Removed the `InTransit' stuff.
6546         (TypeContainer.CheckRecursiveDefinition): Check for circular class
6547         (CS0146) and interface (CS0529) dependencies here.
6548
6549 2005-06-21  Raja R Harinath  <rharinath@novell.com>
6550
6551         * expression.cs (Invocation.EmitCall): Fix initialization
6552         'this_call' to reflect current behaviour.  Fix indentation.
6553
6554         * convert.cs (FindMostEncompassedType): Add two trivial special
6555         cases (number_of_types == 0 || number_of_types == 1).
6556         (FindMostEncompasingType): Likewise.
6557
6558 2005-06-17  Raja R Harinath  <rharinath@novell.com>
6559
6560         Some cleanups preparing for the fix of #75283.
6561         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
6562         error testing.
6563         (EventExpr.InstanceResolve): Likewise.
6564         (EventExpr.DoResolve): Remove redundant checks.
6565
6566 2005-06-10  Duncan Mak  <duncan@novell.com>
6567
6568         * cs-tokenizer.cs (process_directives): New flag for controlling
6569         the processing of preprocessor directives.
6570         (x_token): After seeing a '#', return Token.NONE instead of going
6571         to handle_preprocessing_directive() when not processing
6572         directives. This avoids unnecessary processing during the token peek in
6573         is_punct().
6574
6575         This fixes #74939.
6576
6577         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
6578         the existing error reporting methods instead of Report.Error.
6579
6580         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
6581         after Raja's rewrite.
6582
6583 2005-06-08  Miguel de Icaza  <miguel@novell.com>
6584
6585         * class.cs: Small fix.
6586
6587 2005-06-08  Raja R Harinath  <rharinath@novell.com>
6588
6589         Fix #75160.
6590         * class.cs (GetPartialBases): Fix return value check of
6591         part.GetClassBases.
6592
6593 2005-06-07  Raja R Harinath  <rharinath@novell.com>
6594
6595         Ensure that partial classes are registered in their enclosing
6596         namespace.  Initial part of fix of #75160.
6597         * tree.cs (Tree.RecordDecl): Add new namespace argument.
6598         Register declspace with namespace here, not in
6599         DeclSpace.RecordDecl.
6600         * cs-parser.jay: Pass namespace to RecordDecl.
6601         * class.cs (PartialContainer.Create): Likewise.
6602         (ClassPart.DefineType): New sanity-check.  Throws an exception if
6603         called.
6604         * decl.cs (Declspace.RecordDecl): Remove.
6605         * namespace.cs (NamespaceEntry.DefineName): Remove.
6606
6607 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
6608
6609         * rootcontext.cs: Reset TargetExt as well.
6610
6611 2005-06-03  Raja R Harinath  <rharinath@novell.com>
6612
6613         * ecore.cs (Expression.Resolve): Emit CS0654 error when
6614         -langversion:ISO-1.
6615
6616 2005-06-02  Raja R Harinath  <rharinath@novell.com>
6617
6618         Fix #75080, cs0119.cs.
6619         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
6620         of ...
6621         (Expression.Resolve): ... this.  Use it.  Remove bogus code
6622         allowing ExprClass.Type and ExprClass.Namespace for
6623         ResolveFlags.VariableOrValue.
6624         (Expression.Resolve) [1-argument variant]: Change default resolve
6625         flags based on language version.
6626         (Expression.Error_UnexpectedKind): Use a simple string array
6627         rather than an ArrayList.
6628         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
6629         not ExprClass.Type.
6630         (TypeOfVoid.DoResolve): Likewise.
6631         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
6632         flags argument -- it always has the same value.
6633
6634 2005-05-31  Raja R Harinath  <rharinath@novell.com>
6635
6636         Fix #75081.
6637         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
6638         Use it in the error message.
6639         * assign.cs, expression.cs, statement.cs: Update.
6640
6641 2005-05-30  Raja R Harinath  <rharinath@novell.com>
6642
6643         Fix #75088.
6644         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
6645         the "almostMatchedMember" case too.
6646         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
6647         that failed the accessibility checks to 'almost_match'.
6648
6649 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
6650
6651         * attribute.cs: Use internal MethodBuilder methods to set
6652         ExactSpelling and SetLastError on PInvoke methods, instead
6653         of passing them via charset.  Fixes #75060.
6654
6655 2005-05-27  Raja R Harinath  <rharinath@novell.com>
6656
6657         * parameter.cs (Parameter): Remove TODO comment.
6658         (Parameter.DefineParameter): Remove Location parameter.
6659         (Parameters.LabelParameters): Likewise.
6660         * class.cs (Constructor.Emit): Update to change.
6661         (MethodData.Emit): Likewise.
6662         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
6663         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
6664
6665 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
6666
6667         * parameter.cs,
6668           Removed Parameters.Location and added Parameter.Location instead.
6669           Removed Location parameter from Emit() and GetSignature().
6670         * anonymous.cs,
6671           class.cs,
6672           cs-parser.jay,
6673           delegate.cs,
6674           iterators.cs,
6675           statement.cs :
6676           Modified all related calls.
6677
6678 2005-05-26  Raja R Harinath  <rharinath@novell.com>
6679
6680         Improve user-defined conversion handling.
6681         * convert.cs (GetConversionOperators): Rewrite.  Return only the
6682         applicable operators.
6683         (AddConversionOperators): New.  Helper for GetConversionOperators.
6684         (FindMostEncompassedType, FindMostEncompassingType): Verify that
6685         there is only one most encompassed/encompassing type.
6686         (FindMostSpecificSource, FindMostSpecificTarget): Remove
6687         "applicable operator" handling.
6688         (UserConversion): Move cache here from GetConversionOperators.
6689         Directly cache the chosen operator, rather than the whole
6690         MethodGroup.
6691         (ExplicitNumericConversion): Fix buggy implementation of Decimal
6692         case.  Allow conversion of decimal to sbyte and byte too.
6693         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6694         New static methods.  Used to avoid allocating EmptyExpressions in
6695         convert.cs.
6696
6697 2005-05-24  Duncan Mak  <duncan@novell.com>
6698
6699         * ecore.cs (CastFromDecimal): New class for casting a decimal to
6700         another class, used in Convert.ExplicitNumericConversion.
6701         (CastToDecimal): New class, similar to above, but casts to
6702         System.Decimal, used in Convert.ImplicitNumericConversion and also
6703         in explicit convesion from double/float to decimal.
6704
6705         * convert.cs (ImplicitNumericConversion): Handle implicit
6706         conversions to System.Decimal.
6707         (ExplicitNumericConversion): handle explicit conversions to
6708         System.Decimal.
6709
6710         This fixes #68711.
6711         
6712 2005-05-20  Miguel de Icaza  <miguel@novell.com>
6713
6714         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6715         know the type at this stage, just break through.   Fixes #75008 
6716
6717 2005-05-19  Martin Baulig  <martin@ximian.com>
6718
6719         * delegate.cs
6720         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6721         to disable error reporting.
6722
6723         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6724         here since we don't want to report an error; see the new test-336.cs.
6725
6726 2005-05-19  Raja R Harinath  <rharinath@novell.com>
6727
6728         * statement.cs (ToplevelBlock.GetParameterReference)
6729         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6730         Move here from class Block.
6731         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6732         * expression.cs (ParameterReference.DoResolveBase): Likewise.
6733
6734 2005-05-18  Martin Baulig  <martin@ximian.com>
6735
6736         Fix #74978.
6737
6738         * flowanalysis.cs
6739         (FlowBranching.Reachability): Add non-static public And() and Or()
6740         methods.
6741         (FlowBranchingSwitch): New class; do the `break_origins' thing
6742         like in FlowBranchingLoop.
6743         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6744         reachability, not just locals and parameters.
6745         (FlowBranching.MergeChild): Remove some of the hacks for loop and
6746         switch; MergeBreakOrigins() now takes care of that.
6747
6748 2005-05-18  Martin Baulig  <martin@ximian.com>
6749
6750         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6751         a loop and may leave it, reset the barrier; fixes #74974.
6752
6753 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
6754         
6755         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6756         is back.
6757         
6758         * cs-parser.jay: Catch more lexical errors.
6759         
6760         * report.cs: Add one more Error method.
6761         
6762         * rootcontext.cs,
6763         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6764
6765 2005-05-17  Martin Baulig  <martin@ximian.com>
6766
6767         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6768         #70970. 
6769
6770 2005-05-16  Raja R Harinath  <rharinath@novell.com>
6771
6772         Fix test-382.cs.  Emit values of decimal constants.
6773         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6774         Carved out of ...
6775         (TypeContainer.AddField): ... this.
6776         (TypeContainer.EmitFieldInitializers): Allow the list of fields
6777         with initializers to include 'Const's.
6778         (ClassPart.RegisterFieldForInitialization): Forward to
6779         PartialContainer.
6780         * const.cs (Const.Const): Pass initializer to base class.
6781         (Const.Define): In case of decimal constants, register them for
6782         initialization in a static constructor.
6783
6784 2005-05-14  Martin Baulig  <martin@ximian.com>
6785
6786         * statement.cs (Block.Resolve): Correctly handle unreachable code;
6787         do not call ResolveUnreachable() on unreachable statements in
6788         here, see the comment in the source code.
6789
6790 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6791
6792         Fix #74934.
6793         * expression.cs (BinaryResolveOperator): If one of the operands of
6794         an equality comparison is 'null' and the other is a pointer type,
6795         convert the null to a NullPointer.
6796         * convert.cs (ImplicitReferenceConversion): If the expression is a
6797         NullLiteral and the target type is a pointer type, return a
6798         NullPointer instead.
6799         (ImplicitConversionStandard): Likewise.
6800
6801 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
6802         
6803         * cs-parser.jay: Set readonly context based on special constructs.
6804         
6805         * expression.cs (LocalVariableReference.DoResolveBase): Improved
6806         readonly variable error handling.
6807         
6808         * rootcontext.cs (EmitCode): Don't verify members when error
6809         occurred.
6810         
6811         * statement.cs (LocalInfo): Add reaodnly context information.
6812         (SetReadOnlyContext, GetReadOnlyContext): New methods.
6813
6814 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6815
6816         * statement.cs (Block.Resolve): Revert change below.  Modify fix
6817         for #74041 to initialize 'resolved' to false only for explicit
6818         blocks.  Fixes #74873.
6819
6820 2005-05-12  Raja R Harinath  <harinath@gmail.com>
6821
6822         Fix #74920.
6823         * typemanager.cs (unmanaged_enclosing_types): New.
6824         (IsUnmanagedType): Avoid infloops by using
6825         'unmanaged_enclosing_types' to talk with recursive invocations.
6826
6827 2005-05-13  Martin Baulig  <martin@ximian.com>
6828
6829         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6830         instance variable, not a local.  Fix #74873.
6831         (Block.ResolveUnreachable): Set it to true here.
6832
6833 2005-05-11  Duncan Mak  <duncan@novell.com>
6834
6835         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6836         continuing to process for 'arg'.
6837         (handle_preprocessing_directive): Check the argument of the #endif
6838         directive and report error CS1025 if there are any trailing
6839         characters.
6840
6841         According to the C# spec, having even whitespace after the #endif
6842         directive is illegal; however, because we call arg.TrimEnd ()
6843         beforehand, we have the same behavior as csc, allowing whitespace
6844         after the directive.
6845
6846         Fixes #74892.
6847
6848 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
6849
6850         Fix #74863.
6851         
6852         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6853         (Constructor.GetObsoleteAttribute): Implemented correctly.
6854
6855 2005-05-10  Martin Baulig  <martin@ximian.com>
6856
6857         * support.cs (ReflectionParameters.ParameterModifier): Use
6858         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6859         and `ParameterAttributes.In'.  Fixes #74884.
6860
6861 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
6862
6863         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6864         
6865         * expression.cs (Argument.GetParameterModifier): Turned to property.
6866         (Invocation.Error_InvalidArguments): Add more descriptive errors.
6867         
6868         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6869         its C# equivalent.
6870         
6871 2005-05-09  Raja R Harinath  <rharinath@novell.com>
6872
6873         Fix #74852.
6874         * decl.cs (MemberCache.AddMethods): Register override methods,
6875         rather than non-override methods.
6876         * typemanager.cs (RegisterOverride): New.
6877         (IsOverride): Update.
6878
6879 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
6880
6881         Fix #73105.
6882         
6883         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6884         recursive declaration.
6885         
6886         * statement.cs (Block.ResolveMeta): Report any error in resolving.
6887         
6888 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
6889
6890         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6891         
6892         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6893
6894 2005-05-05  Raja R Harinath  <rharinath@novell.com>
6895
6896         Fix #74797.
6897         * decl.cs (DeclSpace.FamilyAccessible): 
6898         Use TypeManager.IsNestedFamilyAccessible.
6899
6900         Fix reopened #64812.
6901         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6902         internal'.
6903
6904 2005-05-04  Raja R Harinath  <rharinath@novell.com>
6905             Abin Thomas  <projectmonokochi@rediffmail.com>
6906             Anoob V E  <projectmonokochi@rediffmail.com>
6907             Harilal P R  <projectmonokochi@rediffmail.com>
6908
6909         Fix #64812.
6910         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6911         allow access to all static members.
6912
6913 2005-05-04  Martin Baulig  <martin@ximian.com>
6914
6915         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6916
6917 2005-05-04  Martin Baulig  <martin@ximian.com>
6918
6919         Fix #74655.
6920
6921         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6922         section at the end; make things work if `default' is not the last
6923         section.        
6924
6925 2005-05-04  Martin Baulig  <martin@ximian.com>
6926
6927         Fix #70400.
6928
6929         * statement.cs (Switch): Replaced the `got_default' field with a
6930         `default_section' one.
6931         (Switch.CheckSwitch): Set `default_section' here.
6932         (Switch.Resolve): If we're a constant switch and the constant is
6933         not found, use the default section.
6934
6935 2005-05-03  Martin Baulig  <martin@ximian.com>
6936
6937         * expression.cs (ArrayAccess.EmitGetLength): New public method.
6938
6939         * statement.cs (Foreach.ArrayForeach): New nested class.
6940         (Foreach.TemporaryVariable): New nested class.
6941         (Foreach.EmitArrayForeach): Removed; this is now in the new
6942         ArrayForeach class.
6943
6944 2005-05-03  Raja R Harinath  <rharinath@novell.com>
6945
6946         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
6947         more conservative.
6948         (VerifyPendingMethods): Revert change below.
6949
6950         * typemanager.cs (IsOverride, RegisterNonOverride): New.
6951         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6952         that used to trigger warning -28.  Remove warning -28.
6953         * expression.cs (Invocation.OverloadResolve): Use
6954         TypeManager.IsOverride to distinguish override methods.
6955
6956         Fix #74773.
6957         * pending.cs (VerifyPendingMethods): If a base type implements the
6958         requested interface, don't bother checking individual methods of
6959         the base type.  As a side-effect, this prevents the creation of
6960         unnecessary proxies.
6961
6962 2005-05-02  Martin Baulig  <martin@ximian.com>
6963
6964         Fix #70182.
6965
6966         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6967         Also `And' the locals if the old vector is null.
6968         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6969         null; in this case we basically reset all the variables.        
6970
6971 2005-05-02  Martin Baulig  <martin@ximian.com>
6972
6973         Fix #74529.
6974
6975         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6976         Added `FlowBranching branching' argument; always `and' the
6977         variables instead of `or'ing them unless we're an infinite loop.
6978
6979         * statement.cs (While.Resolve): Create a new sibling unless we're
6980         infinite.       
6981
6982 2005-05-02  Martin Baulig  <martin@ximian.com>
6983
6984         Fix #70140.
6985
6986         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6987         arguments; use it instead of creating a new TopLevelBlock.
6988         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6989         our ConstructorInitializer.
6990
6991         * statement.cs
6992         (TopLevelBlock.TopLevelBranching): New public property.
6993         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6994         and create our `TopLevelBranching'.
6995
6996         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6997         anonymous method host, use `block.TopLevelBranching' rather than
6998         creating a new branching.
6999
7000 2005-04-20  Miguel de Icaza  <miguel@novell.com>
7001
7002         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
7003         a ScopeInfo, if any of the current children is a child of the new
7004         entry, move those children there.
7005
7006 2005-04-30  Martin Baulig  <martin@ximian.com>
7007
7008         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
7009         at the beginning of a SwitchSection.  Fix #73335.
7010
7011 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
7012
7013         Fix #74378
7014         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
7015         
7016         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
7017         (FieldExpr.DoResolve): Obsolete members are ignored for field
7018         initializers.
7019         
7020 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
7021
7022         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
7023         of arrays detection.
7024
7025         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
7026         verification.
7027         (Field.VerifyClsCompliance): Volatile fields are not compliant.
7028
7029         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
7030         arrays report.
7031
7032 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
7033
7034         * cs-parser.jay: Use the prefered version of -unsafe in error
7035         message.
7036
7037 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
7038
7039         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
7040         circumstances.
7041
7042 2005-04-20  John Luke  <john.luke@gmail.com>
7043
7044         * driver.cs: fix typo in error message, --outout to --output
7045
7046 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
7047
7048         * codegen.cs (InRefOutArgumentResolving): New field.
7049         
7050         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
7051         fields outside contructor.
7052         
7053         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
7054         
7055 2005-04-19  Miguel de Icaza  <miguel@novell.com>
7056
7057         * anonymous.cs (CaptureContext.EmitParameterInstance): The
7058         parameter code was not completed ever, so it was not as up-to-date
7059         as local variables.  Must finish it.
7060
7061         The bug fix was to compare the Toplevel of the block, not the
7062         current block.  Thanks for Ben for pointing this out. 
7063
7064 2005-04-19  Raja R Harinath  <rharinath@novell.com>
7065
7066         * decl.cs (AddMethods): Use the declaring type of the problem
7067         method to determine if we want to squash a warning.
7068
7069 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
7070
7071         * attribute.cs: Removed debug output.
7072
7073         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
7074         
7075         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
7076         Report.Stderr.
7077         
7078 2005-04-18  Raja R Harinath  <rharinath@novell.com>
7079
7080         Fix #74481.
7081         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
7082         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
7083         all null comparisons against reference types.
7084
7085 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
7086
7087         Fix# 74565
7088         * class.cs (TypeContainer.CircularDepException) New nested
7089         exception class.
7090         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
7091         (TypeContainer.DefineType): Removed error, reset InTransit before
7092         exit.
7093         (Class.DefineType): Throw exception when is in Transit.
7094         Catch exception and report error.
7095         (Struct.DefineType): Throw exception when is in Transit.
7096         Catch exception and report error.
7097         (Interface.DefineType): Throw exception when is in Transit.
7098         Catch exception and report error.
7099
7100         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
7101         handle nested exception handlers.
7102
7103         * flowanalysis.cs (InTryWithCatch): New method, search for try with
7104         a catch.
7105
7106         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
7107         InFinally and InCatch storage.
7108
7109         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
7110         (Catch.Resolve): Set and Restore ec.InCatch.
7111         (Try.Resolve): Set and Restore ec.InFinally.
7112         (Try.HasCatch): True when try has catch.
7113
7114 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
7115
7116         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
7117           for the same event member, so exclude such cases from warning 419.
7118           Fixed bug #74633.
7119
7120 2005-04-16  Miguel de Icaza  <miguel@novell.com>
7121
7122         * expression.cs (Binary.ResolveOperator): Apply patch from John
7123         Luke to fix bug 59864: operators &, | and ^ on enumerations
7124         require that the same enum type on both sides.
7125
7126         * driver.cs: Add warnings to old flag usage, this is to assist
7127         people who produce Makefiles and hope that the Makefiles will be
7128         used on Windows.
7129
7130         * class.cs (TypeContainer.EmitType): Moved the definition of the
7131         special $PRIVATE$ field from the resolve phase to the Emit phase.
7132         During resolve we do not know if we are a struct with
7133         HasExplicitLayout, we know this only after the attributes for the
7134         type are emitted.
7135
7136         Set the FieldOffset to zero on the dummy field that we create for
7137         the class.   Fixes 74590.
7138
7139 2005-04-16  Raja R Harinath  <rharinath@novell.com>
7140
7141         Fix #73834.
7142         * ecore.cs (PropertyExpr.resolved): New.
7143         (DoResolve): Use it to handle a case of double resolution here.
7144         Handle a case of identical-name-and-type-name.
7145         * expression.cs (ArrayCreation.CheckIndices): Avoid double
7146         resolution by storing the results of expression resolution back
7147         into the "probes" array.
7148
7149 2005-04-15  Raja R Harinath  <rharinath@novell.com>
7150
7151         Fix cs0208-7.cs and cs0208-8.cs.
7152         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
7153         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
7154         error reporting to point out the reason a struct is not unmanaged.
7155
7156 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7157
7158         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
7159           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
7160
7161 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7162
7163         Fix #74528.
7164         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
7165         IdenticalNameAndTypeName here.
7166         (EventExpr.InstanceResolve): Likewise.
7167
7168 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
7169
7170         C# 2.0 DefaultCharSetAttribute implementation
7171         
7172         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
7173         which allows us to set GlobalNamespace for every resolve.
7174         (Attribute.ResolveArguments): Cut from Resolve.
7175         (Attribute.GetCharSetValue): Returns CharSet named argument.
7176         (Attribute.DefinePInvokeMethod): Gets default charset from
7177         module settings.
7178         (GlobalAttribute.ResolveAsTypeStep): Override.
7179         (GlobalAttribute.ResolveArguments): Override.
7180         
7181         * class.cs (TypeAttr): Is protected.
7182         
7183         * codegen.cs (ModuleClass.DefaultCharSet): New member.
7184         (ModuleClass.DefaultCharSetType): New memeber.
7185         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
7186         
7187         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
7188         charset from module.
7189         
7190         * delegate.cs (TypeAttr): Override.
7191         (Delegate.DefineType): Use this TypeAttr.
7192         
7193         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
7194         at very early stage (before types are defined) to resolve model
7195         module attributes. It will probably not work with corlib but it
7196         should be ok.
7197         
7198         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
7199         charset from module.
7200         
7201         * typemanager.cs (default_charset_type): New type.
7202
7203 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7204
7205         * decl.cs (MemberCache.AddMethods): Don't warn if
7206         System.Object.Finalize has buggy MethodAttributes.
7207
7208         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
7209         removed below.
7210
7211 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7212
7213         * doc.cs : detect ambiguous reference to overloaded members.
7214           Fixed bug #71603. MS 1.1 csc does not detect it.
7215
7216 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7217
7218         * doc.cs : delegates must not be referenced with parameters.
7219           Fixed bug #71605.
7220
7221 2005-04-12  Miguel de Icaza  <miguel@novell.com>
7222
7223         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
7224
7225 2005-04-10  Miguel de Icaza  <miguel@novell.com>
7226
7227         * driver.cs (MainDriver): Stop processing if the CLS stage found
7228         errors. 
7229
7230         (CompilerCallableEntryPoint.InvokeCompiler): Always
7231         reset after execution;   Take a TextWriter argument for the
7232         output.
7233
7234         * report.cs: Use the error stream instead of hardcoding stderr. 
7235
7236 2005-04-09  Miguel de Icaza  <miguel@novell.com>
7237
7238         * class.cs: Reduce code paths to test, too small of an
7239         optimization to make it worth the extra testing.  Always perform
7240         it. 
7241
7242 2005-04-08  Raja R Harinath  <rharinath@novell.com>
7243
7244         Fix #74510.
7245         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
7246         operators that had errors reported on them.
7247
7248 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
7249
7250         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
7251         argument types.
7252         (Attribute.Resolve): Add named argument type checking.
7253         
7254         * class.cs (FixedField.Define): Use IsPrimitiveType
7255         
7256         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
7257         
7258         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
7259         unsafe parameter types.
7260         
7261         * statement.cs (Using.ResolveExpression): Add better error description.
7262         
7263         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
7264         
7265 2005-04-08  Raja R Harinath  <rharinath@novell.com>
7266
7267         Fix #74484.
7268         * attribute.cs (Attribute.GetAttributeUsage): Resolve
7269         AttributeUsageAttribute in the emitcontext of the attribute class,
7270         not in the emitcontext of the attributable entity it was attached to.
7271         * cs-parser.jay: Use 'current_class', not 'current_container',
7272         when creating a GlobalAttribute.
7273
7274 2005-04-08  Alp Toker  <alp@atoker.com>
7275
7276         * pending.cs: The fix to #58413 failed to compile methods implementing
7277         interfaces with/without params modifiers and vice versa, even though
7278         params modifiers aren't part of the signature. Make the modifier check
7279         less strict as in csc.
7280
7281 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
7282             Anoob V E  <projectmonokochi@rediffmail.com>
7283             Harilal P R  <projectmonokochi@rediffmail.com>
7284
7285         Fix #58413.
7286         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
7287         modifiers of pending methods.
7288         (PendingImplementation.PendingImplementation): Initialize it.
7289         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
7290         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
7291         with ParameterData.  Add check for modifiers.
7292         * class.cs (MethodData.Define): Update to changes.
7293
7294 2005-04-07  Raja R Harinath  <rharinath@novell.com>
7295
7296         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
7297
7298 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
7299
7300         * class.cs (PropertyMethod.Define): Check private accessor in abstract
7301         property.
7302         
7303         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
7304         
7305         * rootcontext.cs,
7306         * typemanager.cs: Registered RequiredAttributeAttribute.
7307         
7308 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
7309
7310         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
7311         Warning CS0169 is back at level 3.
7312         (IMethodData.SetMemberIsUsed): New method.
7313         
7314         * decl.cs (IsUsed): New value; moved from FieldBase.Status
7315         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
7316         
7317         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
7318
7319         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
7320         contants.
7321         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
7322         is used.
7323         
7324         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
7325         is used.
7326         
7327         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
7328         to avoid the problems with nested types.
7329
7330 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
7331             Anoob V.E  <projectmonokochi@rediffmail.com>
7332             Harilal P.R  <projectmonokochi@rediffmail.com>
7333             Raja R Harinath  <rharinath@novell.com>
7334
7335         Fix #73820.
7336         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
7337         attribute.
7338         * typemanager (GetConstructor): Make public.
7339
7340 2005-04-05  John Luke  <john.luke@gmail.com>
7341             Raja R Harinath  <rharinath@novell.com>
7342
7343         Fix #62232.
7344         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
7345         struct too.  Return false quicker in a few cases.
7346         (VerifyUnManaged): Use it.
7347
7348 2005-04-05  Raja R Harinath  <rharinath@novell.com>
7349
7350         Fix #74041.
7351         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
7352         not 'unreachable_seen'.
7353
7354 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
7355
7356         * attribute.cs (Attribute.GetValue): Removed unused.
7357         
7358         * codegen.cs (CodeGen.TrimExt): Removed unused.
7359         
7360         * cs-parser.jay (output): Removed unused.
7361         
7362         * cs-tokenizer.cs (hex_digits): Removed unused.
7363         
7364         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
7365         
7366         * expression.cs (Indirection.LoadExprValue): Removed unused.
7367         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
7368         
7369         * iterators.cs (Iterator.param_types): Removed unused.
7370         
7371         * statement.cs (Goto.block): Removed unused.
7372         (ToplevelBlock.did): Removed unused.
7373         (Switch.ResolveConstantSwitch): Removed unused.
7374
7375 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
7376
7377         * rootcontext.cs: Allow mcs to bootstrap with the compilation
7378         resetting thingy.
7379
7380 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7381
7382         Fix #74232 and cs0208-3.cs.
7383         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
7384         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
7385         unmanaged type.  Don't use FieldBuilders when 't' is a
7386         TypeBuilder.  Use ModFlags and MemberType fields.
7387         * class.cs (MemberBase.member_type): Rename from MemberType.
7388         (MemberBase.MemberType): New property.  Determines member_type on
7389         demand.
7390         (MemberBase.DoDefine): Don't initialize MemberType here.
7391         (FieldMember.Define): Likewise.
7392
7393 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
7394
7395         Fix #74241
7396         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
7397         Attributes are emitted there.
7398         
7399 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7400
7401         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
7402         keyword in 'partial enum' too.
7403         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
7404         is not allowed).
7405         Report from Kamil Skalski <nazgul@omega.pl>.
7406
7407         Fix #74309.
7408         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
7409         have partial containers too.
7410
7411         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
7412         in block' checks to Block.CheckInvariantMeaningInBlock.
7413         * statement.cs (Block.GetKnownVariableInfo): Make private.
7414         (Block.IsVariableUsedInChildBlock): Remove.
7415         (Block.IsVariableUsedInBlock): Likewise.
7416         (Block.CheckInvariantMeaningInBlock): New.  Show location of
7417         conflicting declaration.
7418         (Block.AddVariable): Make error messages less long-winded and more
7419         specific.  Show location of conflicting declaration.
7420         * parameter.cs (Parameters.Location): New readonly property.
7421
7422 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7423
7424         Clean up semantics of invoking ResolveMemberAccess.
7425         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
7426         can have an instance, ensure that we pass in a non-TypeExpression
7427         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
7428         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
7429         argument.  Update to changes and simplify.
7430         (FieldExpr.Emitinstance): Remove CS0120 check.
7431         (PropertyExpr.EmitInstance): Likewise.
7432         * expression.cs (Argument.Resolve): Likewise.
7433         (Invocation.DoResolve): Update to changes in semantics of
7434         InstanceExpression.
7435
7436 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
7437
7438         Fix #74241
7439         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
7440         customization.
7441         
7442         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
7443
7444 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7445
7446         Fix difference in behaviour with commandline invocation.
7447         * driver.cs (Driver.Reset): New.
7448         (CompilerCallableEntryPoint): Call it.
7449
7450         * statement.cs (If.Resolve): Avoid spurious "uninitialized
7451         variable" warnings if the boolean expression failed to resolve.
7452
7453 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
7454
7455         * attribute.cs: Fix the union of several permissions when some of them
7456         are unrestricted (so the result isn't an unrestricted permission set).
7457         Fix #74036.
7458
7459 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7460
7461         * ecore.cs (MemberExpr): New class.  Convert from interface
7462         IMemberExpr.
7463         (MemberExpr.ResolveMemberAccess): Refactor and move here from
7464         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
7465         error checks.
7466         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
7467         (MethodGroupExpr.IsExplicitImpl): Remove.
7468         (Expression.GetFieldFromEvent): Remove.
7469         (SimpleName.MemberStaticCheck): Remove.
7470         (SimpleName.DoSimpleNameResolve): Update to changes.
7471         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
7472         (MemberAccess.IdenticalNameAndTypeName): Remove.
7473         (MemberAccess.error176): Move to MemberExpr.
7474         (MemberAccess.DoResolve): Update to changes.
7475         (BaseAccess.DoResolve): Likewise.
7476
7477 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
7478
7479         C# 2.0 Conditional attribute class implementation
7480         
7481         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
7482         Analyzes class whether it has attribute which has ConditionalAttribute
7483         and its condition is not defined.
7484         
7485         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
7486         (Class.IsExcluded): New method. Search for at least one defined
7487         condition in ConditionalAttribute of attribute class.
7488
7489 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7490
7491         * ecore.cs (PropertyExpr): Derive from Expression, not
7492         ExpressionStatement.
7493         (PropertyExpr.EmitStatement): Remove.
7494
7495 2005-03-29  Raja R Harinath  <rharinath@novell.com>
7496
7497         Fix #74060.
7498         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
7499         internal field "value__" of an enum be private.  The examples for
7500         "value__" that I found on MSDN all used FieldAttributes.Private.
7501
7502         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
7503         Don't mention IL method attribute names.
7504
7505         Fix #47991.  Remove a TODO.
7506         * statement.cs (Block.Toplevel): Make into a field.
7507         (Block.Parameters): Move into ToplevelBlock.
7508         (Block.known_variables): Rename from child_variable_names.
7509         (Block.Block): Remove variants that take Parameters.  Initialize
7510         'Toplevel' with the immediately surrounding toplevel block.
7511         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
7512         LocalInfo parameter.
7513         (Block.GetKnownVariableInfo): New.
7514         (Block.IsVariableNameUsedInChildBlock): Update.
7515         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
7516         the block, even though it may not be in scope.
7517         (Block.AddVariable): Remove Parameters parameter.  Use
7518         Toplevel.Parameters instead.
7519         (Block.AddConstant): Remove Parameters parameter.
7520         (Block.GetParameterReference): Update to use Toplevel.Parameters.
7521         (Block.IsParamaterReference): Likewise.
7522         (Block.IsLocalParameter): Likewise.  Simplify a lot.
7523         (ToplevelBlock.Parameters): New.  Moved from Block.
7524         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
7525         initialize Parameters to a non-null value.
7526         * cs-parser.jay: Update to changes.
7527         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
7528         simple names that mean different things in the same block.  Use
7529         Block.IsVariableNameUsedInBlock.
7530
7531 2005-03-28  Raja R Harinath  <rharinath@novell.com>
7532
7533         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7534         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7535         GetTypeHandle.  It is possible for a reflected type to derive from
7536         a TypeBuilder (e.g., int[] derives from the TypeBuilder
7537         System.Array during mscorlib compilation).
7538         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7539         contain a method_hash, don't create one either.  Don't create a
7540         deep copy of the base cache's method_hash.
7541         (MemberCache.SetupCache): Rename back from DeepCopy.
7542         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7543         already initialized.  If we see an override function, add its
7544         underlying base virtual function to the member_hash too.
7545
7546         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
7547
7548 2005-03-26  Raja R Harinath  <harinath@acm.org>
7549
7550         Fix #73038.
7551         * assign.cs (Assign.DoResolve): When the RHS of an assignment
7552         fails to resolve, ensure that the LHS is still resolved as an
7553         lvalue.
7554
7555 2005-03-25  Raja R Harinath  <harinath@acm.org>
7556
7557         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
7558         ec.ContainerType.
7559         (Enum.current_ec): Remove.
7560         (Enum.LookupEnumValue): Remove EmitContext argument.
7561         Just uses the one created during DefineType.
7562         (Enum.FindMembers): Update.
7563         * expression.cs (MemberAccess.DoResolve): Update.
7564
7565 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
7566
7567         * assign.cs (Assign.DoResolve): Check for CS1717 when
7568         source and target are same (uses Equals).
7569
7570         * expression.cs (LocalVariableReference, ParameterReference,
7571         This): Implemented Equals, GetHashCode.
7572
7573         * statement.cs (Block.GetParameterReference): Removed useless
7574         local variable.
7575
7576 2005-03-22  Raja R Harinath  <rharinath@novell.com>
7577
7578         Fix cs0128.cs
7579         * statement.cs (Block.AddVariable): Ensure that we skip implicit
7580         blocks before deciding whether the error is cs0136 or cs0128.
7581
7582         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
7583         (using_alias_directive, using_namespace_directive): Pass
7584         MemberName, not an expression to Namespace.UsingAlias and
7585         Namespace.Using.
7586         (MakeName): Use the MemberName of the namespace.
7587         * namespace.cs (Namespace.MemberName): New.
7588         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
7589         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
7590         Likewise.
7591         * decl.cs (MemberName.Name): Make readonly.
7592         (MemberName.FromDotted): New "constructor".
7593         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
7594         (MemberCore.Name): Compute from MemberName on demand.
7595         (MemberCore.SetMemberName): Provide a way to change the
7596         MemberName.
7597         (MemberCore.AddToContainer): Don't take a fullname parameter.
7598         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
7599         fully qualified name of the container to the member name.
7600         (TypeContainer.AddToTypeContainer): Use a fully qualified name
7601         only if the type is a member of the root container.
7602         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
7603         MemberName.Left rather than searching for an embedded ".".
7604         (PartialContainer.CreatePart): Update to changes in RootContext.
7605         (MemberBase.ShortName): Turn into a property.  Use
7606         MemberCore.SetMemberName.
7607         (MemberBase.ExplicitInterfaceName): Remove.
7608         (MemberBase.UpdateMemberName): Remove.
7609         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
7610         (PropertyBase.SetMemberName): New override.
7611         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
7612         (Tree.GetDecl): New.
7613         (Tree.AllDecls): Rename from Decls.
7614         * attribute.cs, enum.cs, report.cs: Update to changes.
7615         * driver.cs (MainDriver): Use MemberName.FromDotted on
7616         RootContext.MainClass.
7617
7618 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
7619
7620         * class.cs (FixedField.Define): Check for CS1664 and more sanity
7621         checks.
7622
7623         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
7624
7625 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
7626
7627         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
7628         property accessor modifiers.
7629
7630         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
7631         fixed buffer attribute (CS1716).
7632         (PropertyMethod.HasCustomAccessModifier): When property accessor
7633         has custom modifier.
7634
7635         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
7636         modifiers.
7637         (PropertyExpr.DoResolveLValue): Add CS0272.
7638
7639 2005-03-17  Miguel de Icaza  <miguel@novell.com>
7640
7641         * convert.cs: When converting to a pointer, use the proper Conv.U
7642         or Conv.I depending on the source data type.
7643
7644         * cs-tokenizer.cs: Make the size for large decimal constants,
7645         fixes #72957.
7646
7647 2005-03-17  Martin Baulig  <martin@ximian.com>
7648
7649         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7650         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7651
7652 2005-03-17  Martin Baulig  <martin@ximian.com>
7653
7654         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7655         to bool so we can return an error condition.
7656         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7657         returned an error.
7658
7659 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
7660
7661         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
7662         attributes.
7663
7664 2005-03-16  Raja R Harinath  <rharinath@novell.com>
7665
7666         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
7667         Refactor to avoid traversing the list of assemblies, and to avoid
7668         string concatenation.
7669         * typemanager.cs (guid_attr_type): Remove.
7670         (negative_hits, pointers, references): Remove hashes.
7671         (type_hash): New.
7672         (GetConstructedType): New.  Uses type_hash to handle constructed
7673         types (arrays, references, pointers).
7674         (GetReferenceType, GetPointerType): Use it.
7675         (GetNestedType): New.  Uses type_hash to handle nested types of
7676         reflected types.
7677         (LookupType, LookupTypeDirect): Remove.
7678         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
7679         'types' hash and LookupTypeReflection directly.
7680         (params_string, params_object): Use GetConstructedType.
7681         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
7682         top-level types.
7683         (Namespace.Lookup): Use cached_types.
7684         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7685         provided by old TypeManager.LookupType.
7686         * rootcontext.cs (MakeFQN): Remove.
7687         * decl.cs (DeclSpace.MakeFQN): Likewise.
7688         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7689         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7690         TypeManager.GetConstructedType.
7691         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7692
7693 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
7694
7695         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7696         indexers.
7697
7698         * cs-parser.jay: Reports CS1527 for any namespace element.
7699
7700         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7701         Added CS0407.
7702
7703         * expression.cs (ParameterReference.IsAssigned): Changed error to
7704         CS0269.
7705         (Error_WrongNumArguments): Moved CS0245 detection here.
7706
7707         * statement.cs (Return.Resolve): Add CS1622 report.
7708
7709 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
7710
7711         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7712
7713 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
7714
7715         * attribute.cs expression.cs: Get rid of some allocations.
7716
7717 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
7718
7719         * doc.cs : just eliminate the latest change.
7720
7721 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7722
7723         * doc.cs : commented out the latest change. It breaks xml-030.cs
7724
7725 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7726
7727         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7728           fail. So invoke CreateType() in FindDocumentedType().
7729
7730 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7731
7732         * cs-tokenizer.cs : added IsKeyword().
7733         * doc.cs : Detect keyword incorrectly used as identifier.
7734           Allow identifiers prefixed by @.
7735
7736 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
7737
7738         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7739         It caused exception in namespace resolving (again!).
7740         
7741         * class.cs (Class.ctor): Removed exit.
7742         (PropertyMethod.ctor): ditto.
7743         
7744         * codegen.cs (Codegen.Reset): Reset static data.
7745         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7746         
7747         * cs-tokenizer.cs (Cleanup): Removed.
7748         
7749         * driver.cs (GetSystemDir): Rewrote to one line command.
7750         It caused problem with unloaded dynamic modules.
7751         (UnixParseOption): Removed Exit.
7752         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7753         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7754         Now can be mcs used as library.
7755         
7756         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7757         empty location.
7758         
7759         * location.cs (Reset): Reset static data.
7760         
7761         * namespace.cs (Reset): Reset static data.
7762         
7763         * report.cs (Report.Reset): Reset static data.
7764         
7765         * rootcontext.cs (RootContext.Reset): Reset static data.
7766         
7767         * tree.cs (RootTypes.ctor): Use Location.Null
7768         
7769         * typemanager.cs (TypeManager.Reset): Reset static data.
7770         (CoreLookupType): Removed Exit.
7771         (TypeHandle.Reset): Reset static data.
7772         
7773 2005-03-10  Raja R Harinath  <rharinath@novell.com>
7774
7775         Fix #73516.
7776         * typemanager.cs (ComputeNamespaces): Import namespaces from
7777         referenced modules too.
7778
7779 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7780
7781         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7782         than '.'.
7783
7784 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7785
7786         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7787         enclosing DeclSpace.  This ensures that a name-lookup populates
7788         more caches and there are fewer 'TypeExpression's.  Carve out
7789         nested type lookup into ...
7790         (LookupNestedTypeInHierarchy): ... this.
7791
7792 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7793
7794         Clean up a few partial-class semantics.  
7795         Fixes test-357.cs and cs1618-2.cs.
7796         * cs-parser.jay (struct_declaration): Use 'current_class' as
7797         parent of newly-created struct.  Remove call to Register ().
7798         Use 'pop_current_class' to complete handing the current struct.
7799         (interface_declaration): Likewise.
7800         (class_declaration): Likewise.
7801         (enum_declaration): Use 'current_class' as parent of newly created
7802         enum.
7803         (delegate_declaration): Likewise.
7804         (pop_current_class): New function.  This is used to handle closing
7805         up the 'current_class' and 'current_container', and pointing them
7806         to the enclosing class/container.
7807         (CSharpParser): Initialize 'current_class' too.
7808         * decl.cs (MemberCore): Add check for invariant: a partial
7809         container is not a parsed entity, and thus does not enclose any
7810         parsed members.
7811         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7812         (DeclSpace.BaseTypeExpr): Use it.
7813         (DeclSpace.LookupType): Add check for invariant.
7814         * class.cs (TypeContainer): Add check for invariant: a nested
7815         class should have the same NamespaceEntry as its enclosing class.
7816         (TypeContainer.EmitFieldInitializers): Make virtual.
7817         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7818         MemberCore.
7819         (TypeContainer.Register): Remove.
7820         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7821         null.  Use TypeResolveEmitContext for resolving base types and
7822         interfaces.  Move initialization of Parts.TypeBuilder here from
7823         ...
7824         (TypeContainer.DefineNestedTypes): ... here.
7825         (PartialContainer): Take a Namespace not a NamespaceEntry.
7826         (PartialContainer.Create): Don't use Register.  Call the
7827         appropriate Add... function directly.
7828         (ClassPart): Take both the PartialContainer and the enclosing
7829         class as constructor arguments.
7830         (ClassPart.EmitFieldInitializers): Override.
7831         (ClassPart.PartFindNestedTypes): Remove.
7832         (FieldBase.GetInitializerExpression): Resolve the initializer
7833         expression in the emit context of the enclosing class.
7834         * tree.cs (RootTypes): Remove Register ().
7835         
7836 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
7837
7838         * cs-parser.jay: Removed CS0134.
7839         
7840         * driver.cs: Removed CS1901.
7841         
7842         * expression.cs (SizeOf.DoResolve): Don't report CS0233
7843         for predefined types.
7844
7845 2005-03-07  Duncan Mak  <duncan@novell.com>
7846
7847         * codegen.cs (Save):  Catch UnauthorizedAccessException as
7848         well. Fixes bug #73454.
7849
7850 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
7851
7852         * cs-tokenizer.cs (xtoken): Add CS1035.
7853         
7854         * class.cs (MethodData.Define): Add CS0683.
7855         (FieldMember.ctor): Add CS0681.
7856
7857 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7858
7859         * ecore.cs (SimpleName.DoResolve): Rename from
7860         SimpleName.DoResolveAllowStatic.
7861         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7862         Pass 'intermediate' flag to MemberStaticCheck.
7863         (SimpleName.MemberStaticCheck): Skip "static check" only in case
7864         of "intermediate" lookups via MemberAccess.
7865         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
7866         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7867
7868 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7869
7870         Fix #73394.
7871         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7872         slipped in because of variable names that are identical to a
7873         builtin type's BCL equivalent ('string String;', 'int Int32;').
7874         (PropertyExpr.EmitInstance): Likewise.
7875
7876 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
7877
7878         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7879         
7880         * report.cs (warning_ignore_table): Made public.
7881
7882 2005-03-04  Raja R Harinath  <rharinath@novell.com>
7883
7884         Fix #73282.
7885         * class.cs (MethodData.Emit): Pass 'container' to
7886         container.GetObsoleteAttribute instead of 'container.Parent'.
7887
7888 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
7889
7890         * cs-parser.jay: Add 1534 error test.
7891
7892         * iterators.cs (Yield.CheckContext): Add error 1629.
7893         (Iterator.ctor): Save unsafe modifier.
7894         (MoveNextMethod.DoEmit): Restore unsafe context.
7895
7896         * namespace.cs (UsingAlias): Better error message.
7897
7898 2005-03-03  Dan Winship  <danw@novell.com>
7899
7900         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7901         the warning message [#73219]
7902
7903 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7904
7905         Fix compile with MCS 1.0.0.0.
7906         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7907         w_restore to not depend on string constant folding.
7908
7909 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7910
7911         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
7912         CS0246 check to users who passed 'silent = false'.
7913         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7914         check.
7915         (SimpleName.SimpleNameResolve): Update.
7916         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7917         (MemberAccess.IdenticalNameAndTypeName): Update.
7918         * doc.cs (FindDocumentedTypeNonArray): Update.
7919
7920 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
7921
7922         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7923         * parameters.cs (ComputeAndDefineParameters): Remove.
7924         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7925         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7926         Use GetParameterInfo.
7927
7928 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
7929
7930         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7931
7932 2005-03-02  Raja R Harinath  <rharinath@novell.com>
7933
7934         Unify DeclSpace.LookupType and DeclSpace.FindType.
7935         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
7936         is in charge of defining nested types on demand.
7937         (DeclSpace.LookupType): Use it when the current_type is a
7938         TypeBuilder.  Use LookupTypeDirect for reflected types.
7939         (DeclSpace.FindType): Remove.
7940         (DeclSpace.LookupInterfaceOrClass): Likewise.
7941         (DeclSpace.DefineTypeAndParents): Likewise.
7942         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7943         DeclSpace.LookupType.
7944         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7945         * typemanager.cs (LookupType): Simplify.
7946         (AddUserType): Remove type from negative_hits.
7947         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7948         * class.cs (TypeContainer.FindMembers): Move handling of nested
7949         types ...
7950         (TypeContainer.FindMembers_NestedTypes): ... here.
7951         (TypeContainer.FindNestedType): Implement override.
7952         (ClassPart.FindNestedType): Delegate to PartialContainer.
7953         (ClassPart.PartFindNestedType): Looks up the nested types of the
7954         part alone.
7955
7956 2005-03-02  Martin Baulig  <martin@ximian.com>
7957
7958         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7959         static constructor in static classes.
7960
7961 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7962
7963         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7964         sizeParamIndex is not specified.
7965
7966 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
7967
7968         Fix #73117
7969         * report.cs (WarningMessage.IsEnabled): Missing null check.
7970
7971 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7972
7973         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7974         in the fields and not in the properties.
7975
7976 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
7977
7978         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
7979         fields as well.
7980
7981 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7982
7983         * attribute.cs: Small refactoring (improved robustness).
7984         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7985         (ValidateGuid): Removed.
7986         (Resolve): Removed referenced to above mentioned.
7987         (GetAttributeUsage): Made private and changed to work without
7988         class assistance.
7989         (GetIndexerAttributeValue): Don't crash.
7990         (GetConditionalAttributeValue): Ditto.
7991         (GetClsCompliantAttributeValue): Ditto.
7992         (ExtractSecurityPermissionSet): All attributes exceptions are
7993         error 648.
7994         (GetPropertyValue): New helper.
7995         (GetMethodImplOptions): New method.
7996         (DefinePInvokeMethod): Reuse common code. Implemented handling of
7997         some missing properties.
7998         
7999         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
8000         (Method.ApplyAttributeBuilder): Updated.
8001         
8002         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
8003         exception.
8004
8005 2005-02-28  Raja R Harinath  <rharinath@novell.com>
8006
8007         Fix #73052.
8008         * report.cs (Report.SymbolRelatedToPreviousError): Handle
8009         non-simple types (array, pointer, reference).
8010
8011 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
8012
8013         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
8014
8015         * class.cs (MethodCore.IsDuplicateImplementation): Special error
8016         for operators.
8017         (Method.CheckBase): Catch wrong destructor here.
8018         (MethodData.Define): Add errors 550, 668.
8019
8020         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
8021
8022         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
8023
8024         * pending.cs (VerifyPendingMethods): Add error 551.
8025
8026         * typemanager.cs (CSharpName): Next error report helper.
8027
8028 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
8029
8030         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
8031         attributes. Removed useless attribute double check.
8032         It saves almost 2MBs for corlib.
8033
8034 2005-02-25  Raja R Harinath  <rharinath@novell.com>
8035
8036         Fix #72924.
8037         * statement.cs (ExpressionStatement.Resolve): Make robust to being
8038         called twice in case of error.
8039
8040 2005-02-23  Chris Toshok  <toshok@ximian.com>
8041
8042         Fix compiler portions of #72827.
8043         * statement.cs (Block.Emit): call Begin/EndScope on the
8044         EmitContext instead of the ILGenerator.
8045
8046         * codegen.cs (EmitContext.BeginScope): new method, call
8047         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
8048         we have one.)
8049         (EmitContext.BeginScope): same, but EndScope and CloseScope
8050
8051         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
8052         offset and call the superclass's OpenScope(int) with it.
8053         (SymbolWriter.CloseScope): get the current il
8054         offset and call superclass's CloseScope(int) with it.
8055
8056 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
8057
8058         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
8059         CS1677 for out and ref as well.
8060
8061         * class.cs (Method.Define): Add error CS1599 detection.
8062         
8063         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
8064         
8065         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
8066         
8067         * delegate.cs (Delegate.Define): Add error CS1599 detection.
8068         
8069         * support.cs.cs (ModifierDesc): New helper method.
8070
8071 2005-02-23  Raja R Harinath  <rharinath@novell.com>
8072             Abin Thomas  <projectmonokochi@rediffmail.com>
8073             Anoob V E  <projectmonokochi@rediffmail.com>
8074             Harilal P R  <projectmonokochi@rediffmail.com>
8075
8076         Fix #57851, #72718.
8077         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
8078         MemberLookup (used for error reporting) actually returns a result.
8079         Fix error report number (122, not 112).
8080
8081 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
8082             Anoob V E  <projectmonokochi@rediffmail.com>
8083             Harilal P R  <projectmonokochi@rediffmail.com>
8084
8085         Fix #71134.
8086         * pending.cs (PendingImplementation.GetAbstractMethods):
8087         Find NonPublic members too.
8088
8089 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
8090
8091         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
8092         Fixed error 217.
8093         
8094         * class.cs (MethodCore.CheckMethodAgainstBase):
8095         Add error 239 report.
8096
8097 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8098
8099         Fix #68955.
8100         * expression.cs (Invocation.IsApplicable): Make public.
8101         (Invocation.IsParamsMethodApplicable): Likewise.
8102         * delegate.cs (Delegate.VerifyApplicability): Don't use
8103         Invocation.VerifyArgumentCompat for parameter applicability
8104         testing.  Use Invocation.IsApplicable and
8105         Invocation.IsParamsMethodApplicable.
8106
8107 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
8108
8109         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
8110         
8111         * class.cs (Operator.Define): Add error 217 report.
8112         
8113 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8114
8115         * namespace.cs (UsingEntry.Resolve): Undo change below.
8116
8117 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8118
8119         Fix #72756.
8120         * ecore.cs (Expression.MemberLookupFailed): Add argument to
8121         disable the error message when the extended MemberLookup also
8122         fails.
8123         (Expression.MemberLookupFinal): Update.
8124         (SimpleName.DoSimpleNameResolve): Update.
8125         * expression.cs (MemberAccess.ResolveNamespaceOrType):
8126         Don't use MemberLookupFinal.
8127         (New.DoResolve): Update.
8128         (BaseAccess.CommonResolve): Update.
8129
8130 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8131
8132         Fix #72732.
8133         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
8134         occured previously, don't resolve again.
8135
8136 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
8137
8138         Fix #69949
8139         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
8140         argument. Call ResolveAttributeUsage for unresolved.
8141         when types doesn't match ctor arguments.
8142         
8143         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
8144         for nested attribute classes.
8145         (Class.attribute_usage): Removed.
8146         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
8147         for attribute class.
8148         
8149         * ecore.cs (IsAttribute): Removed.
8150         
8151         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
8152         
8153         * rootcontext.cs (RegisterAttribute): Removed, attributes are
8154         now normal types.
8155         (attribute_types): Removed.
8156         (EmitCode): Global attributes are emited as the latest.
8157
8158 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
8159
8160         * class.cs (EmitFieldInitializers): Don't emit field initializer
8161         for default values when optimilization is on.
8162         
8163         * constant.cs (Constant.IsDefaultValue): New property.
8164         
8165         * driver.cs: Add /optimize handling.
8166         
8167         * constant.cs,
8168         * ecore.cs,
8169         * literal.cs: Implement new IsDefaultValue property.
8170         
8171         * rootcontext.cs (Optimize): New field, holds /optimize option.
8172
8173 2005-02-18  Raja R Harinath  <rharinath@novell.com>
8174
8175         Fix crasher in re-opened #72347.
8176         * namespace.cs (Namespace.Lookup): Return null if
8177         DeclSpace.DefineType returns null.
8178
8179         Fix #72678.
8180         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
8181
8182 2005-02-18  Raja R Harinath  <rharinath@novell.com>
8183
8184         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
8185         now returns null if it cannot resolve to an lvalue.
8186         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
8187         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
8188         returned null.  Remove check for SimpleName.
8189         (EventExpr.DoResolveLValue): New.
8190         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
8191         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
8192         error from ...
8193         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
8194         avoid CS0131 error.
8195         (Unary.ResolveOperator): Move CS0211 check ...
8196         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
8197         CS0131 error.
8198         (Unary.DoResolveLValue): Simplify.
8199         (AddressOf.DoResolveLValue): New.
8200         (ArrayAccess.DoResolveLValue): New.
8201
8202 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
8203
8204         * attribute.cs (Attribute.Resolve): Add arguments casting for
8205         when types doesn't match ctor arguments.
8206
8207 2005-02-16  Raja R Harinath  <rharinath@novell.com>
8208
8209         Fix parts of #63202.
8210         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
8211         lookup of operator in base type.  Ensure that all checks happen
8212         when the operator resolves to an "op_..." method.
8213
8214 2005-02-15  Raja R Harinath  <rharinath@novell.com>
8215
8216         Fix #71992.
8217         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
8218         'ignore_cs0104' parameter.  Pass it to ...
8219         (NamespaceEntry.Lookup): ... this.
8220         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8221         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
8222         (TypeLookupExpression.DoResolveAsTypeStep): Update.
8223         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
8224         Update.  Request that cs0104 errors be ignored.
8225         (ComposedCast.ResolveAsTypeStep): Update.
8226
8227 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8228
8229         Fix #59209.
8230         * expression.cs (Invocation.BetterFunction): Remove support for
8231         comparing virtual functions and their overrides.
8232         (Invocation.IsOverride): New.
8233         (Invocation.OverloadResolve): Don't consider 'override' functions
8234         during candidate selection.  Store them in a lookaside list.
8235         If the selected method is a 'virtual' function, use the list to
8236         find any overrides that are closer to the LHS type.
8237
8238 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
8239
8240         * expression.cs (New.DoResolve): Add complex core type reduction.
8241         (New.Constantify): Converts complex core type syntax like 'new int ()'
8242         to simple constant.
8243         
8244 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8245
8246         * decl.cs (EntryType.EntryType): New constructor to create an
8247         updated copy of a cache entry.
8248         (MemberCache.AddMethods): Use it.
8249         (MemberCache.ClearDeclaredOnly): Remove.
8250         (MemberCache.MemberCache): Update.
8251
8252 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8253
8254         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
8255         variable.  This one is represents the actual low-level declaration
8256         of the method, as opposed to the semantic level `IsStatic'.   
8257
8258         An anonymous method which is hosted into a static method might be
8259         actually an instance method.  IsStatic would reflect the
8260         container, while MethodIsStatic represents the actual code
8261         generated.
8262
8263         * expression.cs (ParameterReference): Use the new MethodIsStatic
8264         instead of IsStatic.
8265
8266         * anonymous.cs (AnonymousMethod.Compatible): Pass the
8267         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
8268         set on the current EmitContext. 
8269
8270         * expression.cs (Cast): Overload DoResolveLValue so we can pass
8271         resolve our casted expression as an LValue.  This triggers the
8272         proper LValue processing that is later required by Assign.
8273
8274         This fixes 72347.
8275
8276         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
8277
8278 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
8279
8280         C# 2.0 Fixed buffer implementation
8281
8282         * anonymous.cs: Update after RegisterHelperClass renaming.
8283
8284         * attribute.cs (AttributeTester.fixed_buffer_cache):
8285         Cache of external fixed buffers.
8286         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
8287         implementation if field is fixed buffer else null.
8288
8289         * class.cs
8290         (TypeContainer.AddField): Accept FieldMember instead of Field.
8291         (FieldBase.IsFieldClsCompliant): Extracted code from
8292         VerifyClsCompliance descendant customization.
8293         (FixedField): New class handles fixed buffer fields.
8294         (FixedFieldExternal): Keeps information about imported fixed
8295         buffer.
8296         (IFixedField): Make access to internal or external fixed buffer
8297         same.
8298
8299         * cs-parser.jay: Add fixed buffer parsing.
8300
8301         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
8302         buffer.
8303
8304         * expression.cs (Indirection): Extended implementation to accept
8305         fixed buffer field.
8306         (PointerArithmetic.Emit): Get element from fixed buffer as well.
8307         (ElementAccess.MakePointerAccess): Get type as parameter.
8308         (DoResolve): Add fixed buffer field expression conversion.
8309         (DoResolveLValue): Ditto.
8310         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
8311         (ArrayPtr): Derives from FixedBufferPtr.
8312         (ArrayPtr.Emit): Add extra emit for array elements.
8313
8314         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
8315
8316         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
8317         for compiler generated types.
8318         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
8319
8320         * statement.cs (Fixed): Refactored to be easier add fixed buffer
8321         and consume less memory.
8322         (Fixed.Resolve): Add fixed buffer case.
8323
8324         * typemanager.cs (compiler_generated_attr_ctor,
8325         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
8326         (HasElementType): Add our own implementation to work on every
8327         runtime.
8328
8329 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8330
8331         * anonymous.cs (CaptureContext): Track whether `this' has been
8332         referenced.   
8333
8334         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
8335         only captured `this' if it was implicitly done (instance
8336         methods/variables were used). 
8337
8338         * codegen.cs (EmitContext.CaptureThis): New method to flag that
8339         `this' must be captured.
8340
8341 2005-01-30  Miguel de Icaza  <miguel@novell.com>
8342  
8343         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
8344         is null it means that there has been no need to capture anything,
8345         so we just create a sibling.
8346
8347         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
8348
8349         Just a partial fix.  The other half is fairly elusive.
8350         
8351 2005-02-10  Raja R Harinath  <rharinath@novell.com>
8352
8353         Fix #52586, cs0121-4.cs.
8354         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
8355         and return a hashtable.
8356         (MemberCache.ClearDeclaredOnly): New.
8357         (MemberCache.MemberCache): Update to change.  Make a deep copy of
8358         the method_hash of a base type too.
8359         (MemberCache.AddMethods): Adapt to having a deep copy of the base
8360         type methods.  Overwrite entries with the same MethodHandle so
8361         that the ReflectedType is correct.  The process leaves in base
8362         virtual functions and their overrides as distinct entries.
8363         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
8364         matters since it was boxed in a ArrayList before.
8365         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
8366         modifier.
8367         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
8368         case of a virtual function and its override (choose the overload
8369         as better).
8370         (Invocation.OverloadResolve): Avoid 'override' members during
8371         'applicable_type' calculation.
8372
8373 2005-02-09  Raja R Harinath  <rharinath@novell.com>
8374
8375         Combine two near-redundant caches.
8376         * typemanager.cs (method_params): Rename from method_internal_params.
8377         (TypeManager.GetParameterData): New.  Replace
8378         Invocation.GetParameterData.
8379         (TypeManager.LookupParametersByBuilder): Remove.
8380         * expression.cs (Invocation.method_parameter_cache): Remove.
8381         (Invocation.GetParameterData): Remove.
8382         Update to changes.
8383         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
8384         Update to changes.
8385
8386 2005-02-08  Raja R Harinath  <rharinath@novell.com>
8387
8388         Fix #72015.
8389         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
8390         TypeManager.multicast_delegate_type is null, resolve it by looking
8391         up "System.MulticastDelegate".
8392         * rootcontext.cs (RootContext.ResolveCore): Simplify.
8393
8394 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
8395             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
8396             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
8397
8398         Fix cs0164.cs.
8399         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
8400         (LabeledStatement.AddReference): New.  Set 'referenced'.
8401         (Goto.Resolve): Use it.
8402
8403 2005-02-05  John Luke  <john.luke@gmail.com>
8404
8405         * driver.cs: remove duplicate -doc line in Usage ()
8406
8407 2005-02-04  Raja R Harinath  <rharinath@novell.com>
8408
8409         * location.cs (Location.AddFile): Fix CS2002 error report.
8410
8411 2005-02-02  Martin Baulig  <martin@ximian.com>
8412
8413         * delegate.cs (Delegate.DefineType): Report an internal error if
8414         TypeManager.multicast_delegate_type is null.  See bug #72015 for
8415         details.        
8416
8417 2005-02-02  Raja R Harinath  <rharinath@novell.com>
8418
8419         Fix a crasher in a variant of #31984.
8420         * const.cs (Constant.CheckBase): New override that defers the
8421         new-or-override check in case the base type hasn't been populated
8422         yet.
8423         (Constant.Define): Ensure the new-or-override check is performed.
8424
8425 2005-02-01  Duncan Mak  <duncan@ximian.com>
8426
8427         * const.cs (LookupConstantValue): Check that `ce' is not null
8428         before calling GetValue ().
8429
8430 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8431
8432         Fix test-334.cs (#69519).
8433         * cs-parser.jay (using_alias_directive): Pass in an expression to
8434         NamespaceEntry.UsingAlias.
8435         (using_namespace_directive): Pass in an expression to
8436         NamespaceEntry.Using.
8437         (namespace_name): Don't flatten to a string.
8438         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
8439         (NamespaceEntry.AliasEntry.Resolve): Lookup using
8440         ResolveAsTypeStep.
8441         (NamespaceEntry.UsingEntry): Likewise.
8442         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
8443         changes.
8444         (NamespaceEntry.LookupForUsing): Remove.
8445         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
8446         names.
8447         (NamespaceEntry.Lookup): Remove support for dotted names.
8448
8449 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8450
8451         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
8452         split into two.
8453         (NamespaceEntry.ImplicitParent): Compute on demand.
8454         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
8455         parallels the current.
8456         (NamespaceEntry.LookupForUsing): Use it.
8457         (NamespaceEntry.Lookup): If the current namespace-entry is
8458         implicit, don't search aliases and using tables.
8459
8460 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8461
8462         Fix #31984.
8463         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
8464         BaseCache here.
8465         (TypeContainer.BaseCache): Compute on demand.
8466         (TypeContainer.FindMembers): Define constants and types if they're
8467         not already created.
8468         (FieldMember.Define): Move resetting of ec.InUnsafe before error
8469         check.
8470         * const.cs (Constant.Define): Make idempotent.
8471
8472 2005-01-29  Miguel de Icaza  <miguel@novell.com>
8473
8474         * pending.cs: Produce better code (no nops produced by using Ldarg
8475         + value).
8476         
8477         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
8478         i - 1' it should be arg + 1.
8479
8480         Fixes bug #71819.
8481
8482 2005-01-28  Raja R Harinath  <rharinath@novell.com>
8483
8484         * attribute.cs (Attribute.CheckAttributeType): Make private
8485         non-virtual.
8486         (Attribute.ResolveType): Make virtual.
8487         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
8488         handling of RootContext.Tree.Types.
8489
8490 2005-01-27  Raja R Harinath  <rharinath@novell.com>
8491
8492         Update attribute-handling to use the SimpleName/MemberAccess
8493         mechanisms.
8494         * cs-parser.jay (attribute): Pass in an expression to the
8495         constructors of Attribute and GlobalAttribute.
8496         * attribute.cs (Attribute): Take an expression for the name.
8497         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
8498         passed in attribute name expression.
8499         (Attribute.CheckAttributeType): Use it.
8500         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
8501         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
8502         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
8503         argument to prevent error messages if the lookup fails.
8504
8505 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
8506
8507         * expression.cs (Indirection): Implemented IVariable interface
8508         to support indirection in AddressOf operator.
8509         (PointerArithmetic.Emit): Add optimalization for case where
8510         result can be precomputed.
8511
8512 2005-01-26  Martin Baulig  <martin@ximian.com>
8513
8514         * class.cs (TypeContainer.AttributeTargets): Return the correct
8515         AttributeTargets depending on our `Kind' instead of throwing an
8516         exception; fixes #71632.
8517
8518 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
8519
8520         Fix #71257
8521         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
8522         constant members.
8523
8524 2005-01-25  Raja R Harinath  <rharinath@novell.com>
8525
8526         Fix #71602.
8527         * expression.cs (MemberAccess.DoResolve): Don't complain with
8528         cs0572 when the LHS of a member access has identical name and type
8529         name.
8530
8531 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
8532
8533         Fix #71651, #71675
8534         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
8535         CreatePermission.
8536         Create custom PermissionSet only for PermissionSetAttribute.
8537
8538 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
8539
8540         Fix #71649
8541         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
8542         delegates in static class.
8543
8544 2005-01-24  Martin Baulig  <martin@ximian.com>
8545
8546         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8547         merging an implicit block, just use its reachability.
8548
8549         * statement.cs (Block.Resolve): Make the unreachable code check
8550         work wrt. implicit blocks; see test-337 from #63842.
8551
8552 2005-01-21  Alp Toker  <alp@atoker.com>
8553  
8554         * cs-parser.jay: destructor_declaration's container is PartialContainer
8555         not Class when partial types are used, so use Kind prop instead of
8556         'is'.
8557         
8558 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
8559
8560         * cs-parser.jay: Improve error reporting when an interface
8561         declares new types.
8562
8563 2005-01-20  Dick Porter  <dick@ximian.com>
8564
8565         * support.cs: SeekableStreamReader fix from Sandor Dobos
8566         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
8567         chars are read.  Fixes bug 70369.
8568
8569 2005-01-20  Raja R Harinath  <rharinath@novell.com>
8570
8571         * cs-parser.jay (catch_clause): Simplify current_block handling
8572         somewhat.
8573
8574 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
8575
8576         * convert.cs (ImplicitStandardConversionExists): Synchronize the
8577         code with ImplicitStandardConversion to handle the implicit
8578         conversion of method groups into valid delegate invocations. 
8579
8580         The problem is that in parameter handling we were using this code
8581         path.  Fixes bug #64698
8582
8583 2005-01-19  Raja R Harinath  <rharinath@novell.com>
8584
8585         * cs-parser.jay: Fix several infelicities.
8586         - Avoid assigning to the parser value stack.  Code like 
8587           '$3 = null' is unclean.  Synthesize a value for the code block
8588           instead. 
8589         - Avoid using oob_stack for storing location information.  Use ...
8590         (_mark_): ... this.  New (empty) rule.  Saves the current location
8591         in $$.
8592         (foreach_statement): Avoid using oob_stack for current_block
8593         handling.  Use technique used in for_statement and
8594         using_statement.  Synthesize a value for the code block to store
8595         additional intermediate information.
8596
8597 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
8598
8599         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
8600         of a different type is only allowed to private fields of a
8601         containing type, not on fields of a base class.
8602
8603         See test-174.cs and error cs0122-9.cs
8604
8605 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8606
8607         Fix test-335.cs (bug #58126).
8608         * cs-parser.jay (argument): Split out non-expression parts of the
8609         rule into 'non_simple_argument'.
8610         (invocation_expression): Support parenthesized invocations with
8611         multiple arguments, and with single non-simple arguments.
8612
8613 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8614
8615         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
8616         places.
8617
8618 2005-01-12  Raja R Harinath  <rharinath@novell.com>
8619
8620         Fix cs0038-1.cs, cs1640-6.cs.
8621         * ecore.cs (Expression.Resolve): Remove special-case for
8622         SimpleName in error-handling.
8623         (Expression.almostMatchedMembers): Relax access permission to
8624         protected.
8625         (Expression.MemberLookupFailed): Handle duplicates in
8626         almostMatchedMembers list.
8627         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
8628         * expression.cs (New.DoResolve): Report CS1540 for more cases.
8629         * typemanager.cs (GetFullNameSignature): Use the MethodBase
8630         overload if the passed in MemberInfo is a MethodBase.
8631
8632 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
8633
8634         Fix #70749
8635         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
8636         for non-CAS & merge permission sets properly.
8637
8638 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8639
8640         Improve standard-compliance of simple name and member access 
8641         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
8642         * ecore.cs (FullNamedExpression): New abstract base class 
8643         for Namespaces and TypeExpressions.
8644         (ResolveFlags.SimpleName): Remove.
8645         (SimpleName): Remove support for dotted names.
8646         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
8647         DeclSpace.FindType and DeclSpace.LookupType.
8648         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
8649         (Expression.ExprClassName): Make member function.
8650         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
8651         a namespace.  Remove creation of dotted "SimpleName"s.
8652         (MemberAccess.DoResolve): Likewise.
8653         * decl.cs (DeclSpace.Cache): Make private.
8654         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
8655         (DeclSpace.FindType): Update.
8656         (DeclSpace.LookupType): Move here from RootContext.  Return a 
8657         FullNamedExpression.
8658         * namespace.cs (Namespace): Derive from FullNamedExpression
8659         so that it can be part of expression resolution.
8660         (Namespace.Lookup): Return an FullNamedExpression.
8661         (NamespaceEntry.LookupAlias): Lookup aliases only in current
8662         namespace.
8663         * rootcontext.cs (NamespaceLookup): Remove.
8664         (LookupType): Move to DeclSpace.
8665         * attribute.cs (CheckAttributeType): Update.
8666         * doc.cs (FindDocumentedType): Remove allowAlias argument.
8667         (FindDocumentedTypeNonArray): Likewise.
8668
8669 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8670
8671         Fix cs0509.cs, cs1632.cs.
8672         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
8673         is the same as IsInterface.
8674         (TypeContainer.GetClassBases): Likewise.
8675         * statement.cs (LabeledStatement.ig): New field.
8676         (LabeledStatement.LabelTarget): Save ILGenerator which created the
8677         label.
8678         (LabeledStatement.DoEmit): Check that the label was created with
8679         the same ILGenerator.
8680
8681 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8682
8683         Fix #71058
8684         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8685         accessors to its properties.
8686
8687         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8688         from accessors to property.
8689         
8690 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8691
8692         Fix #70722
8693         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8694         only for overrides.
8695         
8696 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
8697
8698         * attribute.cs: Check for null and empty strings.  
8699
8700         I have lost another battle to Paolo.
8701
8702 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
8703
8704         Fix #70942
8705         * class.cs (PropertyMethod): Set Parent field in ctors.
8706         (SetMethod.InternalParameters): Add unsafe switch hack.
8707         Override MarkForDuplicationCheck where it is appropriate.
8708
8709         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8710         It says whether container allows members with the same name.
8711         Base default is no.
8712         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8713         Removed is_method parameter.
8714
8715 2005-01-06  Duncan Mak  <duncan@ximian.com>
8716
8717         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8718         because the previous change led to incorrect reporting of CS1032
8719         ("Cannot define/undefine preprocessor symbols after first token in
8720         file"). Instead of using `tokens_seen' as the only flag that
8721         triggers CS1040, introduce `comments_seen'. This new flag is used
8722         to signify having seen comments on the current line, so it is
8723         unset after a newline.
8724
8725 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8726
8727         * doc.cs : When searching for a type, find nested type too.
8728           This fixes bug #71040.
8729
8730 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8731
8732         * doc.cs :
8733           - Warn missing member comment on those classes which also does not
8734             have doc comments. Fixed bug #71041.
8735           - Don't warn missing doc comment on default constructor.
8736             Fixed bug #71042.
8737
8738 2005-01-06  Duncan Mak  <duncan@ximian.com>
8739
8740         * cs-tokenizer.cs (xtoken): After handling traditional C-style
8741         comments, set `tokens_seen' to true. This allows us to detect
8742         misplaced preprocessor directives (i.e. not at the beginning of
8743         the a line, nor after whitespaces). In that case, report error
8744         CS1040. This fixes bug #56460.
8745
8746         * cs-parser.jay (interface_member_declaration): Add checks for
8747         IsExplicitImpl, and report CS0541 error if an interface member is
8748         defined as an explicit interface declaration.
8749
8750 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
8751
8752         Fix #70817
8753         * class.cs (PropertyMethod): Set Parent field in ctors.
8754         (SetMethod.InternalParameters): Add unsafe switch hack.
8755         
8756         * decl.cs (MemberCore.Parent): Cannot be readonly.
8757
8758 2005-01-06  Raja R Harinath  <rharinath@novell.com>
8759
8760         * decl.cs (DeclSpace.ResolveType): Remove.
8761         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8762         Merge in code from ...
8763         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
8764         * class.cs, enum.cs: Update to changes.
8765
8766 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
8767
8768         * anonymous.cs: Ensure that we init the scope of our parent if it
8769         has not been initialized yet.
8770
8771 2004-12-30  Duncan Mak  <duncan@ximian.com>
8772
8773         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8774         if field.FieldBuilder is null. Fixes #70758.
8775
8776         * convert.cs: Fixed some typos and updated some of the comments.
8777         (ImplicitStandardConversionExists):
8778         (TryImplicitIntConversion): If `target_type' is an interface and
8779         the type of `ic' implements this interface, return true or a new
8780         BoxedCast instead of null. This fixes #70468.
8781
8782 2004-12-29  Duncan Mak  <duncan@ximian.com>
8783
8784         * expression.cs (Argument.Emit): Check that Expr is
8785         IMemoryLocation before casting to it, and report CS1510 otherwise.
8786
8787         This fixes #70402.
8788
8789 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
8790
8791         * statement.cs (Block.ThisVariable): remove the recursion here, to
8792         make the --profile more sane.
8793
8794 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
8795
8796         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8797         assembly, by JB Evain.
8798
8799 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8800
8801         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
8802           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8803         "parent" refers to enclosing type/class.  "base" refers to superclass.
8804
8805 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8806
8807         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8808         Ensure that we only have GlobalAttributes.
8809         * attribute.cs (Attribute.Emit): Make non-virtual.
8810         (GlobalAttribute.Emit): Remove.
8811         (Attribute.Resolve): Make virtual.
8812         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
8813         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8814         the argument. Don't create one.
8815         (Attribute.GetObsoleteAttribute): Likewise.
8816         (Attribute.GetClsCompliantAttributeValue): Likewise.
8817         * class.cs, decl.cs: Update to changes.
8818
8819 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
8820
8821         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8822         
8823         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8824         
8825         * statement.cs (Foreach.Resolve): Add error 186 report.
8826
8827 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
8828
8829         * expression.cs (Conditional.DoResolve): Add warning 429.
8830         
8831         * statement.cs (If.Resolve): Add warning 665.
8832
8833 2004-12-16  Raja R Harinath  <rharinath@novell.com>
8834
8835         New invariant: RootContext.Tree.Types.NamespaceEntry == null
8836         except when in the parser, and in GlobalAttribute.
8837         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8838         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8839         RootContext.Tree.Types.NamespaceEntry once work is done.
8840         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
8841         and resets RootContext.Tree.Types.NamespaceEntry.
8842
8843 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
8844
8845         * cs-parser.jay: Don't create a block for every variable.
8846
8847 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
8848
8849         * location.cs: Provide extra information.
8850
8851         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8852         variables from the captured environment, it is the ldarg_0.
8853
8854 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8855
8856         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8857         find a conclusion.
8858         
8859         * class.cs: Changed warning level for 169 to avoid developer
8860         displeasure from warning flooding. It will be changed back when they
8861         fix most of current BCL warnings.
8862         
8863         * RootContext.cs: Pushed default WarningLevel to 3.
8864         
8865         * statement.cs: Removed unused variable.
8866
8867 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8868
8869         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8870         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8871         Add error 502 report.
8872         (StaticClass.DefineType): Add error 441 report.
8873         (Class.AllowedModifiersProp): New virtual property as temporary
8874         extension to AllowedModifiers.
8875         (Class.DefineType): Add error 418 report. Moved ModFlags check here
8876         to share implementation with StaticClass and don't call virtual
8877         methods from ctor.
8878         
8879         * driver.cs (MainDriver): Add error 1558 test.
8880
8881         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8882         report. Moved error 36 test here.
8883
8884         * statement.cs (Throw.Resolve): Add error 724 report.
8885
8886         * typemanager.cs: Add out_attribute_type core type.
8887         
8888 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
8889
8890         * class.cs (TypeContainer.VerifyClsCompliance): Add error
8891         3018 report.
8892         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8893
8894         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8895         3017 report.
8896         
8897         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8898
8899         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
8900         Add error 3023 report.
8901         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8902
8903         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8904         implementation.
8905
8906 2004-12-12  John Luke  <john.luke@gmail.com>
8907
8908         * driver.cs (AddArgs): take -- into account when
8909         adding arguments, fixes bug 65710 
8910
8911 2004-12-12  Martin Baulig  <martin@ximian.com>
8912
8913         * expression.cs (Unary.TryReduceNegative): Added support for
8914         SByteConstant and ByteConstant.
8915         (Unary.Reduce): Check error values from TryReduceNegative().
8916
8917 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
8918
8919         * attributes.cs (Attribute.Resolve): Avoid multiple error report
8920         and report exception as error 182.
8921
8922 2004-12-10  Raja R Harinath  <rharinath@novell.com>
8923
8924         * driver.cs (Main): Fix message when there are warnings.
8925
8926 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
8927
8928         * delegate.cs: Fixed my fix from yesterday, sorry about that.
8929
8930 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
8931
8932         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
8933         Reduced number of warnings.
8934         
8935         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8936
8937 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
8938
8939         * driver.cs: Removed message.
8940
8941         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8942
8943 2004-12-08    <vargaz@freemail.hu>
8944
8945         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8946
8947 2004-12-08  Martin Baulig  <martin@ximian.com>
8948
8949         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8950         instead of a CS3002 for properties and indexer.
8951
8952 2004-12-08  Martin Baulig  <martin@ximian.com>
8953
8954         * decl.cs (MemberName.ToString): Make this work again.
8955
8956 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
8957
8958         * attribute.cs (Resolve): Add error 591 detection.
8959
8960         * class.cs (FieldMember.Define): Add error 1547 detection.
8961         (Indexer.Define): Add error 620 detection.
8962         (Operator.Define): Add error 590 detection.
8963
8964         * ecore.cs: Missing argument for error 79.
8965
8966         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8967         detection.
8968
8969 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
8970
8971         Fix #70106
8972         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8973         only.
8974
8975 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8976
8977         * cs-parser.jay : handle doc comments on implicit/explicit operators.
8978           Some operator comments were suppressed.
8979         * doc.cs : Implicit/explicit operator name in doc comments are like
8980           "op_Explicit(type)~returnType", so added suffix handling.
8981
8982 2004-12-07  Martin Baulig  <martin@ximian.com>
8983
8984         * decl.cs
8985         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8986         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8987         (DeclSpace.ec): New protected field; store the EmitContext here.
8988         (DeclSpace.EmitContext): New public property; moved here from
8989         `TypeContainer'.
8990         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8991         EmitContext.
8992
8993         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8994         (Enum.Emit): Don't create a new EmitContext.
8995
8996         * delegate.cs (Delegate.DefineType): Always create the
8997         EmitContext.
8998
8999         * iterators.cs (Iterators.DefineIterator): Create a new
9000         EmitContext and store it in `ec'.
9001
9002 2004-08-24  Martin Baulig  <martin@ximian.com>
9003
9004         * typemanager.cs
9005         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9006         this for accessibility checks.
9007         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9008         IsNestedFamilyAccessible.
9009         (TypeManager.IsSubclassOf): New method, do what the name actually
9010         says.   
9011
9012 2004-12-06  Raja R Harinath  <rharinath@novell.com>
9013
9014         Fix crash on cs0657-17.cs.
9015         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9016         Use RootContext.Tree.Types, not 'new RootTypes ()'.
9017         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
9018         the case where the NamespaceEntry gets overwritten.
9019
9020 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
9021
9022         Fixed #69195, #56821
9023         * ecore.cs (ResolveBoolean): Tiny refactoring.
9024
9025         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
9026         of right expression resolving when left is false constant and
9027         operator is LogicalAnd OR true constant and operator is LogicalOr.
9028
9029         * statement.cs (ResolveUnreachable): Always reports warning.
9030
9031 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
9032
9033         * class.cs: Distinguish between 1721 and 1722 (just a little help
9034         for the programmer).
9035
9036 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
9037
9038         * delegate.cs: Only allow this on new versions of the language. 
9039
9040 2004-12-02  Duncan Mak  <duncan@ximian.com>
9041
9042         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
9043         Expression class.
9044         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
9045         here as a static method. Take an additional bool out parameter
9046         `must_do_cs1540_check' for signaling to InstanceResolve.
9047         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
9048         member field from PropertyExpr class and made it an argument of
9049         the method instead.
9050         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
9051         check for MarshalByRefObject, and report CS0122 instead of CS1540.
9052         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
9053         and `remove_accessor' as well as InstanceResolve: report CS0122
9054         where applicable.
9055
9056         Fixes #70129.
9057
9058 2004-12-03  Raja R Harinath  <rharinath@novell.com>
9059
9060         Fix test-327.cs, test-328.cs, and put in early infrastructure
9061         for eventually fixing #52697.
9062         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
9063         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
9064         from other methods.
9065         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
9066         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
9067         (VerifyUsing, error246): Update.
9068         * rootcontext.cs (RootContext.NamespaceLookup): Just use
9069         'NamespaceEntry.LookupNamespaceOrType'.
9070
9071 2004-12-03  Martin Baulig  <martin@ximian.com>
9072
9073         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9074         method as our child, call AnonymousMethod.Compatible() on it.
9075
9076 2004-12-03  Raja R Harinath  <rharinath@novell.com>
9077
9078         Disable XML documentation support in 'basic' profile.
9079         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
9080         Redirect XmlElement to System.Object.
9081         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
9082         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
9083         * mcs.exe.sources: Add doc-bootstrap.cs.
9084         * doc-bootstrap.cs: New file.  Contains empty stub implementation
9085         of doc.cs.
9086
9087 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
9088
9089         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
9090           comments are allowed.
9091
9092 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9093
9094         * delegate.cs: Add checks for subtypes in paramaters and return values
9095         in VerifyMethod () to add support for Covariance/Contravariance
9096         in delegates.
9097         
9098 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
9099
9100         * report.cs: Remove extra closing parenthesis.
9101
9102         * convert.cs (Error_CannotImplicitConversion): If the name of the
9103         types are the same, provide some extra information.
9104
9105         * class.cs (FieldBase): Use an unused bit field from the field to
9106         encode the `has_offset' property from the FieldMember.  This saves
9107         a couple of Ks on bootstrap compilation.
9108
9109         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9110         method as our child, return the AnonymousMethod resolved
9111         expression.
9112
9113         * expression.cs (New.DoResolve): Allow return values from
9114         NewDelegate to also include AnonymousMethods.
9115
9116         Fixes #70150.
9117
9118 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
9119
9120         Fix bug #70102
9121         * attribute.cs (Resolve): Improved implementation of params
9122         attribute arguments.
9123
9124         * support.cs (ParameterData): Add HasParams to be faster.
9125
9126 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
9127
9128         all things are for /doc support:
9129
9130         * doc.cs: new file that supports XML documentation generation.
9131         * mcs.exe.sources: added doc.cs.
9132         * driver.cs:
9133           Handle /doc command line option.
9134           Report error 2006 instead of 5 for missing file name for /doc.
9135           Generate XML documentation when required, after type resolution.
9136         * cs-tokenizer.cs:
9137           Added support for picking up documentation (/// and /** ... */),
9138           including a new XmlCommentState enumeration.
9139         * cs-parser.jay:
9140           Added lines to fill Documentation element for field, constant,
9141           property, indexer, method, constructor, destructor, operator, event
9142           and class, struct, interface, delegate, enum.
9143           Added lines to warn incorrect comment.
9144         * rootcontext.cs :
9145           Added Documentation field (passed only when /doc was specified).
9146         * decl.cs:
9147           Added DocComment, DocCommentHeader, GenerateDocComment() and
9148           OnGenerateDocComment() and some supporting private members for
9149           /doc feature to MemberCore.
9150         * class.cs:
9151           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
9152         * delegate.cs:
9153           Added overriden DocCommentHeader.
9154         * enum.cs:
9155           Added overriden DocCommentHeader and GenerateDocComment().
9156
9157 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
9158
9159         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
9160         unwrapping the enumeration values, chain to
9161         DoConstantNumericPromotions again, so we can promote things to the
9162         fundamental types (takes care of enums that are bytes, sbytes).
9163
9164         Fixes bug #62054.
9165
9166 2004-12-01  Raja R Harinath  <rharinath@novell.com>
9167
9168         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
9169         Fix long-standing bug in type-lookup.  Use FindType instead of
9170         LookupType when ec.ResolvingTypeTree.
9171         (Attribute.ResolveType, Attribute.Resolve)
9172         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
9173         Update to changes.
9174         (Attributes.Search): Remove internal version.  Update.
9175         (Attributes.SearchMulti): Update.
9176         (Attributes.GetClsCompliantAttribute): Remove.
9177         (Attributes.GetIndexerNameAttribute): Remove.
9178         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
9179         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
9180         * class.cs (Indexer.Define): Likewise.
9181
9182 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
9183
9184         Fix bug #68790
9185         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
9186         MarshallByReference members access.
9187
9188         * expression.cs: Use CheckMarshallByRefAccess;
9189         Better error CS0197 message.
9190
9191         * report.cs: Print whole related error message.
9192
9193 2004-11-30  Raja R Harinath  <rharinath@novell.com>
9194
9195         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
9196         the current directory to help debugging.
9197
9198 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9199
9200         * class (GetClassBases): Better error 60 report.
9201         (EventProperty): Disabled warning 67 detection.
9202
9203 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9204
9205         Fix bug #60324
9206         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
9207
9208         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
9209         precise values.
9210
9211 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9212
9213         Fix bug #49488
9214         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
9215
9216         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
9217
9218 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
9219
9220         * attribute.cs (Attribute.Resolve): Refine error reporting and
9221         report a cs0117 if the identifier does not exist, to distinguish
9222         from 0617 which is a miss-use of the actual identifier.
9223
9224         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
9225         between cs0070 and cs0079.
9226
9227         * class.cs (MemberBase.DoDefine): When reporting a wrong
9228         accessibility level, we use MethodCore to compare instead of
9229         Method (this was a regression in some refactoring effort).
9230
9231         So now we correctly report cs0056 again.
9232
9233         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
9234         testing the target_type (which was known to be object_type) and
9235         not the source type (which is anonymous_method).
9236
9237         Fixed reporting of error cs1660.
9238
9239         * expression.cs (UserCast.Source): Expose the underlying cast.
9240
9241         * statement.cs (Switch.SwitchGoverningType): Sort the list of
9242         allowed types to find a match to int32 first (most common).
9243
9244         In addition, it ignores any ImplicitUserConversions that did an
9245         internal implicit conversion (as the switch statement allows only
9246         one integral conversion to exist).
9247
9248         * class.cs (PartialContainer.Create): rename `name' to
9249         `member_name' for clarity.  Then replace the string calls with a
9250         call to MemberName.GetPartialName, as now using
9251         MemberName.ToString is an error (this is due to the side effects
9252         it had, that were fixed in the past).
9253
9254         This will restore the error reporting on a number of partial class
9255         errors that were missusing this (and getting an exception as a
9256         results, which is now just a plain textual warning, because
9257         yyparse debug output would crash otherwise).
9258
9259 2004-11-26  Raja R Harinath  <rharinath@novell.com>
9260
9261         * Makefile (PROGRAM_INSTALL_DIR): Remove.
9262
9263 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
9264
9265         * rootcontext.cs (LookupType): Make sure to cache lookups that
9266         don't give us a negative result. This saves about 5% of corlib
9267         compilation time.
9268
9269 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
9270
9271         * report.cs (AbstractMessage.Print): messages are sent to stderr
9272
9273         * class.cs (TypeContainer.GetClassBases): It is an error to have a
9274         non-interface in the list of interfaces (at this point, either
9275         parent was properly set, or a base class is being listed in the
9276         interfaces section).
9277
9278         This flags error 1722, and resolves the crash from bug 69259.
9279
9280 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
9281
9282         * statement.cs (Using.EmitExpressionFinally): make this work right
9283         for valuetypes. Fixes 69926.
9284
9285 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
9286
9287         * const.cs (Const.ChangeType): Cope with the "0 literal can be
9288         converted to an enum" here, before we try to change the underlying
9289         type.  This code exists, but it is a different code path than the
9290         one used while encoding constants.
9291
9292         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
9293         old bug: when converting from the null literal to a pointer,
9294         return an EmptyCast, not the NullLiteral.
9295
9296         This fixes #69921, the recent null_type changes probably made this
9297         bug more prominent.
9298
9299         (ImplicitReferenceConversionExists): In addition, resynchronized
9300         the code here, so it matches the same code in
9301         ImplicitReferenceConversionExists for the `from any class-type S
9302         to any interface-type T'.
9303         
9304
9305 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
9306
9307         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
9308
9309 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
9310
9311         * cs-parser.jay: Use verbosity accordingly. 
9312
9313 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9314
9315         * expression.cs (Unary.ResolveOperator): Do not report warning;
9316         AddressOf reads from variable.
9317         
9318         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
9319
9320 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9321
9322         Fix bug #69462
9323
9324         * attribute.cs (Attributable): Removed CheckTargets.
9325         (Attributes.Emit): Explicit attribute targets are tested here.
9326
9327         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
9328         not enabled for interfaces.
9329
9330         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
9331         (GetAssemblyName): Ouch next bug there.
9332
9333 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9334
9335         * expression.cs: Error 275 added.
9336         
9337 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
9338
9339         Fix bug #69177 (Implemented decimal constant support)
9340
9341         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
9342         (BinaryFold): Add DecimalConstant.
9343
9344         * const.cs (Define): Decimal constant 
9345         (is not constant.
9346         (ChangeType): Add decimal type handling.
9347         (LookupConstantValue): Don't set value for decimal type but
9348         emit DecimalConstantAttribute. Needed for constant optimization.
9349
9350         * constant.cs (ToDecimal): New method.
9351         (ConvertToDecimal): New method.
9352         (IntConstant): Implemented ConvertToDecimal.
9353         (DecimalConstant.Emit): Emit optimized version for decimals in
9354         int range.
9355
9356         * expression.cs (ResolveOperator): Changed order of constant
9357         reduction to work correctly with native types which have
9358         overloaded operators.
9359         (ResolveMemberAccess): Extract constant value from attribute
9360         for decimal type.
9361
9362         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
9363
9364         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
9365         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
9366         (ChangeType): Decimal is special.
9367         (TypeToCoreType): Add decimal type.
9368
9369 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9370
9371         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
9372         decimal types.
9373
9374 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9375
9376         * class.cs (EventField.ApplyAttributeBuilder): Fix error
9377         test cs1667-5.cs.
9378
9379 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9380
9381         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
9382
9383         * pending.cs (PendingImplementation): Grab only interfaces.
9384
9385 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9386
9387         * statement.cs (ForeachHelperMethods): Add location member and
9388         error 202 detection.
9389
9390 2004-11-19  Raja R Harinath  <rharinath@novell.com>
9391
9392         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
9393         automatically handled by executable.make.
9394         (PROGRAM): Make profile-specific.
9395
9396 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
9397
9398         * expression.cs (DoResolveBase): Fixed wrong warning for out
9399         variables.
9400
9401 2004-11-18  Martin Baulig  <martin@ximian.com>
9402
9403         Merged latest changes into gmcs.  Please keep this comment in
9404         here, it makes it easier for me to see what changed in MCS since
9405         the last time I merged.
9406
9407 2004-11-17  Raja R Harinath  <rharinath@novell.com>
9408
9409         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
9410         (TypeHandle.GetMemberCache): New.
9411         (TypeHandle.TypeHandle): Update.
9412         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
9413         (TypeManager.LookupParentInterfacesCache):
9414         Rename from LookupInterfaceCache.  Optimize slightly.
9415         (TypeManager.MemberLookup_FindMembers): Update.
9416         * decl.cs (MemberCache.MemberCache): Set Container to null in the
9417         multi-type variant.
9418         (AddCacheContents): Rename from AddHashtable.
9419         * class.cs (TypeContainer.parent_container): Remove.
9420         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
9421         (TypeContainer.DoDefineMembers): Don't initialize it.
9422         Update to name changes.
9423         
9424 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
9425
9426         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
9427         that factors the code to check access modifiers on override.  
9428
9429         (PropertyBase): Use the code here.
9430
9431         Patch from Lluis S'anchez, fixes bug #69361.
9432
9433 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
9434
9435         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
9436         routine that is used to report the use of a captured variable
9437         whose address has been taken.
9438
9439         There are two checks: one when variables are being captured and
9440         the other check is when the address of a variable is taken. 
9441         
9442         (because an anonymous methods might be resolved before *or* after
9443         the address has been taken) and 
9444
9445         * expression.cs (Conditional.DoResolve): Remove the special
9446         casing that Martin added to trueExpr and falseExpr being both
9447         NullLiteral.  We get the right behavior now just by introducing
9448         the null_type into the compiler. 
9449
9450         * convert.cs (ExplicitConversion): Change the code to use
9451         null_type instead of testing `expr is NullLiteral'.
9452         (ImplicitConversionStandard): use null_type too.
9453         (ImplicitReferenceConversionExists): use null_type too.
9454         (ImplicitReferenceConversion): use null_type too.
9455
9456         * literal.cs: The type of `NullLiteral' is now null_type instead
9457         of object_type. 
9458         (Resolve): Set the type here.
9459
9460         * typemanager.cs: Introduce null_type.
9461
9462 2004-11-17  Martin Baulig  <martin@ximian.com>
9463
9464         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
9465         direction, like FindMembers() does.  Fixes #69546, testcase is in
9466         test-315.cs.    
9467
9468 2004-11-16  Martin Baulig  <martin@ximian.com>
9469
9470         This is based on a patch from Marek Safar, see bug #69082.
9471         Fixes bugs #63705 and #67130.
9472
9473         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
9474         method; create a MemberCache for an interface type and cache the
9475         result.
9476
9477         * decl.cs (IMemberContainer.ParentContainer): Removed.
9478         (IMemberContainer.ParentCache): New property.
9479         (MemberCache.SetupCacheForInterface): Removed.
9480         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
9481         to create a cache for an interface's "parent".
9482
9483         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9484         interfaces too.
9485
9486 2004-11-16  Martin Baulig  <martin@ximian.com>
9487
9488         Merged back from gmcs; these changes already went into gmcs a
9489         couple of weeks ago.
9490
9491         * typemanager.cs
9492         (TypeManager.AddUserType): Removed the `ifaces' argument.
9493         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
9494         `TypeExpr []'.
9495         (TypeManager.AddUserInterface): Removed.
9496         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
9497         `TypeExpr []'.
9498         (TypeManager.GetInterfaces): Likewise.
9499         (TypeManager.GetExplicitInterfaces): Likewise.
9500
9501         * ecore.cs (TypeExpr.GetInterfaces): Removed.
9502
9503         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
9504         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
9505
9506 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
9507
9508         * statement.cs: Avoid adding bools to a hashtable.
9509
9510 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
9511
9512         * expression.cs (Invocation.OverloadResolve): Flag error if we are
9513         calling an unsafe method from a safe location.
9514
9515 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
9516
9517         Fix #69167
9518         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
9519
9520 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
9521
9522         * namespace.cs (VerifyUsing): use GetPartialName instead of
9523         ToString. 
9524
9525 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
9526
9527         * statement.cs (Return.Resolve): Fix regression in typo: if
9528         `in_exc', we have to request a NeedReturnLabel, this was a typo
9529         introduced in the anonymous method check-in.  Fixes #69131.
9530
9531         * Indexers were using the ShortName when defining themselves,
9532         causing a regression in the compiler bootstrap when applying the
9533         patch from 2004-11-02 (first part), now they use their full name
9534         and the bug is gone.
9535
9536 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
9537
9538         * driver.cs: Strip the path from the names of embedded resources. Fixes
9539         #68519.
9540
9541 2004-11-04  Raja R Harinath  <rharinath@novell.com>
9542
9543         Fix error message regression: cs0104-2.cs.
9544         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
9545         (AliasEntry.Resolve): Update.
9546         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
9547         'silent' flag.
9548         (RootContext.LookupType): Update.
9549
9550 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
9551
9552         * cs-parser.jay: Add support for handling accessor modifiers
9553         * class: Add support port accessor modifiers and error checking,
9554         define PropertyMethod.Define as virtual (not abstract anymore)
9555         * ecore.cs: Add checking for proeprties access with access modifiers
9556         * iterators.cs: Modify Accessor constructor call based in the modified
9557         constructor
9558 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
9559
9560         * expression.cs (StringConcat): Handle being called twice,
9561         as when we have a concat in a field init with more than two
9562         ctors in the class
9563
9564 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
9565
9566         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
9567         special case explicit implementations, we should always produce
9568         the .property or .event declaration.
9569         
9570         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
9571         since it will not return correct data if people use this
9572         unresolved in the presence of using statements (see test-313).
9573
9574         * class.cs (MethodData.Define): If we are an explicit interface
9575         implementation, set the method name to the full name of the
9576         interface plus the name of the method.  
9577
9578         Notice that using the method.MethodName.GetFullName() does not
9579         work, as it will only contain the name as declared on the source
9580         file (it can be a shorthand in the presence of using statements)
9581         and not the fully qualifed type name, for example:
9582
9583         using System;
9584
9585         class D : ICloneable {
9586                 object ICloneable.Clone ()  {
9587                 }
9588         }
9589
9590         Would produce a method called `ICloneable.Clone' instead of
9591         `System.ICloneable.Clone'.
9592
9593         * namespace.cs (Alias.Resolve): Use GetPartialName.
9594         
9595 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9596
9597         * cs-parser.jay: Add error 1055 report.
9598
9599 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
9600
9601         * assign.cs (Assign.DoResolve): Only do the transform of
9602         assignment into a New if the types are compatible, if not, fall
9603         through and let the implicit code deal with the errors and with
9604         the necessary conversions. 
9605
9606 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9607
9608         * cs-parser.jay: Add error 1031 report.
9609
9610         * cs-tokenizer.cs: Add location for error 1038.
9611
9612 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9613
9614         * cs-parser.jay: Add error 1016 report.
9615
9616 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9617
9618         * cs-parser.jay: Add errors 1575,1611 report.
9619
9620 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9621
9622         * cs-parser.jay: Add error 1001 report.
9623
9624 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9625
9626         Fix #68850
9627         * attribute.cs (GetMarshal): Add method argument for
9628         caller identification.
9629
9630         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
9631         agument for GetMarshal and RuntimeMissingSupport.
9632
9633 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9634
9635         * attribute.cs (ExtractSecurityPermissionSet): Removed
9636         TypeManager.code_access_permission_type.
9637
9638         * typemanager.cs: Removed TypeManager.code_access_permission_type.
9639
9640 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
9641
9642         * expression.cs (LocalVariableReference.DoResolveLValue): Check
9643         for obsolete use of a variable here.   Fixes regression on errors
9644         cs0619-25 and cs0619-26.
9645
9646 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
9647
9648         Fix #62358, implemented security attribute encoding.
9649
9650         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
9651         Tests permitted SecurityAction for assembly or other types.
9652         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
9653         data from SecurityPermissionAttribute to PermisionSet class.
9654
9655         * class.cs (ApplyAttributeBuilder): Added special handling
9656         for System.Security.Permissions.SecurityAttribute based types.
9657
9658         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
9659         special handling for System.Security.Permissions.SecurityAttribute
9660         based types.
9661
9662         * enum.cs (ApplyAttributeBuilder): Added special handling
9663         for System.Security.Permissions.SecurityAttribute based types.
9664
9665         * parameter.cs (ApplyAttributeBuilder): Added special handling
9666         for System.Security.Permissions.SecurityAttribute based types.
9667
9668         * rootcontext.cs: Next 2 core types.
9669
9670         * typemanager.cs (TypeManager.security_permission_attr_type):
9671         Built in type for the SecurityPermission Attribute.
9672         (code_access_permission_type): Build in type.
9673
9674 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
9675
9676         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9677         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9678         all of this information into
9679         EmitContext.EmitCapturedVariableInstance.
9680         
9681         * codegen.cs (EmitCapturedVariableInstance): move here the
9682         funcionality of emitting an ldarg.0 in the presence of a
9683         remapping.   This centralizes the instance emit code.
9684
9685         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9686         then emit a load of this: it means that we have reached the
9687         topmost ScopeInfo: the one that contains the pointer to the
9688         instance of the class hosting the anonymous method.
9689
9690         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9691         captures to the topmost CaptureContext.
9692
9693 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
9694
9695         * expression.cs (LocalVariableReference): Move the knowledge about
9696         the iterators into codegen's EmitCapturedVariableInstance.
9697
9698 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
9699
9700         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9701         all code paths return a value from an anonymous method (it is the
9702         same as the 161 error, but for anonymous methods).
9703
9704 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
9705
9706         The introduction of anonymous methods in the compiler changed
9707         various ways of doing things in the compiler.  The most
9708         significant one is the hard split between the resolution phase
9709         and the emission phases of the compiler.
9710
9711         For instance, routines that referenced local variables no
9712         longer can safely create temporary variables during the
9713         resolution phase: they must do so from the emission phase,
9714         since the variable might have been "captured", hence access to
9715         it can not be done with the local-variable operations from the runtime.
9716         
9717         * statement.cs 
9718
9719         (Block.Flags): New flag `IsTopLevel' to indicate that this block
9720         is a toplevel block.
9721
9722         (ToplevelBlock): A new kind of Block, these are the blocks that
9723         are created by the parser for all toplevel method bodies.  These
9724         include methods, accessors and anonymous methods.
9725
9726         These contain some extra information not found in regular blocks:
9727         A pointer to an optional CaptureContext (for tracking captured
9728         local variables and parameters).  A pointer to the parent
9729         ToplevelBlock.
9730         
9731         (Return.Resolve): Catch missmatches when returning a value from an
9732         anonymous method (error 1662).
9733         Invoke NeedReturnLabel from the Resolve phase instead of the emit
9734         phase.
9735
9736         (Break.Resolve): ditto.
9737
9738         (SwitchLabel): instead of defining the labels during the
9739         resolution phase, we now turned the public ILLabel and ILLabelCode
9740         labels into methods called GetILLabelCode() and GetILLabel() that
9741         only define the label during the Emit phase.
9742
9743         (GotoCase): Track the SwitchLabel instead of the computed label
9744         (its contained therein).  Emit the code by using
9745         SwitchLabel.GetILLabelCode ().
9746
9747         (LocalInfo.Flags.Captured): A new flag has been introduce to track
9748         whether the Local has been captured or not.
9749
9750         (LocalInfo.IsCaptured): New property, used to tell whether the
9751         local has been captured.
9752         
9753         * anonymous.cs: Vastly updated to contain the anonymous method
9754         support.
9755
9756         The main classes here are: CaptureContext which tracks any
9757         captured information for a toplevel block and ScopeInfo used to
9758         track the activation frames for various local variables.   
9759
9760         Each toplevel block has an optional capture context associated
9761         with it.  When a method contains an anonymous method both the
9762         toplevel method and the anonymous method will create a capture
9763         context.   When variables or parameters are captured, they are
9764         recorded on the CaptureContext that owns them, for example:
9765
9766         void Demo () {
9767              int a;
9768              MyDelegate d = delegate {
9769                  a = 1;
9770              }
9771         }
9772
9773         Here `a' will be recorded as captured on the toplevel
9774         CapturedContext, the inner captured context will not have anything
9775         (it will only have data if local variables or parameters from it
9776         are captured in a nested anonymous method.
9777
9778         The ScopeInfo is used to track the activation frames for local
9779         variables, for example:
9780
9781         for (int i = 0; i < 10; i++)
9782                 for (int j = 0; j < 10; j++){
9783                    MyDelegate d = delegate {
9784                         call (i, j);
9785                    }
9786                 }
9787
9788         At runtime this captures a single captured variable `i', but it
9789         captures 10 different versions of the variable `j'.  The variable
9790         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9791         recorded on a child.  
9792
9793         The toplevel ScopeInfo will also track information like the `this'
9794         pointer if instance variables were referenced (this is necessary
9795         as the anonymous method lives inside a nested class in the host
9796         type of the method). 
9797
9798         (AnonymousMethod): Expanded to track the Toplevel, implement
9799         `AnonymousMethod.Compatible' to tell whether an anonymous method
9800         can be converted to a target delegate type. 
9801
9802         The routine now also produces the anonymous method content
9803
9804         (AnonymousDelegate): A helper class that derives from
9805         DelegateCreation, this is used to generate the code necessary to
9806         produce the delegate for the anonymous method that was created. 
9807
9808         * assign.cs: API adjustments for new changes in
9809         Convert.ImplicitStandardConversionExists.
9810
9811         * class.cs: Adjustments to cope with the fact that now toplevel
9812         blocks are of type `ToplevelBlock'. 
9813
9814         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9815         insteda of standard blocks.
9816
9817         Flag errors if params arguments are passed to anonymous methods.
9818
9819         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9820         `CurrentAnonymousMethod' which points to the current Anonymous
9821         Method.  The variable points to the AnonymousMethod class that
9822         holds the code being compiled.  It is set in the new EmitContext
9823         created for the anonymous method.
9824
9825         (EmitContext.Phase): Introduce a variable and an enumeration to
9826         assist in enforcing some rules about when and where we are allowed
9827         to invoke certain methods (EmitContext.NeedsReturnLabel is the
9828         only one that enfonces this right now).
9829
9830         (EmitContext.HaveCaptureInfo): new helper method that returns
9831         whether we have a CapturedContext initialized.
9832
9833         (EmitContext.CaptureVariable): New method used to register that a
9834         LocalInfo must be flagged for capturing. 
9835
9836         (EmitContext.CapturedParameter): New method used to register that a
9837         parameters must be flagged for capturing. 
9838         
9839         (EmitContext.CapturedField): New method used to register that a
9840         field must be flagged for capturing. 
9841
9842         (EmitContext.HaveCapturedVariables,
9843         EmitContext.HaveCapturedFields): Return whether there are captured
9844         variables or fields. 
9845
9846         (EmitContext.EmitMethodHostInstance): This is used to emit the
9847         instance for the anonymous method.  The instance might be null
9848         (static methods), this (for anonymous methods that capture nothing
9849         and happen to live side-by-side with the current method body) or a
9850         more complicated expression if the method has a CaptureContext.
9851
9852         (EmitContext.EmitTopBlock): Routine that drives the emission of
9853         code: it will first resolve the top block, then emit any metadata
9854         and then emit the code.  The split is done so that we can extract
9855         any anonymous methods and flag any captured variables/parameters.
9856         
9857         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9858         during this phase, the ILGenerator should not be used as labels
9859         and local variables declared here might not be accessible to any
9860         code that is part of an anonymous method.  
9861
9862         Exceptions to this include the temporary variables that are
9863         created by some statements internally for holding temporary
9864         variables. 
9865         
9866         (EmitContext.EmitMeta): New routine, in charge of emitting all the
9867         metadata for a cb
9868
9869         (EmitContext.TemporaryReturn): This method is typically called
9870         from the Emit phase, and its the only place where we allow the
9871         ReturnLabel to be defined other than the EmitMeta.  The reason is
9872         that otherwise we would have to duplicate a lot of logic in the
9873         Resolve phases of various methods that today is on the Emit
9874         phase. 
9875
9876         (EmitContext.NeedReturnLabel): This no longer creates the label,
9877         as the ILGenerator is not valid during the resolve phase.
9878
9879         (EmitContext.EmitThis): Extended the knowledge in this class to
9880         work in anonymous methods in addition to iterators. 
9881
9882         (EmitContext.EmitCapturedVariableInstance): This emits whatever
9883         code is necessary on the stack to access the instance to a local
9884         variable (the variable will be accessed as a field).
9885
9886         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9887         EmitContext.EmitAddressOfParameter): Routines to support
9888         parameters (not completed at this point). 
9889         
9890         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9891         will also remove the parameters.
9892
9893         * convert.cs (Convert): Define a `ConstantEC' which points to a
9894         null.  This is just to prefity some code that uses
9895         ImplicitStandardConversion code and do not have an EmitContext
9896         handy.
9897
9898         The idea is to flag explicitly that at that point in time, it is
9899         known that the conversion will not trigger the delegate checking
9900         code in implicit conversions (which requires a valid
9901         EmitContext). 
9902
9903         Everywhere: pass new EmitContext parameter since
9904         ImplicitStandardConversionExists now requires it to check for
9905         anonymous method conversions. 
9906
9907         (Convert.ImplicitStandardConversionExists): If the type of an
9908         expression is the anonymous_method_type, and the type is a
9909         delegate, we invoke the AnonymousMethod.Compatible method to check
9910         whether an implicit conversion is possible. 
9911
9912         (Convert.ImplicitConversionStandard): Only do implicit method
9913         group conversions if the language level is not ISO_1.
9914
9915         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9916         MethodInfo for the Invoke method.  used by Delegate and
9917         AnonymousDelegate.
9918
9919         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9920         method conversions if the target type is a delegate.
9921
9922         Removed extra debugging nops.
9923
9924         (LocalVariableReference): Turn the `local_info' into a public
9925         field. 
9926
9927         Add `prepared' field, the same hack used for FieldExprs to cope
9928         with composed assignments, as Local variables do not necessarily
9929         operate purely on the stack as they used to: they can be captured
9930         fields. 
9931
9932         Add `temp' for a temporary result, like fields.
9933
9934         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9935
9936         It now copes with Local variables that are captured and emits the
9937         proper instance variable to load it from a field in the captured
9938         case. 
9939
9940         (ParameterReference.DoResolveBase): During the resolve phase,
9941         capture parameters if we are in an anonymous method.
9942
9943         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9944         anonymous method, use the EmitContext helper routines to emit the
9945         parameter reference.
9946
9947         * iterators.cs: Set RemapToProxy to true/false during the
9948         EmitDispose class.
9949
9950         * parameters.cs (GetParameterByName): New helper method. 
9951
9952         * typemanager.cs (anonymous_method_type) a new type that
9953         represents an anonyous method.  This is always an internal type,
9954         used as a fencepost to test against the anonymous-methodness of an
9955         expression. 
9956         
9957 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9958
9959         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9960         561 report.
9961         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9962
9963 2004-10-18  Martin Baulig  <martin@ximian.com>
9964
9965         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9966         `Type' directly, but call ResolveType() on it.
9967         (Catch.Resolve): Likewise.
9968         (Foreach.Resolve): Likewise.
9969
9970 2004-10-18  Martin Baulig  <martin@ximian.com>
9971
9972         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9973         `Type' directly, but call ResolveType() on it.
9974         (Probe.DoResolve): Likewise.
9975         (ArrayCreation.LookupType): Likewise.
9976         (TypeOf.DoResolve): Likewise.
9977         (SizeOf.DoResolve): Likewise.
9978
9979 2004-10-18  Martin Baulig  <martin@ximian.com>
9980
9981         * expression.cs (Invocation.BetterFunction): Put back
9982         TypeManager.TypeToCoreType().
9983
9984 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9985
9986         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9987         the ResolveType.
9988
9989 2004-10-18  Martin Baulig  <martin@ximian.com>
9990
9991         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
9992         `Type' directly, but call ResolveType() on it.
9993
9994 2004-10-18  Martin Baulig  <martin@ximian.com>
9995
9996         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9997         `Type' directly, but call ResolveType() on it.
9998         (MemberBase.DoDefine): Likewise.
9999
10000         * expression.cs (New.DoResolve): Don't access the TypeExpr's
10001         `Type' directly, but call ResolveType() on it.
10002         (ComposedCast.DoResolveAsTypeStep): Likewise.
10003
10004         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
10005         `Type' directly, but call ResolveType() on it.
10006
10007 2004-10-17  John Luke  <john.luke@gmail.com>
10008
10009         * class.cs (Operator.GetSignatureForError): use CSharpName
10010
10011         * parameter.cs (Parameter.GetSignatureForError): Returns
10012         correct name even if was not defined.
10013
10014 2004-10-13  Raja R Harinath  <rharinath@novell.com>
10015
10016         Fix #65816.
10017         * class.cs (TypeContainer.EmitContext): New property.
10018         (DefineNestedTypes): Create an emitcontext for each part.
10019         (MethodCore.DoDefineParameters): Use container's emitcontext.
10020         Pass type array to InternalParameters.
10021         (MemberBase.DoDefine): Use container's emitcontext.
10022         (FieldMember.Define): Likewise.
10023         (Event.Define): Likewise.
10024         (SetMethod.GetParameterInfo): Change argument to EmitContext.
10025         Pass type array to InternalParameters.
10026         (SetIndexerMethod.GetParameterInfo): Likewise.
10027         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
10028         * delegate.cs (Define): Pass emitcontext to
10029         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
10030         array to InternalParameters.
10031         * expression.cs (ParameterReference.DoResolveBase): Pass
10032         emitcontext to GetParameterInfo.
10033         (ComposedCast.DoResolveAsTypeStep): Remove check on
10034         ec.ResolvingTypeTree.
10035         * parameter.cs (Parameter.Resolve): Change argument to
10036         EmitContext.  Use ResolveAsTypeTerminal.
10037         (Parameter.GetSignature): Change argument to EmitContext.
10038         (Parameters.ComputeSignature): Likewise.
10039         (Parameters.ComputeParameterTypes): Likewise.
10040         (Parameters.GetParameterInfo): Likewise.
10041         (Parameters.ComputeAndDefineParameterTypes): Likewise.
10042         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
10043         * support.cs (InternalParameters..ctor): Remove variant that takes
10044         a DeclSpace.
10045         * typemanager.cs (system_intptr_expr): New.
10046         (InitExpressionTypes): Initialize it.
10047
10048 2004-10-12  Chris Toshok  <toshok@ximian.com>
10049
10050         * cs-parser.jay: fix location for try_statement and catch_clause.
10051
10052 2004-10-11  Martin Baulig  <martin@ximian.com>
10053
10054         * report.cs: Don't make --fatal abort on warnings, we have
10055         -warnaserror for that.
10056
10057 2004-10-07  Raja R Harinath  <rharinath@novell.com>
10058
10059         More DeclSpace.ResolveType avoidance.
10060         * decl.cs (MemberCore.InUnsafe): New property.
10061         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
10062         with newly created EmitContext.
10063         (FieldMember.Define): Likewise.
10064         * delegate.cs (Delegate.Define): Likewise.
10065         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
10066         only if normal name-lookup fails.
10067         (TypeExpr.DoResolve): Enable error-checking.
10068         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
10069         (SizeOf.DoResolve): Likewise.
10070         (ComposedCast.DoResolveAsTypeStep): Likewise.
10071         (StackAlloc.DoResolve): Likewise.
10072         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
10073         (Block.Unsafe): New property.
10074         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
10075         (Unsafe): Set 'unsafe' flag of contained block.
10076         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
10077         (Fixed.Resolve): Likewise.
10078         (Catch.Resolve): Likewise.
10079         (Using.ResolveLocalVariableDecls): Likewise.
10080         (Foreach.Resolve): Likewise.
10081
10082 2004-10-05  John Luke <john.luke@gmail.com>
10083
10084         * cs-parser.jay: add location to error CS0175
10085
10086 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
10087
10088         * ecore.cs (Expression.Constantity): Add support for turning null
10089         into a constant.
10090
10091         * const.cs (Const.Define): Allow constants to be reference types
10092         as long as the value is Null.
10093
10094 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
10095
10096         * namespace.cs (NamespaceEntry.Using): No matter which warning
10097         level is set, check if this namespace name has already been added.
10098
10099 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
10100
10101         * expression.cs: reftype [!=]= null should always use br[true,false].
10102         # 67410
10103
10104 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
10105
10106         Fix #67108
10107         * attribute.cs: Enum conversion moved to 
10108         GetAttributeArgumentExpression to be applied to the all
10109         expressions.
10110
10111 2004-10-01  Raja R Harinath  <rharinath@novell.com>
10112
10113         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
10114         * class.c (TypeContainer.DefineType): Flag error if
10115         base types aren't accessible due to access permissions.
10116         * decl.cs (DeclSpace.ResolveType): Move logic to
10117         Expression.ResolveAsTypeTerminal.
10118         (DeclSpace.ResolveTypeExpr): Thin layer over
10119         Expression.ResolveAsTypeTerminal.
10120         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
10121         Refactor code into NestedAccess.  Use it.
10122         (DeclSpace.NestedAccess): New.
10123         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
10124         argument to silence errors.  Check access permissions.
10125         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
10126         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
10127         (Cast.DoResolve): Likewise.
10128         (New.DoResolve): Likewise.
10129         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
10130         (TypeOf.DoResolve): Likewise.
10131
10132         * expression.cs (Invocation.BetterConversion): Return the Type of
10133         the better conversion.  Implement section 14.4.2.3 more faithfully.
10134         (Invocation.BetterFunction): Make boolean.  Make correspondence to
10135         section 14.4.2.2 explicit.
10136         (Invocation.OverloadResolve): Update.
10137         (Invocation): Remove is_base field.
10138         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
10139         (Invocation.Emit): Likewise.
10140
10141 2004-09-27  Raja R Harinath  <rharinath@novell.com>
10142
10143         * README: Update to changes.
10144
10145 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
10146
10147         * cs-parser.jay: Reverted 642 warning fix.
10148
10149 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10150
10151         Fix bug #66615
10152         * decl.cs (FindMemberWithSameName): Indexer can have more than
10153         1 argument.
10154
10155 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10156
10157         * expression.cs (LocalVariableReference.DoResolveLValue):
10158         Do not report warning 219 for out values.
10159         (EmptyExpression.Null): New member to avoid extra allocations.
10160
10161 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10162
10163         * cs-parser.jay: Fix wrong warning 642 report.
10164
10165         * cs-tokenizer.cs (CheckNextToken): New helper;
10166         Inspect next character if is same as expected.
10167
10168 2004-09-23  Martin Baulig  <martin@ximian.com>
10169
10170         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
10171         (Convert.ImplicitReferenceConversionExists): Likewise.
10172
10173 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10174
10175         * class.cs (Operator.Define): Add error 448 and 559 report.
10176
10177 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10178
10179         * class.cs (MemberBase.IsTypePermitted): New protected
10180         method for checking error CS0610.
10181
10182 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10183
10184         * class.cs (TypeContainer.HasExplicitLayout): New property
10185         Returns whether container has StructLayout attribute set Explicit.
10186         (FieldMember): New abstract class for consts and fields.
10187         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
10188         (Field): Reuse FieldMember.
10189
10190         * const.cs (Const): Reuse FieldMember.
10191
10192         * rootcontext.cs: EmitConstants call moved to class.
10193
10194 2004-09-22  Martin Baulig  <martin@ximian.com>
10195
10196         Thanks to Peter Sestoft for this bug report.
10197
10198         * expression.cs (Conditional): If both the `trueExpr' and the
10199         `falseExpr' is a NullLiteral, return a NullLiteral.
10200
10201 2004-09-22  Martin Baulig  <martin@ximian.com>
10202
10203         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
10204         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
10205         for the "get_Current" call.
10206
10207 2004-09-22  Martin Baulig  <martin@ximian.com>
10208
10209         Marek and me just fixed one of our oldest bugs: #28562 :-)
10210
10211         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
10212
10213         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
10214         we're an EnumConstant, just return that.
10215         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
10216         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
10217         to get the value which'll actually be written into the attribute.
10218         However, we have to use GetValue() to access the attribute's value
10219         in the compiler.        
10220
10221 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10222
10223         * constant.cs (Constant.IsNegative): New abstract property
10224         IsNegative.
10225
10226         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
10227         (StackAlloc.DoResolve): Reused IsNegative.
10228
10229 2004-09-21  Martin Baulig  <martin@ximian.com>
10230
10231         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
10232         if we're used in an iterator, we may be called from different
10233         methods.
10234
10235         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
10236         we actually have an exception block.
10237
10238 2004-09-20  John Luke <jluke@cfl.rr.com>
10239
10240         * class.cs, cs-parser.jay: Improve the error report for 1520:
10241         report the actual line where the error happens, not where the
10242         class was declared.
10243
10244         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
10245         Pass location information that was available elsewhere.
10246
10247 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
10248
10249         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
10250         runtime to delay sign assemblies.
10251
10252 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
10253
10254         * cs-parser.jay: Do not report the stack trace, this is barely
10255         used nowadays.
10256
10257 2004-08-22  John Luke  <john.luke@gmail.com>
10258  
10259         * driver.cs : check that a resource id is not already used
10260         before adding it, report CS1508 if it is, bug #63637
10261
10262 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
10263
10264         * ecore.cs: Removed dead code.
10265
10266 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
10267
10268         * class.cs: Do not report warning CS0067 on the interfaces.
10269
10270 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10271
10272         * cs-parser.jay: Add error 504 report.
10273
10274 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10275
10276         * rootcontext.cs: WarningLevel is 4 by default now.
10277
10278         * statement.cs (Fixed.Resolve): Do not null
10279         VariableInfo.
10280
10281 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10282
10283         Fixed bug #55780
10284         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
10285         deep search when property is not virtual.
10286         (PropertyExpr.ResolveAccessors): Make one call for both
10287         accessors.
10288
10289 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10290
10291         Fixed bug #65766
10292         * statement.cs: Error 152 report constains also location.
10293
10294 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10295
10296         Fixed bug #65766
10297         * const.cs: Explicitly set constant as static.
10298
10299 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10300
10301         Fixed bug #64226
10302         * cs-parser.jay: Add error 1017 report.
10303
10304 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10305
10306         Fixed bug #59980, #64224
10307         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
10308
10309         * typemanager.cs (IsSpecialMethod): Simplified
10310
10311 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10312
10313         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
10314         condition with better params.
10315
10316 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10317
10318         Fixed bug #65238
10319         * attribute.cs (Resolve): Property has to have both
10320         accessors.
10321
10322 2004-09-14  Martin Baulig  <martin@ximian.com>
10323
10324         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
10325
10326 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10327
10328         Fixed bug #61902
10329         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
10330         called and is obsolete then this member suppress message
10331         when call is inside next [Obsolete] method or type.
10332
10333         * expression.cs: Use TestObsoleteMethodUsage member.
10334
10335 2004-09-14  Martin Baulig  <martin@ximian.com>
10336
10337         * cs-parser.jay: Sync a bit with the GMCS version.
10338
10339 2004-09-14  Martin Baulig  <martin@ximian.com>
10340
10341         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
10342         (CSharpParser.yacc_verbose_flag): New public field.
10343
10344         * genericparser.cs: Removed.
10345
10346 2004-09-14  Raja R Harinath  <rharinath@novell.com>
10347
10348         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
10349
10350 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
10351
10352         * class.cs (MethodCore.CheckBase): Fix bug #65757.
10353
10354 2004-09-10  Martin Baulig  <martin@ximian.com>
10355
10356         Backported my MemberName changes from GMCS into MCS.
10357
10358         - we are now using a special `MemberName' class instead of using
10359         strings; in GMCS, the `MemberName' also contains the type
10360         arguments.
10361
10362         - changed the grammar rules a bit:
10363           * the old `member_name' is now a `namespace_or_type_name':
10364             The rule is that we use `namespace_or_type_name' everywhere
10365             where we expect either a "member name" (GetEnumerator) or a
10366             "member name" with an explicit interface name
10367             (IEnumerable.GetEnumerator).
10368             In GMCS, the explicit interface name may include type arguments
10369             (IEnumerable<T>.GetEnumerator).
10370           * we use `member_name' instead of just `IDENTIFIER' for
10371             "member names":
10372             The rule is that we use `member_name' wherever a member may
10373             have type parameters in GMCS.       
10374
10375         * decl.cs (MemberName): New public class.
10376         (MemberCore.MemberName): New public readonly field.
10377         (MemberCore.ctor): Take a `MemberName' argument, not a string.
10378         (DeclSpace): Likewise.
10379
10380         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
10381         * enum.cs (Enum.ctor): Likewise.
10382
10383         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
10384         MemberName.     
10385         (AliasEntry.ctor): Take a MemberName, not an Expression.
10386         (AliasEntry.UsingAlias): Likewise.
10387
10388         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
10389         (IMethodData.MemberName): Changed type from string to MemberName.
10390         (MemberBase.ExplicitInterfaceName): Likewise.
10391         (AbstractPropertyEventMethod.SetupName): Make this private.
10392         (AbstractPropertyEventMethod.ctor): Added `string prefix'
10393         argument; compute the member name here.
10394         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
10395         on the `member.MemberName' and the `prefix'.
10396
10397         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
10398         not `type_name'.
10399         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
10400         thus, we get a `MemberName' instead of a `string'.  These
10401         declarations may have type parameters in GMCS.
10402         (interface_method_declaration, delegate_declaration): Likewise.
10403         (class_declaration, interface_declaration): Likewise.
10404         (method_header): Use `namespace_or_type_name' instead of
10405         `member_name'.  We may be an explicit interface implementation.
10406         (property_declaration, event_declaration): Likewise.
10407         (member_name): This is now just an `IDENTIFIER', not a
10408         `namespace_or_type_name'.
10409         (type_name, interface_type): Removed.
10410         (namespace_or_type_name): Return a MemberName, not an Expression.
10411         (primary_expression): Use `member_name' instead of `IDENTIFIER';
10412         call GetTypeExpression() on the MemberName to get an expression.
10413         (IndexerDeclaration.interface_type): Changed type from string to
10414         MemberName.
10415         (MakeName): Operate on MemberName's instead of string's.
10416
10417 2004-09-13  Raja R Harinath  <rharinath@novell.com>
10418
10419         Fix bug #55770.
10420         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
10421         (NamespaceEntry.Lookup): Add new argument to flag if we want the
10422         lookup to avoid symbols introduced by 'using'.
10423         * rootcontext.cs (NamespaceLookup): Update.
10424
10425 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10426
10427         * class.cs (TypeContainer.DoDefineMembers): Do not call
10428         DefineDefaultConstructor for static classes.
10429
10430 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10431
10432         * attribute.cs (Attribute.Resolve): Add error 653 report.
10433
10434         * class.cs (Class.ApplyAttributeBuilder): Add error 641
10435         report.
10436         (Method.ApplyAttributeBuilder): Add error 685 report.
10437         (Operator.Define): Add error 564 report.
10438
10439         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
10440
10441         * expression.cs (Invocation.DoResolve): Add error
10442         245 and 250 report.
10443
10444         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
10445         error 674 report.
10446
10447 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10448
10449         * class.cs (ConstructorInitializer.Resolve):
10450         Wrong error number (515->516).
10451
10452 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10453
10454         * class.cs (Indexer.Define): Add error 631 report.
10455
10456 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10457
10458         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
10459
10460 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10461
10462         * expression.cs (Probe.DoResolve): Add error CS0241 report.
10463
10464 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
10465
10466         * cs-parser.jay: Added error CS0241 report.
10467
10468 2004-09-10  Raja R Harinath  <rharinath@novell.com>
10469
10470         * cs-parser.jay (fixed_statement): Introduce a scope for the
10471         declaration in the 'fixed' statement.
10472
10473 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10474
10475         * cs-parser.jay: Added CS0230 error report.
10476
10477 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10478
10479         * cs-parser.jay: Added errors CS0231 and CS0257 report.
10480
10481 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10482
10483         * expression.cs (Argument.Resolve): Added error CS0192 and
10484         CS0199 report.
10485
10486 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10487
10488         C# 2.0 #pragma warning feature
10489
10490         * cs-tokenizer.cs (PreProcessPragma): New method; 
10491         Handles #pragma directive.
10492
10493         * report.cs (WarningRegions): New class; Support
10494         class for #pragma warning directive. It tests whether
10495         warning is enabled for a given line.
10496
10497 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
10498
10499         * const.cs: Add more descriptive error report, tahnks to
10500         Sebastien. 
10501
10502 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
10503
10504         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
10505
10506 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
10507
10508         * expression.cs: Apply patch from Ben: Remove dead code from
10509         ArrayCreation, and remove the TurnintoConstant call in const.cs,
10510         as that code just threw an exception anwyays.
10511
10512         * const.cs: Remove the call to the turnintoconstant, for details
10513         see bug: #63144
10514         
10515         * literal.cs: The type of the null-literal is the null type;  So
10516         we use a placeholder type (literal.cs:System.Null, defined here)
10517         for it.
10518
10519         * expression.cs (Conditional.DoResolve): Remove some old code that
10520         is no longer needed, conversions have been fixed.
10521
10522         (ArrayCreationExpression.DoResolve): Return false if we fail to
10523         resolve the inner expression.
10524
10525 2004-09-07  Raja R Harinath  <rharinath@novell.com>
10526
10527         Fix test-290.cs.
10528         * cs-parser.jay (delegate_declaration): Record a delegate
10529         declaration as a type declaration.
10530         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
10531
10532 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
10533
10534         * parameter.cs: Do not crash if the type can not be resolved. 
10535
10536         * expression.cs: Report errors with unsafe pointers, fixes #64896
10537
10538 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10539
10540         * expression.cs: Pointer arith always needs to do a conv.i
10541         if the operand is a long. fix 65320
10542
10543 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10544
10545         Fixed cs0619-37.cs, cs0619-38.cs
10546
10547         * enum.cs (GetObsoleteAttribute): Removed.
10548
10549         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
10550         on Enum member is double staged. The first is tested member
10551         and then enum.
10552
10553 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10554
10555         Fixed #56986, #63631, #65231
10556
10557         * class.cs: (TypeContainer.AddToMemberContainer): New method,
10558         adds member to name container.
10559         (TypeContainer.AddToTypeContainer): New method, adds type to
10560         name container.
10561         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
10562         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
10563         AddOperator): Simplified by reusing AddToMemberContainer.
10564         (TypeContainer.UserDefinedStaticConstructor): Changed to property
10565         instead of field.
10566         (Method.CheckForDuplications): Fixed implementation to test all
10567         possibilities.
10568         (MemberBase): Detection whether member is explicit interface
10569         implementation is now in constructor.
10570         (MemberBase.UpdateMemberName): Handles IndexerName.
10571         (Accessor): Changed to keep also location information.
10572         (AbstractPropertyEventMethod): Is derived from MemberCore.
10573         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
10574         will be emited or not.
10575         (PropertyBase.AreAccessorsDuplicateImplementation):
10576         Tests whether accessors are not in collision with some method.
10577         (Operator): Is derived from MethodCore to simplify common
10578         operations.
10579
10580         * decl.cs (Flags.TestMethodDuplication): Test for duplication
10581         must be performed.
10582         (DeclSpace.AddToContainer): Adds the member to defined_names
10583         table. It tests for duplications and enclosing name conflicts.
10584
10585         * enum.cs (EnumMember): Clean up to reuse the base structures
10586
10587 2004-09-03  Martin Baulig  <martin@ximian.com>
10588
10589         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
10590         into TypeContainer, to make partial classes work again.
10591
10592 2004-09-03  Martin Baulig  <martin@ximian.com>
10593
10594         * rootcontext.cs (RootContext.V2): Removed.
10595
10596 2004-03-23  Martin Baulig  <martin@ximian.com>
10597
10598         * expression.cs (Invocation.OverloadResolve): Added `bool
10599         may_fail' argument and use it instead of the Location.IsNull() hack.
10600
10601 2004-09-03  Martin Baulig  <martin@ximian.com>
10602
10603         Merged latest changes into gmcs.  Please keep this comment in
10604         here, it makes it easier for me to see what changed in MCS since
10605         the last time I merged.
10606
10607 2004-09-03  Raja R Harinath  <rharinath@novell.com>
10608
10609         Fix #61128.
10610         * expression.cs (BetterConversion): Don't allow either conversion 
10611         to be null.  Remove redundant implicit conversion test when 'q ==
10612         null' -- when this function is invoked, we already know that the
10613         implicit conversion exists.
10614         (BetterFunction): Assume that 'best' is non-null.  Remove
10615         redundant reimplementation of IsApplicable when 'best' is null.
10616         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
10617         number of arguments.
10618         (IsAncestralType): Extract from OverloadResolve.
10619         (OverloadResolve): Make robust to the MethodGroupExpr being
10620         unsorted.  Implement all the logic of Section 14.5.5.1, and
10621         support overloading of methods from multiple applicable types.
10622         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
10623
10624         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
10625         (RealError, Warning): Append type of report to related symbol.
10626
10627 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
10628
10629         * enum.cs: Fixed CLS-Compliance checks for enum members.
10630         Error tests cs3008-8.cs, cs3014-8.cs
10631
10632 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10633
10634         Fixed bug #62342, #63102
10635         * class.cs: ImplementIndexer uses member.IsExplicitImpl
10636         like ImplementMethod.
10637
10638 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10639
10640         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10641         Fixed bug #65170.
10642
10643 2004-09-02  Martin Baulig  <martin@ximian.com>
10644
10645         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
10646         TypeManager.GetArgumentTypes() rather than calling GetParameters()
10647         on the MethodBase.
10648
10649 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
10650
10651         C# 2.0 Static classes implemented
10652
10653         * class.cs (TypeContainer): instance_constructors,
10654         initialized_fields, initialized_static_fields,
10655         default_constructor, base_inteface_types are protected to be
10656         accessible from StaticClass.
10657         (TypeContainer.DefineDefaultConstructor): New virtual method
10658         for custom default constructor generating
10659         (StaticClass): New class to handle "Static classes" feature.
10660
10661         * cs-parser.jay: Handle static keyword on class like instance
10662         of StaticClass.
10663
10664         * driver.cs: Added "/langversion" command line switch with two
10665         options (iso-1, default).
10666
10667 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
10668
10669         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
10670
10671 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
10672
10673         * delegate.cs: Style.
10674
10675 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10676
10677         * delegate.cs: Add seperate instance expr field for miguel.
10678
10679 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10680
10681         * PointerArithmetic (Resolve): make sure we are not doing
10682         pointer arith on void*. Also, make sure we are resolved
10683         by not setting eclass until resolve.
10684
10685         All callers: Make sure that PointerArithmetic gets resolved.
10686
10687 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10688
10689         * ArrayCreation (LookupType): If the type does not resolve 
10690         to an array, give an error.
10691
10692 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
10693
10694         * statement.cs (Try.Resolve): Fixed bug #64222
10695
10696 2004-08-27  Martin Baulig  <martin@ximian.com>
10697
10698         * class.cs
10699         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10700         crash here.     
10701
10702 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10703
10704         * ecore.cs (Constantify): Get underlying type via
10705         System.Enum.GetUnderlyingType to avoid StackOverflow on the
10706         Windows in special cases.
10707
10708 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10709
10710         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10711         for obtaining also private methods.
10712         (GetRemoveMethod): Used GetRemoveMethod (true)
10713         for obtaining also private methods.
10714
10715 2004-08-24  Martin Baulig  <martin@ximian.com>
10716
10717         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10718         MethodAttributes.HideBySig for operators.
10719
10720 2004-08-23  Martin Baulig  <martin@ximian.com>
10721
10722         Back to the old error reporting system :-)
10723
10724         * report.cs (Message): Removed.
10725         (Report.MessageData, ErrorData, WarningData): Removed.
10726         (Report.Error, Warning): Back to the old system.
10727
10728 2004-08-23  Martin Baulig  <martin@ximian.com>
10729
10730         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10731
10732         * class.cs (TypeContainer.ParentContainer): New public virtual
10733         method; replaces the explicit interface implementation.
10734         (ClassPart.ParentContainer): Override.
10735
10736 2004-08-23  Martin Baulig  <martin@ximian.com>
10737
10738         * statement.cs (Switch): Added support for constant switches; see
10739         #59428 or test-285.cs.
10740
10741 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10742
10743         Fixed bug #62740.
10744         * statement.cs (GetEnumeratorFilter): Removed useless
10745         logic because C# specs is strict. GetEnumerator must be
10746         public.
10747
10748 2004-08-22  Martin Baulig  <martin@ximian.com>
10749
10750         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10751         a switch and may break, reset the barrier.  Fixes #59867.
10752
10753 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10754
10755         CLS-Compliance speed up (~5% for corlib)
10756
10757         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10758         New method. Tests container for CLS-Compliant names
10759
10760         * class.cs (TypeContainer.VerifyClsName): New method.
10761         Checks whether container name is CLS Compliant.
10762         (Constructor): Implements IMethodData.
10763
10764         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10765         low-case table for CLS Compliance test.
10766         (MemberCache.VerifyClsParameterConflict): New method.
10767         Checks method parameters for CS3006 error.
10768
10769         * enum.cs (EnumMember): Is derived from MemberCore.
10770         (Enum.VerifyClsName): Optimized for better performance.
10771
10772 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10773
10774         * report.cs: Renamed Error_T to Error and changed all
10775         references.
10776
10777 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10778
10779         * class.cs (TypeContainer.IndexerArrayList): New inner class
10780         container for indexers.
10781         (TypeContainer.DefaultIndexerName): New constant for default
10782         indexer name. Replaced all "Item" with this constant.
10783         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10784
10785         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10786         DefaultMemberAttribute constructor.
10787
10788 2004-08-05  Martin Baulig  <martin@ximian.com>
10789
10790         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10791         Fix bug #59429.
10792
10793 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10794
10795         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10796         multi platforms problem.
10797
10798         * compiler.csproj: Included shared files.
10799
10800 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10801
10802         Fix bug 60333, 55971 in the more general way
10803         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10804         Added arg_type argument for constant conversion.
10805         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10806
10807 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10808
10809         Fix bug #59760
10810         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10811         OperatorArrayList, MethodCoreArrayList for typecontainer
10812         containers. Changed class member types to these new types.
10813         (MethodArrayList.DefineMembers): Added test for CS0659.
10814
10815 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10816
10817         * cfold.cs: Synchronize the folding with the code in expression.cs
10818         Binary.DoNumericPromotions for uint operands.
10819
10820         * attribute.cs: Revert patch from Raja, it introduced a regression
10821         while building Blam-1.2.1 (hard to isolate a test case).
10822
10823 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10824
10825         Fix for #55382
10826         * class.cs:
10827         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10828         name collision.
10829         (MethodCore.parent_method): New member. The method we're overriding
10830         if this is an override method.
10831         (MethodCore.CheckBase): Moved from Method class and made common.
10832         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10833         private.
10834         (MethodCore.CheckForDuplications): New abstract method. For custom
10835         member duplication search in a container
10836         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10837         method and its return type.
10838         (Event.conflict_symbol): New member. Symbol with same name in the
10839         parent class.
10840
10841         * decl.cs:
10842         (MemberCache.FindMemberWithSameName): New method. The method
10843         is looking for conflict with inherited symbols.
10844
10845 2004-08-04  Martin Baulig  <martin@ximian.com>
10846
10847         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10848
10849         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10850
10851 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10852
10853         * report.cs (Message): New enum for better error, warning reference in
10854         the code.
10855         (MessageData): New inner abstract class. It generally handles printing of
10856         error and warning messages.
10857         Removed unused Error, Warning, Message methods.
10858
10859 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10860
10861         Fix for cs0592-8.cs test
10862         * attribute.cs
10863         (Attributable.ValidAttributeTargets): Made public.
10864         (Attribute.ExplicitTarget): New member for explicit target value.
10865         (Attribute.CheckTargets): Now we translate explicit attribute
10866         target to Target here.
10867
10868 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10869
10870         * ecore.cs (MethodGroupExpr): new IsBase property.
10871
10872         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10873
10874         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10875         rather than an instance expr.
10876
10877         (DelegateCreation.Emit): Use the method group rather than
10878         the instance expression. Also, if you have base.Foo as the
10879         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10880
10881         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10882
10883         (NewDelegate.DoResolve): Only check for the existance of Invoke
10884         if the method is going to be needed. Use MethodGroupExpr.
10885
10886         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10887
10888         * expression.cs: For pointer arith., make sure to use
10889         the size of the type, not the size of the pointer to
10890         the type.
10891
10892 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10893
10894         Fix for #60722
10895         * class.cs (Class): Added error CS0502 test.
10896
10897 2004-08-03  John Luke  <jluke@cfl.rr.com>
10898             Raja R Harinath  <rharinath@novell.com>
10899
10900         Fix for #60997.
10901         * attribute.cs (Attribute.complained_before): New flag.
10902         (Attribute.ResolveType, Attribute.Resolve),
10903         (Attribute.DefinePInvokeMethod): Set it.
10904         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10905         
10906 2004-08-03  Martin Baulig  <martin@ximian.com>
10907
10908         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10909         use a user-defined operator; we still need to do numeric
10910         promotions in case one argument is a builtin type and the other
10911         one has an implicit conversion to that type.  Fixes #62322.
10912
10913 2004-08-02  Martin Baulig  <martin@ximian.com>
10914
10915         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10916         (LocalInfo.IsThis): New public property.
10917         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10918
10919 2004-08-01  Martin Baulig  <martin@ximian.com>
10920
10921         * class.cs (TypeContainer.GetClassBases): Don't set the default
10922         here since we may get called from GetPartialBases().
10923         (TypeContainer.DefineType): If GetClassBases() didn't return a
10924         parent, use the default one.
10925
10926 2004-07-30  Duncan Mak  <duncan@ximian.com>
10927
10928         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10929
10930 2004-07-30  Martin Baulig  <martin@ximian.com>
10931
10932         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10933
10934         * class.cs (SourceMethod): New public class, derive from the
10935         symbol writer's ISourceMethod.
10936         (Method): Use the new symbol writer API.
10937
10938         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10939         as argument and use the new symbol writer.
10940
10941         * location.cs
10942         (SourceFile): Implement the symbol writer's ISourceFile.
10943         (Location.SymbolDocument): Removed.
10944         (Location.SourceFile): New public property.
10945
10946         * symbolwriter.cs: Use the new symbol writer API.
10947
10948 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10949
10950         * Makefile (install-local): Remove.  Functionality moved to
10951         executable.make.
10952
10953 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10954
10955         * Makefile: Install mcs.exe.config file together with mcs.exe.
10956         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10957         correct runtime version.
10958         
10959 2004-07-25  Martin Baulig  <martin@ximian.com>
10960
10961         * class.cs
10962         (TypeContainer.RegisterOrder): Removed, this was unused.
10963         (TypeContainer, interface_order): Removed.
10964         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10965         TypeContainer as argument since we can also be called with a
10966         `PartialContainer' for a partial class/struct/interface.
10967         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10968         of checking whether we're an `Interface' - we could be a
10969         `PartialContainer'.
10970         (PartialContainer.Register): Override; call
10971         AddClass()/AddStruct()/AddInterface() on our parent.
10972
10973         * cs-parser.jay (interface_member_declaration): Add things to the
10974         `current_container', not the `current_class'.
10975
10976         * rootcontext.cs (RegisterOrder): The overloaded version which
10977         takes an `Interface' was unused, removed.
10978
10979         * typemanager.cs (TypeManager.LookupInterface): Return a
10980         `TypeContainer', not an `Interface'.
10981         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10982         contain a `PartialContainer' for an interface, so check it's
10983         `Kind' to figure out what it is.
10984
10985 2004-07-25  Martin Baulig  <martin@ximian.com>
10986
10987         * class.cs (Class.DefaultTypeAttributes): New public constant.
10988         (Struct.DefaultTypeAttributes): Likewise.
10989         (Interface.DefaultTypeAttributes): Likewise.
10990         (PartialContainer.TypeAttr): Override this and add the
10991         DefaultTypeAttributes.
10992
10993 2004-07-25  Martin Baulig  <martin@ximian.com>
10994
10995         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10996         we can just use the `Parent' field instead.
10997
10998 2004-07-25  Martin Baulig  <martin@ximian.com>
10999
11000         * class.cs (TypeContainer.Emit): Renamed to EmitType().
11001
11002 2004-07-25  Martin Baulig  <martin@ximian.com>
11003
11004         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
11005         our parts before defining any methods.
11006         (TypeContainer.VerifyImplements): Make this virtual.
11007         (ClassPart.VerifyImplements): Override and call VerifyImplements()
11008         on our PartialContainer.
11009
11010 2004-07-25  Martin Baulig  <martin@ximian.com>
11011
11012         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
11013
11014         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
11015         argument, we can just use the `Parent' field instead.
11016
11017         * class.cs
11018         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
11019         (MemberBase.DoDefine): Likewise.
11020
11021 2004-07-24  Martin Baulig  <martin@ximian.com>
11022
11023         * decl.cs (MemberCore.Parent): New public field.
11024         (DeclSpace.Parent): Moved to MemberCore.
11025
11026         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
11027         (MemberBase.ctor): Added TypeContainer argument, pass it to our
11028         parent's .ctor.
11029         (FieldBase, Field, Operator): Likewise.
11030         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
11031         (EventField, Event): Likewise.
11032
11033 2004-07-23  Martin Baulig  <martin@ximian.com>
11034
11035         * class.cs (PartialContainer): New public class.
11036         (ClassPart): New public class.
11037         (TypeContainer): Added support for partial classes.
11038         (TypeContainer.GetClassBases): Splitted some of the functionality
11039         out into GetNormalBases() and GetPartialBases().
11040
11041         * cs-tokenizer.cs (Token.PARTIAL): New token.
11042         (Tokenizer.consume_identifier): Added some hacks to recognize
11043         `partial', but only if it's immediately followed by `class',
11044         `struct' or `interface'.
11045
11046         * cs-parser.jay: Added support for partial clases.
11047
11048 2004-07-23  Martin Baulig  <martin@ximian.com>
11049
11050         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
11051         a `DeclSpace' and also made it readonly.
11052         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
11053         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
11054         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
11055
11056         * cs-parser.jay: Pass the `current_class', not the
11057         `current_container' (at the moment, this is still the same thing)
11058         to a new Method, Property, Event, Indexer or Constructor.
11059
11060 2004-07-23  Martin Baulig  <martin@ximian.com>
11061
11062         * cs-parser.jay (CSharpParser): Added a new `current_class' field
11063         and removed the `current_interface' one.
11064         (struct_declaration, class_declaration, interface_declaration):
11065         Set `current_class' to the newly created class/struct/interface;
11066         set their `Bases' and call Register() before parsing their body.
11067
11068 2004-07-23  Martin Baulig  <martin@ximian.com>
11069
11070         * class.cs (Kind): New public enum.
11071         (TypeContainer): Made this class abstract.
11072         (TypeContainer.Kind): New public readonly field.
11073         (TypeContainer.CheckDef): New public method; moved here from
11074         cs-parser.jay.
11075         (TypeContainer.Register): New public abstract method.
11076         (TypeContainer.GetPendingImplementations): New public abstract
11077         method.
11078         (TypeContainer.GetClassBases): Removed the `is_class' and
11079         `is_iface' parameters.
11080         (TypeContainer.DefineNestedTypes): Formerly known as
11081         DoDefineType().
11082         (ClassOrStruct): Made this class abstract.
11083
11084         * tree.cs (RootTypes): New public type. 
11085
11086 2004-07-20  Martin Baulig  <martin@ximian.com>
11087
11088         * tree.cs (Tree.RecordNamespace): Removed.
11089         (Tree.Namespaces): Removed.
11090
11091         * rootcontext.cs (RootContext.IsNamespace): Removed.
11092
11093         * cs-parser.jay (namespace_declaration): Just create a new
11094         NamespaceEntry here.
11095
11096 2004-07-20  Martin Baulig  <martin@ximian.com>
11097
11098         * statement.cs (ExceptionStatement): New abstract class.  This is
11099         now used as a base class for everyone who's using `finally'.
11100         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
11101         our local variables before using them.
11102
11103         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
11104         virtual method.  This is used by Yield.Resolve() to "steal" an
11105         outer block's `finally' clauses.
11106         (FlowBranchingException): The .ctor now takes an ExceptionStatement
11107         argument.
11108
11109         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
11110         version which takes an ExceptionStatement.  This version must be
11111         used to create exception branchings.
11112
11113         * iterator.cs
11114         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
11115         (Iterator.EmitMoveNext): Added exception support; protect the
11116         block with a `fault' clause, properly handle 'finally' clauses.
11117         (Iterator.EmitDispose): Run all the `finally' clauses here.
11118
11119 2004-07-20  Martin Baulig  <martin@ximian.com>
11120
11121         * iterator.cs: This is the first of a set of changes in the
11122         iterator code.  Match the spec more closely: if we're an
11123         IEnumerable, then GetEnumerator() must be called.  The first time
11124         GetEnumerator() is called, it returns the current instance; all
11125         subsequent invocations (if any) must create a copy.
11126
11127 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
11128
11129         * expression.cs: Resolve the constant expression before returning
11130         it. 
11131
11132 2004-07-19  Martin Baulig  <martin@ximian.com>
11133
11134         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
11135         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
11136         the return type of the new EmitContext.
11137
11138 2004-07-18  Martin Baulig  <martin@ximian.com>
11139
11140         * class.cs (Property.Define): Fix iterators.
11141
11142         * iterators.cs (Iterator.Define): Moved the
11143         `container.AddInterator (this)' call here from the .ctor; only do
11144         it if we resolved successfully.
11145
11146 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
11147
11148         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
11149         `true' for preprocessing directives that we parse.  The return
11150         value indicates whether we should return to regular tokenizing or
11151         not, not whether it was parsed successfully.
11152
11153         In the past if we were in: #if false ... #line #endif, we would
11154         resume parsing after `#line'.  See bug 61604.
11155
11156         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
11157         building: IsEnumType should return true only for enums, not for
11158         enums or System.Enum itself.  This fixes #61593.
11159
11160         Likely what happened is that corlib was wrong: mcs depended on
11161         this bug in some places.  The bug got fixed, we had to add the
11162         hack, which caused bug 61593.
11163
11164         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
11165         that was a workaround for the older conditions.
11166
11167 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
11168
11169         * assign.cs: IAssignMethod has a new interface, as documented
11170         inline. All assignment code now uses this new api.
11171
11172         * ecore.cs, expression.cs: All classes which implement
11173         IAssignMethod now use the new interface.
11174
11175         * expression.cs (Invocation): add a hack to EmitCall so that
11176         IndexerAccess can be the target of a compound assignment without
11177         evaluating its arguments twice.
11178
11179         * statement.cs: Handle changes in Invocation api.
11180
11181 2004-07-16  Martin Baulig  <martin@ximian.com>
11182
11183         * iterators.cs: Rewrote this.  We're now using one single Proxy
11184         class for both the IEnumerable and the IEnumerator interface and
11185         `Iterator' derives from Class so we can use the high-level API.
11186
11187         * class.cs (TypeContainer.AddIterator): New method.
11188         (TypeContainer.DoDefineType): New protected virtual method, which
11189         is called from DefineType().
11190         (TypeContainer.DoDefineMembers): Call DefineType() and
11191         DefineMembers() on all our iterators.
11192         (TypeContainer.Emit): Call Emit() on all our iterators.
11193         (TypeContainer.CloseType): Call CloseType() on all our iterators.
11194
11195         * codegen.cs (EmitContext.CurrentIterator): New public field.
11196
11197 2004-07-15  Martin Baulig  <martin@ximian.com>
11198
11199         * typemanager.cs
11200         (TypeManager.not_supported_exception_type): New type.   
11201
11202 2004-07-14  Martin Baulig  <martin@ximian.com>
11203
11204         * iterators.cs: Use real error numbers.
11205
11206 2004-07-14  Martin Baulig  <martin@ximian.com>
11207
11208         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
11209         requires this to be a System.Collection.IEnumerable and not a
11210         class implementing that interface.
11211         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
11212
11213 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
11214
11215         * class.cs: Fixed previous fix, it broke some error tests.
11216
11217 2004-07-12  Martin Baulig  <martin@ximian.com>
11218
11219         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
11220         Fixes #61293.
11221
11222 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
11223
11224         * assign.cs (LocalTemporary): Add new argument: is_address,If
11225         `is_address' is true, then the value that we store is the address
11226         to the real value, and not the value itself.
11227         
11228         * ecore.cs (PropertyExpr): use the new local temporary
11229         stuff to allow us to handle X.Y += z (where X is a struct)
11230
11231 2004-07-08  Martin Baulig  <martin@ximian.com>
11232
11233         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
11234         not always return, just like we're doing in Using.Resolve().
11235
11236 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
11237
11238         * cs-parser.jay (fixed_statement): flag this as Pinned.
11239
11240 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
11241
11242         * typemanager.cs (TypeManager): Removed MakePinned method, this
11243         mechanism is replaced with the .NET 2.x compatible mechanism of
11244         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
11245
11246         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
11247         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
11248         `IsFixed' property which has a different meaning.
11249
11250 2004-07-02  Raja R Harinath  <rharinath@novell.com>
11251
11252         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
11253         visible from inside a nested class, not just the names of the
11254         immediately enclosing class.
11255         Fix for bug #60730.
11256
11257 2004-06-24  Raja R Harinath  <rharinath@novell.com>
11258
11259         * expression.cs (BetterConversion): Remove buggy special-case
11260         handling of "implicit constant expression conversions".  At this
11261         point, we already know that the conversion is possible -- we're
11262         only checking to see which is better.
11263
11264 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11265
11266         * cs-parser.jay: Added error CS0210 test.
11267
11268 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11269
11270         * cs-parser.jay: Added error CS0134 test.
11271
11272 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11273
11274         Fix bug #52507
11275         * cs-parser.jay: Added error CS0145 test.
11276
11277 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11278
11279         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
11280
11281 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
11282         
11283         * expression.cs (StackAlloc.Resolve): The argument may not
11284         be a constant; deal with this case.
11285         
11286 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
11287
11288         * attribute.cs (IndexerName_GetIndexerName): Renamed to
11289         GetIndexerAttributeValue.
11290         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
11291
11292         * class.cs (Indexer.Define): Added error tests for CS0415,
11293         CS0609.
11294
11295 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
11296
11297         * attribute.cs (Attribute.Resolve): Keep field code in sync with
11298         property code.
11299
11300 2004-06-23  Martin Baulig  <martin@ximian.com>
11301
11302         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
11303         neither return nor throw, reset the barrier as well.  Fixes #60457.
11304
11305 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
11306
11307         * class.cs : EventAttributes is now set to None by default.
11308           This fixes bug #60459.
11309
11310 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11311
11312         Fix bug #60219
11313         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11314         Don't throw exception but return null (it's sufficient now).
11315
11316 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11317
11318         * typemanager.cs (GetArgumentTypes): Faster implementation.
11319
11320 2004-06-18  Martin Baulig  <martin@ximian.com>
11321
11322         * attribute.cs (Attribute.Resolve): Check whether we're an
11323         EmptyCast which a Constant child.  Fixes #60333.
11324
11325 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
11326
11327         * statement.cs (EmitCollectionForeach): Account for the fact that
11328         not all valuetypes are in areas which we can take the address of.
11329         For these variables, we store to a temporary variable. Also, make
11330         sure that we dont emit a `callvirt' on a valuetype method.
11331
11332 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11333
11334         * expression.cs (StackAlloc.DoReSolve): Added test for
11335         negative parameter (CS0247).
11336
11337 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11338
11339         Fix bug #59792
11340         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
11341
11342 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11343
11344         Fix bug #59781
11345         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
11346         ulong.
11347
11348 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11349
11350         Fix bug #58254 & cs1555.cs, cs1556.cs
11351         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
11352
11353 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11354
11355         * cs-parser.jay: Added error CS1669 test for indexers.
11356
11357 2004-06-11  Martin Baulig  <martin@ximian.com>
11358
11359         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
11360         call this twice: for params and varargs methods.
11361
11362 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11363
11364         * class.cs:
11365         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
11366
11367 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11368
11369         * attribute.cs (Attribute.GetValidTargets): Made public.
11370
11371         * class.cs: 
11372         (AbstractPropertyEventMethod): New class for better code sharing.
11373         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
11374         CS1667 report.
11375         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
11376
11377 2004-06-11  Raja R Harinath  <rharinath@novell.com>
11378
11379         Fix bug #59477.
11380         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
11381         that the call to Resolve is part of a MemberAccess.
11382         (Expression.Resolve): Use it for SimpleName resolution.
11383         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
11384         Add 'intermediate' boolean argument.
11385         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
11386         error message when the SimpleName can be resolved ambiguously
11387         between an expression and a type.
11388         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
11389         public.
11390         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
11391         call on the left-side.
11392
11393 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11394
11395         * class.cs:
11396         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
11397
11398 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11399
11400         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
11401
11402 2004-06-11  Martin Baulig  <martin@ximian.com>
11403
11404         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
11405         varargs methods if applicable.
11406
11407 2004-06-11  Martin Baulig  <martin@ximian.com>
11408
11409         * expression.cs (Invocation.EmitCall): Don't use
11410         `method.CallingConvention == CallingConventions.VarArgs' since the
11411         method could also have `CallingConventions.HasThis'.
11412
11413 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11414
11415         * class.cs (Event.GetSignatureForError): Implemented.
11416         Fixed crash in error test cs3010.cs
11417
11418 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
11419
11420         * cs-tokenizer.cs: Change the way we track __arglist to be
11421         consistent with the other keywords.
11422
11423 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
11424
11425         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
11426         tomorrow.
11427
11428 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
11429
11430         * codegen.cs: Check that all referenced assemblies have a strongname
11431         before strongnaming the compiled assembly. If not report error CS1577.
11432         Fix bug #56563. Patch by Jackson Harper.
11433         * typemanager.cs: Added a method to return all referenced assemblies.
11434         Fix bug #56563. Patch by Jackson Harper.
11435
11436 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11437
11438         * class.cs:
11439         (Method.ApplyAttributeBuilder): Moved and added conditional
11440         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
11441
11442         * delegate.cs:
11443         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
11444
11445 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11446
11447         Fixed #59640
11448         * class.cs: (EventField.attribute_targets): Changed default target.
11449
11450 2004-06-08  Martin Baulig  <martin@ximian.com>
11451
11452         * expression.cs (Invocation.EmitCall): Enable varargs methods.
11453
11454 2004-06-08  Martin Baulig  <martin@ximian.com>
11455
11456         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
11457
11458 2004-06-07  Martin Baulig  <martin@ximian.com>
11459
11460         Added support for varargs methods.
11461
11462         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
11463         keyword.
11464
11465         * cs-parser.jay: Added support for `__arglist'.
11466
11467         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
11468
11469         * expression.cs (Argument.AType): Added `ArgList'.
11470         (Invocation): Added support for varargs methods.
11471         (ArglistAccess): New public class.
11472         (Arglist): New public class.
11473
11474         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
11475
11476         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
11477         a method's top-level block if the method has varargs.
11478
11479         * support.cs (ReflectionParameters, InternalParameters): Added
11480         support for varargs methods.    
11481
11482 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
11483
11484         * class.cs: Provide location in indexer error report.
11485
11486         * driver.cs: Use standard names.
11487
11488         * namespace.cs: Catch the use of using after a namespace has been
11489         declared also on using aliases.
11490
11491 2004-06-03  Raja R Harinath  <rharinath@novell.com>
11492
11493         Bug #50820.
11494         * typemanager.cs (closure_private_ok, closure_invocation_type)
11495         (closure_qualifier_type, closure_invocation_assembly)
11496         (FilterWithClosure): Move to ...
11497         (Closure): New internal nested class.
11498         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
11499         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
11500         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
11501         (MemberLookup, MemberLookupFailed): Use it.
11502         * expression.cs (New.DoResolve): Treat the lookup for the
11503         constructor as being qualified by the 'new'ed type.
11504         (Indexers.GetIndexersForTypeOrInterface): Update.
11505
11506 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
11507
11508         * attribute.cs
11509         (GetConditionalAttributeValue): New method. Returns
11510         condition of ConditionalAttribute.
11511         (SearchMulti): New method.  Returns all attributes of type 't'.
11512         Use it when attribute is AllowMultiple = true.
11513         (IsConditionalMethodExcluded): New method.
11514
11515         * class.cs
11516         (Method.IsExcluded): Implemented. Returns true if method has conditional
11517         attribute and the conditions is not defined (method is excluded).
11518         (IMethodData): Extended interface for ConditionalAttribute support.
11519         (PropertyMethod.IsExcluded): Implemented.
11520
11521         * decl.cs
11522         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
11523
11524         * expression.cs
11525         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
11526         on the method.
11527
11528 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11529
11530         * expression.cs (ArrayCreationExpression): Make this just an
11531         `expression'. It can't be a statement, so the code here was
11532         dead.
11533
11534 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11535
11536         Fixed #59072
11537         * typemanager.cs (GetFullNameSignature): New method for
11538         MethodBase types.
11539
11540 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11541
11542         Fixed #56452
11543         * class.cs (MemberBase.GetSignatureForError): New virtual method.
11544         Use this method when MethodBuilder is null.
11545         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
11546         Added test for error CS0626 (MONO reports error for this situation).
11547         (IMethodData.GetSignatureForError): Extended interface.
11548
11549 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11550
11551         * attribute.cs
11552         (AttributeTester.GetObsoleteAttribute): Returns instance of
11553         ObsoleteAttribute when type is obsolete.
11554
11555         * class.cs
11556         (TypeContainer.VerifyObsoleteAttribute): Override.
11557         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
11558         (MethodCode.VerifyObsoleteAttribute): Override.
11559         (MemberBase.VerifyObsoleteAttribute): Override.
11560
11561         * decl.cs
11562         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
11563         and report proper error.
11564
11565         *delegate.cs
11566         Delegate.VerifyObsoleteAttribute): Override.
11567
11568         * ecore.cs
11569         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
11570         and report proper error.
11571         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
11572
11573         * enum.cs
11574         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
11575         and enum member.
11576
11577         * expression.cs
11578         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
11579         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
11580         Added test for ObsoleteAttribute.
11581
11582         * statement.cs
11583         (Catch): Derived from Statement.
11584
11585 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11586  
11587         Fixed bug #59071 & cs0160.cs
11588  
11589         * statement.cs (Try.Resolve): Check here whether order of catch
11590         clauses matches their dependencies.
11591
11592 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
11593
11594         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
11595         caused a regression: #59343.  Referencing nested classes from an
11596         assembly stopped working.
11597
11598 2004-05-31  Martin Baulig  <martin@ximian.com>
11599
11600         MCS is now frozen for beta 2.
11601
11602 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11603
11604         * convert.cs: add a trivial cache for overload operator resolution.
11605
11606 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11607
11608         * decl.cs: If possible, use lookuptypedirect here. We can only do
11609         this if there is no `.' after the namespace. Avoids using
11610         LookupType, which does lots of slow processing.
11611         (FindNestedType) New method, does what it says :-).
11612         * namespace.cs: use LookupTypeDirect.
11613         * rootcontext.cs: use membercache, if possible.
11614         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
11615
11616 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11617
11618         * expression.cs:
11619         According to the spec, 
11620
11621         In a member access of the form E.I, if E is a single identifier,
11622         and if the meaning of E as a simple-name (§7.5.2) is a constant,
11623         field, property, localvariable, or parameter with the same type as
11624         the meaning of E as a type-name (§3.8), then both possible
11625         meanings of E are permitted.
11626
11627         We did not check that E as a simple-name had the same type as E as
11628         a type name.
11629
11630         This trivial check gives us 5-7% on bootstrap time.
11631
11632 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11633
11634         * expression.cs (Invocation.OverloadResolve): Avoid the
11635         use of hashtables and boxing here by allocating on demand.
11636
11637 2004-05-30  Martin Baulig  <martin@ximian.com>
11638
11639         * rootcontext.cs (RootContext.LookupType): Don't cache things if
11640         we're doing a silent lookup.  Don't try to lookup nested types in
11641         TypeManager.object_type (thanks to Ben Maurer).
11642
11643 2004-05-30  Martin Baulig  <martin@ximian.com>
11644
11645         Committing a patch from Ben Maurer.
11646
11647         * rootcontext.cs (RootContext.LookupType): Cache negative results.
11648
11649 2004-05-29  Martin Baulig  <martin@ximian.com>
11650
11651         * class.cs (IMethodData.ShouldIgnore): New method.
11652
11653         * typemanager.cs (TypeManager.MethodFlags): Don't take a
11654         `Location' argument, we don't need it anywhere.  Use
11655         `IMethodData.ShouldIgnore ()' instead of
11656         `MethodData.GetMethodFlags ()'.
11657         (TypeManager.AddMethod): Removed.
11658         (TypeManager.AddMethod2): Renamed to AddMethod.
11659
11660 2004-05-29  Martin Baulig  <martin@ximian.com>
11661
11662         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
11663
11664         * convert.cs (Convert.ImplicitReferenceConversion): If we're
11665         converting from a class type S to an interface type and we already
11666         have an object on the stack, don't box it again.  Fixes #52578.
11667
11668 2004-05-29  Martin Baulig  <martin@ximian.com>
11669
11670         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11671         Added support for `params' parameters.  Fixes #59267.
11672
11673 2004-05-29  Martin Baulig  <martin@ximian.com>
11674
11675         * literal.cs (NullPointer): Provide a private .ctor which sets
11676         `type' to TypeManager.object_type.  Fixes #59048.
11677
11678 2004-05-29  Martin Baulig  <martin@ximian.com>
11679
11680         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11681         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
11682
11683         * ecore.cs (EventExpr.instance_expr): Make the field private.
11684
11685 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
11686
11687         Fixed bug #50080 & cs0214-2.cs
11688         * expression.cs (Cast.DoResolve): Check unsafe context here.
11689         
11690         * statement.cs (Resolve.DoResolve): Likewise.
11691
11692 2004-05-26  Martin Baulig  <martin@ximian.com>
11693
11694         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11695
11696         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11697         (RootContext.LookupType): Pass down the `silent' flag.
11698
11699 2004-05-25  Martin Baulig  <martin@ximian.com>
11700
11701         * expression.cs
11702         (MethodGroupExpr.IdenticalTypeName): New public property.
11703         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11704         expression actually refers to a type.
11705
11706 2004-05-25  Martin Baulig  <martin@ximian.com>
11707
11708         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11709         for #56176 and made it actually work.
11710
11711 2004-05-25  Martin Baulig  <martin@ximian.com>
11712
11713         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11714         (FieldExpr, PropertyExpr): Override and implement
11715         CacheTemporaries.  Fixes #52279.
11716
11717 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
11718
11719         * location.cs: In the new compiler listing a file twice is a
11720         warning, not an error.
11721
11722 2004-05-24  Martin Baulig  <martin@ximian.com>
11723
11724         * enum.cs (Enum.DefineType): For the `BaseType' to be a
11725         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
11726
11727 2004-05-24  Martin Baulig  <martin@ximian.com>
11728
11729         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11730         walking the `using' list.  Fixes #53921.
11731
11732 2004-05-24  Martin Baulig  <martin@ximian.com>
11733
11734         * const.cs (Const.LookupConstantValue): Added support for
11735         EmptyCast's; fixes #55251.
11736
11737 2004-05-24  Martin Baulig  <martin@ximian.com>
11738
11739         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11740         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11741         which does the CS0135 check.  The reason is that we first need to
11742         check whether the variable actually exists.
11743
11744 2004-05-24  Martin Baulig  <martin@ximian.com>
11745
11746         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11747         than RootContext.LookupType() to find the explicit interface
11748         type.  Fixes #58584.
11749
11750 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11751
11752         * Makefile: Simplify.  Use executable.make.
11753         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11754
11755 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11756
11757         * decl.cs:
11758         * enum.cs:
11759         Use the invariant culture when doing String.Compare for CLS case
11760         sensitivity.
11761         
11762 2004-05-23  Martin Baulig  <martin@ximian.com>
11763
11764         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11765         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11766
11767         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11768         
11769 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11770
11771         * class.cs (MemberBase.Define): Reuse MemberType member for 
11772         resolved type. Other methods can use it too.
11773
11774 2004-05-23  Martin Baulig  <martin@ximian.com>
11775
11776         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11777         the variable also exists in the current block (otherwise, we need
11778         to report a CS0103).  Fixes #58670.
11779
11780 2004-05-23  Martin Baulig  <martin@ximian.com>
11781
11782         * flowanalysis.cs (Reachability.Reachable): Compute this
11783         on-the-fly rather than storing it as a field.
11784
11785 2004-05-23  Martin Baulig  <martin@ximian.com>
11786
11787         * flowanalysis.cs (Reachability.And): Manually compute the
11788         resulting `barrier' from the reachability.      
11789        
11790 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11791
11792         Fix bug #57835
11793         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11794         instance of ObsoleteAttribute when symbol is obsolete.
11795
11796         * class.cs
11797         (IMethodData): Extended interface for ObsoleteAttribute support.
11798
11799 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11800
11801         * attribute.cs: Fix bug #55970
11802
11803 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11804
11805         Fix bug #52705
11806         * attribute.cs
11807         (GetObsoleteAttribute): New method. Creates the instance of
11808         ObsoleteAttribute.
11809         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11810         ObsoleteAttribute when member is obsolete.
11811         (AttributeTester.Report_ObsoleteMessage): Common method for
11812         Obsolete error/warning reporting.
11813
11814         * class.cs
11815         (TypeContainer.base_classs_type): New member for storing parent type.
11816
11817         * decl.cs
11818         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11819         for this MemberCore.
11820
11821 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11822
11823         * attribute.cs, const.cs: Fix bug #58590
11824
11825 2004-05-21  Martin Baulig  <martin@ximian.com>
11826
11827         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11828         out parameters if the end of the method is unreachable.  Fixes
11829         #58098. 
11830
11831 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11832
11833         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11834         Hari was right, why extra method.
11835
11836 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11837
11838         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11839
11840 2004-05-20  Martin Baulig  <martin@ximian.com>
11841
11842         Merged this back from gmcs to keep the differences to a minumum.
11843
11844         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11845         instead of a Declspace.
11846         (Attribute.ResolveType): Likewise.
11847         (Attributes.Search): Likewise.
11848         (Attributes.Contains): Likewise.
11849         (Attributes.GetClsCompliantAttribute): Likewise.
11850
11851         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11852         argument.
11853         (MethodData.ApplyAttributes): Take an EmitContext instead of a
11854         DeclSpace.
11855
11856 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11857
11858         Fix bug #58688 (MCS does not report error when the same attribute
11859         is assigned twice)
11860
11861         * attribute.cs (Attribute.Emit): Distinction between null and default.
11862
11863 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11864
11865         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11866         of a top-level attribute without an attribute target.
11867         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11868         Make non-static.
11869         (Attribute.Conditional_GetConditionName), 
11870         (Attribute.Obsolete_GetObsoleteMessage): Update.
11871         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11872         part of ScanForIndexerName.
11873         (Attribute.CanIgnoreInvalidAttribute): New function.
11874         (Attribute.ScanForIndexerName): Move to ...
11875         (Attributes.ScanForIndexerName): ... here.
11876         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11877         (Attributes.Search): New internal variant that can choose not to
11878         complain if types aren't resolved.  The original signature now
11879         complains.
11880         (Attributes.GetClsCompliantAttribute): Use internal variant, with
11881         complaints suppressed.
11882         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11883         only if it not useful.
11884         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11885         top-level for attributes that are shared between the assembly
11886         and a top-level class.
11887         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11888         * class.cs: Update to reflect changes.
11889         (DefineIndexers): Fuse loops.
11890         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11891         a couple more variants of attribute names.
11892
11893 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11894
11895         Fix bug #52585 (Implemented explicit attribute declaration)
11896
11897         * attribute.cs:
11898         (Attributable.ValidAttributeTargets): New abstract method. It gets
11899         list of valid attribute targets for explicit target declaration.
11900         (Attribute.Target): It holds target itself.
11901         (AttributeSection): Removed.
11902         (Attribute.CheckTargets): New method. It checks whether attribute
11903         target is valid for the current element.
11904
11905         * class.cs:
11906         (EventProperty): New class. For events that are declared like
11907         property (with add and remove accessors).
11908         (EventField): New class. For events that are declared like field.
11909         class.cs
11910
11911         * cs-parser.jay: Implemented explicit attribute target declaration.
11912
11913         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11914         Override ValidAttributeTargets.
11915
11916         * parameter.cs:
11917         (ReturnParameter): Class for applying custom attributes on 
11918         the return type.
11919         (ParameterAtribute): New class. Class for applying custom
11920         attributes on the parameter type.
11921
11922 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11923
11924         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11925         definitions. 
11926
11927         (Method): Allow UNSAFE here.
11928
11929         * modifiers.cs: Support unsafe reporting.
11930
11931 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11932
11933         * decl.cs: Fix bug #58478.
11934
11935 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11936
11937         * statement.cs: When checking for unreachable code on an EmptyStatement,
11938         set the location. Fixes bug #58488.
11939
11940 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11941
11942         * driver.cs: Add -pkg handling.
11943
11944         From Gonzalo: UseShelLExecute=false
11945
11946 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11947
11948         * attribute.cs:
11949         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11950         for attribute.
11951         (Attribute.IsClsCompliaceRequired): Moved to base for better
11952         accesibility.
11953         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11954         when attribute is AttributeUsageAttribute.
11955         (Attribute.GetValidTargets): Simplified.
11956         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11957         attribute for this type.
11958         (Attribute.ApplyAttributes): Method renamed to Emit and make
11959         non-static.
11960         (GlobalAttributeSection): New class for special handling of global
11961         attributes (assembly, module).
11962         (AttributeSection.Emit): New method.
11963
11964         * class.cs: Implemented Attributable abstract methods.
11965         (MethodCore.LabelParameters): Moved to Parameter class.
11966         (Accessor): Is back simple class.
11967         (PropertyMethod): Implemented Attributable abstract class.
11968         (DelegateMethod): Implemented Attributable abstract class.
11969         (Event): New constructor for disctintion between normal Event
11970         and Event with accessors.
11971
11972         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11973
11974         * codegen.cs, const.cs, decl.cs, delegate.cs:
11975         (CommonAssemblyModulClass): Implemented Attributable abstract class
11976         and simplified.
11977
11978         * enum.cs: Implement IAttributeSupport interface.
11979         (EnumMember): New class for emum members. Implemented Attributable
11980         abstract class
11981
11982         * parameter.cs:
11983         (ParameterBase): Is abstract.
11984         (ReturnParameter): New class for easier [return:] attribute handling.
11985
11986         * typemanager.cs: Removed builder_to_attr.
11987
11988 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11989
11990         Fix bug #57151.
11991         * attribute.cs (Attribute.GetPositionalValue): New function.
11992         * class.cs (TypeContainer.VerifyMembers): New function.
11993         (TypeContainer.Emit): Use it.
11994         (ClassOrStruct): New base class for Class and Struct.
11995         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11996         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11997         class.
11998         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11999         then each non-static field should have a FieldOffset attribute.
12000         Otherwise, none of the fields should have a FieldOffset attribute.
12001         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
12002         and FieldOffset attributes.
12003         * typemanager.cs (TypeManager.struct_layout_attribute_type)
12004         (TypeManager.field_offset_attribute_type): New core types.
12005         (TypeManager.InitCoreTypes): Initialize them.
12006
12007 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
12008
12009         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
12010         Return correct type.
12011         From bug #58270.
12012
12013 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
12014
12015         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
12016         be implicitly converted to ulong.
12017         
12018         * expression.cs: The logic for allowing operator &, | and ^ worked
12019         was wrong, it worked before because we did not report an error in
12020         an else branch.  Fixes 57895.
12021
12022         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
12023         allow volatile fields to be reference types.
12024
12025 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
12026
12027         * driver.cs: Add support for /debug-
12028
12029 2004-05-07  Raja R Harinath  <rharinath@novell.com>
12030
12031         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
12032         Add a 'complain' parameter to silence errors.
12033         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
12034         silently overlooked type-resolutions.
12035         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
12036         to reflect changes.
12037         (Attributes.Search): New function.
12038         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
12039         (Attributes.GetAttributeFullName): Remove hack.
12040         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
12041         Update to reflect changes.
12042         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12043         Use Attributes.Search instead of nested loops.
12044
12045 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
12046
12047         * decl.cs:
12048         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
12049         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
12050         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
12051
12052         * report.cs: (Report.Warning): Renamed to Warning_T because of
12053         parameter collision.
12054
12055 2004-05-05  Raja R Harinath  <rharinath@novell.com>
12056
12057         * expression.cs (MemberAccess.ResolveMemberAccess):
12058         Exit with non-zero status after Report.Error.
12059         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
12060         Likewise.
12061         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
12062
12063 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
12064
12065         * support.cs: Don't hang when the file is empty.
12066
12067 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
12068
12069         * support.cs: In SeekableStreamReader, compute the preamble size of the
12070           underlying stream. Position changes should take into account that initial
12071           count of bytes.
12072
12073 2004-05-03  Todd Berman  <tberman@sevenl.net>
12074
12075         * driver.cs: remove unused GetSysVersion function.
12076
12077 2004-05-03  Todd Berman  <tberman@sevenl.net>
12078
12079         * driver.cs: Remove the hack from saturday, as well as the hack
12080         from jackson (LoadAssemblyFromGac), also adds the CWD to the
12081         link_paths to get that bit proper.
12082
12083 2004-05-01  Todd Berman  <tberman@sevenl.net>
12084
12085         * driver.cs: Try a LoadFrom before a Load, this checks the current
12086         path. This is currently a bug in mono that is be fixed, however, this
12087         provides a workaround for now. This will be removed when the bug
12088         is fixed.
12089
12090 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
12091
12092         * CryptoConvert.cs: Updated to latest version. Fix issue with 
12093         incomplete key pairs (#57941).
12094
12095 2004-05-01  Todd Berman  <tberman@sevenl.net>
12096
12097         * driver.cs: Remove '.' from path_chars, now System.* loads properly
12098         from the GAC
12099
12100 2004-04-30  Jackson Harper  <jackson@ximian.com>
12101
12102         * codegen.cs: Open keys readonly.
12103         
12104 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12105
12106         * typemanager.cs: don't report cyclic struct layout when a struct
12107         contains 2 or more fields of the same type. Failed for Pango.AttrShape
12108         which has 2 Pango.Rectangle fields.
12109
12110 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12111
12112         * expression.cs: Handle IntPtr comparisons with IL code
12113         rather than a method call.
12114
12115 2004-04-29  Martin Baulig  <martin@ximian.com>
12116
12117         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
12118         the list of PropertyInfo's in class hierarchy and find the
12119         accessor.  Fixes #56013.
12120
12121 2004-04-29  Martin Baulig  <martin@ximian.com>
12122
12123         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
12124
12125 2004-04-29  Martin Baulig  <martin@ximian.com>
12126
12127         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12128
12129         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
12130
12131 2004-04-29  Martin Baulig  <martin@ximian.com>
12132
12133         * class.cs (ConstructorInitializer.Resolve): Check whether the
12134         parent .ctor is accessible.  Fixes #52146.
12135
12136 2004-04-29  Martin Baulig  <martin@ximian.com>
12137
12138         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12139
12140         * statement.cs (Using.EmitLocalVariableDecls): Use
12141         TypeManager.idisposable_type, not typeof (IDisposable).
12142         (Foreach.EmitCollectionForeach): Added support for valuetypes.
12143
12144 2004-04-29  Martin Baulig  <martin@ximian.com>
12145
12146         * class.cs (Event.Define): Don't emit the field and don't set
12147         RTSpecialName and SpecialName for events on interfaces.  Fixes
12148         #57703. 
12149
12150 2004-04-29  Raja R Harinath  <rharinath@novell.com>
12151
12152         Refactor Attribute.ApplyAttributes.
12153         * attribute.cs (Attributable): New base class for objects that can
12154         have Attributes applied on them.
12155         (Attribute): Make AttributeUsage fields public.
12156         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
12157         (Attribute.IsInternalCall): New property.
12158         (Attribute.UsageAttr): Convert to a public read-only property.
12159         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
12160         (Attribute.ResolveType, Attribute.Resolve)
12161         (Attribute.ScanForIndexerName): Update to reflect changes.
12162         (Attribute.CheckAttributeTarget): Re-format.
12163         (Attribute.ApplyAttributes): Refactor, to various
12164         Attributable.ApplyAttributeBuilder methods.
12165         * decl.cs (MemberCore): Make Attributable.
12166         * class.cs (Accessor): Make Attributable.
12167         (MethodData.ApplyAttributes): Use proper attribute types, not
12168         attribute names.
12169         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
12170         (TypeContainer.ApplyAttributeBuilder)
12171         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
12172         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
12173         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
12174         (Operator.ApplyAttributeBuilder): New factored-out methods.
12175         * const.cs (Const.ApplyAttributeBuilder): Likewise.
12176         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
12177         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
12178         * parameter.cs (ParameterBase): New Attributable base class
12179         that can also represent Return types.
12180         (Parameter): Update to the changes.
12181
12182 2004-04-29  Jackson Harper  <jackson@ximian.com>
12183
12184         * driver.cs: Prefer the corlib system version when looking for
12185         assemblies in the GAC. This is still a hack, but its a better hack
12186         now.
12187         
12188 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
12189
12190         * decl.cs, enum.cs: Improved error 3005 reporting.
12191   
12192         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
12193         (related_symbols): New private member for list of symbols
12194         related to reported error/warning.
12195         
12196         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
12197
12198 2004-04-29  Martin Baulig  <martin@ximian.com>
12199
12200         * ecore.cs (Expression.Constantify): If we're an enum and
12201         TypeManager.TypeToCoreType() doesn't give us another type, use
12202         t.UnderlyingSystemType.  Fixes #56178.  
12203
12204 2004-04-29  Martin Baulig  <martin@ximian.com>
12205
12206         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
12207         interfaces and for each interface, only add members directly
12208         declared in that interface.  Fixes #53255.
12209
12210 2004-04-28  Martin Baulig  <martin@ximian.com>
12211
12212         * expression.cs (ConditionalLogicalOperator): Use a temporary
12213         variable for `left' to avoid that we evaluate it more than once;
12214         bug #52588.
12215
12216 2004-04-28  Martin Baulig  <martin@ximian.com>
12217
12218         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
12219         `void[]' (CS1547).
12220
12221 2004-04-28  Martin Baulig  <martin@ximian.com>
12222
12223         * statement.cs (LocalInfo.Resolve): Check whether the type is not
12224         void (CS1547).
12225
12226         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
12227         whether the type is not void (CS1547).
12228
12229 2004-04-28  Martin Baulig  <martin@ximian.com>
12230
12231         * expression.cs (Unary.DoResolveLValue): Override this and report
12232         CS0131 for anything but Operator.Indirection.
12233
12234 2004-04-28  Martin Baulig  <martin@ximian.com>
12235
12236         Committing a patch from Ben Maurer; see bug #50820.
12237
12238         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12239         check for classes.
12240
12241         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12242         classes.        
12243
12244 2004-04-28  Martin Baulig  <martin@ximian.com>
12245
12246         Committing a patch from Ben Maurer; see bug #50820.
12247
12248         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12249         check for classes.
12250
12251         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12252         classes.        
12253
12254 2004-04-28  Martin Baulig  <martin@ximian.com>
12255
12256         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
12257         (Block.AddLabel): Call DoLookupLabel() to only search in the
12258         current block.
12259
12260 2004-04-28  Martin Baulig  <martin@ximian.com>
12261
12262         * cfold.cs (ConstantFold.BinaryFold): Added special support for
12263         comparing StringConstants and NullLiterals in Equality and Inequality.
12264
12265 2004-04-28  Jackson Harper  <jackson@ximian.com>
12266
12267         * driver.cs: Attempt to load referenced assemblies from the
12268         GAC. This is the quick and dirty version of this method that
12269         doesnt take into account versions and just takes the first
12270         canidate found. Will be good enough for now as we will not have more
12271         then one version installed into the GAC until I update this method.
12272
12273 2004-04-28  Martin Baulig  <martin@ximian.com>
12274
12275         * typemanager.cs (TypeManager.CheckStructCycles): New public
12276         static method to check for cycles in the struct layout.
12277
12278         * rootcontext.cs (RootContext.PopulateTypes): Call
12279         TypeManager.CheckStructCycles() for each TypeContainer.
12280         [Note: We only need to visit each type once.]
12281
12282 2004-04-28  Martin Baulig  <martin@ximian.com>
12283
12284         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
12285
12286         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
12287         success and added `out object value'.  Use a `bool resolved' field
12288         to check whether we've already been called rather than
12289         `ConstantValue != null' since this breaks for NullLiterals.
12290
12291 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12292
12293         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
12294         setting of this flag, since the 'set' method may be non-public.
12295
12296 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12297
12298         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
12299         check on current_vector.Block.
12300
12301 2004-04-27  Martin Baulig  <martin@ximian.com>
12302
12303         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
12304         a field initializer.  Fixes #56459.
12305
12306 2004-04-27  Martin Baulig  <martin@ximian.com>
12307
12308         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
12309         we're not attempting to use an indexer.  Fixes #52154.
12310
12311 2004-04-27  Martin Baulig  <martin@ximian.com>
12312
12313         * statement.cs (Return): Don't create a return label if we don't
12314         need it; reverts my change from January 20th.  Thanks to Ben
12315         Maurer for this.
12316
12317 2004-04-27  Martin Baulig  <martin@ximian.com>
12318
12319         According to the spec, `goto' can only leave a nested scope, but
12320         never enter it.
12321
12322         * statement.cs (Block.LookupLabel): Only lookup in the current
12323         block, don't recurse into parent or child blocks.
12324         (Block.AddLabel): Check in parent and child blocks, report
12325         CS0140/CS0158 if we find a duplicate.
12326         (Block): Removed this indexer for label lookups.
12327         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
12328         this already does the error reporting for us.
12329
12330         * flowanalysis.cs
12331         (FlowBranching.UsageVector.Block): New public variable; may be null.
12332         (FlowBranching.CreateSibling): Added `Block' argument.
12333         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
12334         label for the target of a `goto' and check whether we're not
12335         leaving a `finally'.
12336
12337 2004-04-27  Martin Baulig  <martin@ximian.com>
12338
12339         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12340         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
12341         just for returns).
12342
12343 2004-04-27  Martin Baulig  <martin@ximian.com>
12344
12345         * statement.cs (Block.AddLabel): Also check for implicit blocks
12346         and added a CS0158 check.
12347
12348 2004-04-27  Martin Baulig  <martin@ximian.com>
12349
12350         * flowanalysis.cs (FlowBranchingLoop): New class.
12351         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
12352         UsageVector's instead of an ArrayList.
12353         (FlowBranching.Label): Likewise.
12354         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
12355         (FlowBranching.AddBreakVector): New method.
12356
12357 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
12358
12359         * attribute.cs: Small regression fix: only convert the type if we
12360         the type is different, fixes System.Drawing build.
12361
12362 2004-04-27  Martin Baulig  <martin@ximian.com>
12363
12364         * attribute.cs (Attribute.Resolve): If we have a constant value
12365         for a named field or property, implicity convert it to the correct
12366         type.
12367
12368 2004-04-27  Raja R Harinath  <rharinath@novell.com>
12369
12370         * statement.cs (Block.Block): Implicit blocks share
12371         'child_variable_names' fields with parent blocks.
12372         (Block.AddChildVariableNames): Remove.
12373         (Block.AddVariable): Mark variable as "used by a child block" in
12374         every surrounding block.
12375         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
12376         been used in a child block, complain about violation of "Invariant
12377         meaning in blocks" rule.
12378         * cs-parser.jay (declare_local_variables): Don't use
12379         AddChildVariableNames.
12380         (foreach_statement): Don't create an implicit block: 'foreach'
12381         introduces a scope.
12382
12383 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
12384
12385         * convert.cs (ImplicitNumericConversion): 0 is also positive when
12386         converting from 0L to ulong.  Fixes 57522.
12387
12388 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12389
12390         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
12391         derived class hides via 'new' keyword field from base class (test-242.cs).
12392         TODO: Handle this in the more general way.
12393         
12394         * class.cs (CheckBase): Ditto.
12395
12396 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12397
12398         * decl.cs (caching_flags): New member for storing cached values
12399         as bit flags.
12400         (MemberCore.Flags): New enum where bit flags for caching_flags
12401         are defined.
12402         (MemberCore.cls_compliance): Moved to caching_flags.
12403         (DeclSpace.Created): Moved to caching_flags.
12404
12405         * class.cs: Use caching_flags instead of DeclSpace.Created
12406         
12407 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
12408
12409         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
12410         if we are only a derived class, not a nested class.
12411
12412         * typemanager.cs: Same as above, but do this at the MemberLookup
12413         level (used by field and methods, properties are handled in
12414         PropertyExpr).   Allow for the qualified access if we are a nested
12415         method. 
12416
12417 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
12418
12419         * class.cs: Refactoring.
12420         (IMethodData): New inteface; Holds links to parent members
12421         to avoid member duplication (reduced memory allocation).
12422         (Method): Implemented IMethodData interface.
12423         (PropertyBase): New inner classes for get/set methods.
12424         (PropertyBase.PropertyMethod): Implemented IMethodData interface
12425         (Event): New inner classes for add/remove methods.
12426         (Event.DelegateMethod): Implemented IMethodData interface.
12427
12428         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
12429         EmitContext (related to class.cs refactoring).
12430
12431 2004-04-21  Raja R Harinath  <rharinath@novell.com>
12432
12433         * delegate.cs (Delegate.VerifyApplicability): If the number of
12434         arguments are the same as the number of parameters, first try to
12435         verify applicability ignoring  any 'params' modifier on the last
12436         parameter.
12437         Fixes #56442.
12438
12439 2004-04-16  Raja R Harinath  <rharinath@novell.com>
12440
12441         * class.cs (TypeContainer.AddIndexer): Use
12442         'ExplicitInterfaceName' to determine if interface name was
12443         explicitly specified.  'InterfaceType' is not initialized at this time.
12444         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
12445         Indexers array is already in the required order.  Initialize
12446         'IndexerName' only if there are normal indexers.
12447         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
12448         (TypeContainer.Emit): Emit DefaultMember attribute only if
12449         IndexerName is initialized.
12450         Fixes #56300.
12451
12452 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
12453
12454         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
12455         Fixes #57007
12456
12457 2004-04-15  Raja R Harinath  <rharinath@novell.com>
12458
12459         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
12460         attributes.
12461         Fix for #56456.
12462
12463         * attribute.cs (Attribute.Resolve): Check for duplicate named
12464         attributes.
12465         Fix for #56463.
12466
12467 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
12468
12469         * iterators.cs (MarkYield): track whether we are in an exception,
12470         and generate code accordingly.  Use a temporary value to store the
12471         result for our state.
12472
12473         I had ignored a bit the interaction of try/catch with iterators
12474         since their behavior was not entirely obvious, but now it is
12475         possible to verify that our behavior is the same as MS .NET 2.0
12476
12477         Fixes 54814
12478
12479 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
12480
12481         * iterators.cs: Avoid creating temporaries if there is no work to
12482         do. 
12483
12484         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
12485         Enumerations, use TypeManager.EnumToUnderlying and call
12486         recursively. 
12487
12488         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
12489         bug #57013
12490
12491         (This.Emit): Use EmitContext.EmitThis to emit our
12492         instance variable.
12493
12494         (This.EmitAssign): Ditto.
12495
12496         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
12497         codepaths, we will move all the functionality into
12498         Mono.CSharp.This 
12499
12500         (FieldExpr.EmitAssign): Ditto.
12501
12502         This fixes several hidden bugs that I uncovered while doing a code
12503         review of this today.
12504
12505         * codegen.cs (EmitThis): reworked so the semantics are more clear
12506         and also support value types "this" instances.
12507
12508         * iterators.cs: Changed so that for iterators in value types, we
12509         do not pass the value type as a parameter.  
12510
12511         Initialization of the enumerator helpers is now done in the caller
12512         instead of passing the parameters to the constructors and having
12513         the constructor set the fields.
12514
12515         The fields have now `assembly' visibility instead of private.
12516
12517 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
12518
12519         * expression.cs (Argument.Resolve): Check if fields passed as ref
12520         or out are contained in a MarshalByRefObject.
12521
12522         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
12523         another compiler type.
12524
12525 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12526
12527         * class.cs (Indexer.Define): use the new name checking method.
12528         Also, return false on an error.
12529         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
12530         (is_identifier_[start/part]_character): make static.
12531
12532 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
12533
12534         * expression.cs (Binary.ResolveOperator): Do no append strings
12535         twice: since we can be invoked more than once (array evaluation)
12536         on the same concatenation, take care of this here.  Based on a fix
12537         from Ben (bug #56454)
12538
12539 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
12540
12541         * codegen.cs: Fix another case where CS1548 must be reported (when 
12542         delay-sign isn't specified and no private is available #56564). Fix
12543         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
12544         error when MCS is used on the MS runtime and we need to delay-sign 
12545         (which seems unsupported by AssemblyBuilder - see #56621).
12546
12547 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
12548
12549         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
12550         (TypeManager.ComputeNamespaces): Faster implementation for
12551         Microsoft runtime.
12552
12553         * compiler.csproj: Updated AssemblyName to mcs.
12554
12555 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12556
12557         * rootcontext.cs: Add new types to the boot resolution.
12558
12559         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12560         MulticastDelegate is not allowed.
12561
12562         * typemanager.cs: Add new types to lookup: System.TypedReference
12563         and ArgIterator.
12564
12565         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12566         check for TypedReference or ArgIterator, they are not allowed. 
12567
12568         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12569         makes us properly catch 1510 in some conditions (see bug 56016 for
12570         details). 
12571
12572 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12573
12574         * CryptoConvert.cs: update from corlib version
12575         with endian fixes.
12576
12577 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12578
12579         * class.cs (Indexer.Define): Check indexername declaration
12580
12581 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12582
12583         * attribute.cs (IsClsCompliant): Fixed problem with handling
12584         all three states (compliant, not-compliant, undetected).
12585
12586 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12587
12588         * attribute.cs (Attribute): Location is now public.
12589         (Resolve): Store resolved arguments (pos_values) in attribute class.
12590         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12591         (GetClsCompliantAttributeValue): New method that gets
12592         CLSCompliantAttribute value.
12593         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12594         if exists else null.
12595         (AttributeTester): New class for CLS-Compliant verification routines.
12596
12597         * class.cs (Emit): Add CLS-Compliant verification.
12598         (Method.GetSignatureForError): Implemented.
12599         (Constructor.GetSignatureForError): Implemented
12600         (Constructor.HasCompliantArgs): Returns if constructor has
12601         CLS-Compliant arguments.
12602         (Constructor.Emit): Override.
12603         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12604         is needed to test only parameters.
12605         (FieldBase.GetSignatureForError): Implemented.
12606         (TypeContainer): New member for storing base interfaces.
12607         (TypeContainer.FindMembers): Search in base interfaces too.
12608
12609         * codegen.cs (GetClsComplianceAttribute): New method that gets
12610         assembly or module CLSCompliantAttribute value.
12611         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12612         for assembly.
12613         (ModuleClass.Emit): Add error 3012 test.
12614
12615         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12616
12617         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12618         state for all decl types.
12619         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12620         if CLS-Compliant tests are required.
12621         (IsClsCompliaceRequired): New method. Analyze whether code
12622         must be CLS-Compliant.
12623         (IsExposedFromAssembly): New method. Returns true when MemberCore
12624         is exposed from assembly.
12625         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12626         value or gets cached value.
12627         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12628         is explicitly marked with CLSCompliantAttribute.
12629         (IsIdentifierClsCompliant): New abstract method. This method is
12630         used to testing error 3005.
12631         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12632         for identifier and parameters CLS-Compliant testing.
12633         (VerifyClsCompliance): New method. The main virtual method for
12634         CLS-Compliant verifications.
12635         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12636         null. I don't know why is null (too many public members !).
12637         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12638         and get value of first CLSCompliantAttribute that found.
12639
12640         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12641         (VerifyClsCompliance): Override and add extra tests.
12642
12643         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12644         clscheck- disable CLS-Compliant verification event if assembly is has
12645         CLSCompliantAttribute(true).
12646
12647         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12648         ApllyAttribute is now called in emit section as in the other cases.
12649         Possible future Emit integration.
12650         (IsIdentifierClsCompliant): New override.
12651         (VerifyClsCompliance): New override.
12652         (GetEnumeratorName): Returns full enum name.
12653
12654         * parameter.cs (GetSignatureForError): Implemented.
12655
12656         * report.cs (WarningData): New struct for Warning message information.
12657         (LocationOfPreviousError): New method.
12658         (Warning): New method. Reports warning based on the warning table.
12659         (Error_T): New method. Reports error based on the error table.
12660
12661         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12662         verifications are done here.
12663
12664         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12665
12666         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12667         CLSCompliantAttribute.
12668         (all_imported_types): New member holds all imported types from other
12669         assemblies.
12670         (LoadAllImportedTypes): New method fills static table with exported types
12671         from all referenced assemblies.
12672         (Modules): New property returns all assembly modules.
12673
12674 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12675
12676         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12677         throwing a parser error.
12678
12679         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12680         which removes the hardcoded get_/set_ prefixes for properties, as
12681         IL allows for the properties to be named something else.  
12682
12683         Bug #56013
12684
12685         * expression.cs: Do not override operand before we know if it is
12686         non-null.  Fix 56207
12687
12688 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12689
12690         * typemanager.cs: support for pinned variables.
12691
12692 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12693
12694         * decl.cs, typemanager.cs: Avoid using an arraylist
12695         as a buffer if there is only one result set.
12696
12697 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12698
12699         * expression.cs: Make sure you cant call a static method
12700         with an instance expression, bug #56174.
12701
12702 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12703
12704         * class.cs (IsDuplicateImplementation): Improve error reporting to
12705         flag 663 (method only differs in parameter modifier).
12706
12707         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12708         in preprocessor directives.
12709
12710         * location.cs (LookupFile): Allow for the empty path.
12711
12712         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12713         better approach for some of that patch, but its failing with the
12714         CharSet enumeration.  For now try/catch will do.
12715
12716         * typemanager.cs: Do not crash if a struct does not have fields.
12717         Fixes 56150.
12718
12719 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12720
12721         * expression.cs: cs0213, cant fix a fixed expression.
12722         fixes 50231.
12723
12724 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12725
12726         * cs-parser.jay: detect invalid embeded statements gracefully.
12727         bug #51113.
12728
12729 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12730
12731         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12732         As a regex:
12733         s/
12734         the invocation type may not be a subclass of the tye of the item/
12735         The type of the item must be a subclass of the invocation item.
12736         /g
12737
12738         Fixes bug #50820.
12739
12740 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12741
12742         * attribute.cs: Added methods to get a string and a bool from an
12743         attribute. Required to information from AssemblyKeyFileAttribute,
12744         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12745         * codegen.cs: Modified AssemblyName creation to include support for
12746         strongnames. Catch additional exceptions to report them as CS1548.
12747         * compiler.csproj: Updated include CryptoConvert.cs.
12748         * compiler.csproj.user: Removed file - user specific configuration.
12749         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12750         Mono.Security assembly. The original class is maintained and tested in
12751         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12752         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12753         like CSC 8.0 (C# v2) supports.
12754         * Makefile: Added CryptoConvert.cs to mcs sources.
12755         * rootcontext.cs: Added new options for strongnames.
12756
12757 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12758
12759         * driver.cs: For --expect-error, report error code `2'
12760         if the program compiled with no errors, error code `1' if
12761         it compiled with an error other than the one expected.
12762
12763 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12764
12765         * compiler.csproj: Updated for Visual Studio .NET 2003.
12766         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12767         * compiler.sln: Updated for Visual Studio .NET 2003.
12768
12769 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12770
12771         * expression.cs: Fix bug #47234. We basically need to apply the
12772         rule that we prefer the conversion of null to a reference type
12773         when faced with a conversion to 'object' (csc behaviour).
12774
12775 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12776
12777         * statement.cs: Shorter form for foreach, eliminates
12778         a local variable. r=Martin.
12779
12780 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12781
12782         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12783         checks if we can use brtrue/brfalse to test for 0.
12784         * expression.cs: use the above in the test for using brtrue/brfalse.
12785         cleanup code a bit.
12786
12787 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12788
12789         * expression.cs: Rewrite string concat stuff. Benefits:
12790
12791         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12792         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12793         rather than a concat chain.
12794
12795         * typemanager.cs: Add lookups for more concat overloads.
12796
12797 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12798
12799         * expression.cs: Emit shorter il code for array init.
12800
12801         newarr
12802         dup
12803         // set 1
12804
12805         // set 2
12806
12807         newarr
12808         stloc.x
12809
12810         ldloc.x
12811         // set 1
12812
12813         ldloc.x
12814         // set 2
12815
12816 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12817
12818         * statement.cs: Before, two switch blocks would be merged if the
12819         total size of the blocks (end_item - begin_item + 1) was less than
12820         two times the combined sizes of the blocks.
12821
12822         Now, it will only merge if after the merge at least half of the
12823         slots are filled.
12824
12825         fixes 55885.
12826
12827 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12828
12829         * class.cs : csc build fix for GetMethods(). See bug #52503.
12830
12831 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12832
12833         * expression.cs: Make sure fp comparisons work with NaN.
12834         This fixes bug #54303. Mig approved this patch a long
12835         time ago, but we were not able to test b/c the runtime
12836         had a related bug.
12837
12838 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12839
12840         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12841
12842 2004-03-19  Martin Baulig  <martin@ximian.com>
12843
12844         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12845         error here and not in our caller.
12846
12847 2004-03-19  Martin Baulig  <martin@ximian.com>
12848
12849         * interface.cs: Completely killed this file.
12850         (Interface): We're now a TypeContainer and live in class.cs.
12851
12852         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12853         argument; we're now also called for interfaces.
12854         (TypeContainer.DefineMembers): Allow this method being called
12855         multiple times.
12856         (TypeContainer.GetMethods): New public method; formerly known as
12857         Interface.GetMethod().  This is used by PendingImplementation.
12858         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12859         it's now private and non-static.
12860         (Interface): Moved this here; it's now implemented similar to
12861         Class and Struct.
12862         (Method, Property, Event, Indexer): Added `bool is_interface'
12863         argument to their .ctor's.
12864         (MemberBase.IsInterface): New public field.
12865
12866         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12867         instances instead of InterfaceMethod, InterfaceProperty, etc.
12868         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12869         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12870
12871 2004-03-19  Martin Baulig  <martin@ximian.com>
12872
12873         * class.cs (MethodCore.IsDuplicateImplementation): New private
12874         method which does the CS0111 checking.
12875         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12876         Use IsDuplicateImplementation().
12877
12878 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12879
12880         * decl.cs (FindMemberToOverride): New method to find the correct
12881         method or property to override in the base class.
12882         * class.cs
12883             - Make Method/Property use the above method to find the
12884               version in the base class.
12885             - Remove the InheritableMemberSignatureCompare as it is now
12886               dead code.
12887
12888         This patch makes large code bases much faster to compile, as it is
12889         O(n) rather than O(n^2) to do this validation.
12890
12891         Also, it fixes bug 52458 which is that nested classes are not
12892         taken into account when finding the base class member.
12893
12894         Reviewed/Approved by Martin.
12895
12896 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12897
12898         * interface.cs: In all interface classes removed redundant
12899         member initialization.
12900
12901 2004-03-16  Martin Baulig  <martin@ximian.com>
12902
12903         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12904
12905 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12906
12907         * decl.cs (DefineTypeAndParents): New helper method to define a
12908         type's containers before the type itself is defined;  This is a
12909         bug exposed by the recent changes to Windows.Forms when an
12910         implemented interface was defined inside a class that had not been
12911         built yet.   
12912
12913         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12914
12915         (Check): Loop correctly to report errors modifiers
12916         (UNSAFE was not in the loop, since it was the same as TOP).
12917
12918         * interface.cs: Every interface member now takes a ModFlags,
12919         instead of a "is_new" bool, which we set on the base MemberCore. 
12920
12921         Every place where we called "UnsafeOk" in the interface, now we
12922         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12923         the unsafe settings from the member declaration instead of the
12924         container interface. 
12925
12926         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12927
12928         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12929         `set_indexer_name' to the pending bits (one per type).
12930
12931         We fixed a bug today that was picking the wrong method to
12932         override, since for properties the existing InterfaceMethod code
12933         basically ignored the method name.  Now we make sure that the
12934         method name is one of the valid indexer names.
12935
12936 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12937  
12938         * support.cs (SeekableStreamReader): Keep track of stream byte
12939         positions and don't mix them with character offsets to the buffer.
12940
12941         Patch from Gustavo Giráldez
12942
12943 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12944
12945         * interface.cs (InterfaceSetGetBase): Removed double member
12946         initialization, base class does it as well.
12947
12948 2004-03-13  Martin Baulig  <martin@ximian.com>
12949
12950         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12951         when compiling corlib.
12952
12953 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12954
12955         * convert.cs (ExplicitConversion): We were reporting an error on
12956         certain conversions (object_type source to a value type, when the
12957         expression was `null') before we had a chance to pass it through
12958         the user defined conversions.
12959
12960         * driver.cs: Replace / and \ in resource specifications to dots.
12961         Fixes 50752
12962
12963         * class.cs: Add check for duplicate operators.  Fixes 52477
12964
12965 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12966
12967         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12968         that are in the middle of the statements, not only at the end.
12969         Fixes #54987
12970
12971         * class.cs (TypeContainer.AddField): No longer set the
12972         `HaveStaticConstructor' flag, now we call it
12973         `UserDefineStaticConstructor' to diferentiate the slightly
12974         semantic difference.
12975
12976         The situation is that we were not adding BeforeFieldInit (from
12977         Modifiers.TypeAttr) to classes that could have it.
12978         BeforeFieldInit should be set to classes that have no static
12979         constructor. 
12980
12981         See:
12982
12983         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12984
12985         And most importantly Zoltan's comment:
12986
12987         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12988
12989         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12990          before its static fields are used', i.e. initialization does not need
12991          to be triggered by the first access to the type. Setting this flag
12992          helps the JIT to compile better code, since it can run the static
12993          constructor at JIT time, and does not need to generate code to call it
12994          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12995          this flag for lots of classes like String. 
12996          
12997          csc sets this flag if the type does not have an explicit static 
12998          constructor. The reasoning seems to be that if there are only static
12999          initalizers for a type, and no static constructor, then the programmer
13000          does not care when this initialization happens, so beforefieldinit
13001          can be used.
13002          
13003          This bug prevents the AOT compiler from being usable, since it 
13004          generates so many calls to mono_runtime_class_init that the AOT code
13005          is much slower than the JITted code. The JITted code is faster, 
13006          because it does not generate these calls if the vtable is type is
13007          already initialized, which is true in the majority of cases. But the
13008          AOT compiler can't do this."
13009
13010 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
13011
13012         * class.cs (MethodData.Emit): Refactor the code so symbolic
13013         information is generated for destructors;  For some reasons we
13014         were taking a code path that did not generate symbolic information
13015         before. 
13016
13017 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13018
13019         * class.cs: Create a Constructor.CheckBase method that
13020         takes care of all validation type code. The method
13021         contains some code that was moved from Define.
13022
13023         It also includes new code that checks for duplicate ctors.
13024         This fixes bug #55148.
13025
13026 2004-03-09  Joshua Tauberer <tauberer@for.net>
13027
13028         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
13029         a { ... }-style array creation invokes EmitStaticInitializers
13030         which is not good for reference-type arrays.  String, decimal
13031         and now null constants (NullCast) are not counted toward
13032         static initializers.
13033
13034 2004-03-05  Martin Baulig  <martin@ximian.com>
13035
13036         * location.cs (SourceFile.HasLineDirective): New public field;
13037         specifies whether the file contains or is referenced by a "#line"
13038         directive.
13039         (Location.DefineSymbolDocuments): Ignore source files which
13040         either contain or are referenced by a "#line" directive.        
13041
13042 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
13043
13044         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
13045         direct access to our parent, so check the method inline there.
13046
13047 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13048
13049         * expression.cs (Invocation.EmitCall): Miguel's last commit
13050         caused a regression. If you had:
13051
13052             T t = null;
13053             t.Foo ();
13054
13055         In Foo the implict this would be null.
13056
13057 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
13058
13059         * expression.cs (Invocation.EmitCall): If the method is not
13060         virtual, do not emit a CallVirt to it, use Call.
13061
13062         * typemanager.cs (GetFullNameSignature): Improve the method to
13063         cope with ".ctor" and replace it with the type name.
13064
13065         * class.cs (ConstructorInitializer.Resolve): Now the method takes
13066         as an argument the ConstructorBuilder where it is being defined,
13067         to catch the recursive constructor invocations.
13068
13069 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
13070
13071         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
13072         routines to check if a type is an enumerable/enumerator allow
13073         classes that implement the IEnumerable or IEnumerator interfaces.
13074
13075         * class.cs (Property, Operator): Implement IIteratorContainer, and
13076         implement SetYields.
13077
13078         (Property.Define): Do the block swapping for get_methods in the
13079         context of iterators.   We need to check if Properties also
13080         include indexers or not.
13081
13082         (Operator): Assign the Block before invoking the
13083         OperatorMethod.Define, so we can trigger the Iterator code
13084         replacement. 
13085
13086         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
13087         Property and Operator classes are not created when we parse the
13088         declarator but until we have the block completed, so we use a
13089         singleton SimpleIteratorContainer.Simple to flag whether the
13090         SetYields has been invoked.
13091
13092         We propagate this setting then to the Property or the Operator to
13093         allow the `yield' to function.
13094
13095 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
13096
13097         * codegen.cs: Implemented attribute support for modules.
13098         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
13099         Assembly/Module functionality.
13100
13101         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
13102         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
13103         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
13104
13105 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
13106
13107         * interface.cs (FindMembers): The operation is performed on all base
13108         interfaces and not only on the first. It is required for future CLS Compliance patch.
13109
13110 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13111
13112         * statement.cs, codegen.cs:
13113         This patch deals with patterns such as:
13114
13115         public class List : IEnumerable {
13116
13117                 public MyEnumerator GetEnumerator () {
13118                         return new MyEnumerator(this);
13119                 }
13120
13121                 IEnumerator IEnumerable.GetEnumerator () {
13122                         ...
13123                 }
13124                 
13125                 public struct MyEnumerator : IEnumerator {
13126                         ...
13127                 }
13128         }
13129
13130         Before, there were a few things we did wrong:
13131         1) we would emit callvirt on a struct, which is illegal
13132         2) we emited ldarg when we needed to emit ldarga
13133         3) we would mistakenly call the interface methods on an enumerator
13134         type that derived from IEnumerator and was in another assembly. For example:
13135
13136         public class MyEnumerator : IEnumerator
13137
13138         Would have the interface methods called, even if there were public impls of the
13139         method. In a struct, this lead to invalid IL code.
13140
13141 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
13142
13143         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
13144           renamed to Emit.
13145
13146         * delegate.cs (Define): Fixed crash when delegate type is undefined.
13147
13148 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
13149
13150         * cs-parser.jay: Fix small regression: we were not testing V2
13151         compiler features correctly.
13152
13153         * interface.cs: If the emit context is null, then create one
13154
13155 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
13156
13157         * decl.cs (GetSignatureForError): New virtual method to get full name
13158           for error messages.
13159
13160         * attribute.cs (IAttributeSupport): New interface for attribute setting.
13161           Now it is possible to rewrite ApplyAttributes method to be less if/else.
13162
13163         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
13164           Duplicated members and code in these classes has been removed.
13165           Better encapsulation in these classes.
13166
13167 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * assign.cs (Assign.DoResolve): When dealing with compound
13170         assignments, there is a new rule in ECMA C# 2.4 (might have been
13171         there before, but it is documented here) that states that in:
13172
13173         a op= b;
13174
13175         If b is of type int, and the `op' is a shift-operator, then the
13176         above is evaluated as:
13177
13178         a = (int) a op b 
13179
13180         * expression.cs (Binary.ResolveOperator): Instead of testing for
13181         int/uint/long/ulong, try to implicitly convert to any of those
13182         types and use that in pointer arithmetic.
13183
13184         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
13185         method to print information for from the type, not from the
13186         null-method we were given.
13187
13188 2004-02-01  Duncan Mak  <duncan@ximian.com>
13189
13190         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
13191         parsing for cmd, fixes bug #53694.
13192
13193 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
13194
13195         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
13196         in the member name duplication tests. Property and operator name duplication
13197         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
13198
13199 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
13200
13201         * interface.cs (PopulateMethod): Fixed crash when interface method
13202         returns not existing type (error test cs0246-3.cs).
13203
13204 2004-02-02  Ravi Pratap M <ravi@ximian.com>
13205
13206         * cs-parser.jay (interface_accessors): Re-write actions to also
13207         store attributes attached to get and set methods. Fix spelling
13208         while at it.
13209
13210         (inteface_property_declaration): Modify accordingly.
13211
13212         (InterfaceAccessorInfo): New helper class to store information to pass
13213         around between rules that use interface_accessors.
13214
13215         * interface.cs (Emit): Apply attributes on the get and set
13216         accessors of properties and indexers too.
13217
13218         * attribute.cs (ApplyAttributes): Modify accordingly to use the
13219         right MethodBuilder when applying attributes to the get and set accessors.
13220
13221 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
13222
13223         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
13224
13225 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
13226
13227         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13228
13229 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
13230
13231         * cs-parser.jay: Remove YIELD token, instead use the new grammar
13232         changes that treat `yield' specially when present before `break'
13233         or `return' tokens.
13234
13235         * cs-tokenizer.cs: yield is no longer a keyword.
13236
13237 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
13238
13239         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13240         setting for default constructors.
13241         For default constructors are almost every time set wrong Modifier. The
13242         generated IL code has been alright. But inside mcs this values was
13243         wrong and this was reason why several of my CLS Compliance tests
13244         failed.
13245
13246 2004-01-22  Martin Baulig  <martin@ximian.com>
13247
13248         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13249         not a QualifiedIdentifier.  This is what `type_name_expression'
13250         was previously doing.
13251         (type_name_expression): Removed; the code is now in
13252         `namespace_or_type_name'.
13253         (qualified_identifier): Removed, use `namespace_or_type_name'
13254         instead.
13255         (QualifiedIdentifier): Removed this class.      
13256
13257 2004-01-22  Martin Baulig  <martin@ximian.com>
13258
13259         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13260         not a string as alias name.
13261
13262 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13263
13264         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13265         #52730 bug, and instead compute correctly the need to use a
13266         temporary variable when requesting an address based on the
13267         static/instace modified of the field and the constructor.
13268  
13269 2004-01-21  Martin Baulig  <martin@ximian.com>
13270
13271         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13272         class and namespace before looking up aliases.  Fixes #52517.
13273
13274 2004-01-21  Martin Baulig  <martin@ximian.com>
13275
13276         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13277         assinged in a 'try'; fixes exception4.cs.
13278
13279 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13280         * class.cs : Implemented parameter-less constructor for TypeContainer
13281
13282         * decl.cs: Attributes are now stored here. New property OptAttributes
13283
13284         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13285
13286         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13287
13288 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13289
13290         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13291           (CSharpSignature): New method for indexer and property signature.
13292
13293 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13294
13295         * pending.cs (IsVirtualFilter): Faster implementation.
13296
13297 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13298
13299         * typemanager.cs: Avoid inclusion of same assembly more than once.
13300
13301 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13302
13303         * cs-parser.jay: Fixed problem where the last assembly attribute
13304           has been applied also to following declaration (class, struct, etc.)
13305           
13306 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13307
13308         * class.cs: Added error CS0538, CS0539 reporting.
13309         Fixed crash on Microsoft runtime when field type is void.
13310
13311         * cs-parser.jay: Added error CS0537 reporting.
13312
13313         * pending.cs: Added error CS0535 reporting.
13314         Improved error report for errors CS0536, CS0534.
13315
13316 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13317
13318         Merge a few bits from the Anonymous Method MCS tree.
13319
13320         * statement.cs (ToplevelBlock): New class for toplevel methods,
13321         will hold anonymous methods, lifted variables.
13322
13323         * cs-parser.jay: Create toplevel blocks for delegates and for
13324         regular blocks of code. 
13325
13326 2004-01-20  Martin Baulig  <martin@ximian.com>
13327
13328         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13329         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13330         and `NeedExplicitReturn'; added `IsLastStatement'.
13331         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13332         have a `ReturnLabel' or we're not unreachable.
13333
13334         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13335         child's reachability; don't just override ours with it.  Fixes
13336         #58058 (lluis's example).
13337         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13338         InFinally(), InLoop(), InSwitch() and
13339         BreakCrossesTryCatchBoundary() methods.
13340
13341         * statement.cs (Return): Do all error checking in Resolve().
13342         Unless we are the last statement in a top-level block, always
13343         create a return label and jump to it.
13344         (Break, Continue): Do all error checking in Resolve(); also make
13345         sure we aren't leaving a `finally'.
13346         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13347         statement in a top-level block.
13348         (Block.Flags): Added `IsDestructor'.
13349         (Block.IsDestructor): New public property.
13350
13351 2004-01-20  Martin Baulig  <martin@ximian.com>
13352
13353         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13354
13355 2004-01-20  Martin Baulig  <martin@ximian.com>
13356
13357         * statement.cs (Statement.ResolveUnreachable): New public method.
13358         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13359         (Block.Resolve): Resolve unreachable statements.
13360
13361 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13362
13363         * expression.cs: We need to fix the case where we do
13364         not have a temp variable here.
13365
13366         * assign.cs: Only expression compound assignments need
13367         temporary variables.
13368
13369 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13370
13371         * flowanalysis.cs: Reduce memory allocation in a few ways:
13372           - A block with no variables should not allocate a bit
13373             vector for itself.
13374           - A method with no out parameters does not need any tracking
13375             for assignment of the parameters, so we need not allocate
13376             any data for it.
13377           - The arrays:
13378                 public readonly Type[] VariableTypes;
13379                 public readonly string[] VariableNames;
13380             Are redundant. The data is already stored in the variable
13381             map, so we need not allocate another array for it.
13382           - We need to add alot of checks for if (params | locals) == null
13383             due to the first two changes.
13384
13385 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13386
13387         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13388         implement IMemoryLocation, we store a copy on a local variable and
13389         take the address of it.  Patch from Benjamin Jemlich
13390
13391         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13392         to use a special "type_name_expression" rule which reduces the
13393         number of "QualifiedIdentifier" classes created, and instead
13394         directly creates MemberAccess expressions.
13395
13396 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13397
13398         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13399         that fixes #52853.  Null literal assignment to ValueType
13400
13401         * class.cs (MethodData.Emit): Instead of checking the name of the
13402         method to determine if its a destructor, create a new derived
13403         class from Method called Destructor, and test for that.  
13404
13405         * cs-parser.jay: Create a Destructor object instead of a Method.  
13406
13407         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13408
13409         Fixes: 52933
13410
13411 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13412
13413         * expression.cs (Binary.ResolveOperator): Perform an implicit
13414         conversion from MethodGroups to their delegate types on the
13415         Addition operation.
13416
13417         * delegate.cs: Introduce a new class DelegateCreation that is the
13418         base class for `NewDelegate' and `ImplicitDelegateCreation',
13419         factor some code in here.
13420
13421         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13422         conversion from MethodGroups to compatible delegate types. 
13423
13424         * ecore.cs (Expression.Resolve): Do not flag error 654
13425         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13426         we allow conversions from MethodGroups to delegate types now.
13427
13428         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13429         assignments in v2 either.
13430
13431 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13434         static read-only fields in ctors.
13435
13436         Applied patch from Benjamin Jemlich 
13437
13438         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13439
13440 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13441
13442         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13443         here to return true, as they can be used like this:
13444
13445                 (XXX) int.MEMBER ()
13446
13447         Fixed 49836 and all the other dups
13448
13449 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13450
13451         * driver.cs: Implement /win32res and /win32icon.
13452
13453 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13454
13455         * cs-parser.jay: Add a rule to improve error handling for the
13456         common mistake of placing modifiers after the type.
13457
13458 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13459
13460         * cs-parser.jay (interface_event_declaration): Catch
13461         initialization of events on interfaces, and report cs0068
13462
13463         * cs-parser.jay (interface_event_declaration): Catch
13464         initialization of events. 
13465
13466         * ecore.cs: Better report missing constructors.
13467
13468         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13469         the error reporting done in the wrong place.  Fix.
13470
13471         * expression.cs (Binary.ResolveOperator): Catch the 
13472         operator + (E x, E y) error earlier, and later allow for implicit
13473         conversions in operator +/- (E e, U x) from U to the underlying
13474         type of E.
13475
13476         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13477         52596, if the container class is abstract, the default constructor
13478         is protected otherwise its public (before, we were always public).
13479
13480         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13481         fixed statement.
13482
13483         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13484         Jemlich that fixes bug #52597, MCS was generating invalid code for
13485         idisposable structs.   Thanks to Ben for following up with this
13486         bug as well.
13487
13488 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13489
13490         * driver.cs: Allow assemblies without code to be generated, fixes
13491         52230.
13492
13493 2004-01-07  Nick Drochak <ndrochak@gol.com>
13494
13495         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13496
13497 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13498
13499         * cs-parser.jay: Add rules to improve error reporting if fields or
13500         methods are declared at the namespace level (error 116)
13501
13502         * Add rules to catch event add/remove
13503
13504 2004-01-04  David Sheldon <dave-mono@earth.li>
13505
13506   * expression.cs: Added matching ")" to error message for 
13507   CS0077
13508
13509 2004-01-03 Todd Berman <tberman@gentoo.org>
13510
13511         * ecore.cs, attribute.cs:
13512         Applying fix from #52429.
13513
13514 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13515
13516         * ecore.cs, expression.cs, statement.cs:
13517         Total rewrite of how we handle branching. We
13518         now handle complex boolean expressions with fewer
13519         jumps. As well if (x == 0) no longer emits a ceq.
13520
13521         if (x is Foo) is much faster now, because we generate
13522         better code.
13523
13524         Overall, we get a pretty big improvement on our benchmark
13525         tests. The code we generate is smaller and more readable.
13526
13527         I did a full two-stage bootstrap. The patch was reviewed
13528         by Martin and Miguel.
13529
13530 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13531
13532         * cs-parser.jay: Make primary_expression not take a QI.
13533         we dont need this because the member_access rule covers
13534         us here. So we replace the rule with just IDENTIFIER.
13535
13536         This has two good effects. First, we remove a s/r conflict.
13537         Second, we allocate many fewer QualifiedIdentifier objects.
13538
13539 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13540
13541         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13542         set the correct information via SRE. This prevents
13543         hanging on the MS runtime. Fixes #29374.
13544
13545 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13546
13547         * convert.cs: correctly handle conversions to value types
13548         from Enum and ValueType as unboxing conversions.
13549
13550         Fixes bug #52569. Patch by Benjamin Jemlich.
13551
13552 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13553
13554         * expression.cs (BetterConversion): Prefer int -> uint
13555         over int -> ulong (csc's behaviour). This fixed bug #52046.
13556
13557 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13558
13559         * decl.cs (MemberCache.FindMembers): now returns a
13560         MemberInfo [].
13561
13562         * typemanager.cs: In general, go with with ^^.
13563         (CopyNewMethods): take an IList.
13564         (RealMemberLookup): Only allocate an arraylist
13565         if we copy from two sets of methods.
13566
13567         This change basically does two things:
13568         1) Fewer array lists allocated due to CopyNewMethods.
13569         2) the explicit cast in MemberList costed ALOT.
13570
13571 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13572
13573         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13574         a hashtable to avoid needless string allocations when an identifier is
13575         used more than once (the common case).
13576
13577 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13578
13579         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13580         is broken, it will not return anything. So, we
13581         have to use the information we have in mcs to
13582         do the task.
13583
13584         * typemanager.cs: Add a cache for GetInterfaces,
13585         since this will now be used more often (due to ^^)
13586
13587         (GetExplicitInterfaces) New method that gets the
13588         declared, not effective, interfaces on a type
13589         builder (eg, if you have interface IFoo, interface
13590         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13591         { IBar }.
13592
13593         This patch makes MCS able to bootstrap itself on
13594         Windows again.
13595
13596 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13597
13598         * expression.cs: Remove the Nop's that Miguel put
13599         in by mistake.
13600
13601 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13602
13603         * report.cs, codegen.cs: Give the real stack trace to
13604         the error when an exception is thrown.
13605
13606 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13607
13608         * decl.cs: only allocate hashtables for ifaces if 
13609         it is an iface!
13610
13611 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13612
13613         * expression.cs: fix the error from cs0121-2.cs
13614         (a parent interface has two child interfaces that
13615         have a function with the same name and 0 params
13616         and the function is called through the parent).
13617
13618 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13619
13620         * class.cs, rootcontext.cs, typmanager.cs: do not
13621         leak pointers.
13622
13623 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13624
13625         * codegen.cs: remove stack for the ec flow branching.
13626         It is already a linked list, so no need.
13627
13628 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13629
13630         * Makefile: Allow custom profiler here.
13631
13632 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13633
13634         * typemanager.cs (LookupType):
13635           - Use a static char [], because split takes
13636             a param array for args, so it was allocating
13637             every time.
13638           - Do not store true in a hashtable, it boxes.
13639
13640 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13641
13642         * flowanalysis.cs: bytify common enums.
13643
13644 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13645
13646         * modifiers.cs: Add a new set of flags for the
13647         flags allowed on explicit interface impls.
13648         * cs-parser.jay: catch the use of modifiers in
13649         interfaces correctly.
13650         * class.cs: catch private void IFoo.Blah ().
13651
13652         All related to bug #50572.
13653
13654 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13655
13656         * decl.cs: Rewrite the consistant accessability checking.
13657         Accessability is not linear, it must be implemented in
13658         a tableish way. Fixes #49704.
13659
13660 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13661
13662         * expression.cs: Handle negation in a checked context.
13663         We must use subtraction from zero. Fixes #38674.
13664
13665 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13666
13667         * class.cs: Ignore static void main in DLLs.
13668         * rootcontext.cs: Handle the target type here,
13669         since we are have to access it from class.cs
13670         * driver.cs: account for the above.
13671
13672 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13673
13674         * report.cs: Give line numbers and files if available.
13675
13676 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13677
13678         * driver.cs: Implement /addmodule.
13679
13680         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13681         ModuleBuilders.
13682
13683 2003-12-20  Martin Baulig  <martin@ximian.com>
13684
13685         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13686         (FieldBase.IsAssigned): Removed this field.
13687         (FieldBase.SetAssigned): New public method.
13688         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13689
13690 2003-12-20  Martin Baulig  <martin@ximian.com>
13691
13692         * expression.cs (LocalVariableReference.DoResolve): Don't set
13693         `vi.Used' if we're called from DoResolveLValue().
13694
13695         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13696         returns the usage vector it just merged into the current one -
13697         pass this one to UsageWarning().
13698         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13699         of the `EmitContext', don't call this recursively on our children.
13700
13701 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13702
13703         * driver.cs: Implement /target:module.
13704
13705 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13706
13707         * support.cs (CharArrayHashtable): New helper class.
13708
13709         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13710         char arrays, not strings, so we can avoid creating a string in
13711         consume_identifier if the identifier is a keyword.
13712
13713 2003-12-16  Martin Baulig  <martin@ximian.com>
13714
13715         * statement.cs (LocalInfo.Assigned): Removed this property.
13716         (LocalInfo.Flags): Removed `Assigned'.
13717         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13718         and uses flow analysis.
13719         (Block.UsageWarning): Made this method private.
13720         (Block.Resolve): Call UsageWarning() if appropriate.
13721
13722         * expression.cs (LocalVariableReference.DoResolve): Always set
13723         LocalInfo.Used here.
13724
13725 2003-12-13  Martin Baulig  <martin@ximian.com>
13726
13727         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13728         any value here; we're now using flow analysis to figure out
13729         whether a statement/block returns a value.
13730
13731 2003-12-13  Martin Baulig  <martin@ximian.com>
13732
13733         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13734         working again.
13735         (FlowBranching.MergeFinally): Don't call
13736         `branching.CheckOutParameters()' here, this is called in
13737         MergeTopBlock().
13738         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13739         when adding the `finally' vector.       
13740
13741 2003-12-13  Martin Baulig  <martin@ximian.com>
13742
13743         * flowanalysis.cs
13744         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13745         actually work and also fix #48962.
13746
13747 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13748
13749         * decl.cs: Do not check System.Object for nested types,
13750         since we know it does not have any. Big bang for buck:
13751
13752         BEFORE:
13753            Run 1:   8.35 seconds
13754            Run 2:   8.32 seconds
13755            corlib:  17.99 seconds
13756         AFTER:
13757            Run 1:   8.17 seconds
13758            Run 2:   8.17 seconds
13759            corlib:  17.39 seconds
13760
13761 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13762
13763         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13764         time we are returning 0 members, so we save alot here.
13765
13766 2003-12-11  Martin Baulig  <martin@ximian.com>
13767
13768         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13769         `MergeChild()', also just take the `FlowBranching' as argument;
13770         call Merge() on it and return the result.
13771         (FlowBranching.Merge): We don't need to do anything if we just
13772         have one sibling.
13773
13774 2003-12-11  Martin Baulig  <martin@ximian.com>
13775
13776         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13777         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13778         Maurer for this idea.
13779
13780 2003-12-11  Martin Baulig  <martin@ximian.com>
13781
13782         * flowanalysis.cs (MergeResult): This class is now gone; we now
13783         use the `UsageVector' for this.  The reason for this is that if a
13784         branching just has one sibling, we don't need to "merge" them at
13785         all - that's the next step to do.
13786         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13787         `MergeResult'.
13788
13789 2003-12-11  Martin Baulig  <martin@ximian.com>
13790
13791         Reworked flow analyis and made it more precise and bug-free.  The
13792         most important change is that we're now using a special `Reachability'
13793         class instead of having "magic" meanings of `FlowReturns'.  I'll
13794         do some more cleanups and optimizations and also add some more
13795         documentation this week.
13796
13797         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13798         largely reworked this class.
13799         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13800         the new `Reachability' class instead of having "magic" values here.
13801         (FlowBranching): We're now using an instance of `Reachability'
13802         instead of having separate `Returns', `Breaks' etc. fields.
13803
13804         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13805         based on flow analysis; ignore the return value of block.Emit ().
13806
13807 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13808
13809         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13810         if they are private.
13811
13812 2003-12-09  Martin Baulig  <martin@ximian.com>
13813
13814         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13815         call them directly on the UsageVector.
13816
13817 2003-12-09  Martin Baulig  <martin@ximian.com>
13818
13819         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13820         Changed return type from `FlowReturns' to `Reachability'.
13821
13822 2003-12-09  Martin Baulig  <martin@ximian.com>
13823
13824         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13825         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13826         `Reachable' fields with a single `Reachability' one.
13827
13828 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13829
13830         * class.cs (FindMembers): Remove foreach's.
13831
13832         Bootstrap times:
13833
13834         BEFORE
13835                 Run 1:   8.74 seconds
13836                 Run 2:   8.71 seconds
13837
13838         AFTER
13839                 Run 1:   8.64 seconds
13840                 Run 2:   8.58 seconds
13841
13842
13843 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13844
13845         * cs-parser.jay:
13846         * gen-treedump.cs:
13847         * statement.cs:
13848         This patch does a few things:
13849                 1. EmptyStatement is now a singleton, so it is never reallocated.
13850                 2. All blah is EmptyStatement constructs have been changed to
13851                    blah == EmptyStatement.Value, which is much faster and valid
13852                    now that EmptyStatement is a singleton.
13853                 3. When resolving a block, rather than allocating a new array for
13854                    the non-empty statements, empty statements are replaced with
13855                    EmptyStatement.Value
13856                 4. Some recursive functions have been made non-recursive.
13857         Mainly the performance impact is from (3), however (1) and (2) are needed for
13858         this to work. (4) does not make a big difference in normal situations, however
13859         it makes the profile look saner.
13860
13861         Bootstrap times:
13862
13863         BEFORE
13864         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13865         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13866         Total memory allocated: 56397 KB
13867
13868         AFTER
13869         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13870         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13871         Total memory allocated: 55666 KB
13872
13873 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13874
13875         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13876         than the hashtable in a hashtable version
13877
13878         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13879         we always end up concating a string. This results in a huge perf
13880         loss, because many strings have to be tracked by the GC. In this
13881         patch, we first use a hashtable that works with two keys, so that
13882         the strings do not need to be concat'ed.
13883
13884         Bootstrap times:
13885         BEFORE
13886                 Run 1:   8.74 seconds
13887                 Run 2:   8.71 seconds
13888
13889         AFTER
13890                 Run 1:   8.65 seconds
13891                 Run 2:   8.56 seconds
13892
13893 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13894
13895         * Makefile: Add a new target `do-time' that does a quick and simple
13896         profile, leaving easy to parse output.
13897
13898 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13899
13900         * codegen.cs (Init): Create the dynamic assembly with 
13901         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13902
13903 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13904
13905         * support.cs: Make the PtrHashtable use only one
13906         instance of its comparer.
13907
13908 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13909
13910         * typemanager.cs: Fix lookup of GetNamespaces.
13911
13912 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13913
13914         * expression.cs: Removed redundant line.
13915
13916         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13917         ArrayLists, use for loops with bounds.  
13918
13919         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13920         arraylist.
13921
13922         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13923         arraylists, use for loop with bounds.
13924
13925         The above three changes give us a 0.071 second performance
13926         improvement out of 3.294 seconds down to 3.223.  On my machine
13927         the above changes reduced the memory usage by 1,387 KB during
13928         compiler bootstrap.
13929
13930         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13931         QualifiedIdentifiers.  Before we created a new string through
13932         concatenation, and mostly later on, the result would be
13933         manipulated by DecomposeQI through string manipulation.
13934
13935         This reduced the compiler memory usage for bootstrapping from
13936         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13937         compile times in 0.05 seconds.
13938
13939 2003-11-28  Dick Porter  <dick@ximian.com>
13940
13941         * support.cs: Do string compares with the Invariant culture.
13942
13943         * rootcontext.cs: 
13944         * gen-treedump.cs: 
13945         * expression.cs: 
13946         * driver.cs: 
13947         * decl.cs: 
13948         * codegen.cs: 
13949         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13950         the comparison is done with the Invariant culture.
13951
13952 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13953
13954         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13955         GetEnumerator method.
13956
13957         (ProbeCollectionType): Iterate starting at the most specific type
13958         upwards looking for a GetEnumerator
13959
13960         * expression.cs: Shift count can be up to 31 for int/uint and 63
13961         for long/ulong.
13962
13963 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13964
13965         * statement.cs (Block.LookupLabel): Also look for the label on the
13966         children blocks.  Use a hash table to keep track of visited
13967         nodes. 
13968
13969         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13970         we actually did transform the other operand, otherwise fall back
13971         to the common codepath that casts to long.
13972
13973         * cs-tokenizer.cs: Use the same code pattern as the int case.
13974         Maybe I should do the parsing myself, and avoid depending on the
13975         Parse routines to get this done.
13976
13977 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13978
13979         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13980         which fixes bug 51347.  This time test it.
13981
13982         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13983         attributes for example can not tell the difference between these.
13984         The difference was only a syntax feature of the language. 
13985
13986         * attribute.cs: Apply attributes to delegates.
13987
13988         * delegate.cs: Call the apply attributes method.
13989
13990 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13991
13992         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13993         comparing 0 vs Byte.MinValue, not the value
13994
13995         (ImplicitConversionRequired): When reporting a conversion error,
13996         use error 31 to print out the constant error instead of the
13997         simpler 29.
13998
13999         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
14000         which fixes bug 51347.
14001
14002 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
14003
14004         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
14005         which fixes the -warnaserror command line option.
14006
14007 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
14008
14009         * cfold.cs (DoNumericPromotions): During constant folding of
14010         additions on UIntConstant, special case intconstants with
14011         IntConstants like we do on the expression binary operator. 
14012
14013 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
14014
14015         * convert.cs (ImplicitReferenceConversion): We were missing a case
14016         (System.Enum are not value types or class types, so we need to
14017         classify them separatedly).
14018
14019         * driver.cs: We do not support error 2007.
14020
14021 2003-11-12 Jackson Harper <jackson@ximian.com>
14022
14023         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
14024         system directory. Also use the full file name so users can
14025         libraries names mscorlib-o-tron.dll in a non system dir.
14026
14027 2003-11-10  Martin Baulig  <martin@ximian.com>
14028
14029         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
14030         (TypeManager.InitCoreTypes): Initialize them here, but instead of
14031         calling `ResolveType()' on them, directly assign their `Type'.
14032
14033 2003-11-08  Martin Baulig  <martin@ximian.com>
14034
14035         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
14036         return value and the `out parent' parameter.
14037         (TypeContainer.DefineType): Moved the CS0644 check into
14038         GetClassBases().  Don't pass the interface types to the
14039         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
14040         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
14041
14042         * ecore.cs (TypeExpr.IsAttribute): New property.
14043         (TypeExpr.GetInterfaces): New method.
14044
14045         * interface.cs (Interface.GetInterfaceTypeByName): Return a
14046         TypeExpr instead of a Type.
14047         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
14048         (Interface.DefineType): Don't pass the interface types to the
14049         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
14050         them later and then call `TypeBulider.AddInterfaceImplementation()'.
14051
14052         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
14053         instead of a `Type[]'.
14054         (TypeManager.RegisterBuilder): Likewise.
14055         (TypeManager.AddUserInterface): Likewise.
14056         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
14057         `Type[]' and also return a `TypeExpr[]'.
14058         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14059
14060 2003-11-08  Martin Baulig  <martin@ximian.com>
14061
14062         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14063         Expression.     
14064
14065 2003-11-08  Martin Baulig  <martin@ximian.com>
14066
14067         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14068         TypeManager.ResolveExpressionTypes().
14069
14070         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14071         instead of an Expression.
14072         (TypeExpr): This is now an abstract base class for `TypeExpression'.
14073         (TypeExpression): New public class; formerly known as `TypeExpr'.
14074
14075         * expression.cs (ComposedCast): Derive from TypeExpr.
14076
14077         * typemanager.cs (TypeManager.system_*_expr): These are now
14078         TypExpr's instead of Expression's.
14079         (TypeManager.ResolveExpressionTypes): New public static function;
14080         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14081         of them.        
14082
14083 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
14084
14085         * expression.cs (New.DoResolve): Do not dereference value that
14086         might be a null return.
14087
14088         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14089         sure that the constant value has the right type.  Fixes an
14090         unreported bug, similar to 50425.
14091
14092         * const.cs (Const.LookupConstantValue): Call
14093         ImplicitStandardConversionExists before doing a conversion to
14094         avoid havng the TypeManager.ChangeType do conversions.
14095
14096         Reduced the number of casts used
14097
14098         (Const.ChangeType): New routine to enable reuse of the constant
14099         type changing code from statement.
14100
14101         * typemanager.cs (ChangeType): Move common initialization to
14102         static global variables.
14103
14104         Fixes #50425.
14105
14106         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14107         every value type to go through, even if it was void.  Fix that. 
14108
14109         * cs-tokenizer.cs: Use is_identifier_start_character on the start
14110         character of the define, and the is_identifier_part_character for
14111         the rest of the string.
14112
14113 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
14114
14115         * expression.cs (UnaryMutator.EmitCode): When I updated
14116         LocalVariableReference.DoResolve, I overdid it, and dropped an
14117         optimization done on local variable references.
14118
14119 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
14120
14121         * ecore.cs: Convert the return from Ldlen into an int.
14122
14123 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
14124
14125         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14126         the accessibility, this is a special case for toplevel non-public
14127         classes (internal for instance).
14128
14129 2003-10-20  Nick Drochak <ndrochak@gol.com>
14130
14131         * ecore.cs: Fix typo and build.  Needed another right paren.
14132
14133 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
14134
14135         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
14136         `internal' case regular and protected, but not allowing protected
14137         to be evaluated later.  Bug 49840
14138
14139 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
14140
14141         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14142         to kb.Nlast, and not the kb.nFirst to isolate the switch
14143         statement.
14144
14145         Extract the underlying type, so enumerations of long/ulong are
14146         treated like long/ulong.
14147
14148 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14149
14150         * expression.cs (New): Overload the meaning of RequestedType to
14151         track the possible creation of the NewDelegate type, since
14152         DoResolve is invoked more than once for new constructors on field
14153         initialization.
14154
14155         See bugs: #48800 and #37014
14156
14157         * cs-parser.jay (declare_local_constants): Take an arraylist
14158         instead of a single constant.
14159
14160         (local_constant_declaration): It should take a
14161         constant_declarators, not a constant_declarator.  Fixes 49487
14162
14163         * convert.cs: Fix error report.
14164
14165 2003-10-13 Jackson Harper <jackson@ximian.com>
14166
14167         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14168         bug #49611
14169
14170 2003-10-09  Martin Baulig  <martin@ximian.com>
14171
14172         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14173         to the .ctor.
14174         (MethodCore.DoDefineParameters): Removed the TypeContainer
14175         argument; use the DeclSpace which was passed to the .ctor instead.
14176         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14177         TypeContainer; we only need a DeclSpace here.
14178
14179 2003-10-09  Martin Baulig  <martin@ximian.com>
14180
14181         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14182         to the .ctor.
14183         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14184         EmitContext's .ctor.    
14185
14186 2003-10-09  Martin Baulig  <martin@ximian.com>
14187
14188         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14189         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14190         AsAccessible(), moved them as well.
14191
14192         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14193
14194 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14195
14196         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14197
14198 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14199
14200         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14201         generation for >=, as spotted by Paolo, bug 48679.  
14202         Patch from David Waite.
14203
14204         * cs-tokenizer.cs: Add handling for #pragma.
14205
14206         * cs-parser.jay: Allow for both yield and yield return in the
14207         syntax.  The anti-cobolization of C# fight will go on!
14208
14209         * class.cs (TypeBuilder.DefineType): Catch error condition here
14210         (Parent.DefineType erroring out and returning null).
14211
14212         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14213         coping with enumerations variables, we were mistakenly processing
14214         them as a regular value type instead of built-in types.  Fixes the
14215         bug #48063
14216
14217         * typemanager.cs (IsBuiltinOrEnum): New method.
14218
14219 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14220
14221         * cs-parser.jay: Upgrade: yield now needs the return clause.
14222
14223 2003-09-19  Martin Baulig  <martin@ximian.com>
14224
14225         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14226         `MemberCache parent' argument.  Normally, an interface doesn't
14227         have a parent type except System.Object, but we use this in gmcs
14228         for generic type parameters.
14229
14230 2003-09-18  Martin Baulig  <martin@ximian.com>
14231
14232         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14233         on `type.IsInterface'; don't check whether the type has a parent
14234         to determine whether it's an interface.
14235
14236 2003-09-15  Martin Baulig  <martin@ximian.com>
14237
14238         * class.cs (TypeContainer.DefineType): Added an error flag to
14239         avoid reporting duplicate CS0146's ("class definition is
14240         circular.").
14241
14242         * driver.cs (Driver.MainDriver): Abort if
14243         RootContext.ResolveTree() reported any errors.
14244
14245 2003-09-07  Martin Baulig  <martin@ximian.com>
14246
14247         * report.cs (Error, Warning): Added overloaded versions which take
14248         a `params object[] args' and call String.Format().
14249
14250 2003-09-07  Martin Baulig  <martin@ximian.com>
14251
14252         * decl.cs (DeclSpace..ctor): Don't call
14253         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14254         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14255         (DeclSpace.RecordDecl): New method.
14256
14257         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14258
14259 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14260
14261         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14262         value attributes to be applied to ParameterBuilders.
14263
14264         * class.cs (MethodCore.LabelParameters): Make static and more
14265         generic so that it can be used from other places - like interface
14266         methods, for instance.
14267
14268         * interface.cs (Interface.Emit): Call LabelParameters before
14269         emitting attributes on the InterfaceMethod.
14270
14271 2003-08-26  Martin Baulig  <martin@ximian.com>
14272
14273         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14274         resolving aliases; fixes #47927.
14275
14276 2003-08-26  Martin Baulig  <martin@ximian.com>
14277
14278         * statement.cs (Using.DoResolve): This is internally emitting a
14279         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14280         do not always return.  Fixes #47681.
14281
14282 2003-08-26  Martin Baulig  <martin@ximian.com>
14283
14284         * decl.cs (MemberCore): Moved WarningNotHiding(),
14285         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14286         into MemberBase.
14287         (AdditionResult): Make this nested in DeclSpace.
14288         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14289         argument; call NamespaceEntry.Define() unless we're nested in a
14290         class or struct.
14291
14292         * namespace.cs (Namespace.DefineName): New public function.  This
14293         is called from DeclSpace's .ctor to add 
14294         (Namespace.Lookup): Include DeclSpaces in the lookup.
14295
14296         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14297
14298         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14299
14300 2003-08-25  Martin Baulig  <martin@ximian.com>
14301
14302         * convert.cs (Convert.ExplicitReferenceConversion): When
14303         converting from an interface type to a class, unbox if the target
14304         type is a struct type.  Fixes #47822.
14305
14306 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14307
14308         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14309         #47854.
14310
14311 2003-08-22  Martin Baulig  <martin@ximian.com>
14312
14313         * class.cs (TypeManager.DefineType): When defining a nested type,
14314         call DefineType() on our parent; fixes #47801.
14315
14316 2003-08-22  Martin Baulig  <martin@ximian.com>
14317
14318         * class.cs (MethodData.Define): While checking if a method is an
14319         interface implementation, improve the test a bit more to fix #47654.
14320
14321 2003-08-22  Martin Baulig  <martin@ximian.com>
14322
14323         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14324         correctly; fixes #47722.
14325
14326 2003-08-22  Martin Baulig  <martin@ximian.com>
14327
14328         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14329         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14330
14331         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14332
14333 2003-08-22  Martin Baulig  <martin@ximian.com>
14334
14335         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14336         can only be assigned in static constructors.  Fixes #47161.
14337
14338 2003-08-22  Martin Baulig  <martin@ximian.com>
14339
14340         Rewrote and improved the flow analysis code.
14341
14342         * flowbranching.cs (FlowBranching): Make this class abstract.
14343         (FlowBranching.CreateBranching): New static function to create a
14344         new flow branching.
14345         (FlowBranchingBlock, FlowBranchingException): New classes.
14346         (FlowBranching.UsageVector.Type): New public readonly field.
14347         (FlowBranching.UsageVector.Breaks): Removed the setter.
14348         (FlowBranching.UsageVector.Returns): Removed the setter.
14349         (FlowBranching.UsageVector): Added Break(), Return(),
14350         NeverReachable() and Throw() methods to modify the reachability.
14351         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14352         done by FlowBranching.Merge().
14353         (FlowBranching.UsageVector.MergeChild): New method; merges the
14354         merge result into the current vector.
14355         (FlowBranching.Merge): New abstract method to merge a branching.
14356
14357 2003-08-12  Martin Baulig  <martin@ximian.com>
14358
14359         * expression.cs (Indirection.CacheTemporaries): Create the
14360         LocalTemporary with the pointer type, not its element type.
14361
14362 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14363
14364         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14365         token was a keyword or not.
14366
14367         Add `error' options where an IDENTIFIER was expected;  Provide
14368         CheckToken and CheckIdentifierToken convenience error reporting
14369         functions. 
14370
14371         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14372
14373         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14374         NameSpaceEntry NameSpaceEntry.
14375
14376         (LookupInterfaceOrClass): Avoid creating a full qualified name
14377         from namespace and name: avoid doing lookups when we know the
14378         namespace is non-existant.   Use new Tree.LookupByNamespace which
14379         looks up DeclSpaces based on their namespace, name pair.
14380
14381         * driver.cs: Provide a new `parser verbose' to display the
14382         exception thrown during parsing.  This is turned off by default
14383         now, so the output of a failure from mcs is more graceful.
14384
14385         * namespace.cs: Track all the namespaces defined in a hashtable
14386         for quick lookup.
14387
14388         (IsNamespace): New method
14389
14390 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14391
14392         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14393         we know that we need to concatenate (full typename can never be
14394         null). 
14395
14396         * class.cs: ditto.
14397
14398         * statement.cs: Use a bitfield;  Do not initialize to null things
14399         which are done by the constructor by default.
14400
14401         * cs-parser.jay: bug fix, parameter was 4, not 3.
14402
14403         * expression.cs: Just use the property;
14404
14405         * statement.cs: No need for GetVariableInfo method.
14406
14407 2003-08-08  Martin Baulig  <martin@ximian.com>
14408
14409         * flowanalysis.cs (FlowReturns): This is now nested in the
14410         `FlowBranching' class.
14411         (MyBitVector): Moved this here from statement.cs.
14412         (FlowBranching.SiblingType): New enum type.
14413         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14414
14415 2003-08-07  Martin Baulig  <martin@ximian.com>
14416
14417         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14418         `FlowBranching' class and called `BranchingType'.
14419
14420 2003-08-07  Martin Baulig  <martin@ximian.com>
14421
14422         * flowanalysis.cs: Moved all the control flow analysis code into
14423         its own file.
14424
14425 2003-08-07  Martin Baulig  <martin@ximian.com>
14426
14427         * assign.cs (Assign.DoResolve): `target' must either be an
14428         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14429         #37319.
14430
14431 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14432
14433         * expression.cs (BinaryMethod): This kind of expression is created by the
14434         Binary class if it determines that the operator has to be handled
14435         by a method.
14436
14437         (BinaryDelegate): This kind of expression is created if we are
14438         dealing with a + or - operator on delegates.
14439
14440         (Binary): remove method, argumetns, and DelegateOperator: when
14441         dealing with methods, 
14442
14443         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14444
14445         * statement.cs (Block): use bitfields for the three extra booleans
14446         we had in use.   Remove unused topblock parameter.
14447
14448         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14449
14450         * assign.cs: Drop extra unneeded tests.
14451
14452 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14453
14454         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14455
14456         * statement.cs (Foreach): Use VariableStorage instead of
14457         LocalBuilders.   
14458
14459         * codegen.cs (VariableStorage): New class used by clients that
14460         require a variable stored: locals or fields for variables that
14461         need to live across yield.
14462
14463         Maybe provide a convenience api for EmitThis+EmitLoad?
14464
14465         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14466         these bad boys.
14467
14468 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14469
14470         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14471         RemapParameterLValue): New methods that are used to turn a
14472         precomputed FieldInfo into an expression like this:
14473
14474                 instance.FieldInfo
14475
14476         The idea is to use this instead of making LocalVariableReference
14477         have more than one meaning.
14478
14479         * cs-parser.jay: Add error production to BASE.
14480
14481         * ecore.cs: Deal with TypeManager.GetField returning null, which
14482         is now a valid return value.
14483
14484         (FieldExprNoAddress): New expression for Fields whose address can
14485         not be taken.
14486
14487         * expression.cs (LocalVariableReference): During the resolve
14488         phases, create new expressions if we are in a remapping context.
14489         Remove code that dealt with remapping here.
14490
14491         (ParameterReference): same.
14492
14493         (ProxyInstance): New expression, like the `This' expression, but
14494         it is born fully resolved.  We know what we are doing, so remove
14495         the errors that are targeted to user-provided uses of `this'.
14496
14497         * statement.cs (Foreach): our variable is now stored as an
14498         Expression;  During resolution, follow the protocol, dont just
14499         assume it will return this.
14500
14501 2003-08-06  Martin Baulig  <martin@ximian.com>
14502
14503         * support.cs (SeekableStreamReader.cs): New public class.
14504
14505         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14506         SeekableStreamReader instead of the normal StreamReader.
14507
14508 2003-08-04  Martin Baulig  <martin@ximian.com>
14509
14510         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14511         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14512         deambiguate casts and delegate invocations.
14513         (parenthesized_expression): Use the new tokens to ensure this is
14514         not a cast of method invocation.
14515
14516         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14517         when reading a `)' and Deambiguate_CloseParens () was previously
14518         called.
14519
14520         * expression.cs (ParenthesizedExpression): New class.  This is
14521         just used for the CS0075 test.
14522         (Binary.DoResolve): Check for CS0075.   
14523
14524 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14525
14526         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14527         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14528         reference comparison.
14529
14530         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14531         examine the ReturnType for equality - this is necessary in the
14532         cases of implicit and explicit operators whose signature also
14533         includes the return type.
14534
14535 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * namespace.cs: Cache the result of the namespace computation,
14538         instead of computing it every time.
14539
14540 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * decl.cs: Use a global arraylist that we reuse over invocations
14543         to avoid excesive memory consumption.  Reduces memory usage on an
14544         mcs compile by one meg (45 average).
14545
14546         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14547         private, work around that.
14548
14549 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14550
14551         * literal.cs (IntLiteral): Define Zero and One static literals. 
14552
14553         * cs-parser.jay (integer_literal): use static literals to reduce
14554         memory usage for the most used literals (0, 1 and -1).  211kb
14555         reduced in memory usage.
14556
14557         Replace all calls to `new ArrayList' with `new
14558         ArrayList(4)' which is a good average number for most allocations,
14559         and also requires only 16 bytes of memory for its buffer by
14560         default. 
14561
14562         This reduced MCS memory usage in seven megabytes for the RSS after
14563         bootstrapping.
14564
14565 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14566
14567         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14568         handle params methods the correct way by forming only one
14569         applicable set with params and normal methods in them. Earlier we
14570         were looking at params methods only if we found no normal methods
14571         which was not the correct thing to do.
14572
14573         (Invocation.BetterFunction): Take separate arguments indicating
14574         when candidate and the best method are params methods in their
14575         expanded form.
14576
14577         This fixes bugs #43367 and #46199.
14578
14579         * attribute.cs: Documentation updates.
14580
14581         (CheckAttribute): Rename to CheckAttributeTarget.
14582         (GetValidPlaces): Rename to GetValidTargets.
14583
14584         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14585         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14586
14587         Fixes bug #44468.
14588
14589 2003-07-28  Martin Baulig  <martin@ximian.com>
14590
14591         * class.cs (TypeContainer.DefineMembers): Use the base type's full
14592         name when looking up the base class of a nested class.  Fixes #46977.
14593
14594 2003-07-26  Martin Baulig  <martin@ximian.com>
14595
14596         * expression.cs (Indexers.Indexer): New nested struct; contains
14597         getter, setter and the indexer's type.
14598         (Indexers.Properties): This is now an ArrayList of
14599         Indexers.Indexer's.
14600         (IndexerAccess.DoResolveLValue): Correctly set the type if the
14601         indexer doesn't have any getters.
14602
14603         * assign.cs (Assign.DoResolve): Also do the implicit conversions
14604         for embedded property and indexer assignments.
14605
14606 2003-07-26  Martin Baulig  <martin@ximian.com>
14607
14608         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
14609         preprocessor directive is not the first non-whitespace character
14610         on a line.
14611
14612 2003-07-26  Martin Baulig  <martin@ximian.com>
14613
14614         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
14615         namespace parsing, follow the spec more closely.
14616
14617         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
14618         NamespaceEntry.Lookup().
14619
14620 2003-07-25  Martin Baulig  <martin@ximian.com>
14621
14622         * MethodCore.cs (OverridesSomething): New public field; it's set
14623         from TypeContainer.DefineMembers if this method overrides
14624         something (which doesn't need to be a method).  Fix #39462.
14625
14626 2003-07-25  Ravi Pratap  <ravi@ximian.com>
14627
14628         * typemanager.cs (GetMembers): Ensure that the list of members is
14629         reversed. This keeps things in sync.
14630
14631         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
14632         find an AttributeUsage attribute.
14633
14634         * expression.cs (Invocation.OverloadResolve): Perform the check
14635         which disallows Invoke to be directly called on a Delegate.
14636
14637         (Error_InvokeOnDelegate): Report error cs1533.
14638
14639 2003-07-25  Martin Baulig  <martin@ximian.com>
14640
14641         * expression.cs (Indexers.GetIndexersForType): Only look in the
14642         interface hierarchy if the requested type is already an
14643         interface.  Fixes #46788 while keeping #46502 fixed.
14644
14645 2003-07-25  Martin Baulig  <martin@ximian.com>
14646
14647         * class.cs (TypeContainer.DefineMembers): Check whether all
14648         readonly fields have been assigned and report warning CS0649 if
14649         not.
14650
14651         * statement.cs (LocalInfo.IsFixed): Always return true if this is
14652         a valuetype.
14653
14654 2003-07-24  Ravi Pratap  <ravi@ximian.com>
14655
14656         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
14657         returned from GetMethods to make things consistent with the
14658         assumptions MCS makes about ordering of methods.
14659
14660         This should comprehensively fix bug #45127 and it does :-)
14661
14662         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
14663         ordering is actually reverse.
14664
14665         * Clean up some debug messages I left lying around.
14666
14667         * interface.cs (Populate*): Get rid of code which emits attributes
14668         since the stage in which we emit attributes is the 'Emit' stage,
14669         not the define stage.
14670
14671         (Emit): Move attribute emission for interface members here.
14672
14673 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14674
14675         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14676         closely: we eliminate methods in base types when we have an
14677         applicable method in a top-level type.
14678
14679         Please see section 14.5.5.1 for an exact description of what goes
14680         on. 
14681
14682         This fixes bug #45127 and a host of other related to corlib compilation.
14683
14684         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14685         array is the method corresponding to the top-level type (this is
14686         because of the changes made to icall.c) so we change this
14687         accordingly.
14688
14689         (MethodGroupExpr.Name): This too.
14690
14691         * typemanager.cs (GetElementType): New method which does the right
14692         thing when compiling corlib. 
14693
14694         * everywhere: Make use of the above in the relevant places.
14695
14696 2003-07-22  Martin Baulig  <martin@ximian.com>
14697
14698         * cs-parser.jay (invocation_expression): Moved
14699         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14700         `cast_expression', but create a InvocationOrCast which later
14701         resolves to either an Invocation or a Cast.
14702
14703         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14704         method; call this before EmitStatement() to make sure that this
14705         expression can be used as a statement.
14706
14707         * expression.cs (InvocationOrCast): New class; resolves to either
14708         an Invocation or a Cast.
14709
14710         * statement.cs (StatementExpression): Call ResolveStatement() on
14711         the ExpressionStatement before emitting it.
14712
14713 2003-07-21  Martin Baulig  <martin@ximian.com>
14714
14715         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14716         `ref' and `out' attributes match; fixes #46220.
14717         (MemberAccess.ResolveMemberAccess): You can't reference a type
14718         through an expression; fixes #33180.
14719         (Indexers.GetIndexersForType): Don't return the indexers from
14720         interfaces the class implements; fixes #46502.
14721
14722 2003-07-21  Martin Baulig  <martin@ximian.com>
14723
14724         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14725         CS0661 checks; fixes bug #30442.
14726
14727 2003-07-21  Martin Baulig  <martin@ximian.com>
14728
14729         * decl.cs (AdditionResult): Added `Error'.
14730
14731         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14732
14733         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14734         makes cs0031.cs actually work.
14735
14736 2003-07-20  Martin Baulig  <martin@ximian.com>
14737
14738         * namespace.cs: Fixed that bug which caused a crash when compiling
14739         the debugger's GUI.
14740
14741 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14742
14743         * typemanager.cs (LookupTypeReflection): Never expose types which
14744         are NotPublic, NestedPrivate, NestedAssembly, or
14745         NestedFamANDAssem.  We used to return these, and later do a check
14746         that would report a meaningful error, but the problem is that we
14747         would not get the real match, if there was a name override.
14748
14749 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14750
14751         * namespace.cs (Namespace, Name): Do not compute the namespace
14752         name dynamically, compute it in the constructor.  This reduced
14753         memory usage by 1697 KB.
14754
14755         * driver.cs: Use --pause to pause at the end.
14756
14757 2003-07-17  Peter Williams  <peter@newton.cx>
14758
14759         * Makefile: Change the name of the test target so that it doesn't
14760         conflict with the recursive test target.
14761
14762 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14763
14764         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14765         AddressOf): Do not use EmitThis, that was wrong, use the actual
14766         this pointer.
14767
14768 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14769
14770         * class.cs (MethodData.Define): While checking if a method is an
14771         interface implementation, improve the test: If we are not public
14772         (use new test here: use the computed MethodAttributes directly,
14773         instead of the parsed modifier flags) check if the `implementing'
14774         method comes from an interface or not.
14775
14776         * pending.cs (VerifyPendingMethods): Slightly better error
14777         message.
14778
14779         * makefile: add test target that does the mcs bootstrap.
14780
14781 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14782
14783         * interface.cs (Define): Do nothing here since there are no
14784         members to populate etc. Move the attribute emission out of here
14785         since this was just totally the wrong place to put it. Attribute
14786         application happens during the 'Emit' phase, not in the 'Define'
14787         phase.
14788
14789         (Emit): Add this method and move the attribute emission here
14790
14791         * rootcontext.cs (EmitCode): Call the Emit method on interface
14792         types too.
14793
14794 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14795
14796         * expression.cs (OverloadResolve): Report error only if Location
14797         is not 'Null' which means that there was a probe going on.
14798
14799 2003-07-14  Martin Baulig  <martin@ximian.com>
14800
14801         * expression.cs (ConditionalLogicalOperator): New public class to
14802         implement user defined conditional logical operators.
14803         This is section 14.11.2 in the spec and bug #40505.
14804
14805 2003-07-14  Martin Baulig  <martin@ximian.com>
14806
14807         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14808
14809 2003-07-14  Martin Baulig  <martin@ximian.com>
14810
14811         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14812
14813         * ecore.cs (IVariable.VerifyFixed): New interface method.
14814
14815         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14816         operator, check whether the variable is actually fixed.  Fixes bug
14817         #36055.  Set a variable definitely assigned when taking its
14818         address as required by the spec.
14819
14820         * statement.cs (LocalInfo.IsFixed): New field.
14821         (LocalInfo.MakePinned): Set `IsFixed' to true.
14822
14823 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14824
14825         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14826         for .ctors, ensure that we only ask for members declared in the
14827         attribute type (BindingFlags.DeclaredOnly).
14828
14829         Fixes bug #43632.
14830
14831         * expression.cs (Error_WrongNumArguments): Report error 1501
14832         correctly the way CSC does.
14833
14834 2003-07-13  Martin Baulig  <martin@ximian.com>
14835
14836         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14837         lookup on the fully qualified name, to make things like "X.X" work
14838         where "X.X" is a fully qualified type name, but we also have a
14839         namespace "X" in the using list.  Fixes #41975.
14840
14841 2003-07-13  Martin Baulig  <martin@ximian.com>
14842
14843         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14844         function. If we're a CompoundAssign, we need to create an embedded
14845         CompoundAssign, not an embedded Assign.
14846         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14847         Fixes #45854.
14848
14849 2003-07-13  Martin Baulig  <martin@ximian.com>
14850
14851         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14852         work to fix bug #46088.
14853
14854 2003-07-13  Ravi Pratap <ravi@ximian.com>
14855
14856         * class.cs (Operator.Emit): Do not emit attributes here - it is
14857         taken care of by the Method class that we delegate too. This takes
14858         care of bug #45876.
14859
14860 2003-07-10  Martin Baulig  <martin@ximian.com>
14861
14862         * expression.cs (TypeOfVoid): New class.
14863         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14864
14865 2003-07-10  Martin Baulig  <martin@ximian.com>
14866
14867         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14868         bug #35957.
14869
14870 2003-07-10  Martin Baulig  <martin@ximian.com>
14871
14872         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14873         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14874
14875         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14876
14877         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14878
14879 2003-07-10  Martin Baulig  <martin@ximian.com>
14880
14881         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14882         of decimal.  Fixes #42850.
14883
14884         NOTE: I also fixed the created byte blob, but this doesn't work on
14885         the MS runtime and csc never produces any byte blobs for decimal
14886         arrays.
14887
14888 2003-07-10  Martin Baulig  <martin@ximian.com>
14889
14890         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14891         structs; fixes #32068.
14892         (Block.AddChildVariableNames): Fixed #44302.
14893
14894 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14895
14896         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14897
14898 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14899
14900         * attribute.cs: And this test is onger needed.
14901
14902 2003-07-08  Martin Baulig  <martin@ximian.com>
14903
14904         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14905         inaccessible types.  Fixes #36313.
14906
14907         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14908
14909         * namespace.cs (NamespaceEntry): Create implicit entries for all
14910         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14911         implicit entries for N1.N2 and N1.
14912
14913 2003-07-08  Martin Baulig  <martin@ximian.com>
14914
14915         Rewrote the handling of namespaces to fix a lot of the issues
14916         wrt. `using' aliases etc.
14917
14918         * namespace.cs (Namespace): Splitted this class into a
14919         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14920
14921         * typemanager.cs (TypeManager.IsNamespace): Removed.
14922         (TypeManager.ComputeNamespaces): Only compute namespaces from
14923         loaded assemblies here, not the namespaces from the assembly we're
14924         currently compiling.
14925
14926 2003-07-08  Martin Baulig  <martin@ximian.com>
14927
14928         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14929
14930 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14931
14932         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14933         already fixed it.  
14934
14935         I thought about the memory savings here, but LookupTypeReflection
14936         is used under already very constrained scenarios.  Compiling
14937         corlib or mcs only exposes one hit, so it would not really reduce
14938         any memory consumption.
14939
14940 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14941
14942         * typemanager.cs: fixes bug #45889 by only adding public types from
14943         other assemblies to the list of known types.
14944
14945 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14946
14947         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14948         on the type we resolved.
14949
14950 2003-07-05  Martin Baulig  <martin@ximian.com>
14951
14952         * pending.cs (PendingImplementation.ParentImplements): Don't
14953         create the proxy if the parent is abstract.
14954
14955         * class.cs (TypeContainer.DefineIndexers): Process explicit
14956         interface implementations first.  Fixes #37714.
14957
14958 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14959
14960         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14961         defined recursively;  but since we modify the input parameters
14962         (left is set to `this' temporarily), we reset this value if the
14963         left_is_explicit is false, which gives the original semantics to
14964         the code.  
14965
14966         * literal.cs (NullPointer): new class used to represent a null
14967         literal in a pointer context.
14968
14969         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14970         type is a pointer, use a NullPointer object instead of a
14971         NullLiteral.   Closes 43687
14972
14973         (ExplicitConversion): Convert pointer values using
14974         the conv opcode to the proper type.
14975
14976         * ecore.cs (New): change ValueTypeVariable property into a method,
14977         that returns whether the valuetype is suitable for being used.
14978
14979         * expression.cs (Binary.DoNumericPromotions): Only return if we
14980         the int constant was a valid uint, and we can return both left and
14981         right as uints.  If not, we continue processing, to trigger the
14982         type conversion.  This fixes 39018.
14983
14984         * statement.cs (Block.EmitMeta): During constant resolution, set
14985         the CurrentBlock property on the emitcontext, so that we resolve
14986         constants propertly.
14987
14988 2003-07-02  Martin Baulig  <martin@ximian.com>
14989
14990         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14991         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14992
14993         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14994         than emitting it here.
14995
14996         * statement.cs: Fixed some more flow analysis bugs.
14997
14998 2003-07-02  Martin Baulig  <martin@ximian.com>
14999
15000         * class.cs (MethodData.Define): When implementing interface
15001         methods, set Final unless we're Virtual.
15002
15003         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15004         check work for interface methods.
15005
15006 2003-07-01  Martin Baulig  <martin@ximian.com>
15007
15008         * ecore.cs (EmitContext.This): Replaced this property with a
15009         GetThis() method which takes a Location argument.  This ensures
15010         that we get the correct error location for a CS0188.
15011
15012 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
15013
15014         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15015         ImplicitStandardConversion.
15016
15017         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15018
15019 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
15020
15021         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15022         optimization.
15023
15024 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
15025
15026         * class.cs (Constructor.Define): Turn off initlocals for unsafe
15027         constructors.
15028
15029         (MethodData.Define): Turn off initlocals for unsafe methods.
15030
15031 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
15032
15033         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15034         complete;  Fixes #37521.
15035
15036         * delegate.cs: Use Modifiers.TypeAttr to compute the
15037         TypeAttributes, instead of rolling our own.  This makes the flags
15038         correct for the delegates.
15039
15040 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15041
15042         * class.cs (Constructor.Define): Set the private flag for static
15043         constructors as well.
15044
15045         * cs-parser.jay (statement_expression): Set the return value to
15046         null, to avoid a crash when we catch an error.
15047
15048 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15049
15050         * cs-parser.jay: Applied patch from Jackson that adds support for
15051         extern and unsafe modifiers to destructor declarations.
15052
15053         * expression.cs: Report error 21 if the user is trying to index a
15054         System.Array.
15055
15056         * driver.cs: Add an error message, suggested by the bug report.
15057
15058         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15059         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15060
15061 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15062
15063         * namespace.cs: Add some information to reduce FAQs.
15064
15065 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15066
15067         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15068         underlying enumeration types.  Fixes #43915.
15069
15070         * expression.cs: Treat ushort/short as legal values to be used in
15071         bitwise operations.
15072
15073 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15074
15075         * delegate.cs: transfer custom attributes for paramenters from
15076         the delegate declaration to Invoke and BeginInvoke.
15077
15078 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15079
15080         * attribute.cs: handle custom marshalers and emit marshal info
15081         for fields, too.
15082
15083 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15084
15085         * makefile.gnu: Added anonymous.cs to the compiler sources.
15086
15087 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15088
15089         * iterators.cs: Change the name of the proxy class to include two
15090         underscores.
15091
15092         * cs-parser.jay: Update grammar to include anonymous methods.
15093
15094         * anonymous.cs: new file.
15095
15096 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * class.cs (Field.Define): Add missing test for pointers and
15099         safety. 
15100
15101 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15102
15103         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15104         we use the stobj opcode.
15105
15106         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15107         since it wasn't the correct fix. 
15108
15109         It still is puzzling that we are required to use stobj for IntPtr
15110         which seems to be a ValueType.
15111
15112 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15115         during regular simple name resolution.   Now, the trick is that
15116         instead of returning for processing the simplename, we do a
15117         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15118         contextual lookup type).   If a match is found, return that, if
15119         not, return for further composition.
15120
15121         This fixes long-standing 30485.
15122
15123         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15124         using the address to initialize an object, do an Stobj instead of
15125         using the regular Stelem.
15126
15127         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15128         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15129         Because if we are a BaseIndexerAccess that value will be true.
15130         Fixes 43643.
15131
15132         * statement.cs (GotoCase.Resolve): Return after reporting an
15133         error, do not attempt to continue. 
15134
15135         * expression.cs (PointerArithmetic.Emit): If our operand is a
15136         long, convert our constants to match the operand before
15137         multiplying.  Convert to I type before adding.   Fixes 43670.
15138
15139 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15140
15141         * enum.cs (ImplicitConversionExists) : Rename to
15142         ImplicitEnumConversionExists to remove ambiguity. 
15143
15144         * ecore.cs (NullCast): New type of cast expression class which
15145         basically is very similar to EmptyCast with the difference being
15146         it still is a constant since it is used only to cast a null to
15147         something else
15148         (eg. (string) null)
15149
15150         * convert.cs (ImplicitReferenceConversion): When casting a null
15151         literal, we return a NullCast.
15152
15153         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15154         should be around anymore.
15155
15156         The renaming (reported was slightly wrong). Corrections:
15157
15158         ConvertImplicitStandard -> ImplicitConversionStandard
15159         ConvertExplicitStandard -> ExplicitConversionStandard
15160
15161         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15162         before passing them in !
15163
15164         * convert.cs (ImplicitConversionStandard): When comparing for
15165         equal expr and target types, ensure that expr is not a
15166         NullLiteral.
15167
15168         In general, we must not be checking (expr_type ==
15169         target_type) in the top level conversion methods
15170         (ImplicitConversion, ExplicitConversion etc). This checking is
15171         done in the methods that they delegate to.
15172
15173 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * convert.cs: Move Error_CannotConvertType,
15176         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15177         ImplicitNumericConversion, ImplicitConversionExists,
15178         ImplicitUserConversionExists, StandardConversionExists,
15179         FindMostEncompassedType, FindMostSpecificSource,
15180         FindMostSpecificTarget, ImplicitUserConversion,
15181         ExplicitUserConversion, GetConversionOperators,
15182         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15183         TryImplicitIntConversion, Error_CannotConvertImplicit,
15184         ConvertImplicitRequired, ConvertNumericExplicit,
15185         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15186         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15187         its own file.
15188
15189         Perform the following renames:
15190
15191         StandardConversionExists -> ImplicitStandardConversionExists
15192         ConvertImplicit -> ImplicitConversion
15193         ConvertImplicitStandard -> ImplicitStandardConversion
15194         TryImplicitIntConversion -> ImplicitIntConversion
15195         ConvertImplicitRequired -> ImplicitConversionRequired
15196         ConvertNumericExplicit -> ExplicitNumericConversion
15197         ConvertReferenceExplicit -> ExplicitReferenceConversion
15198         ConvertExplicit -> ExplicitConversion
15199         ConvertExplicitStandard -> ExplicitStandardConversion
15200
15201 2003-05-19  Martin Baulig  <martin@ximian.com>
15202
15203         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15204         (TypeInfo): Added support for structs having structs as fields.
15205
15206         * ecore.cs (FieldExpr): Implement IVariable.
15207         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15208         VariableInfo for the field.
15209
15210 2003-05-18  Martin Baulig  <martin@ximian.com>
15211
15212         * expression.cs (This.DoResolve): Report a CS0027 if we're
15213         emitting a field initializer.
15214
15215 2003-05-18  Martin Baulig  <martin@ximian.com>
15216
15217         * expression.cs (This.ResolveBase): New public function.
15218         (This.DoResolve): Check for CS0188.
15219
15220         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15221         This.Resolve().
15222
15223         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15224         `instance_expression' to null if we don't have any non-static
15225         methods.
15226
15227 2003-05-18  Martin Baulig  <martin@ximian.com>
15228
15229         Reworked the way how local variables and parameters are handled by
15230         the flow analysis code.
15231
15232         * statement.cs (TypeInfo, VariableMap): New public classes.
15233         (VariableInfo): New public class.  This is now responsible for
15234         checking whether a variable has been assigned.  It is used for
15235         parameters and local variables.
15236         (Block.EmitMeta): Take the InternalParameters as argument; compute
15237         the layout of the flow vectors here.
15238         (Block.LocalMap, Block.ParameterMap): New public properties.
15239         (FlowBranching): The .ctor doesn't get the InternalParameters
15240         anymore since Block.EmitMeta() now computes the layout of the flow
15241         vector.
15242         (MyStructInfo): This class is now known as `StructInfo' and nested
15243         in `TypeInfo'; we don't access this directly anymore.
15244
15245         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15246         property and removed IsAssigned(), IsFieldAssigned(),
15247         SetAssigned() and SetFieldAssigned(); we now call them on the
15248         VariableInfo so we don't need to duplicate this code everywhere.
15249
15250         * expression.cs (ParameterReference): Added `Block block' argument
15251         to the .ctor.
15252         (LocalVariableReference, ParameterReference, This): The new
15253         VariableInfo class is now responsible for all the definite
15254         assignment stuff.
15255
15256         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15257         IsParameterAssigned, SetParameterAssigned): Removed.
15258
15259 2003-05-18  Martin Baulig  <martin@ximian.com>
15260
15261         * typemanager.cs (InitCoreTypes): Try calling
15262         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15263         the 3-args-version.  Corlib now also needs our `void_type'.
15264         (GetMethod): Added overloaded version which takes an optional
15265         `bool report_errors' to allow lookups of optional methods.
15266
15267 2003-05-12  Martin Baulig  <martin@ximian.com>
15268
15269         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15270         only used for locals and not for parameters.
15271
15272 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15273
15274         * support.cs (InternalParameters.ParameterType): Return the
15275         ExternalType of the parameter.
15276
15277         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15278         they were unused.
15279
15280 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15281
15282         * class.cs (MethodData.Define): Do not set the `newslot' on
15283         interface members, if they are also flagged as "override".
15284
15285         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15286         better code for ++i and i++.  This only works for static fields
15287         and local variables.
15288
15289         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15290         want to pull the DeclSpace out of the builder_to_declspace instead
15291         of the TypeBuilder (like in TypeContainer.FindMembers).
15292
15293         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15294         instead of LookupTypeContainer.  Fixes the crash on .NET for
15295         looking up interface members.
15296
15297         * const.cs: Create our own emit context during the Definition
15298         stage, so that constants are evaluated in the proper context, when
15299         a recursive definition happens.
15300
15301 2003-05-11  Martin Baulig  <martin@ximian.com>
15302
15303         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15304         new block for a switch section.
15305         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15306         the adding/lookup in the switch block.  Fixes #39828.
15307
15308 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15309
15310         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15311         functionality: I needed to convert the data after I had performed
15312         the add/sub operation into the operands type size.
15313
15314         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15315         pass the type for the box operation, otherwise the resulting
15316         object would have been of type object.
15317
15318         (BoxedCast): Add constructor to specify the type to box as.
15319
15320 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15321
15322         * iterators.cs: I was reusing the `count' variable inadvertently,
15323         take steps to not allow this to happen.
15324
15325 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15326
15327         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15328         by creating an array at the point where the params starts and
15329         putting all those arguments there, then adjusting the size of the
15330         array.
15331
15332 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15333
15334         * expression.cs (New.AddressOf): Implement interface
15335         IMemoryLocation.  This is used when the `new' operator is used in
15336         the context of an invocation to a method on a value type.
15337
15338         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15339         example. 
15340
15341         * namespace.cs: Also check the using aliases here.
15342
15343         * driver.cs: Move the test for using validity after the types have
15344         been entered, so we do a single pass that also includes the using
15345         aliases. 
15346
15347         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15348         in the regular case.   CreateSiblingForFinally is doing extra
15349         error checking.
15350
15351         * attribute.cs (GetAttributeArgumentExpression): Store the result
15352         on an out value, and use the return value to indicate failure
15353         instead of using null (which is a valid return for Constant.GetValue).
15354
15355         * statement.cs: Perform the analysis flow for the increment
15356         portion after the statement, because this will be the real flow of
15357         execution.  Fixes #42385
15358
15359         * codegen.cs (EmitContext.EmitArgument,
15360         EmitContext.EmitStoreArgument): New helper functions when the
15361         RemapToProxy flag is set.
15362
15363         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15364         function.
15365
15366         Add support for remapping parameters. 
15367
15368         * iterators.cs: Propagate parameter values;  Store parameter
15369         values in the proxy classes.
15370
15371 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15372
15373         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15374         need a proxy reference;  I do not know what I was thinking
15375
15376         * cs-parser.jay (constructor_initializer): catch another error,
15377         and display nice message.
15378
15379         (field_declaration): catch void field declaration
15380         to flag a better error. 
15381
15382         * class.cs (MemberBase.CheckBase): Report an error instead of a
15383         warning if a new protected member is declared in a struct. 
15384         (Field.Define): catch the error of readonly/volatile.
15385
15386         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15387
15388         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15389         volatile variable is taken
15390
15391 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15392
15393         * statement.cs (Fixed.Resolve): Report an error if we are not in
15394         an unsafe context.
15395
15396 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * typemanager.cs: reuse the code that handles type clashes for
15399         delegates and enumerations.
15400
15401         * class.cs (Report28): Always report.
15402
15403         * expression.cs (EncodeAsAttribute): Allow nulls here.
15404
15405 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15406
15407         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15408         the functionality for testing whether an expression is valid for
15409         an attribute here.  Also handle the case of arrays of elements
15410         being stored. 
15411
15412         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15413         encoding a linear array into an array of objects that are suitable
15414         to be passed to an CustomAttributeBuilder.
15415
15416         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15417
15418         * ecore.cs: (FieldExpr): Handle field remapping here.
15419
15420         * iteratators.cs: Pass the instance variable (if the method is an
15421         instance method) to the constructors, so we can access the field
15422         variables on the class.
15423
15424         TODO: Test this with structs.  I think the THIS variable on
15425         structs might have to be a pointer, and not a refenrece
15426
15427 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15428
15429         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15430         local variables to fields in a proxy class.
15431
15432         * iterators.cs (PopulateProxy): Rename our internal fields to
15433         <XXX>.  
15434         Create a <THIS> field if we are an instance method, so we can
15435         reference our parent container variables.
15436         (MapVariable): Called back from the EmitContext code to enter a
15437         new variable to field mapping into the proxy class (we just create
15438         a FieldBuilder).
15439
15440         * expression.cs
15441         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15442         for using the remapped locals to fields.
15443
15444         I placed the code here, because that gives the same semantics to
15445         local variables, and only changes the Emit code.
15446
15447         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15448         statements inside iterators.
15449         (VariableInfo): Add a FieldBuilder for the cases when we are
15450         remapping local variables to fields in a proxy class
15451
15452         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15453         current_block != null.
15454
15455         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15456         not cope with strings, as it has been moved to the
15457         TableSwitchEmit.  Fixed bug in switch generation.
15458
15459         * expression.cs (New.DoResolve): Provide more context for the user
15460         when reporting an error.
15461
15462         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15463         pointers. 
15464
15465         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15466         check the permissions for it.  Note than in a type-resolution
15467         context the check was already present in DeclSpace.ResolveType,
15468         but was missing from the MemberAccess.
15469
15470         (ArrayCreation.CheckIndices): warn if the user has
15471         more nested levels of expressions, but there are no more
15472         dimensions specified.  Avoids crash on bug 41906.
15473
15474 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15475
15476         * statement.cs (Block): replace Implicit bool, for a generic
15477         flags.   
15478         New flag: `Unchecked'.  This is used during the EmitMeta phase
15479         (which is out-of-line with the regular Resolve/Emit process for a
15480         statement, as this is done ahead of time, but still gets a chance
15481         to call constant resolve).
15482
15483         (Block.Flags): new enum for adding a new flag.
15484
15485         (Block.EmitMeta): track the state of unchecked.
15486
15487         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15488         to enable constant resolution to work there as well.
15489
15490 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15491
15492         * typemanager.cs (ienumerable_type): Also look up
15493         System.Collections.IEnumerable. 
15494
15495 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15496
15497         TODO: Test more than one conditional per method.
15498
15499         * class.cs (Indexer.Define): Report the location where the user is
15500         referencing the unsupported feature.
15501
15502         (MethodData): Overload the use of `conditionals' to
15503         minimize the creation of needless ArrayLists.   This saves roughly
15504         212kb on my machine.
15505
15506         (Method): Implement the new IIteratorContainer interface.
15507         (Method.SetYields): Implement the method by setting the ModFlags
15508         to contain METHOD_YIELDS.
15509
15510         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15511         which just got set to null.
15512
15513         * iterators.cs: New file.
15514
15515         (Yield, YieldBreak): New statements.
15516
15517         * statement.cs (Return.Resolve): Flag an error if we are used in
15518         an iterator method.
15519
15520         * codegen.cs (InIterator): New flag set if the code is being
15521         compiled in an iterator method.
15522
15523         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15524         internal modifier, and we just use it to avoid adding extra
15525         fields, as this is seldom used.  
15526
15527         * cs-parser.jay: Add yield_statement (yield and yield break).
15528
15529         * driver.cs: New flag -v2 to turn on version 2 features. 
15530
15531         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15532         hashtable when v2 is enabled.
15533
15534 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15535
15536         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15537         there is already a namespace defined with this name.
15538
15539         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15540         people upgraded their corlibs.
15541
15542         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15543         always use fully qualified types, no need to use the compiler
15544         front end.
15545
15546         (TypeManager.IsNamespace): Use binarysearch.
15547
15548         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15549         AddDelegate): I did not quite use the new IsValid API properly: I
15550         have to pass the short-name and the fullname.  I was passing only
15551         the basename instead of the fullname sometimes. 
15552
15553         (TypeContainer.DefineType): call NamespaceClash.
15554
15555         * interface.cs (Interface.DefineType): use NamespaceClash before
15556         defining the type.
15557
15558         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15559         defining the type.
15560
15561         * enum.cs: (Enum.DefineType): use NamespaceClash before
15562         defining the type.
15563
15564         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15565         speed increase.  First, use the negative_hits cache when we get a
15566         negative.  Second, add the type with its full original name
15567         instead of the new . and + encoded name (reflection uses + to
15568         separate type from a nested type).  Use LookupTypeReflection
15569         directly which bypasses the type->name hashtable (that we already
15570         know does not contain the type.
15571
15572         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15573         location/container type. 
15574
15575         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15576
15577 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15578
15579         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15580
15581         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15582         method is being referenced in the method group from a static
15583         context, and report error 120 if so.
15584
15585         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15586         Error118. 
15587
15588         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15589         is created, we create the A namespace).
15590
15591         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15592         Fixes #41591
15593
15594 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15595
15596         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15597         invocation to ModuleBuilder.GetType with the same values will
15598         return a new type instance, so we need to cache its return
15599         values. 
15600
15601         * expression.cs (Binary.ResolveOperator): Only allow the compare
15602         operators on enums if they are of the same type.
15603
15604         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15605         types of ValueType on their own case.  Before we were giving them
15606         the same treatment as objects.
15607
15608         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15609         fullname.  Short name is used to compare against container name.
15610         Fullname is used to check against defined namespace names.
15611
15612         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15613         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15614
15615         (Method.CheckBase): Call parent.
15616         (MemberBase.CheckBase): Check for protected members on sealed
15617         classes.
15618         (PropertyBase.CheckBase): Call parent.
15619         (Field.Define): Call parent.
15620
15621         * report.cs: Negative error codes are now mapped to 8000 - code,
15622         so that the display is render more nicely.
15623
15624         * typemanager.cs: Do not use try/catch, instead report a regular
15625         error. 
15626
15627         (GetPointerType, GetReferenceType): These methods provide
15628         mechanisms to obtain the T* and T& from a T.  We had the code
15629         previously scattered around the code base, and it also used
15630         TypeManager.LookupType that would go through plenty of caches.
15631         This one goes directly to the type source.
15632
15633         In some places we did the Type.GetType followed by
15634         ModuleBuilder.GetType, but not in others, so this unifies the
15635         processing as well.
15636
15637         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15638         statements now that we have namespace information.
15639
15640         * typemanager.cs (IsNamespace): New method, returns whether the
15641         string presented is a namespace or not.
15642
15643         (ComputeNamespaces): New public entry point, computes the list of
15644         available namespaces, using the GetNamespaces API call in Mono, or
15645         the slower version in MS.NET.   
15646
15647         Now before we start the semantic analysis phase, we have a
15648         complete list of namespaces including everything that the user has
15649         provided.
15650
15651         Deleted old code to cache namespaces in .nsc files.
15652
15653 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15654
15655         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15656         class/struct location definition Location for the implicit
15657         constructor location.
15658
15659         (Operator.Define): Use the location of the operator for the
15660         implicit Method definition.
15661
15662         (Constructor.Emit): use the constructor location for the implicit
15663         base initializer constructor.
15664
15665         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15666         and the Expression class now contains two new methods:
15667
15668         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15669         isolate type lookup from the rest of the resolution process.
15670
15671         Since we use Expressions to hold type definitions due to the way
15672         we parse the input we have historically overloaded Resolve to
15673         perform the Type lookups if a special flag is passed.  Now this is
15674         eliminated and two methods take their place. 
15675
15676         The differences in the two methods between xStep and xTerminal is
15677         that xStep is involved in our current lookup system that uses
15678         SimpleNames to compose a name, while xTerminal is used just to
15679         catch the case where the simplename lookup failed.
15680
15681 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15682
15683         * expression.cs (ResolveMemberAccess): Remove redundant code.
15684         TypeExpr expressions are always born fully resolved.
15685
15686         * interface.cs (PopulateMethod): Do not lookup the types twice.
15687         We were doing it once during SemanticAnalysis and once during
15688         PopulateMethod.
15689
15690         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15691         in local variable type definitions, were being returned as a
15692         SimpleName (we decomposed everything into a string), that is
15693         because primary_expression was being used instead of a type in the
15694         grammar (reduce/reduce conflicts).
15695
15696         The part that was wrong is that we converted the expression into a
15697         string (an oversimplification in one hand, compounded with primary
15698         expressions doing string concatenation).
15699
15700         So things like:
15701
15702         A.B.C [] x;
15703
15704         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15705         using clauses from working on this particular context.  And a type
15706         was being matched directly against "A.B.C[]".
15707
15708         We now use the correct approach, and allow for ComposedCast to be
15709         part of the unary expression.  So the "A.B.C []" become a composed
15710         cast of "A.B.C" (as a nested group of MemberAccess with a
15711         SimpleName at the end) plus the rank composition "[]". 
15712
15713         Also fixes 35567
15714
15715 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15716
15717         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15718         for the access level checking.
15719
15720         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15721         `TypeContainer container', because I kept getting confused when I
15722         was debugging this code.
15723
15724         * expression.cs (Indexers): Instead of tracking getters/setters,
15725         we now track them in parallel.  We create one arraylist less, but
15726         most importantly it is possible now for the LValue code to find a
15727         matching get for a set.
15728
15729         (IndexerAccess.DoResolveLValue): Update the code.
15730         GetIndexersForType has been modified already to extract all the
15731         indexers from a type.  The code assumed it did not.
15732
15733         Also make the code set the correct return type for the indexer.
15734         This was fixed a long time ago for properties, but was missing for
15735         indexers.  It used to be void_type.
15736
15737         (Binary.Emit): Test first for doubles instead of
15738         floats, as they are more common.
15739
15740         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15741         when dealing with floats and the <=, >= operators.  This fixes bug
15742         #39314 
15743
15744         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15745         to load the array value by emitting a load on the foreach variable
15746         type.  This was incorrect.  
15747
15748         We now emit the code to load an element using the the array
15749         variable type, and then we emit the conversion operator.
15750
15751         Fixed #40176
15752
15753 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15754
15755         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15756
15757 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15758
15759         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15760         test for protection before we test for signatures. 
15761
15762         (MethodSignature.ToString): implement.
15763
15764         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15765         to the case where we reduced into a LongConstant.
15766
15767         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15768         depend on whether the information is acurrate, because the
15769         Microsoft runtime will always claim that the array type is public,
15770         regardless of the real state.
15771
15772         If the type is a pointer, another problem happens: the type is
15773         reported as non-public in Microsoft.  
15774
15775         In both cases we have to call CheckAccessLevel recursively with
15776         the underlying type as the argument to be tested.
15777
15778 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15779
15780         * assign.cs (Assign.Emit): If we are dealing with a compound
15781         assignment expression, we should use the code path that stores the
15782         intermediate result in a temporary value.  This fixes #40903.
15783
15784         *expression.cs (Indirection.ToString): Provide ToString method for
15785         debugging. 
15786
15787 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15788
15789         * class.cs: Null out fields holding references to Block objects so
15790         they can be garbage collected.
15791
15792         * expression.cs (OverloadResolve): Remove unused local.
15793
15794 2003-04-07  Martin Baulig  <martin@ximian.com>
15795
15796         * codegen.cs (EmitContext.CurrentFile): New public field.
15797         (EmitContext.Mark): Use the CurrentFile to check whether the
15798         location is in the correct file.
15799         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15800
15801 2003-04-07  Martin Baulig  <martin@ximian.com>
15802
15803         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15804
15805         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15806         location.  [FIXME: The location argument which gets passed to this
15807         method is sometimes wrong!]
15808
15809 2003-04-07  Nick Drochak <ndrochak@gol.com>
15810
15811         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15812
15813 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15814
15815         * expression.cs (Indirection.EmitAssign): We were using the
15816         temporary, but returning immediately instead of continuing the
15817         EmitAssing flow.
15818
15819 2003-04-06  Martin Baulig  <martin@ximian.com>
15820
15821         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15822         if it's a nested child, but also deriving from the outer class.
15823         See test 190.cs.
15824
15825         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15826         nested child, but also deriving from the outer class.  See
15827         test-190.cs.
15828         (FilterWithClosure): We may access private members of the outer
15829         class if we're a nested child and deriving from the outer class.
15830         (RealMemberLookup): Only set `closure_private_ok' if the
15831         `original_bf' contained BindingFlags.NonPublic.
15832
15833 2003-04-05  Martin Baulig  <martin@ximian.com>
15834
15835         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15836
15837 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15838
15839         * class.cs (Event.Define): Do not allow abstract events to have
15840         initializers. 
15841
15842 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15843
15844         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15845         block in event declarations.
15846
15847         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15848         value type, get its address.
15849
15850         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15851         leaving a class on the stack instead of a boolean value (int
15852         0/1).  Change the code so we compare against null, and then the
15853         result against zero.
15854
15855         * class.cs (TypeContainer.GetClassBases): We were checking for the
15856         parent class being sealed too late.
15857
15858         * expression.cs (Binary.Emit): For <= and >= when dealing with
15859         floating point values, use cgt.un and clt.un instead of cgt and
15860         clt alone.
15861
15862 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15863
15864         * statement.cs: Apply the same optimization as MS: skip the 
15865         GetEnumerator returning an IEnumerator, and use the one returning a 
15866         CharEnumerator instead. This allows us to avoid the try-finally block 
15867         and the boxing.
15868
15869 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15870
15871         * cs-parser.jay: Attributes cannot be applied to
15872                          namespaces. Fixes #40473
15873
15874 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15875
15876         * class.cs:
15877         (Add*): check if the name is valid using the full name for constants,
15878         fields, properties and events.
15879
15880 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15883         char constants to be part of the enumeration.
15884
15885         * expression.cs (Conditional.DoResolve): Add support for operator
15886         true. Implements the missing functionality from 14.12
15887
15888         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15889         operator true/false as required by the spec.
15890
15891         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15892         implicit conversion to boolean.
15893
15894         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15895         also one where the type implements `operator true'. 
15896
15897         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15898         get an expression that will invoke operator true based on an
15899         expression.  
15900
15901         (GetConversionOperators): Removed the hack that called op_True
15902         here.  
15903
15904         (Expression.ResolveBoolean): Move this from Statement.
15905
15906 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15907
15908         * ecore.cs (FieldExpr): do not allow initialization of initonly
15909         fields on derived classes
15910
15911 2003-03-13  Martin Baulig  <martin@ximian.com>
15912
15913         * statement.cs (Block.Emit): Call ig.BeginScope() and
15914         ig.EndScope() when compiling with debugging info; call
15915         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15916
15917 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15918
15919         * expression.cs (Indexers): Do not construct immediately, allow
15920         for new members to be appended as we go.  Fixes 38143
15921
15922 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15923
15924         * expression.cs: save/restore context when resolving an unchecked
15925         expression.
15926
15927 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15928
15929         * cfold.cs: Catch division by zero in modulus operator during
15930         constant folding.
15931
15932 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * interface.cs (Interface.DefineMembers): Avoid defining members
15935         twice. 
15936
15937 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15938
15939         * driver.cs: handle the +/- options for -noconfig
15940
15941         * statement.cs (Unckeched.Resolve): Also track the state of
15942         unchecked in the Resolve phase.
15943
15944 2003-02-27  Martin Baulig  <martin@ximian.com>
15945
15946         * ecore.cs (Expression.MemberLookup): Don't create a
15947         MethodGroupExpr for something which is not a method.  Fixes #38291.
15948
15949 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15950
15951         * class.cs (MemberBase.CheckParameters): Also check that the type
15952         is unmanaged if it is a pointer.
15953
15954         * expression.cs (SizeOf.Resolve): Add location information.
15955
15956         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15957         a managed type is declared.
15958
15959         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15960         parameter modifiers as well.  Fixes bug 38606
15961
15962         * class.cs: Very sad.  Am backing out the speed up changes
15963         introduced by the ArrayList -> Array in the TypeContainer, as they
15964         were not actually that much faster, and introduced a bug (no error
15965         reports on duplicated methods).
15966
15967         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15968         source first, this will guarantee that we have a valid expression
15969         before calling in lower levels functions that will require a
15970         resolved object.  Then use this original_source in the
15971         target.ResolveLValue instead of the original source that was
15972         passed to us.
15973
15974         Another change.  Use target.Resolve instead of LValueResolve.
15975         Although we are resolving for LValues, we will let the Assign code
15976         take care of that (it will be called again from Resolve).  This
15977         basically allows code like this:
15978
15979         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15980         class Y { void A (X x) { x [0] += o; }
15981
15982         The problem was that the indexer was trying to resolve for
15983         set_Item (idx, object o) and never finding one.  The real set_Item
15984         was set_Item (idx, X).  By delaying the process we get the right
15985         semantics. 
15986
15987         Fixes bug 36505
15988
15989 2003-02-23  Martin Baulig  <martin@ximian.com>
15990
15991         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15992         while calling DoEmit ().
15993
15994         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15995         source files; if you use the #line directive inside a method, the
15996         compiler stops emitting line numbers for the debugger until it
15997         reaches the end of the method or another #line directive which
15998         restores the original file.
15999
16000 2003-02-23  Martin Baulig  <martin@ximian.com>
16001
16002         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16003
16004 2003-02-23  Martin Baulig  <martin@ximian.com>
16005
16006         * statement.cs (Block.AddChildVariableNames): We need to call this
16007         recursively, not just for our immediate children.
16008
16009 2003-02-23  Martin Baulig  <martin@ximian.com>
16010
16011         * class.cs (Event.Define): Always make the field private, like csc does.
16012
16013         * typemanager.cs (TypeManager.RealMemberLookup): Make events
16014         actually work, fixes bug #37521.
16015
16016 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
16017
16018         * delegate.cs: When creating the various temporary "Parameters"
16019         classes, make sure that we call the ComputeAndDefineParameterTypes
16020         on those new parameters (just like we do with the formal ones), to
16021         allow them to be resolved in the context of the DeclSpace.
16022
16023         This fixes the bug that Dick observed in Bugzilla #38530.
16024
16025 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
16026
16027         * expression.cs (ResolveMemberAccess): When resolving a constant,
16028         do not attempt to pull a constant if the value was not able to
16029         generate a valid constant.
16030
16031         * const.cs (LookupConstantValue): Do not report more errors than required.
16032
16033 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16034
16035         * expression.cs: fixes bug #38328.
16036
16037 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16038
16039         * class.cs: Changed all the various members that can be part of a
16040         class from being an ArrayList to be an Array of the right type.
16041         During the DefineType type_list, interface_list, delegate_list and
16042         enum_list are turned into types, interfaces, delegates and enums
16043         arrays.  
16044
16045         And during the member population, indexer_list, event_list,
16046         constant_list, field_list, instance_constructor_list, method_list,
16047         operator_list and property_list are turned into their real arrays.
16048
16049         Although we could probably perform this operation earlier, for
16050         good error reporting we need to keep the lists and remove the
16051         lists for longer than required.
16052
16053         This optimization was triggered by Paolo profiling the compiler
16054         speed on the output of `gen-sample-program.pl' perl script. 
16055
16056         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16057         not crash in methods like MemberLookupFailed that use this field.  
16058
16059         This problem arises when the compiler fails to resolve a type
16060         during interface type definition for example.
16061
16062 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16063
16064         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16065         inherit from System.Object, so we have to stop at null, not only
16066         when reaching System.Object.
16067
16068 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16071         DeclaredOnly because the parent indexer might have had a different
16072         name, but did not loop until the top of the hierarchy was reached.
16073
16074         The problem this one fixes is 35492: when a class implemented an
16075         indexer from an interface, we were getting the interface method
16076         (which was abstract) and we were flagging an error (can not invoke
16077         abstract method).
16078
16079         This also keeps bug 33089 functioning, and test-148 functioning.
16080
16081         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16082         out if a method is special is to see if it is declared in a
16083         property or event, or whether it is one of the predefined operator
16084         names.   This should fix correctly #36804.
16085
16086 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16087
16088         The goal here is to remove the dependency on EmptyCast.Peel ().
16089         Killing it completely.
16090
16091         The problem is that currently in a number of places where
16092         constants are expected, we have to "probe" for an EmptyCast, and
16093         Peel, which is not the correct thing to do, as this will be
16094         repetitive and will likely lead to errors. 
16095
16096         The idea is to remove any EmptyCasts that are used in casts that
16097         can be reduced to constants, so we only have to cope with
16098         constants. 
16099
16100         This bug hunt was triggered by Bug 37363 and the desire to remove
16101         the duplicate pattern where we were "peeling" emptycasts to check
16102         whether they were constants.  Now constants will always be
16103         constants.
16104
16105         * ecore.cs: Use an enumconstant here instead of wrapping with
16106         EmptyCast.  
16107
16108         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16109         throwing me off.  By handling this we can get rid of a few hacks.
16110
16111         * statement.cs (Switch): Removed Peel() code.
16112
16113 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16114
16115         * class.cs: Location information for error 508
16116
16117         * expression.cs (New.DoResolve): Add a guard against double
16118         resolution of an expression.  
16119
16120         The New DoResolve might be called twice when initializing field
16121         expressions (see EmitFieldInitializers, the call to
16122         GetInitializerExpression will perform a resolve on the expression,
16123         and later the assign will trigger another resolution
16124
16125         This leads to bugs (#37014)
16126
16127         * delegate.cs: The signature for EndInvoke should contain any ref
16128         or out parameters as well.  We were not doing this in the past. 
16129
16130         * class.cs (Field.Define): Do not overwrite the type definition
16131         inside the `volatile' group.  Turns out that volatile enumerations
16132         were changing the type here to perform a validity test, which
16133         broke conversions. 
16134
16135 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16136
16137         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16138         and structs, we do not want to load the instance variable
16139
16140         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16141         enum_type has to be handled like an object reference (implicit
16142         conversions exists from this to object), but the regular IsClass
16143         and IsValueType tests will never return true for this one.
16144
16145         Also we use TypeManager.IsValueType instead of type.IsValueType,
16146         just for consistency with the rest of the code (this is only
16147         needed if we ever use the construct exposed by test-180.cs inside
16148         corlib, which we dont today).
16149
16150 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16151
16152         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16153         just InternalCall.
16154
16155 2003-02-09  Martin Baulig  <martin@ximian.com>
16156
16157         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16158         (Namespace.DefineNamespaces): New static public method; this is
16159         called when we're compiling with debugging to add all namespaces
16160         to the symbol file.
16161
16162         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16163         pass it to the Namespace's .ctor.
16164
16165         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16166         and MethodBase arguments; pass the namespace ID to the symwriter;
16167         pass the MethodBase instead of the token to the symwriter.
16168         (SymbolWriter.DefineNamespace): New method to add a namespace to
16169         the symbol file.
16170
16171 2003-02-09  Martin Baulig  <martin@ximian.com>
16172
16173         * symbolwriter.cs: New file.  This is a wrapper around
16174         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16175         methods here in near future.
16176
16177 2003-02-09  Martin Baulig  <martin@ximian.com>
16178
16179         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16180         ILGenerator.MarkSequencePoint() which are actually used by the
16181         symbol writer.
16182
16183 2003-02-09  Martin Baulig  <martin@ximian.com>
16184
16185         * location.cs (SourceFile): New public sealed class.  This
16186         contains the name and an index which is used in the location's token.
16187         (Location): Reserve an appropriate number of bits in the token for
16188         the source file instead of walking over that list, this gives us a
16189         really huge performance improvement when compiling with debugging.
16190
16191         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16192         `SourceFile' argument instead of a string.
16193         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16194         but don't parse/tokenize here, we need to generate the list of all
16195         source files before we do that.
16196         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16197         the files.
16198
16199         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16200         instead of a string.
16201
16202         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16203         of a string.
16204
16205 2003-02-09  Martin Baulig  <martin@ximian.com>
16206
16207         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16208         filename on `#line default'.
16209
16210 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16211
16212         * statement.cs: don't clear the pinned var when the fixed statement
16213         returns from the method (fixes bug#37752).
16214
16215 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16216
16217         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16218         to IsValueType.
16219
16220 2003-02-07  Martin Baulig  <martin@ximian.com>
16221
16222         * driver.cs: Removed the `--debug-args' command line argument.
16223
16224         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16225         automatically by the AsssemblyBuilder.
16226         (CodeGen.InitializeSymbolWriter): We don't need to call any
16227         initialization function on the symbol writer anymore.  This method
16228         doesn't take any arguments.
16229
16230 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16231
16232         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16233         from referenced assemblies as well.
16234
16235 2003-02-02  Martin Baulig  <martin@ximian.com>
16236
16237         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16238
16239 2003-02-02  Martin Baulig  <martin@ximian.com>
16240
16241         * class.cs (Constructor.Emit): Open the symbol writer before
16242         emitting the constructor initializer.
16243         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16244         single-stepping through constructor initializers.
16245
16246 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16247
16248         * class.cs: Handle error 549: do not allow virtual methods in
16249         sealed classes. 
16250
16251 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16252
16253         * decl.cs: Check access levels when resolving types
16254
16255 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16256
16257         * statement.cs: Add parameters and locals set in catch blocks that might 
16258         return to set vector
16259
16260 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16261
16262         * class.cs (Operator): Set the SpecialName flags for operators.
16263
16264         * expression.cs (Invocation.DoResolve): Only block calls to
16265         accessors and operators on SpecialName methods.
16266
16267         (Cast.TryReduce): Handle conversions from char constants.
16268
16269
16270 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16271
16272         * statement.cs: small memory and time optimization in FlowBranching.
16273
16274 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16275
16276         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16277         problem that the last fix but in the other sid (Set).
16278
16279         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16280         access when there is no indexer in the hierarchy.
16281
16282 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16283
16284         * class.cs: Combine some if statements.
16285
16286 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16287
16288         * driver.cs: fixed bug #37187.
16289
16290 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16291
16292         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16293         any indexer, it's needed to build a list with all the indexers in the
16294         hierarchy (AllGetters), else we have problems. Fixes #35653.
16295
16296 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16297
16298         * class.cs (MethodData.Define): It is wrong for an interface
16299         implementation to be static in both cases: explicit and implicit.
16300         We were only handling this in one case.
16301
16302         Improve the if situation there to not have negations.
16303
16304         * class.cs (Field.Define): Turns out that we do not need to check
16305         the unsafe bit on field definition, only on usage.  Remove the test.
16306
16307 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16308
16309         * driver.cs: use assembly.Location instead of Codebase (the latest
16310         patch made mcs fail when using MS assemblies).
16311
16312 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16313
16314         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16315         get the path to *corlib.dll.
16316
16317 2003-01-21  Nick Drochak <ndrochak@gol.com>
16318
16319         * cs-tokenizer.cs:
16320         * pending.cs:
16321         * typemanager.cs: Remove compiler warnings
16322
16323 2003-01-20  Duncan Mak  <duncan@ximian.com>
16324
16325         * AssemblyInfo.cs: Bump the version number to 0.19.
16326
16327 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16328
16329         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16330
16331 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16332
16333         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16334
16335 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16336
16337         * cs-parser.jay: Small fix: we were not comparing the constructor
16338         name correctly.   Thanks to Zoltan for the initial pointer.
16339
16340 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16341
16342         * cs-tokenizer.cs: Set file name when specified with #line
16343
16344 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16345
16346         * cs-parser.jay: Only perform the constructor checks here if we
16347         are named like the class;  This will help provider a better
16348         error.  The constructor path is taken when a type definition is
16349         not found, but most likely the user forgot to add the type, so
16350         report that rather than the constructor error.
16351
16352 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16353
16354         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16355         allocations.
16356
16357 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16358
16359         * cs-parser.jay: Add cleanup call.
16360
16361 2003-01-13  Duncan Mak  <duncan@ximian.com>
16362
16363         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16364         consistent with other methods.
16365
16366 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16367
16368         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16369
16370 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16371
16372         * attribute.cs: only set GuidAttr to true when we have a
16373         GuidAttribute.
16374
16375 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16376
16377         * ecore.cs:
16378         * expression.cs:
16379         * typemanager.cs: fixes to allow mcs compile corlib with the new
16380         Type.IsSubclassOf fix.
16381
16382 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16383
16384         * expression.cs (LocalVariableReference.DoResolve): Classify a
16385         constant as a value, not as a variable.   Also, set the type for
16386         the variable.
16387
16388         * cs-parser.jay (fixed_statement): take a type instead of a
16389         pointer_type, so we can produce a better error message later.
16390
16391         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16392         as an error.  
16393
16394         (For.DoEmit): Make inifinite loops have a
16395         non-conditional branch back.
16396
16397         (Fixed.DoEmit): First populate the pinned variables, then emit the
16398         statement, then clear the variables.  Before I was emitting the
16399         code once for each fixed piece.
16400
16401
16402 2003-01-08  Martin Baulig  <martin@ximian.com>
16403
16404         * statement.cs (FlowBranching.MergeChild): A break in a
16405         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16406
16407 2003-01-08  Martin Baulig  <martin@ximian.com>
16408
16409         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16410         lives in the same number space than `param_map'.  Fixes #36154.
16411
16412 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16413
16414         * cs-parser.jay (constructor_declaration): Set the
16415         Constructor.ModFlags before probing for it.  This makes the
16416         compiler report 514, 515 and 132 (the code was there, but got
16417         broken). 
16418
16419         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16420         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16421         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16422
16423 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16424
16425         * enum.cs: create the enum static fields using the enum type.
16426
16427 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16428
16429         * class.cs: don't try to create the ParamBuilder for the return
16430         type if it's not needed (and handle it breaking for the ms runtime
16431         anyway).
16432
16433 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16434
16435         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16436
16437 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16438
16439         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16440         the command.   This showed up while compiling the JANET source
16441         code, which used \r as its only newline separator.
16442
16443 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16444
16445         * class.cs (Method.Define): If we are an operator (because it
16446         reuses our code), then set the SpecialName and HideBySig.  #36128
16447
16448 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16449
16450         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16451         exception, report error 120 `object reference required'.
16452
16453         * driver.cs: Add --pause option, used during to measure the size
16454         of the process as it goes with --timestamp.
16455
16456         * expression.cs (Invocation.DoResolve): Do not allow methods with
16457         SpecialName to be invoked.
16458
16459 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16460
16461         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16462         number before adding it.
16463
16464 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16465
16466         * ecore.cs (StandardImplicitConversion): When in an unsafe
16467         context, we allow conversion between void * to any other pointer
16468         type. This fixes bug #35973.
16469
16470 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16471
16472         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16473         is not thrown when extensionless outputs are used 
16474
16475 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16476
16477         * rootcontext.cs: fixed compilation of corlib.
16478
16479 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16480
16481         * attribute.cs (Attributes.Contains): Add new method.
16482
16483         * class.cs (MethodCore.LabelParameters): if the parameter is an
16484         `out' parameter, check that no attribute `[In]' has been passed.
16485
16486         * enum.cs: Handle the `value__' name in an enumeration.
16487
16488 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16489
16490         * decl.cs: Added special case to allow overrides on "protected
16491         internal" methods
16492
16493 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16494
16495         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16496         since it makes much more sense.
16497
16498         (Attributes.ctor): Don't require a Location parameter.
16499
16500         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16501
16502         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16503         since we already have that information per attribute.
16504
16505         * everywhere : make appropriate changes.
16506
16507         * class.cs (LabelParameters): Write the code which actually
16508         applies attributes to the return type. We can't do this on the MS
16509         .NET runtime so we flag a warning in the case an exception is
16510         thrown.
16511
16512 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16513
16514         * const.cs: Handle implicit null conversions here too.
16515
16516 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16517
16518         * class.cs (MethodCore.LabelParameters): Remove the extra
16519         Type [] parameter since it is completely unnecessary. Instead
16520         pass in the method's attributes so that we can extract
16521         the "return" attribute.
16522
16523 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16524
16525         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16526         of ignoring it and letting the compile continue.
16527
16528         * typemanager.cs (ChangeType): use an extra argument to return an
16529         error condition instead of throwing an exception.
16530
16531 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16532
16533         * expression.cs (Unary.TryReduce): mimic the code for the regular
16534         code path.  Perform an implicit cast in the cases where we can
16535         implicitly convert to one of the integral types, and then reduce
16536         based on that constant.   This fixes bug #35483.
16537
16538 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16539
16540         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16541
16542 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16543
16544         * namespace.cs: fixed bug #35489.
16545
16546 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16547
16548         * class.cs: Remove some dead code.
16549
16550         * cs-parser.jay: Estimate the number of methods needed
16551         (RootContext.MethodCount);
16552
16553         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16554         numbers instead of StringBuilders.
16555
16556         * support.cs (PtrHashtable): Add constructor with initial size;
16557         We can now reduce reallocations of the method table.
16558
16559 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16560
16561         * attribute.cs (ApplyAttributes): Keep track of the emitted
16562         attributes on a per-target basis. This fixes bug #35413.
16563
16564 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16565
16566         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16567         default to the Windows 1252 encoding.
16568
16569         (UnixParseOption): Support version, thanks to Alp for the missing
16570         pointer. 
16571
16572         * AssemblyInfo.cs: Add nice assembly information.
16573
16574         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16575         (bug 35169).
16576
16577         * cs-parser.jay: Allow a trailing comma before the close bracked
16578         in the attribute_section production.
16579
16580         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16581         address of the instance was being taken, I will take this out,
16582         because we take the address of the object immediately here.
16583
16584 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16585
16586         * typemanager.cs (AreMultipleAllowed): Take care of the most
16587         obvious case where attribute type is not in the current assembly -
16588         stupid me ;-)
16589
16590 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16591
16592         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16593         definitions, instead of doing that afterwards.  
16594
16595         Also we use a nice little hack, depending on the constructor, we
16596         know if we are a "composed" name or a simple name.  Hence, we
16597         avoid the IndexOf test, and we avoid 
16598
16599         * codegen.cs: Add code to assist in a bug reporter to track down
16600         the source of a compiler crash. 
16601
16602 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16603
16604         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16605         types have been emitted for a given element and flag an error
16606         if something which does not have AllowMultiple set is used more
16607         than once.
16608
16609         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16610         attribute types and their corresponding AllowMultiple properties
16611
16612         (AreMultipleAllowed): Check the property for a given type.
16613
16614         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16615         property in the case we have a TypeContainer.
16616
16617         (Attributes.AddAttribute): Detect duplicates and just skip on
16618         adding them. This trivial fix catches a pretty gross error in our
16619         attribute emission - global attributes were being emitted twice!
16620
16621         Bugzilla bug #33187 is now fixed.
16622
16623 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16624
16625         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16626         instead of pp_and).
16627
16628         * expression.cs (Binary.ResolveOperator): I can only use the
16629         Concat (string, string, string) and Concat (string, string,
16630         string, string) if the child is actually a concatenation of
16631         strings. 
16632
16633 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16634
16635         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16636         context where we need a 2-character lookahead.
16637
16638         * pending.cs (PendingImplementation): Rework so we can keep track
16639         of interface types all the time, and flag those which were
16640         implemented by parents as optional.
16641
16642 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16643
16644         * expression.cs (Binary.ResolveOperator): Use
16645         String.Concat(string,string,string) or
16646         String.Concat(string,string,string,string) when possible. 
16647
16648         * typemanager: More helper methods.
16649
16650
16651 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16652
16653         * pending.cs: remove the bogus return from GetMissingInterfaces()
16654         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16655
16656 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16657
16658         * namespace.cs: avoid duplicated 'using xxx' being added to
16659         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16660         when we get more than one 'using' statement for the same namespace.
16661         Report a CS0105 warning for it.
16662
16663 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16664
16665         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16666         of calling getChar/putback, uses internal knowledge of it.    
16667
16668         (xtoken): Reorder tokenizer so most common patterns are checked
16669         first.  This reduces the compilation time in another 5% (from 8.11s
16670         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16671
16672         The parsing time is 22% of the compilation in mcs, and from that
16673         64% is spent on the tokenization process.  
16674
16675         I tried using a binary search for keywords, but this is slower
16676         than the hashtable.  Another option would be to do a couple of
16677         things:
16678
16679                 * Not use a StringBuilder, instead use an array of chars,
16680                   with a set value.  Notice that this way we could catch
16681                   the 645 error without having to do it *afterwards*.
16682
16683                 * We could write a hand-parser to avoid the hashtable
16684                   compares altogether.
16685
16686         The identifier consumption process takes 37% of the tokenization
16687         time.  Another 15% is spent on is_number.  56% of the time spent
16688         on is_number is spent on Int64.Parse:
16689
16690                 * We could probably choose based on the string length to
16691                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16692                   computations. 
16693
16694         Another 3% is spend on wrapping `xtoken' in the `token' function.
16695
16696         Handle 0xa0 as whitespace (#34752)
16697
16698 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * typemanager.cs (IsCLRType): New routine to tell whether a type
16701         is one of the builtin types.  
16702
16703         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16704         typecode in more places instead of doing pointer comparissions.
16705         We could leverage some knowledge about the way the typecodes are
16706         laid out.
16707
16708         New code to cache namespaces in assemblies, it is currently not
16709         invoked, to be used soon.
16710
16711         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16712
16713         * expression.cs (Binary.ResolveOperator): specially handle
16714         strings, and do not perform user-defined operator overloading for
16715         built-in types.
16716
16717 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16718
16719         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16720         internalcall as it is a pretty simple operation;  Avoid whenever
16721         possible to call Char.IsLetter.
16722
16723         (consume_identifier): Cut by half the number of
16724         hashtable calls by merging the is_keyword and GetKeyword behavior.
16725
16726         Do not short-circuit, because if we do, we
16727         report errors (ie, #if false && true would produce an invalid
16728         directive error);
16729
16730
16731 2002-11-24  Martin Baulig  <martin@ximian.com>
16732
16733         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16734         check constant ranges and report a CS0221.  Fixes #33186.
16735
16736 2002-11-24  Martin Baulig  <martin@ximian.com>
16737
16738         * cs-parser.jay: Make this work for uninitialized variable
16739         declarations in the `for' initializer.  Fixes #32416.
16740
16741 2002-11-24  Martin Baulig  <martin@ximian.com>
16742
16743         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16744         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16745
16746 2002-11-24  Martin Baulig  <martin@ximian.com>
16747
16748         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16749         argument; if true, we also check for user-defined conversions.
16750         This is only needed if both arguments are of a user-defined type.
16751         Fixes #30443, added test-175.cs.
16752         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16753
16754         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16755
16756 2002-11-24  Martin Baulig  <martin@ximian.com>
16757
16758         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16759         function to get the store opcode.
16760         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16761         only emit the Ldelema if the store opcode is Stobj.  You must run
16762         both test-34 and test-167 to test this.  Fixes #34529.
16763
16764 2002-11-23  Martin Baulig  <martin@ximian.com>
16765
16766         * ecore.cs (Expression.MemberLookup): Added additional
16767         `qualifier_type' argument which is used when we're being called
16768         from MemberAccess.DoResolve() and null if we're called from a
16769         SimpleName lookup.
16770         (Expression.MemberLookupFailed): New method to report errors; this
16771         does the CS1540 check and reports the correct error message.
16772
16773         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16774         argument for the CS1540 check and redone the way how we're dealing
16775         with private members.  See the comment in the source code for details.
16776         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16777         `closure_start_type' to `closure_qualifier_type' and check whether
16778         it's not null.  It was not this filter being broken, it was just
16779         being called with the wrong arguments.
16780
16781         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16782         and pass it the correct `qualifier_type'; this also does the error
16783         handling for us.
16784
16785 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16786
16787         * expression.cs (Invocation.EmitParams): If the we are dealing
16788         with a non-built-in value type, load its address as well.
16789
16790         (ArrayCreation): Use a a pretty constant instead
16791         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16792         static initializers.  
16793
16794         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16795         because they are not really value types, just glorified integers. 
16796
16797         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16798
16799         * ecore.cs: Remove redundant code for enumerations, make them use
16800         the same code path as everything else, fixes the casting issue
16801         with enumerations in Windows.Forms.
16802
16803         * attribute.cs: Do only cast to string if it is a string, the
16804         validation happens later.
16805
16806         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16807         people upgrade their corlibs.
16808
16809         * ecore.cs: Oops, enumerations were not following the entire code path
16810
16811 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16812
16813         * typemanager.cs (FilterWithClosure): Commented out the test for
16814         1540 in typemanager.cs, as it has problems when accessing
16815         protected methods from a parent class (see test-174.cs). 
16816
16817         * attribute.cs (Attribute.ValidateGuid): new method.
16818         (Attribute.Resolve): Use above.
16819
16820 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16821
16822         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16823
16824         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16825         handling for enumerations, as we only needed the TypeContainer
16826         functionality to begin with (this is required for the fix below to
16827         work for enums that reference constants in a container class for
16828         example). 
16829
16830         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16831
16832         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16833         a valid TypeBuilder to perform lookups on.o
16834
16835         * class.cs (InheritableMemberSignatureCompare): Use true in the
16836         call to GetGetMethod and GetSetMethod, because we are comparing
16837         the signature, and we need to get the methods *even* if they are
16838         private. 
16839
16840         (PropertyBase.CheckBase): ditto.
16841
16842         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16843         GotoCase.Resolve): Use Peel on EmpytCasts.
16844
16845         * ecore.cs (EmptyCast): drop child, add Peel method.
16846
16847 2002-11-17  Martin Baulig  <martin@ximian.com>
16848
16849         * ecore.cs (EmptyCast.Child): New public property.
16850
16851         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16852         label resolved to an EmptyCast.  Fixes #34162.
16853         (GotoCase.Resolve): Likewise.
16854         (Block.EmitMeta): Likewise.
16855
16856 2002-11-17  Martin Baulig  <martin@ximian.com>
16857
16858         * expression.cs (Invocation.BetterConversion): Prefer int over
16859         uint; short over ushort; long over ulong for integer literals.
16860         Use ImplicitConversionExists instead of StandardConversionExists
16861         since we also need to check for user-defined implicit conversions.
16862         Fixes #34165.  Added test-173.cs.
16863
16864 2002-11-16  Martin Baulig  <martin@ximian.com>
16865
16866         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16867         with the `true' and `false' literals.  Fixes #33151.
16868
16869 2002-11-16  Martin Baulig  <martin@ximian.com>
16870
16871         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16872         October 22nd; don't do the cs1540 check for static members.
16873
16874         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16875         now using our own filter here and doing the cs1540 check again.
16876
16877 2002-11-16  Martin Baulig  <martin@ximian.com>
16878
16879         * support.cs (InternalParameters): Don't crash if we don't have
16880         any fixed parameters.  Fixes #33532.
16881
16882 2002-11-16  Martin Baulig  <martin@ximian.com>
16883
16884         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16885         when looking up static methods to make this work on Windows.
16886         Fixes #33773.
16887
16888 2002-11-16  Martin Baulig  <martin@ximian.com>
16889
16890         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16891         a setter rather than using PropertyInfo.CanWrite.
16892
16893 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16894
16895         * class.cs: Allow acces to block member by subclasses. Fixes build
16896         breaker.
16897
16898 2002-11-14  Martin Baulig  <martin@ximian.com>
16899
16900         * class.cs (Constructor.Emit): Added the extern/block check.
16901         Fixes bug #33678.
16902
16903 2002-11-14  Martin Baulig  <martin@ximian.com>
16904
16905         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16906         iteration while looking for indexers, this is needed because the
16907         indexer may have a different name in our base classes.  Fixed the
16908         error reporting (no indexers at all, not get accessor, no
16909         overloaded match).  Fixes bug #33089.
16910         (IndexerAccess.DoResolveLValue): Likewise.
16911
16912 2002-11-14  Martin Baulig  <martin@ximian.com>
16913
16914         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16915         indexers.  Fixes the first part of bug #33089.
16916         (MethodSignature.InheritableMemberSignatureCompare): Added support
16917         for properties.
16918
16919 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16920
16921         * attribute.cs (Attribute.Resolve): Catch the
16922         NullReferenceException and report it since it isn't supposed to
16923         happen. 
16924
16925 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16926
16927         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16928         LogicalOr and LogicalAnd that can benefit from recursively
16929         handling EmitBranchable.  The code now should be nice for Paolo.
16930
16931 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16932
16933         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16934         the Type lookups, as we perform quite a number of lookups on
16935         non-Types.  This can be removed once we can deterministically tell
16936         whether we have a type or a namespace in advance.
16937
16938         But this might require special hacks from our corlib.
16939
16940         * TODO: updated.
16941
16942         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16943         and double which avoids a conversion from an integer to a double.
16944
16945         * expression.cs: tiny optimization, avoid calling IsConstant,
16946         because it effectively performs the lookup twice.
16947
16948 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16949
16950         But a bogus return here to keep the semantics of the old code
16951         until the Mono runtime is fixed.
16952
16953         * pending.cs (GetMissingInterfaces): New method used to remove all
16954         the interfaces that are already implemented by our parent
16955         classes from the list of pending methods. 
16956
16957         * interface.cs: Add checks for calls after ResolveTypeExpr.
16958
16959 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16960
16961         * class.cs (Class.Emit): Report warning 67: event not used if the
16962         warning level is beyond 3.
16963
16964         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16965         being a NullLiteral.
16966
16967         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16968         specifiers. 
16969
16970         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16971         path that might fail if a type can not be resolved.
16972
16973         * expression.cs (Binary.Emit): Emit unsigned versions of the
16974         operators. 
16975
16976         * driver.cs: use error 5.
16977
16978 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16979
16980         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16981
16982 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16983
16984         * cs-parser.jay (switch_section): A beautiful patch from Martin
16985         Baulig that fixed 33094.
16986
16987 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16988
16989         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16990         Check whether the base is abstract and report an error if so.
16991
16992         * expression.cs (IndexerAccess.DoResolveLValue,
16993         IndexerAccess.DoResolve): ditto. 
16994
16995         (Invocation.DoResolve): ditto.
16996
16997         (Invocation.FullMethodDesc): Improve the report string.
16998
16999         * statement.cs (Block): Eliminate IsVariableDefined as it is
17000         basically just a wrapper for GetVariableInfo.
17001
17002         * ecore.cs (SimpleName): Use new 
17003
17004         * support.cs (ReflectionParamter.ParameterType): We unwrap the
17005         type, as we return the actual parameter ref/unref state on a
17006         different call.
17007
17008 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * support.cs: Return proper flags REF/OUT fixing the previous
17011         commit.  
17012
17013         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
17014         not used to mean `ref' but `ref or out' in ParameterReference
17015
17016         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17017         full type signature instead of calling TypeManger.CSharpName
17018         ourselves. 
17019
17020         * support.cs (InternalParameters.ParameterDesc): Do not compare
17021         directly to the modflags, because REF/OUT will actually be bitsets
17022         if set. 
17023
17024         * delegate.cs (VerifyMethod): Check also the modifiers.
17025
17026         * cs-tokenizer.cs: Fix bug where floating point values with an
17027         exponent where a sign was missing was ignored.
17028
17029         * driver.cs: Allow multiple assemblies to be specified in a single
17030         /r: argument
17031
17032 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17033
17034         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17035         because identifiers after a parenthesis would end up in this kind
17036         of production, and we needed to desamiguate it for having casts
17037         like:
17038
17039                 (UserDefinedType *) xxx
17040
17041 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17042
17043         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17044         we should set on the Bindingflags.NonPublic, but not turn on
17045         private_ok.  private_ok controls whether a Private member is
17046         returned (this is chekced on the filter routine), while the
17047         BindingFlags.NonPublic just controls whether private/protected
17048         will be allowed.   This fixes the problem part of the problem of
17049         private properties being allowed to be used in derived classes.
17050
17051         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17052         so we can call the children DoResolveLValue method (this will
17053         properly signal errors on lvalue assignments to base properties)
17054
17055         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17056         getter are null, and we have a property info, we know that this
17057         happened because the lookup failed, so we report an error 122 for
17058         protection level violation.
17059
17060         We also silently return if setter and getter are null in the
17061         resolve functions, this condition only happens if we have flagged
17062         the error before.  This is the other half of the problem. 
17063
17064         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17065         not have accessibility information, that is why we were returning
17066         true in the filter function in typemanager.cs.
17067
17068         To properly report 122 (property is inaccessible because of its
17069         protection level) correctly, we report this error in ResolveAccess
17070         by failing if both the setter and the getter are lacking (ie, the
17071         lookup failed). 
17072
17073         DoResolve and DoLResolve have been modified to check for both
17074         setter/getter being null and returning silently, the reason being
17075         that I did not want to put the knowledge about this error in upper
17076         layers, like:
17077
17078         int old = Report.Errors;
17079         x = new PropertyExpr (...);
17080         if (old != Report.Errors)
17081                 return null;
17082         else
17083                 return x;
17084
17085         So the property expr is returned, but it is invalid, so the error
17086         will be flagged during the resolve process. 
17087
17088         * class.cs: Remove InheritablePropertySignatureCompare from the
17089         class, as we no longer depend on the property signature to compute
17090         whether it is possible to implement a method or not.
17091
17092         The reason is that calling PropertyInfo.GetGetMethod will return
17093         null (in .NET, in Mono it works, and we should change this), in
17094         cases where the Get Method does not exist in that particular
17095         class.
17096
17097         So this code:
17098
17099         class X { public virtual int A { get { return 1; } } }
17100         class Y : X { }
17101         class Z : Y { public override int A { get { return 2; } } }
17102
17103         Would fail in Z because the parent (Y) would not have the property
17104         defined.  So we avoid this completely now (because the alternative
17105         fix was ugly and slow), and we now depend exclusively on the
17106         method names.
17107
17108         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17109         reference method, instead of using the property.
17110
17111         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17112         routines are gone now.
17113
17114         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17115         names, they were incorrectly named.
17116
17117         * cs-tokenizer.cs: Return are more gentle token on failure. 
17118
17119         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17120         had an out-of-sync index variable, which caused it to remove from
17121         the list of pending methods the wrong method sometimes.
17122
17123 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17124
17125         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17126         CanWrite, because those refer to this particular instance of the
17127         property, and do not take into account the fact that we can
17128         override single members of a property.
17129
17130         Constructor requires an EmitContext.  The resolution process does
17131         not happen here, but we need to compute the accessors before,
17132         because the resolution does not always happen for properties.
17133
17134         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17135         subclass, before we did not update this flag, but we did update
17136         bindingflags. 
17137
17138         (GetAccessors): Drop this routine, as it did not work in the
17139         presence of partially overwritten set/get methods. 
17140
17141         Notice that this broke the cs1540 detection, but that will require
17142         more thinking. 
17143
17144 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17145
17146         * class.cs:
17147         * codegen.cs:
17148         * driver.cs: issue a warning instead of an error if we don't support
17149         debugging for the platform. Also ignore a couple of errors that may
17150         arise when trying to write the symbols. Undo my previous patch.
17151
17152 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17153
17154         * driver.cs: ignore /debug switch except for Unix platforms.
17155
17156 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17157
17158         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17159
17160 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17161
17162         * driver.cs: Do not make mcs-debug conditional, so we do not break
17163         builds that use it.
17164
17165         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17166         review this patch.  But basically after all the children variables
17167         have been merged, the value of "Breaks" was not being set to
17168         new_breaks for Switch blocks.  I think that it should be set after
17169         it has executed.  Currently I set this to the value of new_breaks,
17170         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17171         conservative, but I do not understand this code very well.
17172
17173         I did not break anything in the build, so that is good ;-)
17174
17175         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17176
17177 2002-10-20  Mark Crichton  <crichton@gimp.org>
17178
17179         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17180
17181 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17182
17183         * cfold.cs: Fixed compile blocker.
17184
17185 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17186
17187         * driver.cs: I was chekcing the key, not the file.
17188
17189 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17190
17191         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17192         message that we were generating - we just need to silently return
17193         a null.
17194
17195 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17196
17197         * class.cs (Event.Define): Change my previous commit, as this
17198         breaks the debugger.  This is a temporary hack, as it seems like
17199         the compiler is generating events incorrectly to begin with.
17200
17201         * expression.cs (Binary.ResolveOperator): Added support for 
17202         "U operator - (E x, E y)"
17203
17204         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17205         y)".
17206
17207         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17208         init-only variables, but this path did not take into account that
17209         there might be also instance readonly variables.  Correct this
17210         problem. 
17211
17212         This fixes bug 32253
17213
17214         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17215         delegates as well.
17216
17217         * driver.cs: Change the extension for modules to `netmodule'
17218
17219         * cs-parser.jay: Improved slightly the location tracking for
17220         the debugger symbols.
17221
17222         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17223         modifiers that were specified instead of the hardcoded value
17224         (FamAndAssem).  This was basically ignoring the static modifier,
17225         and others.  Fixes 32429.
17226
17227         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17228         fixed a bug in the process (32476)
17229
17230         * expression.cs (ArrayAccess.EmitAssign): Patch from
17231         hwang_rob@yahoo.ca that fixes bug 31834.3
17232
17233 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17234
17235         * driver.cs: Make the module extension .netmodule.
17236
17237 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17238
17239         * driver.cs: Report an error if the resource file is not found
17240         instead of crashing.
17241
17242         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17243         false, like Emit does.
17244
17245 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17246
17247         * typemanager.cs: Remove unused private member.  Also reported mcs
17248         bug to report this as a warning like csc.
17249
17250 2002-10-15  Martin Baulig  <martin@gnome.org>
17251
17252         * statement.cs (Statement.Emit): Made this a virtual method; emits
17253         the line number info and calls DoEmit().
17254         (Statement.DoEmit): New protected abstract method, formerly knows
17255         as Statement.Emit().
17256
17257         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17258
17259 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17260
17261         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17262         have fixed a remaining problem: not every AddXXXX was adding a
17263         fully qualified name.  
17264
17265         Now everyone registers a fully qualified name in the DeclSpace as
17266         being defined instead of the partial name.  
17267
17268         Downsides: we are slower than we need to be due to the excess
17269         copies and the names being registered this way.  
17270
17271         The reason for this is that we currently depend (on the corlib
17272         bootstrap for instance) that types are fully qualified, because
17273         we dump all the types in the namespace, and we should really have
17274         types inserted into the proper namespace, so we can only store the
17275         basenames in the defined_names array.
17276
17277 2002-10-10  Martin Baulig  <martin@gnome.org>
17278
17279         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17280         from bug #31834, see the bug report for a testcase which is
17281         miscompiled.
17282
17283 2002-10-10  Martin Baulig  <martin@gnome.org>
17284
17285         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17286         flow analysis code for this.
17287
17288         * statement.cs (Do, While, For): Tell the flow analysis code about
17289         infinite loops.
17290         (FlowBranching.UsageVector): Added support for infinite loops.
17291         (Block.Resolve): Moved the dead code elimination here and use flow
17292         analysis to do it.
17293
17294 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17295
17296         * class.cs (Field.Define): Catch cycles on struct type
17297         definitions. 
17298
17299         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17300         fields if the fields are static.  We only need to check instance
17301         fields. 
17302
17303         * expression.cs (As.DoResolve): Test for reference type.
17304
17305         * statement.cs (Using.ResolveExpression): Use
17306         ConvertImplicitRequired, not ConvertImplicit which reports an
17307         error on failture
17308         (Using.ResolveLocalVariableDecls): ditto.
17309
17310         * expression.cs (Binary.ResolveOperator): Report errors in a few
17311         places where we had to.
17312
17313         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17314
17315 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17316
17317         * expression.cs: Use StoreFromPtr instead of extracting the type
17318         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17319
17320         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17321         an enumeration value to a System.Enum, but System.Enum is not a
17322         value type, but an class type, so we need to box.
17323
17324         (Expression.ConvertExplicit): One codepath could return
17325         errors but not flag them.  Fix this.  Fixes #31853
17326
17327         * parameter.cs (Resolve): Do not allow void as a parameter type.
17328
17329 2002-10-06  Martin Baulig  <martin@gnome.org>
17330
17331         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17332         if it's a class type and not a struct.  Fixes #31815.
17333
17334 2002-10-06  Martin Baulig  <martin@gnome.org>
17335
17336         * statement.cs: Reworked the flow analysis code a bit to make it
17337         usable for dead code elimination.
17338
17339 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17340
17341         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17342
17343 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17344
17345         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17346         to fix the test 165, will investigate deeper.
17347
17348 2002-10-04  Martin Baulig  <martin@gnome.org>
17349
17350         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17351         finally blocks actually work.
17352         (Try.Resolve): We don't need to create a sibling for `finally' if
17353         there is no finally block.
17354
17355 2002-10-04  Martin Baulig  <martin@gnome.org>
17356
17357         * class.cs (Constructor.Define): The default accessibility for a
17358         non-default constructor is private, not public.
17359
17360 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17361
17362         * class.cs (Constructor): Make AllowedModifiers public, add
17363         EXTERN.
17364
17365         * cs-parser.jay: Perform the modifiers test here, as the
17366         constructor for the Constructor class usually receives a zero
17367         because of the way we create it (first we create, later we
17368         customize, and we were never checking the modifiers).
17369
17370         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17371         is a version of LookupTypeReflection that includes the type-name
17372         cache.  This can be used as a fast path for functions that know
17373         the fully qualified name and are only calling into *.GetType() to
17374         obtain a composed type.
17375
17376         This is also used by TypeManager.LookupType during its type
17377         composition.
17378
17379         (LookupType): We now also track the real type name, as sometimes
17380         we can get a quey for the real type name from things like
17381         ComposedCast.  This fixes bug 31422.
17382
17383         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17384         complete type fullname, it does not have to go through the type
17385         resolution system to obtain the composed version of the type (for
17386         obtaining arrays or pointers).
17387
17388         (Conditional.Emit): Use the EmitBoolExpression to
17389         generate nicer code, as requested by Paolo.
17390
17391         (ArrayCreation.CheckIndices): Use the patch from
17392         hwang_rob@yahoo.ca to validate the array initializers. 
17393
17394 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17395
17396         * class.cs (ConstructorInitializer.Emit): simplify code by using
17397         Invocation.EmitCall, and at the same time, fix the bugs in calling
17398         parent constructors that took variable arguments. 
17399
17400         * ecore.cs (Expression.ConvertNumericExplicit,
17401         Expression.ImplicitNumericConversion): Remove the code that
17402         manually wrapped decimal (InternalTypeConstructor call is now gone
17403         as well).
17404
17405         * expression.cs (Cast.TryReduce): Also handle decimal types when
17406         trying to perform a constant fold on the type.
17407
17408         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17409
17410         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17411         that only turned off an error report, and did nothing else. 
17412
17413 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17414
17415         * driver.cs: Handle and ignore /fullpaths
17416
17417 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17418
17419         * expression.cs (Binary.ResolveOperator): Catch the case where
17420         DoNumericPromotions returns true, 
17421
17422         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17423
17424 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17425
17426         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17427         report error 70.
17428
17429 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17430
17431         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17432         conversion exists, but it is also required that the conversion be
17433         performed.  This manifested in "(Type64Enum) 2".  
17434
17435         * class.cs (TypeManager.AddMethod): The fix is not to change
17436         AddEnum, because that one was using a fully qualified name (every
17437         DeclSpace derivative does), but to change the AddMethod routine
17438         that was using an un-namespaced name.  This now correctly reports
17439         the duplicated name.
17440
17441         Revert patch until I can properly fix it.  The issue
17442         is that we have a shared Type space across all namespaces
17443         currently, which is wrong.
17444
17445         Options include making the Namespace a DeclSpace, and merge
17446         current_namespace/current_container in the parser.
17447
17448 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17449
17450         * cs-parser.jay: Improve error reporting when we get a different
17451         kind of expression in local_variable_type and
17452         local_variable_pointer_type. 
17453
17454         Propagate this to avoid missleading errors being reported.
17455
17456         * ecore.cs (ImplicitReferenceConversion): treat
17457         TypeManager.value_type as a target just like object_type.   As
17458         code like this:
17459
17460         ValueType v = 1;
17461
17462         Is valid, and needs to result in the int 1 being boxed before it
17463         is assigned to the value type v.
17464
17465         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17466         to validate the enumeration name.
17467
17468         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17469         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17470         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17471
17472         * ecore.cs (TryImplicitIntConversion): When doing an
17473         implicit-enumeration-conversion, check if the type is 64-bits and
17474         perform a conversion before passing to EnumConstant.
17475
17476 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17477
17478         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17479         report ambiguous type references.  Unlike the MS version, we
17480         report what the ambiguity is.   Innovation at work ;-)
17481
17482         (DeclSpace.FindType): Require a location argument to
17483         display when we display an ambiguous error.
17484
17485         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17486
17487         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17488
17489         * expression.cs (EmitDynamicInitializers): Apply patch from
17490         hwang_rob@yahoo.ca that fixes the order in which we emit our
17491         initializers. 
17492
17493 2002-09-21  Martin Baulig  <martin@gnome.org>
17494
17495         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17496         delegate takes no arguments.
17497
17498 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17499
17500         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17501         from integers.
17502
17503         * expression.cs: Extract the underlying type.
17504
17505         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17506
17507         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17508
17509 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17510
17511         * class.cs (TypeContainer.DefineType): We can not use the nice
17512         PackingSize with the size set to 1 DefineType method, because it
17513         will not allow us to define the interfaces that the struct
17514         implements.
17515
17516         This completes the fixing of bug 27287
17517
17518         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17519         means also structs.  This fixes part of the problem. 
17520         (Expresion.ImplicitReferenceConversionExists): ditto.
17521
17522         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17523         error if there were no errors reported during the type lookup
17524         process, to avoid duplicates or redundant errors.  Without this
17525         you would get an ambiguous errors plus a type not found.  We have
17526         beaten the user enough with the first error.  
17527
17528         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17529         reference. 
17530
17531         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17532         during the resolution process, stop the lookup, this avoids
17533         repeated error reports (same error twice).
17534
17535         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17536
17537         * typemanager.cs (LookupType): Redo the type lookup code to match
17538         the needs of System.Reflection.  
17539
17540         The issue is that System.Reflection requires references to nested
17541         types to begin with a "+" sign instead of a dot.  So toplevel
17542         types look like: "NameSpace.TopLevelClass", and nested ones look
17543         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17544         levels. 
17545
17546 2002-09-19  Martin Baulig  <martin@gnome.org>
17547
17548         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17549         says that a method always returns or always throws an exception,
17550         don't report the CS0161.
17551
17552         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17553         set `Returns = new_returns'.
17554
17555 2002-09-19  Martin Baulig  <martin@gnome.org>
17556
17557         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17558         to an enum constant, check for a CS0176.
17559
17560 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17563         for operators that must be in pairs and report errors.
17564
17565         * ecore.cs (SimpleName.DoResolveType): During the initial type
17566         resolution process, when we define types recursively, we must
17567         check first for types in our current scope before we perform
17568         lookups in the enclosing scopes.
17569
17570         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17571
17572         (Invocation.VerifyArgumentsCompat): Call
17573         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17574         I thought we were supposed to always call this, but there are a
17575         few places in the code where we dont do it.
17576
17577 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17578
17579         * driver.cs: Add support in -linkres and -resource to specify the
17580         name of the identifier.
17581
17582 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17583
17584         * ecore.cs (StandardConversionExists): Sync with the conversion
17585         code: allow anything-* to void* conversions.
17586
17587         (FindMostSpecificSource): Use an Expression argument
17588         instead of a Type, because we might be handed over a Literal which
17589         gets a few more implicit conversions that plain types do not.  So
17590         this information was being lost.
17591
17592         Also, we drop the temporary type-holder expression when not
17593         required.
17594
17595 2002-09-17  Martin Baulig  <martin@gnome.org>
17596
17597         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17598         this is an explicit interface implementation.
17599
17600 2002-09-17  Martin Baulig  <martin@gnome.org>
17601
17602         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17603         different `IndexerName' attributes.
17604
17605         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17606         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17607         virtual CommonResolve().
17608
17609 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17610
17611         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17612         and convert that to the UnderlyingType.
17613
17614         * statement.cs (Foreach.Resolve): Indexers are just like variables
17615         or PropertyAccesses.
17616
17617         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17618         inside quoted strings, we were not doing this before.
17619
17620 2002-09-16  Martin Baulig  <martin@gnome.org>
17621
17622         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17623         resolve it.  This is needed for the definite assignment check of the
17624         instance expression, fixes bug #29846.
17625         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17626
17627 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17628
17629         * parameter.cs: Fix compile error.  Cannot reference static member
17630         from an instance object.  Is this an mcs bug?
17631
17632 2002-09-14  Martin Baulig  <martin@gnome.org>
17633
17634         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17635         multiple times.  Fixes bug #30295, added test-166.cs.
17636
17637 2002-09-14  Martin Baulig  <martin@gnome.org>
17638
17639         * statement.cs (Block.Emit): Don't emit unreachable code.
17640         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17641         `break' statements.
17642         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17643
17644 2002-09-14  Martin Baulig  <martin@gnome.org>
17645
17646         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17647         is set.
17648
17649 2002-09-14  Martin Baulig  <martin@gnome.org>
17650
17651         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17652         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17653         be false on the ms runtime.
17654
17655 2002-09-13  Martin Baulig  <martin@gnome.org>
17656
17657         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17658         the CS0038 error message.
17659
17660 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17661
17662         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17663         constant inside, return it.
17664
17665 2002-09-12  Martin Baulig  <martin@gnome.org>
17666
17667         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17668         implicit conversion can be done between enum types.
17669
17670         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17671         check whether an implicit conversion to the current enum's UnderlyingType
17672         exists and report an error if not.
17673
17674         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17675         without debugging support.
17676
17677         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17678         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17679
17680 2002-09-12  Martin Baulig  <martin@gnome.org>
17681
17682         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17683
17684         * ecore.cs (IMemberExpr.DeclaringType): New property.
17685         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17686         nonstatic member of an outer type (CS0038).
17687
17688 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17689
17690         * driver.cs: Activate the using-error detector at warning level
17691         4 (at least for MS-compatible APIs).
17692
17693         * namespace.cs (VerifyUsing): Small buglett fix.
17694
17695         * pending.cs (PendingImplementation): pass the container pointer. 
17696
17697         * interface.cs (GetMethods): Allow for recursive definition.  Long
17698         term, I would like to move every type to support recursive
17699         definitions, not the current ordering mechanism that we have right
17700         now.
17701
17702         The situation is this: Attributes are handled before interfaces,
17703         so we can apply attributes to interfaces.  But some attributes
17704         implement interfaces, we will now handle the simple cases
17705         (recursive definitions will just get an error).  
17706
17707         * parameter.cs: Only invalidate types at the end if we fail to
17708         lookup all types.  
17709
17710 2002-09-09  Martin Baulig  <martin@gnome.org>
17711
17712         * ecore.cs (PropertyExpr.Emit): Also check for
17713         TypeManager.system_int_array_get_length so this'll also work when
17714         compiling corlib.  Fixes #30003.
17715
17716 2002-09-09  Martin Baulig  <martin@gnome.org>
17717
17718         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17719         and throw an exception if we can't get the type's size.  Fixed #30040,
17720         added test-165.cs.
17721
17722 2002-09-09  Martin Baulig  <martin@gnome.org>
17723
17724         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17725
17726         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17727         context.  Fixes bug #30027.
17728
17729         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17730         virtual functions.  Fixes bug #30043, added test-164.cs.
17731
17732 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17733
17734         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17735
17736 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17737
17738         * driver.cs: Use an object to get the windows codepage since it's not a
17739         static property.
17740
17741 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17742
17743         * statement.cs (For.Emit): for infinite loops (test == null)
17744         return whether there is a break inside, not always "true".
17745
17746         * namespace.cs (UsingEntry): New struct to hold the name of the
17747         using definition, the location where it is defined, and whether it
17748         has been used in a successful type lookup.
17749
17750         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17751         strings.
17752
17753         * decl.cs: ditto.
17754
17755 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17756
17757         * attribute.cs : Fix incorrect code which relied on catching
17758         a NullReferenceException to detect a null being passed in
17759         where an object was expected.
17760
17761 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * statement.cs (Try): flag the catch variable as assigned
17764
17765         * expression.cs (Cast): Simplified by using ResolveType instead of
17766         manually resolving.
17767
17768         * statement.cs (Catch): Fix bug by using ResolveType.
17769
17770 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17771
17772         * expression.cs (BetterConversion): Special case for when we have
17773         a NullLiteral as the argument and we have to choose between string
17774         and object types - we choose string the way csc does.
17775
17776         * attribute.cs (Attribute.Resolve): Catch the
17777         NullReferenceException and report error #182 since the Mono
17778         runtime no more has the bug and having this exception raised means
17779         we tried to select a constructor which takes an object and is
17780         passed a null.
17781
17782 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17783
17784         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17785         message (1502, 1503) when we can't locate a method after overload
17786         resolution. This is much more informative and closes the bug
17787         Miguel reported.
17788
17789         * interface.cs (PopulateMethod): Return if there are no argument
17790         types. Fixes a NullReferenceException bug.
17791
17792         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17793         expressions too. Previously we were checking only in one place for
17794         positional arguments leaving out named arguments.
17795
17796         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17797         type to the enum type is not allowed. Remove code corresponding to
17798         that.
17799
17800         (ConvertNumericExplicit): Allow explicit conversions from
17801         the underlying type to enum type. This precisely follows the spec
17802         and closes a bug filed by Gonzalo.
17803
17804 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17805
17806         * compiler.csproj:
17807         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17808
17809 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17812         it was important that we stored the right value after the
17813         reduction in `converted'.
17814
17815 2002-09-04  Martin Baulig  <martin@gnome.org>
17816
17817         * location.cs (Location.SymbolDocument): Use full pathnames for the
17818         source files.
17819
17820 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17821
17822         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17823         of the expression resolve mechanism, because that will catch the
17824         SimpleName error failures.
17825
17826         (Conditional): If we can not resolve the
17827         expression, return, do not crash.
17828
17829 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17830
17831         * cs-tokenizer.cs:
17832         (location): display token name instead of its number.
17833
17834 2002-08-28  Martin Baulig  <martin@gnome.org>
17835
17836         * expression.cs (Binary.ResolveOperator): Don't silently return
17837         but return an error if an operator cannot be applied between two
17838         enum types.
17839
17840 2002-08-28  Martin Baulig  <martin@gnome.org>
17841
17842         * class.cs (Constructor.Define): Set the permission attributes
17843         correctly instead of making all constructors public.
17844
17845 2002-08-28  Martin Baulig  <martin@gnome.org>
17846
17847         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17848         for private members before reporting a CS0103; if we find anything,
17849         it's a CS0122.
17850
17851 2002-08-28  Martin Baulig  <martin@gnome.org>
17852
17853         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17854         to check whether `closure_start_type == closure_invocation_type',
17855         we also need to check whether `m.DeclaringType == closure_invocation_type'
17856         before bypassing the permission checks.  We might be accessing
17857         protected/private members from the base class.
17858         (TypeManager.RealMemberLookup): Only set private_ok if private
17859         members were requested via BindingFlags.NonPublic.
17860
17861         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17862
17863         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17864         MethodGroupExpr.IsExplicitImpl if appropriate.
17865         (Invocation.DoResolve): Don't report the CS0120 for explicit
17866         interface implementations.
17867
17868 2002-08-27  Martin Baulig  <martin@gnome.org>
17869
17870         * expression.cs (Invocation.DoResolve): If this is a static
17871         method and we don't have an InstanceExpression, we must report
17872         a CS0120.
17873
17874 2002-08-25  Martin Baulig  <martin@gnome.org>
17875
17876         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17877         `==' between a valuetype and an object.
17878
17879 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17880
17881         * ecore.cs (TypeExpr): Provide a ToString method.
17882
17883 2002-08-24  Martin Baulig  <martin@gnome.org>
17884
17885         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17886         now called proggie.dbg and it's a binary file.
17887
17888 2002-08-23  Martin Baulig  <martin@gnome.org>
17889
17890         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17891
17892 2002-08-23  Martin Baulig  <martin@gnome.org>
17893
17894         * struct.cs (MyStructInfo.ctor): Make this work with empty
17895         structs; it's not allowed to use foreach() on null.
17896
17897 2002-08-23  Martin Baulig  <martin@gnome.org>
17898
17899         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17900         writer the full pathname of the generated assembly.
17901
17902 2002-08-23  Martin Baulig  <martin@gnome.org>
17903
17904         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17905         A `finally' block never returns or breaks; improved handling of
17906         unreachable code.
17907
17908 2002-08-23  Martin Baulig  <martin@gnome.org>
17909
17910         * statement.cs (Throw.Resolve): Allow `throw null'.
17911
17912 2002-08-23  Martin Baulig  <martin@gnome.org>
17913
17914         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17915         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17916         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17917         MemberLookup would return a wrong event if this is an explicit
17918         interface implementation and the class has an event with the same
17919         name.
17920
17921 2002-08-23  Martin Baulig  <martin@gnome.org>
17922
17923         * statement.cs (Block.AddChildVariableNames): New public method.
17924         (Block.AddChildVariableName): Likewise.
17925         (Block.IsVariableNameUsedInChildBlock): Likewise.
17926         (Block.AddVariable): Check whether a variable name has already
17927         been used in a child block.
17928
17929         * cs-parser.jay (declare_local_variables): Mark all variable names
17930         from the current block as being used in a child block in the
17931         implicit block.
17932
17933 2002-08-23  Martin Baulig  <martin@gnome.org>
17934
17935         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17936         find the symbol writer.
17937
17938         * driver.cs: csc also allows the arguments to /define being
17939         separated by commas, not only by semicolons.
17940
17941 2002-08-23  Martin Baulig  <martin@gnome.org>
17942
17943         * interface.cs (Interface.GetMembers): Added static check for events.
17944
17945 2002-08-15  Martin Baulig  <martin@gnome.org>
17946
17947         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17948         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17949
17950         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17951         why the MethodData.EmitDestructor() change was necessary.
17952
17953 2002-08-20  Martin Baulig  <martin@gnome.org>
17954
17955         * class.cs (TypeContainer.FindMembers): Added static check for events.
17956
17957         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17958
17959         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17960         use Type.GetEvents(), not Type.FindMembers().
17961
17962 2002-08-20  Martin Baulig  <martin@gnome.org>
17963
17964         * decl.cs (MemberCache): Added a special method cache which will
17965         be used for method-only searched.  This ensures that a method
17966         search will return a MethodInfo with the correct ReflectedType for
17967         inherited methods.      
17968
17969 2002-08-20  Martin Baulig  <martin@gnome.org>
17970
17971         * decl.cs (DeclSpace.FindMembers): Made this public.
17972
17973 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17974
17975         * delegate.cs: fixed build on windows.
17976         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17977
17978 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17979
17980         * ecore.cs (StandardConversionExists): Return a false
17981         if we are trying to convert the void type to anything else
17982         since that is not allowed.
17983
17984         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17985         we flag error 70 in the event an event is trying to be accessed
17986         directly from outside the declaring type.
17987
17988 2002-08-20  Martin Baulig  <martin@gnome.org>
17989
17990         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17991         MemberCache from typemanager.cs to decl.cs.
17992
17993 2002-08-19  Martin Baulig  <martin@gnome.org>
17994
17995         * class.cs (TypeContainer): Implement IMemberContainer.
17996         (TypeContainer.DefineMembers): Create the MemberCache.
17997         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17998         return public members if BindingFlags.Public was given, check
17999         whether members are static.
18000
18001 2002-08-16  Martin Baulig  <martin@gnome.org>
18002
18003         * decl.cs (DeclSpace.Define): Splitted this in Define and
18004         DefineMembers.  DefineMembers is called first and initializes the
18005         MemberCache.
18006
18007         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
18008         DefineMembers() on all our DeclSpaces.
18009
18010         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18011         but call DefineMembers() on all nested interfaces.  We call their
18012         Define() in our new Define() function.
18013
18014         * interface.cs (Interface): Implement IMemberContainer.
18015         (Interface.Define): Moved all code except the attribute stuf to
18016         DefineMembers().
18017         (Interface.DefineMembers): Initialize the member cache.
18018
18019         * typemanager.cs (IMemberFinder): Removed this interface, we don't
18020         need this anymore since we can use MemberCache.FindMembers directly.
18021
18022 2002-08-19  Martin Baulig  <martin@gnome.org>
18023
18024         * typemanager.cs (MemberCache): When creating the cache for an
18025         interface type, add all inherited members.
18026         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18027         to `out bool used_cache' and documented it.
18028         (TypeManager.MemberLookup): If we already used the cache in the first
18029         iteration, we don't need to do the interfaces check.
18030
18031 2002-08-19  Martin Baulig  <martin@gnome.org>
18032
18033         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18034         here from IMemberFinder and don't implement this interface anymore.
18035         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18036
18037         * typemanager.cs (IMemberFinder): This interface is now only used by
18038         classes which actually support the member cache.
18039         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18040         since we only put DeclSpaces into this Hashtable.
18041         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18042         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18043
18044 2002-08-16  Martin Baulig  <martin@gnome.org>
18045
18046         * typemanager.cs (ICachingMemberFinder): Removed.
18047         (IMemberFinder.MemberCache): New property.
18048         (TypeManager.FindMembers): Merged this with RealFindMembers().
18049         This function will never be called from TypeManager.MemberLookup()
18050         so we can't use the cache here, just the IMemberFinder.
18051         (TypeManager.MemberLookup_FindMembers): Check whether the
18052         IMemberFinder has a MemberCache and call the cache's FindMembers
18053         function.
18054         (MemberCache): Rewrote larger parts of this yet another time and
18055         cleaned it up a bit.
18056
18057 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18058
18059         * driver.cs (LoadArgs): Support quoting.
18060
18061         (Usage): Show the CSC-like command line arguments.
18062
18063         Improved a few error messages.
18064
18065 2002-08-15  Martin Baulig  <martin@gnome.org>
18066
18067         * typemanager.cs (IMemberContainer.Type): New property.
18068         (IMemberContainer.IsInterface): New property.
18069
18070         The following changes are conditional to BROKEN_RUNTIME, which is
18071         defined at the top of the file.
18072
18073         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18074         class'es members, but add all members from TypeHandle.ObjectType
18075         if we're an interface.
18076         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18077         is the current type.
18078         (MemberCache.CacheEntry.Container): Removed this field.
18079         (TypeHandle.GetMembers): Include inherited members.
18080
18081 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18082
18083         * typemanager.cs: fixed compilation and added a comment on a field that
18084         is never used.
18085
18086 2002-08-15  Martin Baulig  <martin@gnome.org>
18087
18088         * class.cs (ConstructorInitializer.Resolve): In the
18089         Expression.MemberLookup call, use the queried_type as
18090         invocation_type.
18091
18092         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18093         declared' attribute, it's always true.
18094         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18095         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18096         temporary wrapper for FindMembers which tells MemberLookup whether
18097         members from the base classes are included in the return value.
18098         This will go away soon.
18099         (TypeManager.MemberLookup): Use this temporary hack here; once the
18100         new MemberCache is completed, we don't need to do the DeclaredOnly
18101         looping here anymore since the MemberCache will take care of this.
18102         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18103         (MemberCache): When creating the MemberCache for a class, get
18104         members from the current class and all its base classes.
18105         (MemberCache.CacheEntry.Container): New field.  This is a
18106         temporary hack until the Mono runtime is fixed to distinguish
18107         between ReflectedType and DeclaringType.  It allows us to use MCS
18108         with both the MS runtime and the unfixed Mono runtime without
18109         problems and without accecting performance.
18110         (MemberCache.SearchMembers): The DeclaredOnly looping from
18111         TypeManager.MemberLookup is now done here.      
18112
18113 2002-08-14  Martin Baulig  <martin@gnome.org>
18114
18115         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18116         Type.GetFields on dynamic types but get the fields from the
18117         corresponding TypeContainer.
18118         (MyStructInfo.GetStructInfo): Added check for enum types.
18119
18120         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18121         (MemberList.SyncRoot): Implemented.
18122         (TypeManager.FilterWithClosure): No need to check permissions if
18123         closure_start_type == closure_invocation_type, don't crash if
18124         closure_invocation_type is null.
18125
18126 2002-08-13  Martin Baulig  <martin@gnome.org>
18127
18128         Rewrote TypeContainer.FindMembers to use a member cache.  This
18129         gives us a speed increase of about 35% for the self-hosting MCS
18130         build and of about 15-20% for the class libs (both on GNU/Linux).
18131
18132         * report.cs (Timer): New class to get enhanced profiling.  This
18133         whole class is "TIMER" conditional since it remarkably slows down
18134         compilation speed.
18135
18136         * class.cs (MemberList): New class.  This is an IList wrapper
18137         which we're now using instead of passing MemberInfo[]'s around to
18138         avoid copying this array unnecessarily.
18139         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18140         (ICachingMemberFinder, IMemberContainer): New interface.
18141         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18142         has already been checked, otherwise use it for the name comparision.
18143         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18144         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18145         if possible.  Returns a MemberList, not a MemberInfo [].
18146         (TypeHandle): New class, implements IMemberContainer.  We create
18147         one instance of this class per type, it contains a MemberCache
18148         which is used to do the member lookups.
18149         (MemberCache): New class.  Each instance of this class contains
18150         all members of a type and a name-based hash table.
18151         (MemberCache.FindMembers): This is our new member lookup
18152         function.  First, it looks up all members of the requested name in
18153         the hash table.  Then, it walks this list and sorts out all
18154         applicable members and returns them.
18155
18156 2002-08-13  Martin Baulig  <martin@gnome.org>
18157
18158         In addition to a nice code cleanup, this gives us a performance
18159         increase of about 1.4% on GNU/Linux - not much, but it's already
18160         half a second for the self-hosting MCS compilation.
18161
18162         * typemanager.cs (IMemberFinder): New interface.  It is used by
18163         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18164         Enum, Delegate or Interface.
18165         (TypeManager.finder_to_member_finder): New PtrHashtable.
18166         (TypeManager.finder_to_container): Removed.
18167         (TypeManager.finder_to_delegate): Removed.
18168         (TypeManager.finder_to_interface): Removed.
18169         (TypeManager.finder_to_enum): Removed.
18170
18171         * interface.cs (Interface): Implement IMemberFinder.
18172
18173         * delegate.cs (Delegate): Implement IMemberFinder.
18174
18175         * enum.cs (Enum): Implement IMemberFinder.
18176
18177         * class.cs (TypeContainer): Implement IMemberFinder.
18178
18179 2002-08-12  Martin Baulig  <martin@gnome.org>
18180
18181         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18182
18183 2002-08-12  Martin Baulig  <martin@gnome.org>
18184
18185         * ecore.cs (ITypeExpression): New interface for expressions which
18186         resolve to a type.
18187         (TypeExpression): Renamed to TypeLookupExpression.
18188         (Expression.DoResolve): If we're doing a types-only lookup, the
18189         expression must implement the ITypeExpression interface and we
18190         call DoResolveType() on it.
18191         (SimpleName): Implement the new ITypeExpression interface.
18192         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18193         hack, the situation that we're only looking up types can't happen
18194         anymore when this method is called.  Moved the type lookup code to
18195         DoResolveType() and call it.
18196         (SimpleName.DoResolveType): This ITypeExpression interface method
18197         is now doing the types-only lookup.
18198         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18199         (ResolveFlags): Added MaskExprClass.
18200
18201         * expression.cs (MemberAccess): Implement the ITypeExpression
18202         interface.
18203         (MemberAccess.DoResolve): Added support for a types-only lookup
18204         when we're called via ITypeExpression.DoResolveType().
18205         (ComposedCast): Implement the ITypeExpression interface.
18206
18207         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18208         Expression.Resolve() with ResolveFlags.Type instead.
18209
18210 2002-08-12  Martin Baulig  <martin@gnome.org>
18211
18212         * interface.cs (Interface.Define): Apply attributes.
18213
18214         * attribute.cs (Attribute.ApplyAttributes): Added support for
18215         interface attributes.
18216
18217 2002-08-11  Martin Baulig  <martin@gnome.org>
18218
18219         * statement.cs (Block.Emit): Only check the "this" variable if we
18220         do not always throw an exception.
18221
18222         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18223         whether the property has a set accessor.
18224
18225 2002-08-11  Martin Baulig  <martin@gnome.org>
18226
18227         Added control flow analysis support for structs.
18228
18229         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18230         with control flow analysis turned off.
18231         (IVariable): New interface.
18232         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18233         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18234         (FieldExpr.DoResolve): Resolve the instance expression with flow
18235         analysis turned off and do the definite assignment check after the
18236         resolving when we know what the expression will resolve to.
18237
18238         * expression.cs (LocalVariableReference, ParameterReference):
18239         Implement the new IVariable interface, only call the flow analysis
18240         code if ec.DoFlowAnalysis is true.
18241         (This): Added constructor which takes a Block argument.  Implement
18242         the new IVariable interface.
18243         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18244         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18245         This does the definite assignment checks for struct members.
18246
18247         * class.cs (Constructor.Emit): If this is a non-static `struct'
18248         constructor which doesn't have any initializer, call
18249         Block.AddThisVariable() to tell the flow analysis code that all
18250         struct elements must be initialized before control returns from
18251         the constructor.
18252
18253         * statement.cs (MyStructInfo): New public class.
18254         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18255         argument to this indexer.  If non-zero, check an individual struct
18256         member, not the whole struct.
18257         (FlowBranching.CheckOutParameters): Check struct members.
18258         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18259         overloaded versions of these methods which take an additional
18260         `int field_idx' argument to check struct members.
18261         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18262         overloaded versions of these methods which take an additional
18263         `string field_name' argument to check struct member.s
18264         (VariableInfo): Implement the IVariable interface.
18265         (VariableInfo.StructInfo): New public property.  Returns the
18266         MyStructInfo instance of the variable if it's a struct or null.
18267         (Block.AddThisVariable): New public method.  This is called from
18268         Constructor.Emit() for non-static `struct' constructor which do
18269         not have any initializer.  It creates a special variable for the
18270         "this" instance variable which will be checked by the flow
18271         analysis code to ensure that all of the struct's fields are
18272         initialized before control returns from the constructor.
18273         (UsageVector): Added support for struct members.  If a
18274         variable/parameter is a struct with N members, we reserve a slot
18275         in the usage vector for each member.  A struct is considered fully
18276         initialized if either the struct itself (slot 0) or all its
18277         members are initialized.
18278
18279 2002-08-08  Martin Baulig  <martin@gnome.org>
18280
18281         * driver.cs (Driver.MainDriver): Only report an error CS5001
18282         if there were no compilation errors.
18283
18284         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18285         `UnsafeContext' property to determine whether the parent is in
18286         unsafe context rather than checking the parent's ModFlags:
18287         classes nested in an unsafe class are unsafe as well.
18288
18289 2002-08-08  Martin Baulig  <martin@gnome.org>
18290
18291         * statement.cs (UsageVector.MergeChildren): Distinguish between
18292         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18293         we return.  Added test17() and test18() to test-154.cs.
18294
18295 2002-08-08  Martin Baulig  <martin@gnome.org>
18296
18297         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18298         Family access, make sure the invoking type isn't a subclass of the
18299         queried type (that'd be a CS1540).
18300
18301         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18302         this method which takes an additional `Type invocation_type'.
18303
18304         * expression.cs (BaseAccess.DoResolve): Use the base type as
18305         invocation and query type.
18306         (MemberAccess.DoResolve): If the lookup failed and we're about to
18307         report a CS0122, try a lookup with the ec.ContainerType - if this
18308         succeeds, we must report a CS1540.
18309
18310 2002-08-08  Martin Baulig  <martin@gnome.org>
18311
18312         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18313         (MethodGroupExpr): Implement the IMemberExpr interface.
18314
18315         * expression (MemberAccess.ResolveMemberAccess): No need to have
18316         any special code for MethodGroupExprs anymore, they're now
18317         IMemberExprs.   
18318
18319 2002-08-08  Martin Baulig  <martin@gnome.org>
18320
18321         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18322         Family, FamANDAssem and FamORAssem permissions.
18323         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18324
18325 2002-08-08  Martin Baulig  <martin@gnome.org>
18326
18327         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18328         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18329         or loop block.
18330
18331 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18332
18333         * driver.cs: implemented /resource option to embed managed resources.
18334
18335 2002-08-07  Martin Baulig  <martin@gnome.org>
18336
18337         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18338         (FieldBase.HasFieldInitializer): New public property.
18339         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18340         returns the field initializer and makes sure it is only resolved once.
18341         (TypeContainer.EmitFieldInitializers): Call
18342         FieldBase.GetInitializerExpression to get the initializer, this ensures
18343         that it isn't resolved multiple times.
18344
18345         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18346         the resolving process (SimpleName/MemberLookup) that we're currently
18347         emitting a field initializer (which must not access any instance members,
18348         this is an error CS0236).
18349
18350         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18351         argument, if the `IsFieldInitializer' flag is set, we must report and
18352         error CS0236 and not an error CS0120.   
18353
18354 2002-08-07  Martin Baulig  <martin@gnome.org>
18355
18356         * ecore.cs (IMemberExpr): New public interface.
18357         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18358         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18359         if the expression is an IMemberExpr.
18360
18361         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18362         to be null, implicitly default to `this' if we're non-static in
18363         this case.  Simplified the code a lot by using the new IMemberExpr
18364         interface.  Also fixed bug #28176 here.
18365
18366 2002-08-06  Martin Baulig  <martin@gnome.org>
18367
18368         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18369         ParameterReferences during semantic analysis so that we can do a
18370         type-only search when resolving Cast, TypeOf and SizeOf.
18371         (block): Pass the `current_local_parameters' to the Block's
18372         constructor.
18373
18374         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18375         argument to the constructor.
18376         (ConstructorInitializer.Resolve): Create a temporary implicit
18377         block with the parameters.
18378
18379         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18380         references here if we aren't doing a type-only search.
18381
18382         * statement.cs (Block): Added constructor which takes a
18383         `Parameters parameters' argument.
18384         (Block.Parameters): New public property.
18385
18386         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18387         to `Parameters' and made it public readonly.
18388
18389 2002-08-06  Martin Baulig  <martin@gnome.org>
18390
18391         * ecore.cs (Expression.Warning): Made this public as well.
18392
18393         * report.cs (Report.Debug): Print the contents of collections.
18394
18395 2002-08-06  Martin Baulig  <martin@gnome.org>
18396
18397         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18398         used to tell Resolve() which kinds of expressions it may return.
18399         (Expression.Resolve): Added overloaded version of this method which
18400         takes a `ResolveFlags flags' argument.  This can be used to tell
18401         Resolve() which kinds of expressions it may return.  Reports a
18402         CS0118 on error.
18403         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18404         ResolveFlags.SimpleName.
18405         (Expression.Error118): Added overloaded version of this method which
18406         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18407         which kinds of expressions are allowed.
18408
18409         * expression.cs (Argument.ResolveMethodGroup): New public method.
18410         Resolves an argument, but allows a MethodGroup to be returned.
18411         This is used when invoking a delegate.
18412
18413         * TODO: Updated a bit.
18414
18415 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18416
18417         Fixed compilation with csc.
18418
18419         * ecore.cs: Expression.Error made public. Is this correct? Should
18420         Warning be made public too?
18421
18422         * expression.cs: use ea.Location instead of ea.loc.
18423         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18424
18425 2002-08-06  Martin Baulig  <martin@gnome.org>
18426
18427         * ecore.cs (Expression.loc): Moved the location here instead of
18428         duplicating it in all derived classes.
18429         (Expression.Location): New public property.
18430         (Expression.Error, Expression.Warning): Made them non-static and
18431         removed the location argument.
18432         (Expression.Warning): Added overloaded version which takes an
18433         `int level' argument.
18434         (Expression.Error118): Make this non-static and removed the
18435         expression and location arguments.
18436         (TypeExpr): Added location argument to the constructor.
18437
18438         * expression.cs (StaticCallExpr): Added location argument to
18439         the constructor.
18440         (Indirection, PointerArithmetic): Likewise.
18441         (CheckedExpr, UnCheckedExpr): Likewise.
18442         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18443         (StringPtr): Likewise.
18444
18445
18446 2002-08-05  Martin Baulig  <martin@gnome.org>
18447
18448         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18449
18450         * assign.cs (Assign.DoResolve): Check whether the source
18451         expression is a value or variable.
18452
18453         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18454         while resolving the corresponding blocks.
18455
18456         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18457         an error, don't silently return null.
18458
18459         * statement.cs (Block.AddVariable): Do the error reporting here
18460         and distinguish between CS0128 and CS0136.
18461         (Block.DoResolve): Report all unused labels (warning CS0164).
18462         (LabeledStatement): Pass the location to the constructor.
18463         (LabeledStatement.HasBeenReferenced): New property.
18464         (LabeledStatement.Resolve): Set it to true here.
18465
18466         * statement.cs (Return.Emit): Return success even after reporting
18467         a type mismatch error (CS0126 or CS0127), this is what csc does and
18468         it avoids confusing the users with any consecutive errors.
18469
18470 2002-08-05  Martin Baulig  <martin@gnome.org>
18471
18472         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18473
18474         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18475
18476         * expression.cs (MemberAccess.DoResolve): Silently return if an
18477         error has already been reported.
18478
18479         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18480         error has already been reported.
18481
18482 2002-08-05  Martin Baulig  <martin@gnome.org>
18483
18484         * statement.cs (UsageVector): Only initialize the `parameters'
18485         vector if we actually have any "out" parameters.
18486
18487 2002-08-05  Martin Baulig  <martin@gnome.org>
18488
18489         * expression.cs (Binary.ResolveOperator): When combining delegates,
18490         they must have the same type.
18491
18492 2002-08-05  Martin Baulig  <martin@gnome.org>
18493
18494         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18495         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18496         work with the ms runtime and we also don't need it: if we're a
18497         PropertyBuilder and not in the `indexer_arguments' hash, then we
18498         are a property and not an indexer.
18499
18500         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18501         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18502         since the latter one doesn't work with the ms runtime.
18503
18504 2002-08-03  Martin Baulig  <martin@gnome.org>
18505
18506         Fixed bugs #27998 and #22735.
18507
18508         * class.cs (Method.IsOperator): New public field.
18509         (Method.CheckBase): Report CS0111 if there's already a method
18510         with the same parameters in the current class.  Report CS0508 when
18511         attempting to change the return type of an inherited method.
18512         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18513         and it's not marked abstract or extern.
18514         (PropertyBase): New abstract base class for Property and Indexer.
18515         (PropertyBase.CheckBase): Moved here from Property and made it work
18516         for indexers.
18517         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18518         the same so we can reuse it there.
18519         (Property, Indexer): Derive from PropertyBase.
18520         (MethodSignature.inheritable_property_signature_filter): New delegate
18521         to find properties and indexers.
18522
18523         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18524         argument and improved error reporting.
18525
18526         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18527         EmptyReadOnlyParameters and made it a property.
18528
18529         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18530         version of this method which takes a `PropertyInfo indexer'.
18531         (TypeManager.RegisterIndexer): New method.
18532
18533         * class.cs: Added myself as author of this file :-)
18534
18535 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18536
18537         * class.cs: fixed compilation on windoze.
18538
18539 2002-08-03  Martin Baulig  <martin@gnome.org>
18540
18541         * interface.cs (Interface.GetInterfaceBases): Check whether all
18542         base interfaces are at least as accessible than the current one.
18543
18544         * class.cs (TypeContainer.GetClassBases): Check whether base types
18545         are at least as accessible than the current type.
18546         (TypeContainer.AsAccessible): Implemented and made non-static.
18547         (MemberBase.CheckParameters): Report errors if the accessibility
18548         checks fail.
18549
18550         * delegate.cs (Delegate.Delegate): The default visibility is
18551         internal for top-level types and private for nested types.
18552         (Delegate.Define): Report errors if the accessibility checks fail.
18553
18554         * enum.cs (Enum.Enum): The default visibility is internal for
18555         top-level types and private for nested types.
18556         (Enum.DefineType): Compute the correct visibility.
18557
18558         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18559         function which takes a `bool is_toplevel' instead of a TypeContainer.
18560
18561         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18562         builtin type.
18563
18564 2002-08-02  Martin Baulig  <martin@gnome.org>
18565
18566         * expression.cs (LocalVariableReferenc): Added constructor which
18567         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18568         (LocalVariableReference.IsReadOnly): New property.
18569         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18570         variable is readonly, use our own readonly flag to do this; you can
18571         use the new constructor to get a writable reference to a read-only
18572         variable.
18573
18574         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18575         reference to the local variable.
18576
18577 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18578
18579         * rootcontext.cs (ResolveCore): Also include System.Exception
18580
18581         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18582         we reach an EmptyStatement.
18583
18584         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18585         is also fine.
18586
18587         * expression.cs (Binary.ResolveOperator): Check error result in
18588         two places.
18589
18590         use brtrue/brfalse directly and avoid compares to null.
18591
18592 2002-08-02  Martin Baulig  <martin@gnome.org>
18593
18594         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18595         Fixes bug #28407, added test-155.cs.
18596
18597 2002-08-01  Martin Baulig  <martin@gnome.org>
18598
18599         * class.cs (Event.EmitDefaultMethod): Make this work with static
18600         events.  Fixes #28311, added verify-3.cs.
18601
18602 2002-08-01  Martin Baulig  <martin@gnome.org>
18603
18604         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18605         `is_disposable' fields.
18606         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18607         `hm.is_disposable' if we're using the collection pattern.
18608         (Foreach.EmitCollectionForeach): Use the correct type for the
18609         enumerator's local variable, only emit the try/finally block if
18610         necessary (fixes #27713).
18611
18612 2002-08-01  Martin Baulig  <martin@gnome.org>
18613
18614         * ecore.cs (Expression.report118): Renamed to Error118 and made
18615         it public static.
18616
18617         * statement.cs (Throw.Resolve): Check whether the expression is of
18618         the correct type (CS0118) and whether the type derives from
18619         System.Exception (CS0155).
18620         (Catch.Resolve): New method.  Do the type lookup here and check
18621         whether it derives from System.Exception (CS0155).
18622         (Catch.CatchType, Catch.IsGeneral): New public properties.
18623
18624         * typemanager.cs (TypeManager.exception_type): Added.
18625
18626 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18627
18628         * driver.cs: Updated About function.
18629
18630 2002-07-31  Martin Baulig  <martin@gnome.org>
18631
18632         Implemented Control Flow Analysis.
18633
18634         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18635         (EmitContext.CurrentBranching): Added.
18636         (EmitContext.StartFlowBranching): Added.
18637         (EmitContext.EndFlowBranching): Added.
18638         (EmitContext.KillFlowBranching): Added.
18639         (EmitContext.IsVariableAssigned): Added.
18640         (EmitContext.SetVariableAssigned): Added.
18641         (EmitContext.IsParameterAssigned): Added.
18642         (EmitContext.SetParameterAssigned): Added.
18643         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18644         Added control flow analysis stuff here.
18645
18646         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18647         resolve the expression as lvalue.
18648         (LocalVariableReference.DoResolve): Check whether the variable has
18649         already been assigned.
18650         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18651         the parameter as assigned here.
18652         (ParameterReference.DoResolve): Check whether the parameter has already
18653         been assigned.
18654         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18655         expression as lvalue.
18656
18657         * statement.cs (FlowBranching): New class for the flow analysis code.
18658         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18659         (LabeledStatement.IsDefined): New public property.
18660         (LabeledStatement.AddUsageVector): New public method to tell flow
18661         analyis that the label may be reached via a forward jump.
18662         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18663         flow analysis.
18664         (VariableInfo.Number): New public field.  This is used by flow analysis
18665         to number all locals of a block.
18666         (Block.CountVariables): New public property.  This is the number of
18667         local variables in this block (including the locals from all parent
18668         blocks).
18669         (Block.EmitMeta): Number all the variables.
18670
18671         * statement.cs: Added flow analysis support to all classes.
18672
18673 2002-07-31  Martin Baulig  <martin@gnome.org>
18674
18675         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18676         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18677         then use this argument.
18678
18679         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18680
18681         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18682         use this to specify /define options.
18683
18684 2002-07-29  Martin Baulig  <martin@gnome.org>
18685
18686         * statement.cs (Fixed): Moved all code that does variable lookups
18687         and resolvings from Emit to Resolve.
18688
18689         * statement.cs (For): Moved all code that does variable lookups
18690         and resolvings from Emit to Resolve.
18691
18692         * statement.cs (Using): Moved all code that does variable lookups
18693         and resolvings from Emit to Resolve.
18694
18695 2002-07-29  Martin Baulig  <martin@gnome.org>
18696
18697         * attribute.cs (Attribute.Resolve): Explicitly catch a
18698         System.NullReferenceException when creating the
18699         CustromAttributeBuilder and report a different warning message.
18700
18701 2002-07-29  Martin Baulig  <martin@gnome.org>
18702
18703         * support.cs (ParameterData.ParameterName): Added method to
18704         get the name of a parameter.
18705
18706         * typemanager.cs (TypeManager.IsValueType): New public method.
18707
18708 2002-07-29  Martin Baulig  <martin@gnome.org>
18709
18710         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18711         is a flag which specifies that it's either ref or out.
18712         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18713         the out parameter to `out Parameter.Modifier mod', also set the
18714         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18715
18716         * support.cs (InternalParameters.ParameterModifier): Distinguish
18717         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18718         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18719
18720         * expression.cs (Argument.GetParameterModifier): Distinguish
18721         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18722         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18723
18724 2002-07-29  Martin Baulig  <martin@gnome.org>
18725
18726         * expression.cs (ParameterReference.ParameterReference): Added
18727         `Location loc' argument to the constructor.
18728
18729         * cs-parser.jay: Pass location to ParameterReference.
18730
18731 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18732
18733         * statement.cs (Try): Initialize the location.
18734
18735         * cs-parser.jay: pass location to Try.
18736
18737         * expression.cs (Unary.Reduce): Change the prototype to return
18738         whether a constant fold could be performed or not.  The result is
18739         returned in an out parameters.  In the case of Indirection and
18740         AddressOf, we want to perform the full tests.
18741
18742 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18743
18744         * statement.cs (Statement.Emit): Flag dead code.
18745
18746 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18747
18748         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18749
18750 2002-07-27  Martin Baulig  <martin@gnome.org>
18751
18752         * class.cs (MethodData.Define): Put back call to
18753         TypeManager.AddMethod(), accidentally commented this out.
18754
18755         * report.cs (Debug): New public method to print debugging information,
18756         this is `[Conditional ("DEBUG")]'.
18757
18758 2002-07-26  Martin Baulig  <martin@gnome.org>
18759
18760         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18761         (switch_statement): Push the current_block to the switch_stack and
18762         pop it again when we're done with the switch.
18763         (switch_section): The new block is a child of the current_block.
18764         Fixes bug #24007, added test-152.cs.
18765
18766 2002-07-27  Martin Baulig  <martin@gnome.org>
18767
18768         * expression.cs (Invocation.EmitArguments): When calling a varargs
18769         function with only its fixed arguments, we need to pass an empty
18770         array.
18771
18772 2002-07-27  Martin Baulig  <martin@gnome.org>
18773
18774         Mono 0.13 has been released.
18775
18776 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18777
18778         * driver.cs: Rename --resource to --linkres, because that is what
18779         we do currently, we dont support --resource yet.
18780
18781         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18782
18783 2002-07-25  Martin Baulig  <martin@gnome.org>
18784
18785         * class.cs (MethodData): New public class.  This is a `method builder'
18786         class for a method or one accessor of a Property/Indexer/Event.
18787         (MethodData.GetMethodFlags): Moved here from MemberBase.
18788         (MethodData.ApplyAttributes): Likewise.
18789         (MethodData.ApplyObsoleteAttribute): Likewise.
18790         (MethodData.ApplyConditionalAttribute): Likewise.
18791         (MethodData.ApplyDllImportAttribute): Likewise.
18792         (MethodData.CheckAbstractAndExternal): Likewise.
18793         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18794         (MethodData.Emit): Formerly known as Method.Emit().
18795         (MemberBase): Moved everything which was specific to a single
18796         accessor/method to MethodData.
18797         (Method): Create a new MethodData and call Define() and Emit() on it.
18798         (Property, Indexer, Event): Create a new MethodData objects for each
18799         accessor and call Define() and Emit() on them.
18800
18801 2002-07-25  Martin Baulig  <martin@gnome.org>
18802
18803         Made MethodCore derive from MemberBase to reuse the code from there.
18804         MemberBase now also checks for attributes.
18805
18806         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18807         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18808         as virtual.
18809         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18810         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18811         (MemberBase.ApplyAttributes): New virtual method; applies the
18812         attributes to a method or accessor.
18813         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18814         (MemberBase.ApplyConditionalAttribute): Likewise.
18815         (MemberBase.ApplyDllImportAttribute): Likewise.
18816         (MemberBase.CheckAbstractAndExternal): Likewise.
18817         (MethodCore.ParameterTypes): This is now a property instead of a
18818         method, it's initialized from DoDefineParameters().
18819         (MethodCore.ParameterInfo): Removed the set accessor.
18820         (MethodCore.DoDefineParameters): New protected virtual method to
18821         initialize ParameterTypes and ParameterInfo.
18822         (Method.GetReturnType): We can now simply return the MemberType.
18823         (Method.GetMethodFlags): Override the MemberBase version and add
18824         the conditional flags.
18825         (Method.CheckBase): Moved some code from Define() here, call
18826         DoDefineParameters() here.
18827         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18828         here to avoid some larger code duplication.
18829         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18830         ensure that abstract and external accessors don't declare a body.
18831
18832         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18833         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18834         lookup in the attribute's parent classes, so we need to abort as soon
18835         as we found the first match.
18836         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18837         the attribute has no arguments.
18838
18839         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18840         of a Method.
18841
18842 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18843
18844         * cs-parser.jay: reverted previous patch.
18845
18846 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18847
18848         * cs-parser.jay: fixed bug #22119.
18849
18850 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18851
18852         * attribute.cs: fixed compilation. The error was:
18853         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18854         be assigned to before control leaves the current method."
18855         [FIXME:  Filed as bug #28186: MCS must report this error.]
18856
18857 2002-07-25  Martin Baulig  <martin@gnome.org>
18858
18859         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18860         method to pull the condition name ouf of a Conditional attribute.
18861         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18862         the obsolete message and error flag out of an Obsolete attribute.
18863
18864         * class.cs (Method.GetMethodFlags): New public method to get the
18865         TypeManager.MethodFlags for this method.
18866         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18867         private methods.
18868         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18869         if we're overriding a virtual function, set the new private variable
18870         `parent_method'; call the new TypeManager.AddMethod().
18871
18872         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18873         the MethodBuilder and the Method in a PtrHashtable.
18874         (TypeManager.builder_to_method): Added for this purpose.
18875         (TypeManager.MethodFlags): Added IsObsoleteError.
18876         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18877         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18878         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18879         the message from the attribute.
18880
18881 2002-07-24  Martin Baulig  <martin@gnome.org>
18882
18883         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18884         preprocessor directives, ensure that the argument to #define/#undef is
18885         exactly one identifier and that it's actually an identifier.
18886
18887         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18888         did not work ....
18889
18890 2002-07-24  Martin Baulig  <martin@gnome.org>
18891
18892         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18893         initialize it to TypeManager.object_type in the constructor.
18894         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18895         of the `hm.get_current' method if we're using the collection pattern.
18896         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18897         for the explicit conversion to make it work when we're using the collection
18898         pattern and the `Current' property has a different return type than `object'.
18899         Fixes #27713.
18900
18901 2002-07-24  Martin Baulig  <martin@gnome.org>
18902
18903         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18904         does not match, but don't report any errors.  This method is called in
18905         order for all methods in a MethodGroupExpr until a matching method is
18906         found, so we don't want to bail out if the first method doesn't match.
18907         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18908         matches, report the 123.  Fixes #28070.
18909
18910 2002-07-24  Martin Baulig  <martin@gnome.org>
18911
18912         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18913         TypeManager.TypeToCoreType() to the top of the method so the
18914         following equality checks will work.  Fixes #28107.
18915
18916 2002-07-24  Martin Baulig  <martin@gnome.org>
18917
18918         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18919         operand is of type uint, and the other operand is of type sbyte,
18920         short or int, the operands are converted to type long." -
18921         Actually do what this comment already told us.  Fixes bug #28106,
18922         added test-150.cs.
18923
18924 2002-07-24  Martin Baulig  <martin@gnome.org>
18925
18926         * class.cs (MethodBase): New abstract class.  This is now a base
18927         class for Property, Indexer and Event to avoid some code duplication
18928         in their Define() and DefineMethods() methods.
18929         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18930         generic methods for Define() and DefineMethods().
18931         (FieldBase): Derive from MemberBase, not MemberCore.
18932         (Property): Derive from MemberBase, not MemberCore.
18933         (Property.DefineMethod): Moved all the code from this method to the
18934         new MethodBase.DefineAccessor(), just call it with appropriate
18935         argumetnts.
18936         (Property.Define): Call the new Property.DoDefine(), this does some
18937         sanity checks and we don't need to duplicate the code everywhere.
18938         (Event): Derive from MemberBase, not MemberCore.
18939         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18940         accessors, this will also make them work with interface events.
18941         (Indexer): Derive from MemberBase, not MemberCore.
18942         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18943         (Indexer.Define): Use the new MethodBase functions.
18944
18945         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18946         argument to the constructor.
18947         (Interface.FindMembers): Added support for interface events.
18948         (Interface.PopluateEvent): Implemented.
18949
18950         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18951
18952 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18953
18954         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18955         but this is required to check for a method name being the same as
18956         the containing class.  
18957
18958         Handle this now.
18959
18960 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18961
18962         * interface.cs: initialize variable.
18963
18964 2002-07-23  Martin Baulig  <martin@gnome.org>
18965
18966         Implemented the IndexerName attribute in interfaces.
18967
18968         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18969         name if this is an explicit interface implementation.
18970         (Indexer.InterfaceIndexerName): New public variable.  If we're
18971         implementing an interface indexer, this is the IndexerName in that
18972         interface.  Otherwise, it's the IndexerName.
18973         (Indexer.DefineMethod): If we're implementing interface indexer,
18974         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18975         and Pending.ImplementIndexer methods.
18976         (Indexer.Define): Also define the PropertyBuilder if we're
18977         implementing an interface indexer and this is neither an explicit
18978         interface implementation nor do the IndexerName match the one in
18979         the interface.
18980
18981         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18982         If a method is defined here, then we always need to create a proxy
18983         for it.  This is used when implementing interface indexers.
18984         (Pending.IsInterfaceIndexer): New public method.
18985         (Pending.ImplementIndexer): New public method.
18986         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18987         This is used when implementing interface indexers to define a proxy
18988         if necessary.
18989         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18990         define a proxy if necessary.
18991
18992         * interface.cs (Interface.IndexerName): New public variable.
18993         (Interface.PopulateIndexer): Set the IndexerName.
18994         (Interface.DefineIndexers): New private method.  Populate all the
18995         indexers and make sure their IndexerNames match.
18996
18997         * typemanager.cs (IndexerPropertyName): Added support for interface
18998         indexers.
18999
19000 2002-07-22  Martin Baulig  <martin@gnome.org>
19001
19002         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19003         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19004         ret if HasReturnLabel.
19005         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19006         variables.
19007
19008         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19009         and set the ec.LoopBeginTryCatchLevel.
19010         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19011         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19012         the current ec.TryCatchLevel, the branch goes out of an exception
19013         block.  In this case, we need to use Leave and not Br.
19014
19015 2002-07-22  Martin Baulig  <martin@gnome.org>
19016
19017         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19018         block unless the block does not always return or it is contained in
19019         another try { ... } catch { ... } block.  Fixes bug #26506.
19020         Added verify-1.cs to the test suite.
19021
19022 2002-07-22  Martin Baulig  <martin@gnome.org>
19023
19024         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19025         then we do not always return.  Fixes bug #24985.
19026
19027 2002-07-22  Martin Baulig  <martin@gnome.org>
19028
19029         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19030         lookup on a per-class level; ie. walk up the class hierarchy until we
19031         found at least one applicable method, then choose the best among them.
19032         Fixes bug #24463 and test-29.cs.
19033
19034 2002-07-22  Martin Baulig  <martin@gnome.org>
19035
19036         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19037         return types of the methods.  The return type is not part of the
19038         signature and we must not check it to make the `new' modifier work.
19039         Fixes bug #27999, also added test-147.cs.
19040         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19041
19042         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19043         on the method's return type.
19044
19045 2002-07-21  Martin Baulig  <martin@gnome.org>
19046
19047         * assign.cs: Make this work if the rightmost source is a constant and
19048         we need to do an implicit type conversion.  Also adding a few more tests
19049         to test-38.cs which should have caught this.
19050
19051         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19052         target in the makefile for this.  The makefile.gnu is primarily intended
19053         for end-users who don't want to debug the compiler.
19054
19055 2002-07-21  Martin Baulig  <martin@gnome.org>
19056
19057         * assign.cs: Improved the Assign class so it can now handle embedded
19058         assignments (X = Y = Z = something).  As a side-effect this'll now also
19059         consume less local variables.  test-38.cs now passes with MCS, added
19060         a few new test cases to that test.
19061
19062 2002-07-20  Martin Baulig  <martin@gnome.org>
19063
19064         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19065         instructions.  Fixes bug #27977, also added test-146.cs.
19066
19067 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19068
19069         * cs-tokenizer.cs: fixed getHex ().
19070
19071 2002-07-19  Martin Baulig  <martin@gnome.org>
19072
19073         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19074         not Type.GetType() to lookup the array type.  This is needed when
19075         we're constructing an array of a user-defined type.
19076         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19077         single-dimensional arrays, but also for single-dimensial arrays of
19078         type decimal.
19079
19080 2002-07-19  Martin Baulig  <martin@gnome.org>
19081
19082         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19083         this function is called, it's not allowed to share LocalBuilders
19084         among ILGenerators.
19085
19086 2002-07-19  Martin Baulig  <martin@gnome.org>
19087
19088         * expression.cs (Argument.Resolve): Report an error 118 when trying
19089         to pass a type as argument.
19090
19091 2002-07-18  Martin Baulig  <martin@gnome.org>
19092
19093         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19094         Conv_R_Un for the signed `long' type.
19095
19096 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19097
19098         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19099         `expr' for the temporary result, as that will fail if we do
19100         multiple resolves on the same expression.
19101
19102 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19103
19104         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19105         ec.TypeContainer for looking up aliases. 
19106
19107         * class.cs (TypeContainer): Remove LookupAlias from here.
19108
19109         * decl.cs (DeclSpace); Move here.
19110
19111 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19112
19113         * class.cs (FindMembers): Only call filter if the constructor
19114         bulider is not null.
19115
19116         Also handle delegates in `NestedTypes' now.  Now we will perform
19117         type lookups using the standard resolution process.  This also
19118         fixes a bug.
19119
19120         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19121         This uses Expressions (the limited kind that can be parsed by the
19122         tree) instead of strings.
19123
19124         * expression.cs (ComposedCast.ToString): Implement, used to flag
19125         errors since now we have to render expressions.
19126
19127         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19128         FormArrayType. 
19129
19130         * ecore.cs (SimpleName.ToString): ditto.
19131
19132         * cs-parser.jay: Instead of using strings to assemble types, use
19133         Expressions to assemble the type (using SimpleName, ComposedCast,
19134         MemberAccess).  This should fix the type lookups in declarations,
19135         because we were using a different code path for this.
19136
19137         * statement.cs (Block.Resolve): Continue processing statements
19138         even when there is an error.
19139
19140 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19141
19142         * class.cs (Event.Define): Also remove the `remove' method from
19143         the list of pending items.
19144
19145         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19146         generate more compact code. 
19147
19148 2002-07-17  Martin Baulig  <martin@gnome.org>
19149
19150         * const.cs (Const.LookupConstantValue): Add support for constant
19151         `unchecked' and `checked' expressions.
19152         Also adding test case test-140.cs for this.
19153
19154 2002-07-17  Martin Baulig  <martin@gnome.org>
19155
19156         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19157         check whether mi.ReturnType implements the IEnumerator interface; the
19158         `==' and the IsAssignableFrom() will fail in this situation.
19159
19160 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19161
19162         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19163         here too.
19164
19165 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19166
19167         * expression.cs: fixed bug #27811.
19168
19169 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19172         Molaro: when we are a ref, the value already contains a pointer
19173         value, do not take the address of it.
19174
19175 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19176         * removed mb-parser.jay and mb-tokenizer.cs
19177
19178 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19179
19180         * expression.cs: check against the building corlib void type.
19181
19182 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19183
19184         * ecore.cs: fix for valuetype static readonly fields: when 
19185         initializing them, we need their address, not the address of a copy.
19186
19187 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19188
19189         * typemanager.cs: register also enum_type in corlib.
19190
19191 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19192
19193         * class.cs: allow calling this (but not base) initializers in structs.
19194
19195 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19196
19197         * ecore.cs: make sure we compare against the building base types
19198         in GetTypeSize ().
19199
19200 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19201
19202         * typemanager.cs: fix TypeToCoreType() to handle void and object
19203         (corlib gets no more typerefs after this change).
19204
19205 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19206
19207         * expression.cs (ArrayCreation.EmitArrayArguments): use
19208         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19209
19210         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19211         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19212         array indexes, the runtime actually forbids them.
19213
19214         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19215         for array arguments here.
19216
19217         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19218         instead of the default for ValueTypes.
19219
19220         (New.DoEmit): Use IsValueType instead of
19221         IsSubclassOf (value_type)
19222         (New.DoResolve): ditto.
19223         (Invocation.EmitCall): ditto.
19224
19225         * assign.cs (Assign): ditto.
19226
19227         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19228         Statements *are* currently doing part of their resolution during
19229         Emit.  
19230
19231         Expressions do always resolve during resolve, but statements are
19232         only required to propagate resolution to their children.
19233
19234 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19235
19236         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19237
19238         (LoadAssembly): Do not add the dll if it is already specified
19239
19240         (MainDriver): Add the System directory to the link path at the end,
19241         after all the other -L arguments. 
19242
19243         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19244         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19245         ldelem.u1) and using the opposite for sbytes.
19246
19247         This fixes Digger, and we can finally run it.
19248
19249         * driver.cs (UnixParseOption): Move the option parsing here.  
19250         (CSCParseOption): Implement CSC-like parsing of options.
19251
19252         We now support both modes of operation, the old Unix way, and the
19253         new CSC-like way.  This should help those who wanted to make cross
19254         platform makefiles.
19255
19256         The only thing broken is that /r:, /reference: and /lib: are not
19257         implemented, because I want to make those have the same semantics
19258         as the CSC compiler has, and kill once and for all the confussion
19259         around this.   Will be doing this tomorrow.
19260
19261         * statement.cs (Unsafe.Resolve): The state is checked during
19262         resolve, not emit, so we have to set the flags for IsUnsfe here.
19263
19264 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19265
19266         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19267         not catch the Error_ObjectRefRequired in SimpleName (as it is
19268         possible to have a class/instance variable name that later gets
19269         deambiguated), we have to check this here.      
19270
19271 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19272
19273         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19274         make static and put into Expression.
19275
19276         (Event.Define): Register the private field of the event with the 
19277         TypeManager so that GetFieldFromEvent can get at it.
19278
19279         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19280         keep track of the private field associated with an event which
19281         has no accessors.
19282
19283         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19284         private field.
19285
19286         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19287
19288 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19289
19290         * expression.cs (Binary.EmitBranchable): this routine emits the
19291         Binary expression in a branchable context.  This basically means:
19292         we need to branch somewhere, not just get the value on the stack.
19293
19294         This works together with Statement.EmitBoolExpression.
19295
19296         * statement.cs (Statement.EmitBoolExpression): Use
19297         EmitBranchable. 
19298
19299 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19300
19301         * statement.cs (For): Reduce the number of jumps in loops.
19302
19303         (For): Implement loop inversion for the For statement.
19304
19305         (Break): We can be breaking out of a Try/Catch controlled section
19306         (foreach might have an implicit try/catch clause), so we need to
19307         use Leave instead of Br.
19308
19309         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19310         now).  If the instace expression supports IMemoryLocation, we use
19311         the AddressOf method from the IMemoryLocation to extract the
19312         address instead of emitting the instance.
19313
19314         This showed up with `This', as we were emitting the instance
19315         always (Emit) instead of the Address of This.  Particularly
19316         interesting when This is a value type, as we dont want the Emit
19317         effect (which was to load the object).
19318
19319 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19320
19321         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19322
19323         * statement.cs (Checked): Set the CheckedState during the resolve
19324         process too, as the ConvCast operations track the checked state on
19325         the resolve process, and not emit.
19326
19327         * cs-parser.jay (namespace_member_declaration): Flag that we have
19328         found a declaration when we do.  This is used to flag error 1529
19329
19330         * driver.cs: Report ok when we display the help only.
19331
19332 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19333
19334         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19335
19336 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19337
19338         * cs-tokenizer.cs (define): We also have to track locally the
19339         defines.  AllDefines is just used for the Conditional Attribute,
19340         but we also need the local defines for the current source code. 
19341
19342 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19343
19344         * statement.cs (While, For, Do): These loops can exit through a
19345         Break statement, use this information to tell whether the
19346         statement is the last piece of code.
19347
19348         (Break): Flag that we break.
19349
19350         * codegen.cs (EmitContexts): New `Breaks' state variable.
19351
19352 2002-07-03  Martin Baulig  <martin@gnome.org>
19353
19354         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19355         modifiers in method declarations in structs.  Otherwise, you won't
19356         be able to override things like Object.Equals().
19357
19358 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19359
19360         * class.cs (Method, Property, Indexer): Do not allow the public
19361         modifier to be used in explicit interface implementations.
19362
19363         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19364         override modifiers in method declarations in structs
19365
19366 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19367
19368         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19369         integer or real overflow, report an error
19370
19371 2002-07-02  Martin Baulig  <martin@gnome.org>
19372
19373         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19374         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19375         to tell the runtime about our newly created System.Object and
19376         System.ValueType types.
19377
19378 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19379
19380         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19381         struct instead of Ldarg/Starg.
19382
19383 2002-07-02  Martin Baulig  <martin@gnome.org>
19384
19385         * expression.cs (Indirection.Indirection): Call
19386         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19387
19388 2002-07-02  Martin Baulig  <martin@gnome.org>
19389
19390         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19391         ValueType, call TypeManager.TypeToCoreType() on it.
19392         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19393         the OpCodes.Newarr argument.
19394
19395 2002-07-02  Martin Baulig  <martin@gnome.org>
19396
19397         * expression.cs (Invocation.EmitCall): When compiling corlib,
19398         replace all calls to the system's System.Array type to calls to
19399         the newly created one.
19400
19401         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19402         System.Array methods.
19403         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19404         from the system's System.Array type which must be replaced.
19405
19406 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19407
19408         * typemanager.cs: load unverifiable_code_ctor so we can build
19409         corlib using the correct type. Avoid using GetTypeCode() with
19410         TypeBuilders.
19411         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19412         TypeManager.object_type to allow building corlib.
19413
19414 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19415
19416         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19417
19418 2002-07-01  Martin Baulig  <martin@gnome.org>
19419
19420         * class.cs: Make the last change actually work, we need to check
19421         whether `ifaces != null' to avoid a crash.
19422
19423 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19424
19425         * class.cs: when we build structs without fields that implement
19426         interfaces, we need to add the interfaces separately, since there is
19427         no API to both set the size and add the interfaces at type creation
19428         time.
19429
19430 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19431
19432         * expression.cs: the dimension arguments to the array constructors
19433         need to be converted if they are a long.
19434
19435 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19436
19437         * class.cs: don't emit ldarg.0 if there is no parent constructor
19438         (fixes showstopper for corlib).
19439
19440 2002-06-29  Martin Baulig  <martin@gnome.org>
19441
19442         MCS now compiles corlib on GNU/Linux :-)
19443
19444         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19445         ie. check for MethodImplOptions.InternalCall.
19446
19447         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19448         and TypeManager.attribute_type are null, so we must explicitly check
19449         whether parent is not null to find out whether it's an attribute type.
19450         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19451         and SetBuilder, not only if the property is neither abstract nor external.
19452         This is necessary to set the MethodImplOptions on the accessor methods.
19453         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19454         SetBuilder, see Property.Emit().
19455
19456         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19457         populate "System.Object", "System.ValueType" and "System.Attribute" since
19458         they've already been populated from BootCorlib_PopulateCoreTypes().
19459
19460 2002-06-29  Martin Baulig  <martin@gnome.org>
19461
19462         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19463         is the NullLiteral, we also need to make sure that target_type is not
19464         an enum type.   
19465
19466 2002-06-29  Martin Baulig  <martin@gnome.org>
19467
19468         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19469         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19470         before calling BootstrapCorlib_ResolveDelegate ().
19471
19472 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19473
19474         * statement.cs: fixed build-breaker. All tests passed ok.
19475
19476 2002-06-27  Martin Baulig  <martin@gnome.org>
19477
19478         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19479         for System.Decimal when compiling corlib.
19480
19481 2002-06-27  Martin Baulig  <martin@gnome.org>
19482
19483         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19484         switch blocks which contain nothing but a default clause.
19485
19486 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19487
19488        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19489
19490 2002-06-27  Martin Baulig  <martin@gnome.org>
19491
19492         * ecore.cs (PropertyExpr.PropertyExpr): Call
19493         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19494
19495         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19496         is already a TypeBuilder.
19497
19498 2002-06-27  Martin Baulig  <martin@gnome.org>
19499
19500         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19501         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19502         the "from an array-type to System.Array" case.  This makes it work
19503         when compiling corlib.
19504
19505 2002-06-27  Martin Baulig  <martin@gnome.org>
19506
19507         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19508         non-static PropertyExpr, set its InstanceExpression.  This makes
19509         the `ICollection.Count' property work in System/Array.cs.
19510
19511 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19512
19513         * driver.cs: Made error handling more consistent.  Errors now
19514         tracked by Report class, so many methods which used to return int
19515         now return void.  Main() now prints success/failure and 
19516         errors/warnings message.
19517
19518         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19519         the magic number return values (123 and 124).  Now, if the
19520         expected error occurs, the compiler exits with success (exit value
19521         0).  If the compilation completes without seeing that particular
19522         error, the compiler exits with failure (exit value 1).  The
19523         makefile in mcs/errors has been changed to handle the new behaviour.
19524
19525         * report.cs: Made 'expected error' number a property and renamed
19526         it from 'Probe' to 'ExpectedError'.
19527
19528         * genericparser.cs: Removed error handling support, since it is
19529         now all done by Report class.
19530
19531         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19532         class, so parse() no longer returns an int.
19533
19534         * namespace.cs: Use Report.Error instead of GenericParser.error
19535
19536 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19537
19538         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19539         TypeContainer.AddOperator): At the front of the list put the
19540         explicit implementations, so they get resolved/defined first. 
19541
19542 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19543
19544         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19545         interface type is implemented by this TypeContainer.  Used during
19546         explicit interface implementation.
19547
19548         (Property.Define, Indexer.Define, Method.Define): Validate that
19549         the given interface in the explicit implementation is one of the
19550         base classes for the containing type.
19551
19552         Also if we are explicitly implementing an interface, but there is
19553         no match in the pending implementation table, report an error.
19554
19555         (Property.Define): Only define the property if we are
19556         not explicitly implementing a property from an interface.  Use the
19557         correct name also for those properties (the same CSC uses,
19558         although that is really not needed).
19559
19560         (Property.Emit): Do not emit attributes for explicitly implemented
19561         properties, as there is no TypeBuilder.
19562
19563         (Indexer.Emit): ditto.
19564
19565         Hiding then means that we do not really *implement* a pending
19566         implementation, which makes code fail.
19567
19568 2002-06-22  Martin Baulig  <martin@gnome.org>
19569
19570         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19571         the return value of Object.GetType().  [FIXME: we need to do this whenever
19572         we get a type back from the reflection library].
19573
19574 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19575
19576         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19577
19578 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19579
19580         * attribute.cs: Return null if we can not look up the type.
19581
19582         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19583         the interface types found.
19584
19585         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19586         interface types found.
19587
19588         * typemanager.cs (GetInterfaces): Make this routine returns alll
19589         the interfaces and work around the lame differences between
19590         System.Type and System.Reflection.Emit.TypeBuilder in the results
19591         result for GetInterfaces.
19592
19593         (ExpandInterfaces): Given an array of interface types, expand and
19594         eliminate repeated ocurrences of an interface.  This expands in
19595         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19596         be IA, IB, IC.
19597
19598 2002-06-21  Martin Baulig  <martin@gnome.org>
19599
19600         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19601         on System.Enum.
19602
19603 2002-06-21  Martin Baulig  <martin@gnome.org>
19604
19605         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19606         and called with one of the core types, return the corresponding typebuilder for
19607         that type.
19608
19609         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19610         element type.
19611
19612 2002-06-21  Martin Baulig  <martin@gnome.org>
19613
19614         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19615         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19616         (Expression.ConvertReferenceExplicit): Likewise.
19617
19618         * expression.cs (ElementAccess.DoResolve): Likewise.
19619         (ElementAccess.DoResolveLValue): Likewise.
19620
19621 2002-06-10  Martin Baulig  <martin@gnome.org>
19622
19623         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19624         add the "value" parameter to the parameter list.
19625
19626         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19627         to our caller.
19628
19629 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19630
19631         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19632         the argument to an int, uint, long or ulong, per the spec.  Also
19633         catch negative constants in array creation.
19634
19635 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19636
19637         * class.cs: do not allow the same interface to appear twice in
19638         the definition list.
19639
19640 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19641
19642         * ecore.cs: don't use ldlen with System.Array.
19643
19644 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19645
19646         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19647
19648 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19649
19650         * modifiers.cs: produce correct field attributes for protected
19651         internal. Easy fix so miguel can work on ther harder stuff:-)
19652
19653 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19654
19655         * pending.cs: New file.  Move the code from class.cs here.
19656         Support clearning the pending flag for all methods (when not doing
19657         explicit interface implementation).
19658
19659 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19660
19661         * rootcontext.cs: added a couple more types needed to bootstrap.
19662
19663 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19664
19665         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19666         constructor in the type, instead of any constructor in the type
19667         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19668         a bug in the Mono runtime when applying the params attribute). 
19669
19670 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19671         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19672
19673 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19674
19675         * expression.cs (Unary.ResolveOperator): Use TypeManager
19676         to resolve the type.
19677
19678 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19679
19680         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19681         attached.
19682
19683         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19684         with each member too.
19685
19686         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19687         field builders too - this takes care of the enum member case.
19688
19689 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19690
19691         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19692         address-of operator on both value types and pointers.
19693
19694 2002-06-10  Martin Baulig  <martin@gnome.org>
19695
19696         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19697         PropertyBuilder to the `property_builders' list.
19698
19699         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19700         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19701         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19702         find any indexers which are inherited from an interface.
19703
19704 2002-06-09  Martin Baulig  <martin@gnome.org>
19705
19706         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19707         the same type as the constant if necessary.  There's also a test-130.cs
19708         for this.
19709
19710         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19711
19712         * typemanager.cs (TypeManager.ChangeType): Previously known as
19713         Enum.ChangeEnumType().
19714
19715 2002-06-09  Martin Baulig  <martin@gnome.org>
19716
19717         * expression.cs (Cast.TryReduce): Added support for consts.
19718
19719 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19720
19721         * class.cs (Accessor): Hold attributes information so we can pass
19722         it along.
19723
19724         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19725         Modify to pass in attributes attached to the methods.
19726
19727         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19728
19729         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19730         to handle the Accessor kind :-)
19731
19732         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19733
19734 2002-06-08  Martin Baulig  <martin@gnome.org>
19735
19736         * expression.cs (Unary.TryReduceNegative): Added support for
19737         ULongConstants.
19738
19739 2002-06-08  Martin Baulig  <martin@gnome.org>
19740
19741         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19742         name can't be found in the `defined_names' - the caller will do a
19743         MemberLookup in this case and thus find methods in System.Enum
19744         such as Enum.IsDefined().
19745
19746 2002-06-08  Martin Baulig  <martin@gnome.org>
19747
19748         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19749         Convert.ChangeType() which works with TypeBuilder created types.
19750         (Enum.LookupEnumValue, Enum.Define): Use it here.
19751
19752         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19753         `TypeBuilder.BaseType != null' check.
19754         (TypeContainer.FindMembers): Only lookup parent members if we
19755         actually have a parent.
19756         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19757         (ConstructorInitializer.Resolve): Likewise.
19758
19759         * interface.cs (Interface.FindMembers): Added
19760         `TypeBuilder.BaseType != null' check.
19761
19762         * rootcontext.cs (RootContext.ResolveCore): Added
19763         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19764         classes_second_stage.
19765
19766         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19767         debug_type and trace_type when compiling with --nostdlib.       
19768
19769 2002-06-07  Martin Baulig  <martin@gnome.org>
19770
19771         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19772         (AddField): Set it to true when adding a non-static field.
19773         (DefineType): Use `have_nonstatic_fields' to find out whether we
19774         have non-static fields, not `Fields != null'.
19775
19776 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19777
19778         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19779         dereferencing a null on the static-field code path)
19780
19781 2002-05-30  Martin Baulig  <martin@gnome.org>
19782
19783         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19784         to take command line arguments.  Use reflection to call the new
19785         custom `Initialize' function on the symbol writer and pass it the
19786         command line arguments.
19787
19788         * driver.cs (--debug-args): New command line argument to pass command
19789         line arguments to the symbol writer.
19790
19791 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19792
19793         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19794         the target type for indexers and properties.  Thanks to Joe for
19795         catching this.
19796
19797 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * typemanager.cs (MethodFlags): returns the method flags
19800         (Obsolete/ShouldIgnore) that control warning emission and whether
19801         the invocation should be made, or ignored. 
19802
19803         * expression.cs (Invocation.Emit): Remove previous hack, we should
19804         not do this on matching a base type, we should do this based on an attribute
19805
19806         Only emit calls to System.Diagnostics.Debug and
19807         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19808         on the command line.
19809
19810         * rootcontext.cs: Global settings for tracing and debugging.
19811
19812         * cs-tokenizer.cs (define): New utility function to track
19813         defines.   Set the global settings for TRACE and DEBUG if found.
19814
19815 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19816
19817         * interface.cs (Populate*): Pass in the TypeContainer as well as
19818         the DeclSpace as parameters so that we can create EmitContexts and
19819         then use that to apply attributes etc.
19820
19821         (PopulateMethod, PopulateEvent, PopulateProperty)
19822         (PopulateIndexer): Apply attributes everywhere.
19823
19824         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19825         etc.
19826
19827         (ApplyAttributes): Update accordingly.
19828
19829         We now apply interface attributes for all members too.
19830
19831 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19832
19833         * class.cs (Indexer.Define); Correctly check if we are explicit
19834         implementation (instead of checking the Name for a ".", we
19835         directly look up if the InterfaceType was specified).
19836
19837         Delay the creation of the PropertyBuilder.
19838
19839         Only create the PropertyBuilder if we are not an explicit
19840         interface implementation.   This means that explicit interface
19841         implementation members do not participate in regular function
19842         lookups, and hence fixes another major ambiguity problem in
19843         overload resolution (that was the visible effect).
19844
19845         (DefineMethod): Return whether we are doing an interface
19846         implementation. 
19847
19848         * typemanager.cs: Temporary hack until we get attributes in
19849         interfaces (Ravi is working on that) and we get IndexerName
19850         support in interfaces.
19851
19852         * interface.cs: Register the indexers as properties.
19853
19854         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19855         warning, I have verified that this is a bug in the .NET runtime
19856         (JavaScript suffers of the same problem).
19857
19858         * typemanager.cs (MemberLookup): When looking up members for
19859         interfaces, the parent of an interface is the implicit
19860         System.Object (so we succeed in searches of Object methods in an
19861         interface method invocation.  Example:  IEnumerable x;  x.ToString
19862         ()) 
19863
19864 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19865
19866         * class.cs (Event): Events should also register if they do
19867         implement the methods that an interface requires.
19868
19869         * typemanager.cs (MemberLookup); use the new GetInterfaces
19870         method. 
19871
19872         (GetInterfaces): The code used to lookup interfaces for a type is
19873         used in more than one place, factor it here. 
19874
19875         * driver.cs: Track the errors at the bottom of the file, we kept
19876         on going.
19877
19878         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19879         instance if the method we are calling is static!
19880
19881 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * attribute.cs (ApplyAttributes): Make this function filter out
19884         the IndexerName attribute (as that attribute in reality is never
19885         applied) and return the string constant for the IndexerName
19886         attribute. 
19887
19888         * class.cs (TypeContainer.Emit): Validate that all the indexers
19889         have the same IndexerName attribute, and if so, set the
19890         DefaultName attribute on the class. 
19891
19892         * typemanager.cs: The return value might contain other stuff (not
19893         only methods).  For instance, consider a method with an "Item"
19894         property and an Item method.
19895
19896         * class.cs: If there is a problem with the parameter types,
19897         return. 
19898
19899 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19900
19901         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19902         looks at user defined conversion after making a call to 
19903         StandardConversionExists - we need this for overload resolution.
19904
19905         * expression.cs : Update accordingly the various method calls.
19906
19907         This fixes 2 bugs filed against implicit user defined conversions 
19908
19909 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19910
19911         * statement.cs: Track the result of the assignment.
19912
19913 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19914
19915         * expression.cs (MemberAccess): Improved error reporting for
19916         inaccessible members.
19917
19918 2002-05-22  Martin Baulig  <martin@gnome.org>
19919
19920         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19921         itself with debugging support.
19922
19923 2002-05-22  Martin Baulig  <martin@gnome.org>
19924
19925         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19926         Removed, this isn't needed anymore.
19927
19928 2002-05-20  Martin Baulig  <martin@gnome.org>
19929
19930         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19931         be underlying type for an enum.
19932
19933 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19934
19935         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19936         that splits out the loading of just the core types.
19937
19938         * rootcontext.cs (ResolveCore): Split the struct resolution in
19939         two, so we can load the enumeration underlying types before any
19940         enums are used.
19941
19942         * expression.cs (Is): Bandaid until we fix properly Switch (see
19943         bug #24985 for details).
19944
19945         * typemanager.cs (ImplementsInterface): The hashtable will contain
19946         a null if there are no interfaces implemented.
19947
19948 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19949
19950         * cs-parser.jay (indexer_declarator): It is fine to have array
19951         parameters
19952
19953 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19954
19955         * typemanager.cs: (RegisterBuilder): New function used to register
19956         TypeBuilders that implement interfaces.  Since
19957         TypeBuilder.GetInterfaces (as usual) does not work with lame
19958         Reflection.Emit. 
19959         (AddUserType): register interfaces.
19960
19961         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19962         dealing with TypeBuilder.  Also, arrays are showing up as
19963         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19964         methods can not be invoked on them!
19965
19966         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19967         (ImplicitReferenceConversionExists): Split out from
19968         StandardConversionExists. 
19969
19970         * expression.cs (As): We were only implementing one of the three
19971         cases for the as operator.  We now implement them all.
19972         (Is): Implement the various other cases for Is as well.
19973
19974         * typemanager.cs (CACHE): New define used to control if we want or
19975         not the FindMembers cache.  Seems to have a negative impact on
19976         performance currently
19977
19978         (MemberLookup): Nested types have full acess to
19979         enclosing type members
19980
19981         Remove code that coped with instance/static returns for events, we
19982         now catch this in RealFindMembers.
19983
19984         (RealFindMembers): only perform static lookup if the instance
19985         lookup did not return a type or an event.  
19986
19987 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * assign.cs (CompoundAssign): We pass more semantic information
19990         now to Compound Assignments than we did before: now we have all
19991         the information at hand, and now we resolve the target *before* we
19992         do the expression expansion, which allows the "CacheValue" method
19993         to have the effect we intended (before, a [x] += 1 would generate
19994         two differen ArrayAccess expressions from the ElementAccess,
19995         during the resolution process).
19996
19997         (CompoundAssign.DoResolve): Resolve target and original_source here.
19998
19999 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
20000
20001         * expression.cs (ArrayAccess): dropped debugging information. 
20002
20003         * typemanager.cs: Small bug fix: I was always returning i_members,
20004         instead of one of i_members or s_members (depending on which had
20005         the content).
20006
20007         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
20008         method is invoked before any code generation takes place, and it
20009         is a mechanism to inform that the expression will be invoked more
20010         than once, and that the method should use temporary values to
20011         avoid having side effects
20012
20013         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20014
20015         * ecore.cs (Expression.CacheTemporaries): Provide empty default
20016         implementation.
20017
20018         * expression.cs (Indirection, ArrayAccess): Add support for
20019         CacheTemporaries in these two bad boys. 
20020
20021         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20022         ldobj or ldind_ref.  
20023         (StoreFromPtr): Handle stobj as well.
20024
20025         * expression.cs (UnaryMutator): Share more code.
20026
20027         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20028         down: I was not tracking the Filter function as well, which
20029         was affecting the results of the cache.
20030
20031 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
20032
20033         * attribute.cs: Remove the hack to handle the CharSet property on
20034         StructLayouts. 
20035
20036 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20037
20038         * attribute.cs (DoResolve): More uglyness, we now only try to
20039         resolve the attribute partially, to extract the CharSet
20040         information (only if we are a StructLayout attribute).  Otherwise 
20041
20042         (GetExtraTypeInfo): Add some code to conditionally kill in the
20043         future this.   I am more and more convinced that the .NET
20044         framework has special code to handle the attribute setting on
20045         certain elements.
20046
20047         * expression.cs (IsParamsMethodApplicable): Revert my previous
20048         foreach change here, it was wrong.
20049
20050 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20051
20052         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20053         (pp_expr): do not abort on unknown input, just return.
20054         (eval): abort if there are pending chars.
20055
20056         * attribute.cs (Attribute.Resolve): Positional parameters are
20057         optional.  Deal with that case.
20058
20059         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20060         the Ansi/Unicode/Auto information for the type.
20061
20062         (TypeContainer.DefineType): instantiate the EmitContext here, as
20063         we will be using it during the type definition (to resolve
20064         attributes) and during the emit phase.
20065
20066         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20067         to pull type information out of the attributes
20068
20069         (Attribute.Resolve): track the constructor builder, and allow for
20070         multiple invocations (structs and classes will use this).
20071
20072         * ecore.cs (MemberLookupFinal): new version with all the
20073         parameters customizable.
20074
20075         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20076         constructors.  Return if the result value is null (as the error
20077         would have been flagged already by MemberLookupFinal)
20078
20079         Do not allow instances of abstract classes or interfaces to be
20080         created.
20081
20082         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20083         We have to compare the assembly property here when dealing with
20084         FamANDAssem and Assembly access modifiers, because we might be
20085         creating an assembly from *modules* (that means that we are not
20086         getting TypeBuilders for types defined in other modules that are
20087         part of this assembly).
20088
20089         (Method.Emit): If the method is marked abstract and has a body,
20090         emit an error. 
20091
20092         (TypeContainer.DefineMembers): If both the defined member and the
20093         parent name match are methods, then do not emit any warnings: let
20094         the Method.Define routine take care of flagging warnings.  But if
20095         there is a mismatch (method overrides something else, or method is
20096         overriwritten by something, then emit warning).
20097
20098         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20099         set to null, this means `do not check for the return type on the
20100         signature'. 
20101
20102         (Method.Define): set the return type for the method signature to
20103         null, so that we get methods with the same name and parameters and
20104         different return types.  This is used to flag warning 114 (you are
20105         hiding a method, and you probably want to use the new/override
20106         keywords instead).
20107
20108         * typemanager.cs (MemberLookup): Implemented proper access
20109         control, closing a long standing set of bug reports.  The problem
20110         was that the Framework only has two bits: Public and NonPublic,
20111         and NonPublic includes private and protected methods, but we need
20112         to enforce the FamANDAssem, FamOrAssem and Family. 
20113
20114 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20115
20116         * statement.cs (GotoCase): Return true: Ammounts to giving up
20117         knowledge on whether we return or not, and letting the other case
20118         be responsible for it.
20119
20120 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20121
20122         * driver.cs: Do not load directories for each file processed, only
20123         do it if there is a pattern.
20124
20125         * ecore.cs: Report readonly assigns here as well, as we might have
20126         been resolved only by MemberAccess.
20127
20128         (SimpleName.SimpleNameResolve): Also be useful for LValue
20129         resolution.   We need this to propagate assign to local readonly variables
20130
20131         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20132         do not want to reuse potential criteria memory.
20133
20134         * class.cs (MyEventBuilder): Set reflected_type;
20135
20136         * ecore.cs (Constantify): Added support for constifying bools.
20137
20138         (RootContext.LookupType): Added a cache for values looked up in
20139         the declaration space.
20140
20141         * typemanager.cs (FindMembers): Now is a front-end to
20142         RealFindMembers, and provides a two-level hashtable-based cache to
20143         the request.  
20144
20145         15% performance improvement: from 22.5 to 19.2 seconds.
20146
20147         * expression.cs (IsParamsMethodApplicable): use foreach.
20148         (Invocation.DoResolve): ditto.
20149         (New.DoResolve): ditto.
20150         (ArrayCreation.DoResolve): ditto.
20151
20152         * ecore.cs (FindMostEncompassingType): use foreach.
20153
20154         * delegate.cs (NewDelegate.DoResolve): Use foreach
20155
20156         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20157         (RemoveMethods): use foreach.
20158
20159         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20160         nested foreach statements instead of for, and also break out of
20161         the inner loop once a match is found.
20162
20163         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20164
20165 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20166
20167         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20168         we actually unwrap the expression to allow for extra information
20169         to be extracted. 
20170
20171         * expression.cs: Use Shr_Un on unsigned operations. 
20172
20173 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20174
20175         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20176         applicable operators was not being considered correctly. This closes
20177         the bug Miguel reported.
20178
20179 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20180
20181         * attribute.cs: check that the type derives from System.Attribute
20182         and report the correct error in that case (moved the duplicate code to
20183         its own method, too).
20184
20185 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20186
20187         * attribute.cs: lookup attribute type name as the spec says: first the
20188         bare attribute name and then name + "Attribute" (nant compiles with
20189         mcs after this fix).
20190
20191 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20192
20193         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20194         Because of the way we parse things, we should try to see if a
20195         UIntConstant can fit in an integer.
20196
20197 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20198
20199         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20200         when we are in an explicit context.
20201
20202         (ConvertReferenceExplicit): When converting from Iface type S to Class
20203         T make sure the rules are implemented as an OR.
20204
20205         * parameter.cs (ParameterType): Make it a property for now although the
20206         purpose really isn't anything immediate.
20207
20208         * expression.cs (Is*Applicable): Do better checking on the parameter type
20209         of a ref/out parameter. The ones from the system assemblies are already 
20210         marked with the correct type so we don't need to do any correction.
20211
20212         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20213         the object type is standard too so include that.
20214
20215 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20216
20217         * ecore.cs (StandardConversionExists): Augment with missing code:
20218         deal with IntConstant, LongConstants and Enumerations.
20219
20220         * assign.cs: Report the error, instead of failing silently
20221
20222         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20223         typecontainer that they are declared, because the
20224         typecontainer/namespace will have the list of using clauses that
20225         need to be applied.
20226
20227         Assembly Attributes were escaping the normal registration
20228         mechanism. 
20229
20230         (EmitCode): Apply attributes within an EmitContext that represents
20231         the container they were declared on.
20232
20233         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20234
20235 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20236
20237         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20238         Revamp completely - make much cleaner as we now operate only
20239         on a set of Types.
20240
20241         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20242         to implement the logic detailed in the spec more correctly.
20243
20244         (UserDefinedConversion): Update accordingly.
20245
20246 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20247
20248         * statement.cs: Return flow analysis information up.
20249
20250         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20251         and the default.
20252
20253         (token): Do not consume an extra character before calling
20254         decimal_digits.
20255
20256 2002-05-06  Piers Haken <piersh@friskit.com>
20257
20258         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20259
20260 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20261
20262         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20263         EmitContext during the instance constructor initializer
20264         resolution, to stop access to instance variables.
20265
20266         This is mandated by the spec, last paragraph of the `constructor
20267         initializers' section. 
20268
20269 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20270
20271         * cs-parser.jay, class.cs (Accessor): new class used to represent
20272         an accessor (get or set).  In the past we used `null' to represent
20273         a missing accessor.  But this is ambiguous because there was no
20274         way to tell in abstract indexers/properties if one of them was
20275         specified.
20276
20277         Now there is a way of addressing that.
20278
20279         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20280         instead of FindMembers.
20281
20282         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20283         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20284
20285         * attribute.cs: Treat indexers and properties as the same in terms
20286         of applying attributes
20287
20288         * ecore.cs (FindMostEncompassedType): Use statically initialized
20289         EmptyExpressions()s like we do elsewhere to avoid creating useless
20290         objects (and we take this out of the tight loop).
20291
20292         (GetConversionOperators): Move the code to extract the actual
20293         operators to a separate routine to clean things up.
20294
20295 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20296
20297         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20298         events are always registered FieldBuilders.
20299
20300         * class.cs (FieldBase): New class shared by Fields 
20301
20302         * delegate.cs: If we are a toplevel delegate, use our full name.
20303         If we are a nested delegate, then only use our tail name.
20304
20305 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20306
20307         * expression.cs (IsApplicable): Ensure that we add the "&" to
20308         ref/out types before comparing it with the type of the argument.
20309
20310         (IsParamsMethodApplicable): Ditto.
20311
20312         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20313         silly me ;-)
20314
20315         * delegate.cs : Handle the case when we have more than one applicable
20316         method. Flag an error only when we finish checking all.
20317
20318 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * expression.cs: Add support for boolean static initializers.
20321
20322 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20323
20324         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20325
20326         * parameter.cs (ComputeParameterTypes,
20327         ComputeAndDefineParameterTypes): Better error handling: now we
20328         clear the `types' cache if we fail during any of the type lookups.
20329         We also return the status code correctly to our caller
20330
20331         * delegate.cs: If we fail to define a delegate, abort the extra
20332         steps. 
20333
20334         * expression.cs (Binary.ResolveOperator): for
20335         operator==(object,object) and operator !=(object, object) we also
20336         have to verify that there is an implicit conversion from one to
20337         the other.
20338
20339         (ArrayAccess.DoResolve): Array Access can operate on
20340         non-variables. 
20341
20342 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20343
20344         * assign.cs (CompoundAssign): A new class used as a "flag" that
20345         the assignment actually is happening as part of a compound
20346         assignment operator.
20347
20348         During compound assignment, a few new rules exist to enable things
20349         like:
20350
20351         byte b |= 1 + 2
20352
20353         From the spec:
20354
20355         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20356         to the type of x) if y is implicitly convertible to the type of x,
20357         and the operator is a builtin operator and the return type of the
20358         operator is explicitly convertible to the type of x. 
20359
20360         * rootcontext.cs: Reset warning level to 2.  4 catches various
20361         "interesting" features in mcs, we must clean this up at some
20362         point, but currently am trying to kill other bugs ;-)
20363
20364         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20365         in container classes as well.  
20366
20367         * expression.cs (Binary.ResolveOperator): Handle string case
20368         before anything else (as operator overloading does emit an error
20369         before doing anything else).
20370
20371         This code could go away when we move to a table driven model, but
20372         i could not come up with a good plan last night.
20373
20374 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20375
20376         * typemanager.cs (CSharpName): reimplementation using regex.
20377         * class.cs: added null check for fields in Emit
20378         * rootcontext.cs: set warninglevel to 4
20379
20380 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20381
20382         * typemanager.cs (CSharpName): reimplemented with Lupus
20383         suggestion.
20384
20385 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20386
20387         * statement.cs (If): correclty implement Resolve, because we were
20388         not catching sem errors in there.  The same process is needed
20389         everywhere else. 
20390         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20391
20392
20393         (Statement.Warning_DeadCodeFound): Factorize code.
20394         (While): Report dead code here too.
20395
20396         (Statement): Added Resolve virtual method to allow
20397         for resolution split from the emit code.
20398
20399 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20400
20401         * statement.cs (EmitBoolExpression): No longer try to resolve the
20402         expression here.    
20403         (MakeBoolean): New utility function that resolve, implicitly
20404         converts to boolean and tags the expression. 
20405
20406
20407         (If, Do): Implement dead code elimination.
20408         (While): Implement loop inversion
20409
20410         (Do, While, For, If): Resolve the expression prior to calling our
20411         code generation.
20412
20413 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20414
20415         * class.cs:
20416           - added method Report28 (warning: program has more than one entry point)
20417           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20418           - modified method Method.Define, the part at the end of the method
20419
20420         * rootcontext.cs: added static public Location EntryPointLocation;
20421           
20422         * ../errors/cs0028.cs : Add test case for the above warning.              
20423
20424         * typemanager.cs:
20425           - modified method CSharpName to allow arrays of primitive type to
20426             be printed nicely (e.g. instead of System.Int32[][] it now prints
20427             int[][])
20428           - added method CSharpSignature: returns the signature of a method
20429             in string format to be used in reporting errors, warnings, etc.
20430
20431         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20432         with String.Empty.
20433
20434 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20435
20436         * delegate.cs (Define): Fix extremely silly bug where I was
20437         setting the type of the 'object' parameter of the BeginInvoke
20438         method to System.IAsyncResult instead of System.Object ;-)
20439
20440 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20441
20442         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20443         here. 
20444
20445         (Constructor.Emit): return if we fail to initialize the
20446         constructor.  Another door closed!  
20447
20448         * expression.cs (New.DoResolve): Improve error message (from -6 to
20449         1501).  Use DeclaredOnly lookup to find the exact constructor.
20450
20451         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20452         loop.  This is useful.
20453
20454         * cs-parser.jay: Adjust the default parameters so that destructors
20455         have the proper signature.
20456
20457 2002-04-26  Martin Baulig  <martin@gnome.org>
20458
20459         * driver.cs (LoadAssembly): If `assembly' contains any characters
20460         which are only valid in path names and not in assembly names
20461         (currently slash, backslash and point), use Assembly.LoadFrom ()
20462         instead of Assembly.Load () on the `assembly' (before iteration
20463         over the link_paths).
20464
20465 2002-04-26  Martin Baulig  <martin@gnome.org>
20466
20467         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20468
20469 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20470
20471         * class.cs (Property): use the new typemanager.MemberLookup
20472
20473         (TypeContainer.MemberLookup): Implement using the
20474         TypeManager.MemberLookup now. 
20475
20476         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20477         and return MemberInfos, so that these can be used without an
20478         EmitContext (what we had before).
20479
20480 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20481
20482         * expression.cs: Fix the case where the argument to params if the
20483         type of the params.  I omitted handling this before.   Fixed
20484
20485 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20486
20487         * driver.cs: Call BootCorlib_PopulateCoreType
20488
20489         * class.cs (Property.CheckBase): Check for properties only, not
20490         for all members. 
20491
20492         * interface.cs: Temporary hack: try/catch around the
20493         CustomAttributeBuilder, because I am getting an exception that I
20494         do not understand.
20495
20496         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20497         types whose definitions are required to be there (attributes are
20498         defined before standard types).
20499
20500         Compute definitions as we boot the various types, as they are used
20501         immediately (value_type class will need object_type, but if we do
20502         not initialize object_type, we will pass a null, which will let
20503         the runtime pick the System.Object from the existing corlib, which
20504         is not what we want).
20505
20506 2002-04-22  Patrik Torstensson <totte@labs2.com>
20507
20508         * cs-tokenizer.cs: fixed a number of trim() issues.
20509
20510 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20511
20512         * expression.cs (Argument.Type): Ensure that we return the correct
20513         type when we have out or ref parameters [in which case we 
20514         append a "&"].
20515
20516 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20517
20518         * class.cs (Property, Indexer): Allow extern modifier in there. 
20519
20520         * typemanager.cs (InitBaseTypes): Initializes object_type and
20521         value_type, since those will be used early on during the bootstrap
20522         process to compile corlib.
20523
20524         (InitCoreTypes): Move code from here to InitBaseTypes.
20525
20526 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20527
20528         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20529         single-dimension arrays as using the ldlen opcode.  
20530
20531         Daniel Lewis discovered this optimization.  
20532
20533         * typemanager.cs: Add signature for System.Array::get_Length
20534
20535 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20536
20537         * statement.cs: report the error when the foreach does not apply to an
20538         array nor a collection.
20539
20540 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20541
20542         * expression.cs: Add implicit conversions to the operator ~.
20543
20544         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20545
20546         * typemanager.cs: Locate the decimal constructor.
20547
20548 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20549
20550         * attribute.cs: use the new property of TypeOf.
20551         * expression.cs: added 'get' property around typearg.
20552
20553         These changes fix a build breaker reported by NickD. Is this the
20554         correct way to fix?  If not, please, revert my changes and make it
20555         work :-).
20556
20557 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20558
20559         * attribute.cs: Add support for typeof in attribute invocations.
20560         I am not sure that this is right though.
20561
20562 2002-04-14  Duncan Mak  <duncan@ximian.com>
20563
20564         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20565         Binary.Operator.Division case.
20566
20567 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20568
20569         * class.cs (DefineType): Ensure that we do a proper check on
20570         attribute types and also register it with the TypeManager.
20571
20572         (TypeContainer.Targets): The default for attribute types is
20573         AttributeTargets.All.
20574
20575         * attribute.cs (ApplyAttributes): Registering the attribute type
20576         is done elsewhere, not when we discover we have a Usage attribute.
20577
20578 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20579
20580         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20581         and get rid of is_delegate parameter.
20582
20583         * everywhere : update.
20584
20585 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20586
20587         * cs-parser.jay (compilation_unit): Revamp completely to use
20588         some new ideas that I got from Rhys' grammar to solve the problems
20589         with assembly level attributes.
20590
20591         (outer_declaration): New grammar production.
20592
20593         (attribute_sections): Add.
20594
20595         (opt_attributes): Base on attribute_sections
20596
20597         (namespace_declaration): Allow opt_attributes to tackle the case
20598         when we have assembly level attributes - we are clever in this
20599         regard now ;-)
20600
20601         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20602         attributes in the non-global context.
20603
20604         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20605         instead of SetGlobalAttributes.
20606
20607         * class.cs, rootcontext.cs : Ensure we define and generate 
20608         attribute types before anything else.
20609
20610         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20611         and flag the new error -20 for the case when the attribute type
20612         does not have valid targets specified. csc does not catch this.
20613
20614         * ../errors/errors.txt : update for error # -20
20615
20616 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20617
20618         * support.cs (InternalParameters.ParameterModifier): Do some null
20619         checking and return sane values.
20620
20621         * class.cs (Method.Define): If we are a PInvoke method, ensure
20622         that we are static and extern. Report error # 601
20623
20624         * ../errors/cs0601.cs : Add test case for the above error.
20625
20626 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20627
20628         * rootcontext.cs (attribute_types): We need to keep type of
20629         all attribute types separately and emit code for them first.
20630
20631         (RegisterAttribute) : Implement.
20632
20633         * class.cs (DefineType): Check if the current Type is a custom
20634         attribute type and register it accordingly.
20635
20636         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20637         adding the first attribute twice and rename to
20638
20639         (SetGlobalAttributes): this.
20640
20641         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20642         lookups.
20643
20644         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20645         if we are processing global arguments. Hmm, I am unsure of this.
20646
20647 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20648
20649         * expression.cs: added static array of strings to avoid calling
20650         Enum.ToString () for Operator in Binary. Significant recover of
20651         performance.
20652
20653 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20654
20655         * class.cs (FindMembers): Allow the Builders of the various
20656         members to be null.  If they are skip them.  This only happens
20657         during the PInvoke declaration.
20658
20659 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20660
20661         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20662         failure, so we do not keep going afterwards.
20663
20664         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20665         wanted to pass `false' as the `is_delegate' argument.  If this is
20666         the case, why not use delegate_type == null to mean `is_delegate =
20667         false' and anything else as is_delegate = true.
20668
20669 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20670
20671         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20672         code for the section, not the beginning of the tests.
20673
20674 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20675
20676         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20677
20678         * expression.cs (Binary): same.  Warn about errors where we have
20679         Enum/Enum in operator + as well.
20680
20681 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20682
20683         * statement.cs:
20684                 - added support for switch(bool)
20685                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20686                 - add TableSwitchEmit() to handle table-based switch statements
20687
20688 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20689
20690         * expression.cs (Invocation.OverloadResolve): Factor out code which
20691         does parameter compatibility checking with arguments so that we can 
20692         re-use the code even from Delegate.VerifyApplicability
20693
20694         (VerifyArgumentsCompat): Move above code here.
20695
20696         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20697         and instead make a call to the above method.
20698
20699 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20700
20701         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20702         We use it to keep track of classes which are attribute types.
20703
20704 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20705
20706         * delegate.cs (Delegate.Define): Correctly define the types in the
20707         presence of fixed and array parameters.
20708
20709         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20710         doing FindMembers.
20711
20712         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20713         include NonPublic after the first iteration.
20714
20715         * class.cs (Indexer.CheckBase): Only check if both parents are
20716         non-null. 
20717
20718         * cs-parser.jay (accessor_body): If empty, set to null.
20719
20720         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20721         same code path here to resolve constants names that we did have in
20722         MemberAccess.DoResolve.  There is too much code duplicated here.
20723
20724 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20725
20726         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20727
20728         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20729         to MakeUnionSet.
20730
20731         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20732         tokens, numbers and strings.
20733
20734         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20735         parenthesis.
20736
20737         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20738         asyncronous parameters and the regular parameters.  
20739
20740         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20741         specify the target directory.
20742
20743         * expression.cs: (This.DoResolve): Simplify
20744         (As.Emit): Optimize, do not generate IsInst if the expression is
20745         always of the given type.
20746
20747         (Is.DoResolve): Bug fix, we were reporting both always/never for
20748         the is expression.
20749
20750         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20751         creating too many unnecessary arrays.
20752
20753 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20754
20755         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20756         fields instead of rolling our own initializer.   Takes care of all
20757         implicit conversions, and drops unnecessary static checks/argument.
20758
20759 2002-03-31  Dick Porter  <dick@ximian.com>
20760
20761         * driver.cs: use the GetDirectories() return values properly, and
20762         use "/" as path separator.
20763
20764 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20765
20766         * expression.cs (Unary): Optimize - - expr into expr.
20767         (Binary): Optimize a + (-b) into a -b.
20768
20769         * codegen.cs (CodeGen): Made all methods static.
20770
20771 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20772
20773         * rootcontext.cs: 
20774
20775         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20776         TypeBuilder property.
20777
20778         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20779         instead. 
20780
20781         * tree.cs: Removed the various RecordXXXX, and replaced with a
20782         single RecordDecl.  Removed all the accessor methods, and just
20783         left a single access point Type 
20784
20785         * enum.cs: Rename DefineEnum to DefineType.
20786
20787         * decl.cs: New abstract method `DefineType' used to unify the
20788         Defines for Enumerations, Interfaces, TypeContainers and
20789         Delegates.
20790
20791         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20792         LookupBaseClasses method that used to live in class.cs and
20793         interface.cs here, and renamed to FindType.
20794
20795         * delegate.cs: Implement DefineType.  Take advantage of the
20796         refactored pattern for locating the parent builder without taking
20797         the parent_builder argument (which we know does not work if we are
20798         nested, and triggering a toplevel definition).
20799
20800 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20801
20802         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20803         accessibility of a member has changed during override and report
20804         an error if so.
20805
20806         * class.cs (Method.Define, Property.Define): Only complain on
20807         overrides if the method is private, any other accessibility is
20808         fine (and since we just checked the permission is the same, we are
20809         good to go).
20810
20811         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20812         and elif are processed always.  The other pre-processing
20813         directives are only processed if we are "taking" the path
20814
20815 2002-03-29  Martin Baulig  <martin@gnome.org>
20816
20817         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20818         current location is not Null.
20819
20820         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20821         a separate method so we can profile it.
20822
20823         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20824         `span.Seconds' are just seconds, but no minutes or hours.
20825         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20826
20827 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20828
20829         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20830         Remove the gratuitous set of Final:
20831
20832                                 // If an interface implementation, then we can set Final.
20833                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20834                                     implementing.DeclaringType.IsInterface)
20835                                         flags |= MethodAttributes.Final;
20836
20837         I do not know what I was smoking when I used that.
20838
20839
20840         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20841         step into fixing the name resolution issues for delegates and
20842         unifying the toplevel name resolution.
20843
20844 2002-03-28  Martin Baulig  <martin@gnome.org>
20845
20846         * class.cs (Method.Emit): If we have a symbol writer, call its
20847         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20848         tell it about the current method.
20849
20850         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20851         writer that we're going to emit the first byte of IL code for a new
20852         statement (a new source line).
20853         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20854         EmitContext.Mark() before emitting any code.
20855
20856         * location.cs (SymbolDocument): Return null when we're Null.
20857
20858         * statement.cs (Statement): Moved the `Location loc' variable here.
20859         (Statement.EmitBoolExpression): If we have a symbol writer, call
20860         ec.Mark() before emitting any code to tell it that we're at the
20861         beginning of a new statement.
20862         (StatementExpression): Added `Location' argument to the constructor.
20863         (Block): Added public readonly variable `StartLocation' and public
20864         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20865         (Block): Added constructor which takes a start and end location.
20866         (Block.SetEndLocation): New method. This sets the end location.
20867         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20868         local variables we create.
20869         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20870         each statement and do also mark the begin and end of the block.
20871
20872         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20873         tell it the current lexer.Location, use Location.Null for the end of the
20874         block.
20875         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20876         current block, set its end location using SetEndLocation().
20877         (statement_expression): StatementExpression constructor now takes the
20878         lexer.Location as additional argument.
20879         (for_statement, declare_local_variables): Likewise.
20880         (declare_local_variables): When creating a new implicit block, use the
20881         new Block constructor and pass it the lexer.Location.
20882
20883 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20884
20885         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20886         members also on the parent interfaces recursively.
20887
20888 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20889
20890         * report.cs: Use new formats, since Gonzalo finished the missing
20891         bits. 
20892
20893         * expression.cs (Binary.ResolveOperator): added missing operator|
20894         operator& and operator^ for bool/bool.
20895
20896         * cs-parser.jay: CheckDef now takes a Location argument that is
20897         used to report errors more precisly (instead of reporting the end
20898         of a definition, we try to track something which is a lot closer
20899         to the source of the problem).
20900
20901         * cs-tokenizer.cs: Track global token use, so we can properly flag
20902         the use of #define/#undef after the first token has been seen.
20903
20904         Also, rename the reportXXXX to Error_DescriptiveName
20905
20906         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20907         TypeContainer, so that Enum and Interface can use this too.
20908
20909         * class.cs (TypeContainer.LookupInterfaceOrClass,
20910         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20911         `builder' argument.  Typically this was used to pass the parent
20912         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20913         the definition).  
20914
20915         The problem is that a nested class could trigger the definition of
20916         a toplevel class, and the builder would be obviously wrong in that
20917         case. 
20918
20919         So we drop this argument, and we compute dynamically the
20920         TypeBuilder/ModuleBuilder (the correct information was available
20921         to us anyways from DeclSpace.Parent)
20922
20923         * interface.cs (Interface.DefineInterface): Drop builder
20924         parameter cleanup like class.cs
20925
20926         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20927         like class.cs
20928
20929         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20930         values. 
20931
20932         (Try.Emit): Propagate the returns value from the statement.
20933
20934         (Return.Emit): Even if we are leavning 
20935
20936         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20937
20938         * modifiers.cs: Fix the computation of MethodAttributes flags.
20939
20940 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20941
20942         * driver.cs: allow compilation of files that start with '/'.
20943         Add a default case when checking the argument of --target.
20944
20945 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20946
20947         * interface.cs: Implement the same search algorithm for types in
20948         the interface code.
20949
20950         * delegate.cs: Do not allow multiple definition.
20951
20952         * Recovered ChangeLog that got accidentally amputated
20953
20954         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20955
20956         * rootcontext.cs: Load manually enum to allow core classes to
20957         contain enumerations.
20958
20959         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20960         Update to new static methods in TypeManager.
20961
20962         * typemanager.cs (GetMethod, GetConstructor): Use our
20963         implementation of FindMembers to find the members, since during
20964         corlib compilation, the types are TypeBuilders and GetMethod and
20965         GetConstructor do not work.
20966
20967         Make all methods in TypeManager static.
20968
20969         (InitCodeHelpers): Split the functionality from
20970         the InitCodeTypes function.
20971
20972         * driver.cs: Call InitCodeHelpers after we have populated the
20973         types. 
20974
20975         * cs-parser.jay (delegate_declaration): we did not used to compute
20976         the delegate name correctly for void delegates.
20977
20978 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20979
20980         * rootcontext.cs (RootContext): Init the interface_resolve_order
20981         and type_container_resolve_order always.
20982
20983         (ResolveCore, BootstrapCorlib_ResolveClass,
20984         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20985         compiler when compiling with --nostdlib
20986
20987         * class.cs (TypeContainer.DefineType): Check that our parent is
20988         not null.  This test is most important when we are bootstraping
20989         the core types.
20990
20991         * codegen.cs: Split out the symbol writing code.
20992
20993 2002-03-25  Martin Baulig  <martin@gnome.org>
20994
20995         * driver.cs (-g): Made -g an alias for --debug.
20996
20997 2002-03-24  Martin Baulig  <martin@gnome.org>
20998
20999         * codegen.cs (SymbolWriter): New public variable. Returns the
21000         current symbol writer.
21001         (CodeGen): Added `bool want_debugging_support' argument to the
21002          constructor. If true, tell the ModuleBuild that we want debugging
21003         support and ask it for the ISymbolWriter.
21004         (Save): If we have a symbol writer, call it's Close() method after
21005         saving the assembly.
21006
21007         * driver.c (--debug): New command line argument to create a
21008         debugger information file.
21009
21010         * location.cs (SymbolDocument): New public property. Returns an
21011         ISymbolDocumentWriter object for the current source file or null
21012         if we don't have a symbol writer.
21013
21014 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
21015
21016         * driver.cs (LoadAssembly): Correctly return when all the paths
21017         have been tried and not before.
21018
21019         * statement.cs (Switch.Emit): return the actual coverage for this
21020         statement (returns/not-returns)
21021
21022         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21023         switch of the statement if we are the last switch section.  That
21024         kills two problems: try/catch problems (we used to emit an empty
21025         nop at the end) and switch statements where all branches would
21026         return. 
21027
21028 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
21029
21030         * driver.cs: Add default assemblies (the equivalent to the
21031         Microsoft CSC.RSP file)
21032
21033         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21034         also update tokens_seen and set it to false.
21035
21036         * driver.cs: Implement --recurse for Mike.
21037
21038         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21039         correctly splitting out the paths.
21040
21041 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21042
21043         * interface.cs (Interface.PopulateProperty): Instead of using
21044         `parent' as the declaration space for the set parameters, use
21045         `this' 
21046
21047         * support.cs (InternalParameters): InternalParameters constructor
21048         takes a DeclSpace instead of a TypeContainer.
21049
21050         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21051         types are being initialized, load the address of it before calling
21052         the function.  
21053
21054         (New): Provide a mechanism to disable the generation of local
21055         value type temporaries when the caller will be providing us with
21056         an address to store it.
21057
21058         (ArrayCreation.EmitDynamicInitializers): Use it.
21059
21060 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21061
21062         * expression.cs (Invocation.EmitArguments): Only probe for array
21063         property if there is more than one argument.  Sorry about that.
21064
21065         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21066         empty param arrays.
21067
21068         * class.cs (Method.LabelParameters): Fix incorrect code path that
21069         prevented the `ParamArrayAttribute' from being applied to the
21070         params attribute.
21071
21072 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21073
21074         * support.cs (ReflectionParameters): Correctly compute whether the
21075         last argument is a params array.  Fixes the problem with
21076         string.Split ('a')
21077
21078         * typemanager.cs: Make the assemblies array always be non-null
21079         (empty, but non-null)
21080
21081         * tree.cs (RecordDecl): New function that abstracts the recording
21082         of names.  This reports error 101, and provides a pointer to the
21083         previous declaration.  Fixes a crash in the compiler.
21084
21085         * cs-parser.jay (constructor_declaration): Update to new grammar,
21086         and provide a constructor_body that can be empty.
21087
21088 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21089
21090         * driver.cs: Add support for --resources.
21091
21092         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21093         Make all types for the various array helper methods be integer.
21094
21095         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21096         CheckState to ConvCast.
21097
21098         (ConvCast): Now it takes a `checked' state argument, to avoid
21099         depending on the emit context for the conversion, and just using
21100         the resolve time setting.
21101
21102         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21103         instead of Invocation.EmitArguments.  We do not emit the original
21104         arguments, instead we emit those which have been converted to
21105         unsigned int expressions.
21106
21107         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21108
21109         * codegen.cs: ditto.
21110
21111         * expression.cs (LocalVariableReference): Drop the use of the
21112         Store function that depended on the variable index.
21113
21114         * statement.cs (VariableInfo): Drop the `Idx' property from this
21115         class, as this is not taking into account the indexes for
21116         temporaries tat we generate during the execution, getting the
21117         indexes wrong.
21118
21119         * class.cs: First emit class initializers, then call the parent
21120         constructor. 
21121
21122         * expression.cs (Binary): Fix opcode emision.
21123         (UnaryMutator.EmitCode): Support checked code generation
21124
21125         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21126         matches for events for both the Static and Instance scans,
21127         pointing to the same element.   Fix that.
21128
21129 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21130
21131         * rootcontext.cs (ResolveTree): Always set the
21132         interface_resolve_order, because nested interfaces will be calling
21133         into us.
21134
21135         * class.cs (GetInterfaceOrClass): Track the same resolution
21136         process used by TypeManager.LookupType.  This fixes the nested
21137         type lookups in class declarations (separate path from
21138         LookupType). 
21139
21140         (TypeContainer.DefineType): Also define nested interfaces.
21141         (TypeContainer.RegisterOrder): New public function used to
21142         register the order in which child interfaces need to be closed.
21143
21144         Nested interfaces need to be closed after their parents have been
21145         created. 
21146
21147         * interface.cs (InterfaceAttr): Put all the logic for computing
21148         the interface attribute here. 
21149
21150         (DefineInterface): Register our interface order with the
21151         RootContext or with the TypeContainer depending on the case.
21152
21153 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21154
21155         * cs-parser.jay: rework foreach statement to work with the new
21156         changes to the policy on SimpleNames.
21157
21158         * report.cs: support Stacktrace on warnings as well.
21159
21160         * makefile: drop --unsafe and /unsafe from the compile.
21161
21162 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21163
21164         * ecore.cs (StandardConversionExists): Modify to take an Expression
21165         as the first parameter. Ensure we do null -> reference type conversion
21166         checking.
21167
21168         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21169         temporary Expression objects.
21170
21171 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21172
21173         * interface.cs: workaround bug in method overloading resolution
21174         (there is already a bugzilla bug for it).
21175
21176 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21177
21178         We could also solve this problem by having a separate path for
21179         performing type lookups, instead of DoResolve, we could have a
21180         ResolveType entry point, and only participating pieces of the
21181         production (simplename, deref, array) would implement this. 
21182
21183         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21184         signal SimpleName to only resolve type names and not attempt to
21185         resolve anything else.
21186
21187         * expression.cs (Cast): Set the flag.
21188
21189         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21190
21191         * class.cs: Only report 108 if there is no `new' modifier.
21192
21193         * cs-parser.jay: rework foreach statement to work with the new
21194         changes to the policy on SimpleNames.
21195
21196         * report.cs: support Stacktrace on warnings as well.
21197
21198         * makefile: drop --unsafe and /unsafe from the compile.
21199
21200 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21201
21202         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21203         lookups here, instead of doing that at parse time.  This means
21204         that our grammar will not introduce `LocalVariableReferences' as
21205         expressions at this point.  That solves the problem of code like
21206         this:
21207
21208         class X {
21209            static void Main ()
21210            { int X = 1;
21211             { X x = null }}}
21212
21213         This is only half the fix.  The full fix requires parameters to
21214         also be handled in this way.
21215
21216         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21217         makes the use more obvious of the DeclSpace.  The
21218         ec.TypeContainer.TypeBuilder is now only used to pull the
21219         TypeBuilder for it.
21220
21221         My theory is that I can get rid of the TypeBuilder completely from
21222         the EmitContext, and have typecasts where it is used (from
21223         DeclSpace to where it matters).  
21224
21225         The only pending problem is that the code that implements Aliases
21226         is on TypeContainer, and probably should go in DeclSpace.
21227
21228         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21229         lookups here, instead of doing that at parse time.  This means
21230         that our grammar will not introduce `LocalVariableReferences' as
21231         expressions at this point.  That solves the problem of code like
21232         this:
21233
21234         class X {
21235            static void Main ()
21236            { int X = 1;
21237             { X x = null }}}
21238
21239         This is only half the fix.  The full fix requires parameters to
21240         also be handled in this way.
21241
21242         * class.cs (Property.DefineMethod): When implementing an interface
21243         method, set newslot, when implementing an abstract method, do not
21244         set the flag (before we tried never setting it, or always setting
21245         it, which is the difference).
21246         (Indexer.DefineMethod): same.
21247         (Method.DefineMethod): same.
21248
21249         * ecore.cs: Only set the status used flag if we get back a Field.
21250
21251         * attribute.cs: Temporary hack, so Paolo can keep working.
21252
21253 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21254
21255         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21256         the unmanaged type in the case we have a MarshalAs attribute.
21257
21258         (Resolve): Handle the case when we are parsing the special MarshalAs
21259         attribute [we need to store the unmanaged type to use later]
21260
21261         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21262         MarshalAs Attribute.
21263
21264         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21265         on parameters and accordingly set the marshalling info.
21266
21267 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21268
21269         * class.cs: Optimizing slightly by removing redundant code after
21270         we switched to the `NoTypes' return value.
21271         (Property.DefineMethod): use NoTypes here too.
21272
21273         This fixes the bug I introduced in my last batch of changes.
21274
21275 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21276
21277         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21278
21279         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21280         Enums since those are types too. 
21281
21282         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21283
21284         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21285         thanks to a call during the lookup process.
21286
21287 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21288
21289         * statement.cs (Foreach): Lots of work to accomodate a particular
21290         kind of foreach statement that I had not kept in mind.  It is
21291         possible to have foreachs on classes that provide a GetEnumerator
21292         method that return objects that implement the "pattern" for using
21293         a foreach, there is no need to support GetEnumerator
21294         specifically. 
21295
21296         This is needed to compile nant.
21297
21298         * decl.cs: Only report 114 if the member is not `Finalize' and if
21299         the warning level is at least 2.
21300
21301         * class.cs: Moved the compare function from Method to
21302         MethodSignature. 
21303
21304         (MethodSignature.InheritableMemberSignatureCompare): Add new
21305         filter function that is used to extract inheritable methods from a
21306         class. 
21307
21308         (Method.Define): Use the new `inheritable_method_signature_filter'
21309         delegate
21310
21311         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21312         command. 
21313
21314 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21315
21316         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21317
21318         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21319
21320         * expression.cs: Pass location information to
21321         ConvertImplicitStandard. 
21322
21323         * class.cs: Added debugging code to track return values from
21324         interfaces. 
21325
21326 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21327
21328         * expression.cs (Is.DoResolve): If either side of the `is' is an
21329         interface, do not flag the warning.
21330
21331         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21332         for interfaces
21333
21334         * report.cs: Allow for --fatal to be used with --probe.
21335
21336         * typemanager.cs (NoTypes): Move the definition for the empty Type
21337         array here. 
21338
21339         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21340         properties. 
21341         (TypeContainer.DefineProxy): New function used to proxy to parent
21342         implementations when implementing interfaces.
21343         (TypeContainer.ParentImplements): used to lookup if our parent
21344         implements a public function that is required by an interface.
21345         (TypeContainer.VerifyPendingMethods): Hook this up.
21346
21347         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21348         `modules' and `assemblies' arraylists into arrays.  We only grow
21349         these are the very early start up of the program, so this improves
21350         the speedof LookupType (nicely measured).
21351
21352         * expression.cs (MakeByteBlob): Replaced unsafe code with
21353         BitConverter, as suggested by Paolo.
21354
21355         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21356         folding of string concatenation, but if either side is a string,
21357         and the other is not, then return null, and let the runtime use
21358         the concatenation on the string plus the object (using
21359         `Object.ToString'). 
21360
21361 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21362
21363         Constant Folding has been implemented now.
21364
21365         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21366         the error instead on types that are not supported in one's
21367         complement. 
21368
21369         * constant.cs (Constant and all children): New set of functions to
21370         perform implict and explicit conversions.
21371
21372         * ecore.cs (EnumConstant): Implement the new functions to perform
21373         conversion by proxying to the child expression.
21374
21375         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21376         own separate setting that can not be turned off from the command
21377         line using --unchecked or --checked and is only controlled using
21378         the checked/unchecked statements and expressions.  This setting is
21379         used by the constant folder to flag errors.
21380
21381         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21382         ConstantCheckState as well.   
21383
21384         During Resolve, they also have to flag the state, because the
21385         constant folder runs completely in the Resolve phase.
21386
21387         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21388         well.
21389
21390 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21391
21392         * cfold.cs: New file, this file contains the constant folder.
21393
21394         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21395         argument to track whether we are using the resulting address to
21396         load or store a value and provide better error messages. 
21397
21398         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21399         new AddressOf arguments.
21400
21401         * statement.cs (Foreach.EmitCollectionForeach): Update
21402
21403         * expression.cs (Argument.Emit): Call AddressOf with proper
21404         arguments to track usage.
21405
21406         (New.DoEmit): Call AddressOf with new arguments.
21407
21408         (Unary.Emit): Adjust AddressOf call.
21409
21410 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21411
21412         * cs-parser.jay (member_access): Change the case for pre-defined types
21413         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21414         this suggestion.
21415
21416         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21417         a method body.
21418
21419         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21420         essentially like methods and apply attributes like MethodImplOptions to them too.
21421
21422         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21423         not being null.
21424
21425         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21426         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21427         is the DeclSpace.
21428
21429         * Update code everywhere accordingly.
21430
21431         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21432
21433         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21434
21435 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21436
21437         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21438         try performing lookups against those instead of jumping straight into using
21439         the 'using' clauses.
21440
21441         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21442
21443         (LookupType): Perform lookups in implicit parents too.
21444
21445         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21446         sequence as RootContext.LookupType. 
21447
21448         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21449         the various cases of namespace lookups into this method.
21450
21451 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21452
21453         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21454         in positional arguments)
21455
21456         * class.cs (Operator): Update the AllowedModifiers to contain
21457         extern. 
21458
21459         * cs-parser.jay: Update operator declaration to allow for the
21460         operator body to be empty.
21461
21462         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21463         values. 
21464
21465 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21466
21467         * class.cs (Method.Emit): Label parameters.
21468
21469         * driver.cs: Return 1 or 0 as the program exit code.
21470
21471 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21472
21473         * expression.cs: Special case the `null' object when trying to
21474         auto-compute the type, as anything can be explicitly converted to
21475         that. 
21476
21477         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21478         spotting this Paolo.
21479
21480         (Expression.ImplicitNumericConversion): Perform comparissions of
21481         the type using the underlying type in the case of an enumeration
21482         rather than using the enumeration type for the compare.
21483
21484         Cope with the underlying == type case, which is not possible to
21485         catch before. 
21486
21487         (Expression.ConvertNumericExplicit): Perform comparissions of
21488         the type using the underlying type in the case of an enumeration
21489         rather than using the enumeration type for the compare.
21490
21491         * driver.cs: If the user does not supply an extension, assume .exe
21492
21493         * cs-parser.jay (if_statement): Rewrote so that we can track the
21494         location for the if statement.
21495
21496         * expression.cs (Binary.ConstantFold): Only concat strings when
21497         the operation is "+", not everything ;-)
21498
21499         * statement.cs (Statement.EmitBoolExpression): Take a location
21500         argument. 
21501         (If, While, Do): Track location.
21502
21503         * expression.cs (Binary.ResolveOperator): In the object + string
21504         case, I was missing a call to ConvertImplicit
21505
21506 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21507
21508         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21509         Location arguments. Ensure we use RootContext.LookupType to do our work
21510         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21511
21512         * interface.cs (PopulateMethod): Handle the type of the parameter being
21513         null gracefully.
21514
21515         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21516         have a params method with no fixed arguments and a call is made with no
21517         arguments.
21518
21519 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21520
21521         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21522         the verbatim-string-literal
21523
21524         * support.cs (InternalParameters.ParameterModifier): handle null
21525         fixed parameters.
21526         (InternalParameters.ParameterType): ditto.
21527
21528         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21529         duplicating the name of the variable parameter.
21530         (GetParameterByName): Fix bug where we were not looking up array
21531         paramters if they were the only present (thanks Paolo!).
21532         (GetParameterInfo): We only have an empty set of types if both
21533         fixed and array are set to null.
21534         (GetParameterInfo-idx): Handle FixedParameter == null
21535
21536         * cs-parser.jay: Handle the case where there is no catch
21537         statements (missing null test).
21538
21539 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21540
21541         * driver.cs (MainDriver): Be conservative on our command line
21542         handling.
21543
21544         Catch DirectoryNotFoundException when calling GetFiles.
21545
21546         (SplitPathAndPattern): Used to split the input specification into
21547         a path and a pattern that we can feed to Directory.GetFiles.
21548
21549 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21550
21551         * statement.cs (Fixed): Implement the last case of the Fixed
21552         statement (string handling).
21553
21554         * expression.cs (StringPtr): New class used to return a char * to
21555         a string;  Used by the Fixed statement.
21556
21557         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21558
21559         * expression.cs (Binary.ResolveOperator): Remove redundant
21560         MemberLookup pn parent type.
21561         Optimize union call, we do not need a union if the types are the same.
21562         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21563         type.
21564
21565         Specialize the use of MemberLookup everywhere, instead of using
21566         the default settings. 
21567
21568         (StackAlloc): Implement stackalloc keyword.
21569
21570         * cs-parser.jay: Add rule to parse stackalloc.
21571
21572         * driver.cs: Handle /h, /help, /?
21573
21574         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21575         before we supported unsafe code.
21576
21577         * makefile: add --unsafe to the self compilation of mcs.
21578
21579 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21580
21581         * expression.cs (PointerArithmetic): New class that is used to
21582         perform pointer arithmetic.
21583         (Binary.Resolve): Handle pointer arithmetic
21584         Handle pointer comparission.
21585         (ArrayPtr): Utility expression class that is used to take the
21586         address of an array.
21587
21588         (ElementAccess): Implement array access for pointers
21589
21590         * statement.cs (Fixed): Implement fixed statement for arrays, we
21591         are missing one more case before we are done.
21592
21593         * expression.cs (Indirection): Implement EmitAssign and set the
21594         ExprClass to Variable.  This allows pointer dereferences to be
21595         treated as variables, and to have values assigned to them.
21596
21597         * ecore.cs (Expression.StoreFromPtr): New utility function to
21598         store values dereferencing.
21599
21600 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21601
21602         * expression.cs (Binary.ResolveOperator): Ensure that we are
21603         not trying to operate on a void type - this fixes the reported
21604         bug.
21605
21606         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21607         the parent implementation is sealed.
21608
21609         * ../errors/cs0239.cs : Add.
21610
21611         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21612
21613         * typemanager.cs (unverifiable_code_type): Corresponds to 
21614         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21615         which have unsafe code in them.
21616
21617         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21618         unsafe context.
21619
21620 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21621
21622         * cs-tokenizer.cs: Add support for @"litreal strings"
21623
21624         Make tokenizer accept pre-processor directives
21625         on any column (remove the old C-like limitation). 
21626
21627         * rootcontext.cs (EmitCode): Emit any global attributes.
21628         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21629
21630         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21631
21632         * cs-parser.jay: Add support for global attributes.  
21633
21634 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21635
21636         * expression.cs (Indirection): New helper class.  Unary will
21637         create Indirection classes to be able to implement the
21638         IMemoryLocation interface on it.
21639
21640 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21641
21642         * cs-parser.jay (fixed_statement): reference the right statement.
21643
21644         * statement.cs (Fixed.Emit): Finish implementing the fixed
21645         statement for the &x case.
21646
21647 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21648
21649         * class.cs (Property.Define, Method.Define): Remove newslot when
21650         `implementing'.  
21651
21652         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21653         wrong.  NewSlot should only be used if the `new' keyword is present.
21654
21655         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21656         locating our system dir.  Sorry about this.
21657
21658 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21659
21660         * driver.cs (GetSystemDir): Compute correctly the location of our
21661         system assemblies.  I was using the compiler directory instead of
21662         the library directory.
21663
21664 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21665
21666         * expression.cs (BetterFunction): Put back in what Miguel commented out
21667         since it is the correct fix. The problem is elsewhere ;-)
21668
21669         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21670         parameters of the parms method are themselves compatible or not !
21671
21672         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21673         to check that a class implements an interface before saying that an implicit
21674         conversion was allowed. Use ImplementsInterface to do the checking.
21675
21676 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21677
21678         * class.cs (Method.Define): Track whether we are an explicit
21679         implementation or not.  And only call DefineMethodOverride if we
21680         are an explicit implementation.
21681
21682         (Property.DefineMethod): Ditto.
21683
21684 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21685
21686         * expression.cs (BetterFunction): Catch hideous bug which was
21687          preventing us from detecting ambiguous calls due to implicit casts i.e
21688         cs0121.
21689
21690 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21691
21692         * support.cs (Pair): Remove un-needed method.  I figured why I was
21693         getting the error in cs-parser.jay, the variable in a foreach loop
21694         is readonly, and the compiler does not really treat this as a variable.
21695
21696         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21697         instead of EQUALS in grammar.  
21698
21699         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21700
21701         * expression.cs (Unary.DoResolve): Check whether the argument is
21702         managed or not.
21703
21704 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21705
21706         * support.cs: Api for Pair to set a value.  Despite the fact that
21707         the variables are public the MS C# compiler refuses to compile
21708         code that accesses the field if the variable is part of a foreach
21709         statement. 
21710
21711         * statement.cs (Fixed): Begin implementation of the fixed
21712         statement.
21713
21714         (Block.AddVariable): Return the VariableInfo on success and null
21715         on failure instead of true/false. 
21716
21717         * cs-parser.jay (foreach): Catch errors on variables already
21718         defined (we were ignoring this value before) and properly unwind
21719         the block hierarchy
21720
21721         (fixed_statement): grammar for the fixed statement.
21722
21723 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21724
21725         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21726         pointer types to be incretemented.
21727
21728         (SizeOf): Implement.
21729
21730         * cs-parser.jay (pointer_member_access): Implement
21731         expr->IDENTIFIER production.
21732
21733         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21734         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21735         on safe contexts.
21736
21737         (Unary): Implement indirection.
21738
21739         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21740         use in non-unsafe context).
21741
21742         (SimpleName.DoResolve): Check for pointers in field access on safe
21743         contexts. 
21744
21745         (Expression.LoadFromPtr): Factor the load-indirect code in this
21746         function.  This was duplicated in UnboxCast and ParameterReference
21747
21748 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21749
21750         * expression.cs (ComposedCast): report an error if a pointer cast
21751         is used in a safe region.
21752
21753         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21754         pointer type casts in unsafe context.
21755
21756         * codegen.cs (EmitContext): Set up IsUnsafe.
21757
21758         * cs-parser.jay (non_expression_type): Add productions for pointer
21759         casts. 
21760
21761         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21762         code.  We should not use force into static mode if the method is
21763         not virtual.  Fixes bug in MIS
21764
21765         * statement.cs (Do.Emit, While.Emit, For.Emit,
21766         Statement.EmitBoolExpression): Add support to Do and While to
21767         propagate infinite loop as `I do return' semantics.
21768
21769         Improve the For case to also test for boolean constants.
21770
21771         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21772         to the list of attributes we can add.
21773
21774         Remove `EmitContext' argument.
21775
21776         * class.cs (Method.Define): Apply parameter attributes.
21777         (Constructor.Define): Apply parameter attributes.
21778         (MethodCore.LabelParameters): Move here the core of labeling
21779         parameters. 
21780
21781         * support.cs (ReflectionParameters.ParameterModifier,
21782         InternalParameters.ParameterModifier): Use IsByRef on the type and
21783         only return the OUT bit for these parameters instead of in/out/ref
21784         flags.
21785
21786         This is because I miss-understood things.  The ParameterInfo.IsIn
21787         and IsOut represent whether the parameter has the [In] and [Out]
21788         attributes set.  
21789
21790 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21791
21792         * ecore.cs (FieldExpr.Emit): Release temporaries.
21793
21794         * assign.cs (LocalTemporary.Release): new function.
21795
21796         * codegen.cs (EmitContext.GetTemporaryStorage,
21797         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21798         temporary storage.  Now we can "put back" localbuilders when we
21799         are done with them
21800
21801 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21802
21803         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21804         need to make a copy of the variable to generate verifiable code.
21805
21806 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21807
21808         * driver.cs: Compute dynamically the system directory.
21809
21810         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21811         Slower, but more generally useful.  Used by the abstract
21812         registering implementation. 
21813
21814         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21815         the rules for the special rule on Type/instances.  First check if
21816         we have the same name, and if so, try that special static path
21817         rather than the instance path.
21818
21819 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21820
21821         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21822         for, while and if.
21823
21824         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21825         Enum, ValueType, Delegate or Array for non-corlib compiles.
21826
21827         * cs-tokenizer.cs: Catch long identifiers (645)
21828
21829         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21830         piece of code.
21831
21832         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21833         fix, we were returning too early, so we were not registering
21834         pending methods from abstract classes.
21835
21836         Do not register pending methods if the class is abstract.
21837
21838         * expression.cs (Conditional.DoResolve): Report circular implicit
21839         conversions when we neecd to compute it for conditional
21840         expressions. 
21841
21842         (Is.DoResolve): If the expression is always of the provided type,
21843         flag warning 183.  If the expression can not ever be of the
21844         provided type flag warning 184.
21845
21846         * class.cs: Catch 169 as well.
21847
21848         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21849         read. 
21850
21851 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21852
21853         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21854
21855 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21856
21857         * interface.cs: (PopulateMethod): Check for pointers being defined
21858         only if the unsafe context is active.
21859         (PopulateProperty): ditto.
21860         (PopulateIndexer): ditto.
21861
21862         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21863         specified.  If pointers are present, make sure that they are
21864         present in an unsafe context.
21865         (Constructor, Constructor.Define): ditto.
21866         (Field, Field.Define): ditto.
21867         (Property, Property.Define): ditto.
21868         (Event, Event.Define): ditto.
21869
21870         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21871         hashtable if there are classes or structs defined.
21872
21873         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21874         code, as the constant resolution moved.
21875
21876         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21877         the metadata, so we can flag error 133. 
21878
21879         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21880         pointer is being declared in an unsafe context.
21881
21882 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21883
21884         * modifiers.cs (Modifiers.Check): Require a Location argument.
21885         Report error 227 for Unsafe use.
21886
21887         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21888
21889         * statement.cs (For.Emit): If the test is null, then report that
21890         we do `return', as we wont reach anything afterwards.
21891
21892         (Switch.SwitchGoverningType): Track the expression that matched
21893         the conversion.
21894
21895         * driver.cs: Allow negative numbers as an error code to flag.
21896
21897         * cs-parser.jay: Handle 1551.
21898
21899         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21900
21901 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21902
21903         * cs-parser.jay: Report 1518 (type declaration can only contain
21904         class, struct, interface, enum or delegate)
21905
21906         (switch_label): Report 1523 (keywords `case' or `default' must
21907         preced code)
21908
21909         (opt_switch_sections): Report 1522 (empty switch)
21910
21911         * driver.cs: Report 1515 (response file specified multiple times)
21912         Report 1516 (Source file specified multiple times).
21913
21914         * expression.cs (Argument.Resolve): Signal 1510
21915
21916         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21917         access not allowed in static code)
21918
21919 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21920
21921         * typemanager.cs (IsPointerType): Utility method which we are going
21922         to need a lot.
21923
21924         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21925         the object type, so we take care of that.
21926
21927         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21928
21929         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21930         added to non-params parameters :-)
21931
21932         * typemanager.cs (CSharpName): Include 'void' type too. 
21933
21934         (void_ptr_type): Include in the set of core types.
21935
21936         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21937         duplicating code.
21938
21939         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21940         an unsafe context.
21941
21942         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21943         completely forgotten about it.
21944
21945 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21946
21947         * cs-parser.jay (pointer_type): Add. This begins our implementation
21948         of parsing rules for unsafe code.
21949
21950         (unsafe_statement): Implement.
21951
21952         (embedded_statement): Modify to include the above.
21953
21954         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21955
21956         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21957         if the current context is an unsafe one.
21958
21959         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21960         are handled differently, we need separate rules for them.
21961
21962         (local_variable_declaration): Update to use local_variable_pointer_type
21963         to allow variable declarations of unmanaged pointer types.
21964
21965         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21966         in unsafe contexts.
21967
21968         * ../errors/cs0214.cs : Add.
21969
21970 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21971
21972         * makefile: remove 'response' file when cleaning.
21973
21974 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21975
21976         * cs-parser.jay: Report 1524.
21977
21978 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21979
21980         * typemanager.cs (RegisterMethod): drop checking if we have
21981         registered this from here
21982
21983 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21984
21985         * class.cs (Method.EmitDestructor): Implement calling our base
21986         destructor. 
21987
21988         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21989         value of InFinally.
21990
21991         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21992         this routine and will wrap the call in a try/catch block.  Deal
21993         with the case.
21994
21995 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21996
21997         * ecore.cs (Expression.MemberLookup): instead of taking a
21998         parameter `same_type' that was used to tell whether we could
21999         access private members we compute our containing type from the
22000         EmitContext.
22001
22002         (FieldExpr): Added partial support for volatile fields.  This does
22003         not work for volatile fields exposed from assemblies, as I can not
22004         figure out how to extract the modreq from it.
22005
22006         Updated all the source files to use this.
22007
22008         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22009         because it is referenced by MemberLookup very often. 
22010
22011 2002-01-09  Ravi Pratap  <ravi@ximian.com>
22012
22013         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22014         TypeBuilder.GetCustomAttributes to retrieve what we need.
22015
22016         Get rid of redundant default_member_attr_type as this is the same as
22017         default_member_type which already exists.
22018
22019         * interface.cs, attribute.cs : Update accordingly.
22020
22021 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
22022
22023         * typemanager.cs: Enable IndexerPropertyName again.  It does not
22024         work for TYpeBuilders though.  Ravi, can you please fix this?
22025
22026         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22027
22028         * expression.cs (Argument.Emit): Handle the case of ref objects
22029         being passed to ref functions;  
22030
22031         (ParameterReference.EmitLoad): Loads the content of the pointer
22032         without dereferencing.
22033
22034 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22035
22036         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22037
22038 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22039
22040         * class.cs (Indexer.DefineMethod): Incorporate the interface
22041         type in the name of the method if we are doing explicit interface
22042         implementation.
22043
22044         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22045
22046         (BetterConversion): Fix extremely trivial bug where we were referring to
22047         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22048         again !
22049
22050         * ../errors/bug16.cs : Add although we have fixed it.
22051
22052 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22053
22054         * expression.cs (BaseIndexer): Begin implementation.
22055
22056         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22057
22058         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22059         production directly to remove a shift/reduce, and implement
22060         explicit interface implementation.
22061
22062         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22063         after a floating point suffix.
22064
22065         * expression.cs (DoNumericPromotions): Improved the conversion for
22066         uint/uint.  If we have a constant, we avoid doing a typecast to a
22067         larger type.
22068
22069         * class.cs (Indexer): Implement explicit interface implementation
22070         for indexers.
22071
22072 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22073
22074         * class.cs: make the default instance constructor public and hidebysig.
22075
22076 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22077
22078         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22079         so we can call it from elsewhere.
22080
22081         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22082         we emit it internally if the class has a defined indexer; otherwise the user
22083         emits it by decorating the class definition with the DefaultMemberAttribute.
22084
22085         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22086         attribute is not used on a type which defines an indexer.
22087
22088         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22089         character when we skip whitespace.
22090
22091         * ../errors/cs0646.cs : Add.
22092
22093 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22094
22095         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22096         again. 
22097
22098         * makefile: Add practical target `mcs3.exe' which builds the third
22099         generation compiler. 
22100
22101         * expression.cs (New): Fix structures constructor calling.
22102
22103         * class.cs (Property, Method, Indexer): Emit Final flag on the
22104         method if we are an interface implementation and we are not
22105         abstract. 
22106
22107         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22108         whether this property is referencing a `base' method.
22109
22110         * expression.cs (Invocation.EmitCall): take an extra argument:
22111         is_base, this is used to determine whether the `call' or
22112         `callvirt' opcode should be used.
22113
22114
22115         * delegate.cs: update EmitCall.
22116
22117         * class.cs (Method.Define): Set NewSlot for the cases where we are
22118         not implementing an interface method.
22119
22120         (Property.Define): ditto.
22121
22122 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22123
22124         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22125         'r'.  Allows mcs to parse itself fully.
22126
22127 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22128
22129         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22130         of the number of initializers that require the InitializeArray method.
22131
22132         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22133         update the above field where necessary.
22134
22135         (MakeByteBlob): Update accordingly.
22136
22137         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22138         greater than 2.
22139
22140         (EmitDynamicInitializers): Update in accordance with the new optimization.
22141
22142         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22143         same OpCode applies.
22144
22145         * cs-parser.jay : Fix some glaring errors I introduced.
22146
22147 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22148
22149         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22150         so that we can check for name clashes there too.
22151
22152         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22153         for interface indexers.
22154
22155         * interfaces.cs (Define): Emit the default member attribute.
22156
22157         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22158         variable was being referred to while setting the value ;-)
22159
22160 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22161
22162         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22163         byte-by-byte information when we know the data is zero.
22164
22165         Make the block always a multiple of 4, because
22166         DefineInitializedData has a bug.
22167
22168         * assign.cs: Fix, we should assign from the temporary, not from
22169         the source. 
22170
22171         * expression.cs (MakeByteBlob): Fix my incorrect code.
22172
22173 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22174
22175         * typemanager.cs (EnumToUnderlying): This function is used to get
22176         the underlying type from an enumeration, because it does not
22177         always work. 
22178
22179         * constant.cs: Use the I4_S form for values between -128 and 127.
22180
22181         * statement.cs (Block.LookupLabel): Looks up a label.
22182         (Block): Drop support for labeled blocks.
22183
22184         (LabeledStatement): New kind of statement that represents a label
22185         only.
22186
22187         (Goto): Finally implement this bad boy.
22188
22189         * cs-parser.jay: Update to reflect new mechanism to implement
22190         labels.
22191
22192 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22193
22194         * codegen.cs (EmitContext.This): a codegen property that keeps the
22195         a single instance of this instead of creating many different this
22196         instances. 
22197
22198         * delegate.cs (Delegate.DoResolve): Update to use the property;
22199
22200         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22201
22202         * expression.cs (BaseAccess.DoResolve): Ditto.
22203
22204 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22205
22206         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22207         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22208
22209         (InitCoreTypes): Update accordingly.
22210
22211         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22212         so we can quickly store the state.
22213
22214         (ApplyAttributes): Set the correct implementation flags
22215         for InternalCall methods.
22216
22217 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22218
22219         * expression.cs (EmitCall): if a method is not virtual, then do
22220         not use callvirt on it.
22221
22222         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22223         user defined stuff) requires the use of stobj, which takes an
22224         address on the stack instead of an array and an index.  So emit
22225         the Ldelema operation for it.
22226
22227         (EmitStoreOpcode): Use stobj for valuetypes.
22228
22229         (UnaryMutator.EmitCode): Use the right 1 value depending on
22230         whether we are dealing with int64/uint64, float or doubles.
22231
22232         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22233         constructors that I implemented last night.
22234
22235         (Constructor.IsDefault): Fix to work properly for static
22236         constructors.
22237
22238         * cs-parser.jay (CheckDef): report method signature errors.
22239         Update error number 103 to be 132.
22240
22241         * decl.cs: New AdditionResult enumeration value: MethodExists.
22242         Although we do this check for methods later on in the semantic
22243         analysis, catching repeated default constructors is so easy that
22244         we catch these here. 
22245
22246         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22247         promotions code.
22248
22249         (ParameterReference.EmitAssign, Emit): handle
22250         bools as bytes.
22251
22252         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22253         (ArrayAccess.EmitStoreOpcode): ditto.
22254
22255         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22256
22257         * expression.cs (MakeByteBlob): Complete all the missing types
22258         (uint, short, ushort, byte, sbyte)
22259
22260         * class.cs: Only init instance field initializers on instance
22261         constructors. 
22262
22263         Rename `constructors' to instance_constructors. 
22264
22265         (TypeContainer.AddConstructor): Only add constructors to the list
22266         if it is not static.
22267
22268         Make sure that we handle default_static_constructor independently
22269         everywhere where we handle instance_constructors
22270
22271 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22272
22273         * class.cs: Do not lookup or create a base initializer for a
22274         static constructor.
22275
22276         (ConstructorInitializer.Resolve): use the proper type to lookup
22277         for constructors.
22278
22279         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22280
22281         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22282         in DeclSpace. 
22283
22284         * decl.cs: CloseType is now an virtual method, the default
22285         implementation just closes this type.
22286
22287 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22288
22289         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22290         to PreserveSig by default. Also emit HideBySig on such methods.
22291
22292         Basically, set the defaults to standard values.
22293
22294         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22295         argument, if candidate is better, it can't be worse than the best !
22296
22297         (Invocation): Re-write bits to differentiate between methods being
22298         applicable in their expanded form and their normal form - for params
22299         methods of course.
22300
22301         Get rid of use_standard everywhere as only standard conversions are allowed
22302         in overload resolution. 
22303
22304         More spec conformance.
22305
22306 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22307
22308         * driver.cs: Add --timestamp, to see where the compiler spends
22309         most of its time.
22310
22311         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22312         `this' in static code.
22313
22314         (SimpleName.DoResolve): Implement in terms of a helper function
22315         that allows static-references to be passed upstream to
22316         MemberAccess.
22317
22318         (Expression.ResolveWithSimpleName): Resolve specially simple
22319         names when called by MemberAccess to implement the special
22320         semantics. 
22321
22322         (Expression.ImplicitReferenceConversion): Handle conversions from
22323         Null to reference types before others, as Null's type is
22324         System.Object. 
22325
22326         * expression.cs (Invocation.EmitCall): Handle the special case of
22327         calling methods declared on a reference type from a ValueType
22328         (Base classes System.Object and System.Enum)
22329
22330         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22331         the left hand side is a TypeExpr, not on every enumeration. 
22332
22333         (Binary.Resolve): If types are reference types, then do a cast to
22334         object on operators != and == of both arguments.
22335
22336         * typemanager.cs (FindMembers): Extract instance and static
22337         members if requested.
22338
22339         * interface.cs (PopulateProperty): Use void_type instead of null
22340         as the return type for the setter method.
22341
22342         (PopulateIndexer): ditto.
22343
22344 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22345
22346         * support.cs (ReflectionParameters): Fix minor bug where we
22347         were examining the wrong parameter for the ParamArray attribute.
22348
22349         Cope with requests for the type of the parameter at position
22350         greater than the params parameter's. We now return the element
22351         type of the params array as that makes more sense.
22352
22353         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22354         accordingly as we no longer have to extract the element type
22355         ourselves.
22356
22357         (Invocation.OverloadResolve): Update.
22358
22359 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22360
22361         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22362         against IEnumerator, test whether the return value is a descendant
22363         of the IEnumerator interface.
22364
22365         * class.cs (Indexer.Define): Use an auxiliary method to implement
22366         the other bits of the method definition.  Begin support for
22367         explicit interface implementation.
22368
22369         (Property.DefineMethod): Use TypeManager.void_type instead of null
22370         for an empty return value.
22371
22372 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22373
22374         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22375         dealing with a FieldExpr which is composed of a FieldBuilder, in
22376         the code path we did extract the constant, but we should have
22377         obtained the underlying value to be able to cast it (otherwise we
22378         end up in an infinite loop, this is what Ravi was running into).
22379
22380         (ArrayCreation.UpdateIndices): Arrays might be empty.
22381
22382         (MemberAccess.ResolveMemberAccess): Add support for section
22383         14.5.4.1 that deals with the special case of E.I when E is a type
22384         and something else, that I can be a reference to a static member.
22385
22386         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22387         handle a particular array type to create byte blobs, it is just
22388         something we dont generate byteblobs for.
22389
22390         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22391         arguments. 
22392
22393         * location.cs (Push): remove the key from the hashtable that we
22394         are about to add.   This happens for empty files.
22395
22396         * driver.cs: Dispose files after we have parsed them.
22397
22398         (tokenize): new function that only runs the tokenizer on its
22399         input, for speed testing.
22400
22401 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22402
22403         * class.cs (Event.Define): Define the private field only if there
22404         are no accessors defined.
22405
22406         * expression.cs (ResolveMemberAccess): If there is no associated
22407         field with the event, that means we have an event defined with its
22408         own accessors and we should flag error cs0070 since transforming
22409         ourselves into a field is not valid in that case.
22410
22411         * ecore.cs (SimpleName.DoResolve): Same as above.
22412
22413         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22414         and charset to sane values.
22415
22416 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22417
22418         * assign.cs (DoResolve): Perform check on events only if they 
22419         are being accessed outside the declaring type.
22420
22421         * cs-parser.jay (event_declarations): Update rules to correctly
22422         set the type of the implicit parameter etc.
22423
22424         (add_accessor, remove_accessor): Set current local parameters.
22425
22426         * expression.cs (Binary): For delegate addition and subtraction,
22427         cast the return value from the method into the appropriate delegate
22428         type.
22429
22430 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22431
22432         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22433         of these as the workaround is unnecessary.
22434
22435         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22436         delegate data - none of that is needed at all.
22437
22438         Re-write bits to extract the instance expression and the delegate method
22439         correctly.
22440
22441         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22442         on delegates too.
22443
22444         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22445         of attaching attributes instead of duplicating code everywhere.
22446
22447         * everywhere : Update code to do attribute emission using the above method.
22448
22449 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22450
22451         * expression.cs (IsParamsMethodApplicable): if there are not
22452         parameters, return immediately.
22453
22454         * ecore.cs: The 0 literal can be implicity converted to an enum
22455         type. 
22456
22457         (SimpleName.DoResolve): First lookup the type, then lookup the
22458         members. 
22459
22460         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22461         want to get its address.  If the InstanceExpression is not
22462         addressable, store the result in a temporary variable, then get
22463         the address of it.
22464
22465         * codegen.cs: Only display 219 errors on warning level or above. 
22466
22467         * expression.cs (ArrayAccess): Make it implement the
22468         IMemoryLocation interface.
22469
22470         (Binary.DoResolve): handle the operator == (object a, object b)
22471         and operator != (object a, object b) without incurring into a
22472         BoxedCast (because 5 != o should never be performed).
22473
22474         Handle binary enumerator operators.
22475
22476         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22477         value type, otherwise use Ldelem_ref.
22478
22479         Use precomputed names;
22480
22481         (AddressOf): Implement address of
22482
22483         * cs-parser.jay (labeled_statement): Fix recursive block
22484         addition by reworking the production.
22485
22486         * expression.cs (New.DoEmit): New has a special case:
22487                 
22488                  If we are dealing with a ValueType, we have a few
22489                  situations to deal with:
22490                 
22491                     * The target of New is a ValueType variable, that is
22492                       easy, we just pass this as the variable reference
22493                 
22494                     * The target of New is being passed as an argument,
22495                       to a boxing operation or a function that takes a
22496                       ValueType.
22497                 
22498                       In this case, we need to create a temporary variable
22499                       that is the argument of New.
22500
22501
22502 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22503
22504         * rootcontext.cs (LookupType): Check that current_type is not null before
22505         going about looking at nested types.
22506
22507         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22508         not implement the IAssignMethod interface any more.
22509
22510         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22511         where we tranform them into FieldExprs if they are being resolved from within
22512         the declaring type.
22513
22514         * ecore.cs (SimpleName.DoResolve): Do the same here.
22515
22516         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22517
22518         * ../errors/bug10.cs : Add.
22519
22520         * ../errors/cs0070.cs : Add.
22521
22522         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22523
22524         * assign.cs : Get rid of EventIsLocal everywhere.
22525
22526 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22527
22528         * ecore.cs (ConvertIntLiteral): finished the implementation.
22529
22530         * statement.cs (SwitchLabel): Convert the value we are using as a
22531         key before looking up the table.
22532
22533 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22534
22535         * codegen.cs (EmitTopBlock): Require a Location argument now.
22536
22537         * cs-parser.jay (constructor_declarator): We need to setup
22538         current_local_parameters before we parse the
22539         opt_constructor_initializer, to allow the variables to be bound
22540         to the constructor arguments.
22541
22542         * rootcontext.cs (LookupType): First lookup nested classes in our
22543         class and our parents before we go looking outside our class.
22544
22545         * expression.cs (ConstantFold): Extract/debox the values at the
22546         beginnning. 
22547
22548         * rootcontext.cs (EmitCode): Resolve the constants first before we
22549         resolve the types.  This is not really needed, but it helps debugging.
22550
22551         * statement.cs: report location.
22552
22553         * cs-parser.jay: pass location to throw statement.
22554
22555         * driver.cs: Small bug fix.
22556
22557         * report.cs: Updated format to be 4-zero filled digits.
22558
22559 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22560
22561         * expression.cs (CheckIndices): Fix minor bug where the wrong
22562         variable was being referred to ;-)
22563
22564         (DoEmit): Do not call EmitStaticInitializers when the 
22565         underlying type is System.Object.
22566
22567 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22568
22569         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22570         and do the usual workaround for SRE.
22571
22572         * class.cs (MyEventBuilder.EventType): New member to get at the type
22573         of the event, quickly.
22574
22575         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22576
22577         * assign.cs (Assign.DoResolve): Handle the case when the target
22578         is an EventExpr and perform the necessary checks.
22579
22580         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22581         interface.
22582
22583         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22584
22585         (EventExpr): Set the type in the constructor itself since we 
22586         are meant to be born fully resolved.
22587
22588         (EventExpr.Define): Revert code I wrote earlier.
22589                 
22590         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22591         instance expression is null. The instance expression is a This in that case
22592         or a null, depending on whether it is a static method or not.
22593
22594         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22595         refers to more than one method.
22596
22597         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22598         and accordingly flag errors.
22599
22600 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22601
22602         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22603
22604 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22605
22606         * location.cs (ToString): Provide useful rutine.
22607
22608 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22609
22610         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22611         objects, return the actual integral boxed.
22612
22613         * statement.cs (SwitchLabel): define an ILLabel for each
22614         SwitchLabel. 
22615
22616         (Switch.CheckSwitch): If the value is a Literal, extract
22617         the underlying literal.
22618
22619         Also in the unused hashtable we had, add the SwitchLabel so we can
22620         quickly look this value up.
22621
22622         * constant.cs: Implement a bunch of new constants.  Rewrite
22623         Literal based on this.  Made changes everywhere to adapt to this.
22624
22625         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22626         dereferencing array only once, and also copes with enumrations.
22627
22628         bytes are two bytes wide, not one.
22629
22630         (Cast): Perform constant conversions.
22631
22632         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22633         wrappers to the literals here.
22634
22635         * expression.cs (DoNumericPromotions): long literals can converted
22636         to ulong implicity (this is taken care of elsewhere, but I was
22637         missing this spot).
22638
22639         * ecore.cs (Expression.Literalize): Make the return type Literal,
22640         to improve type checking.
22641
22642         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22643
22644 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22645
22646         * literal.cs: Revert code from ravi that checked the bounds.  The
22647         bounds are sane by the definition of the type itself. 
22648
22649         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22650         need to actually look up in our parent hierarchy for interfaces
22651         implemented. 
22652
22653         * const.cs: Use the underlying type for enumerations
22654
22655         * delegate.cs: Compute the basename for the delegate creation,
22656         that should fix the delegate test case, and restore the correct
22657         Type Lookup semantics in rootcontext
22658
22659         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22660         referencing a nested type with the Reflection API is using the "+"
22661         sign. 
22662
22663         * cs-parser.jay: Do not require EOF token at the end.
22664
22665 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22666
22667         * rootcontext.cs (LookupType): Concatenate type names with
22668         a '.' instead of a '+' The test suite passes again.
22669
22670         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22671         field of the enumeration.
22672
22673         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22674         the case when the member is an EventExpr.
22675
22676         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22677         static has an associated instance expression.
22678
22679         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22680
22681         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22682
22683         * class.cs (Event.Define): Register event and perform appropriate checks
22684         for error #111.
22685
22686         We define the Add and Remove methods even if the use provides none because
22687         in that case, we provide default implementations ourselves.
22688
22689         Define a private field of the type of the event. This is done by the CSC compiler
22690         and we should be doing it too ;-)
22691
22692         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22693         More methods we use in code we generate.
22694
22695         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22696         is important.
22697
22698         (InitCoreTypes): Update accordingly for the above.
22699
22700         * class.cs (Event.Emit): Generate code for default accessors that we provide
22701
22702         (EmitDefaultMethod): Do the job in the above.
22703
22704         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22705         appropriate place.
22706
22707 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22708
22709         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22710         builders even if we were missing one.
22711
22712         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22713         pass the Basename as our class name instead of the Name.  The
22714         basename will be correctly composed for us.
22715
22716         * parameter.cs (Paramters): Now takes a Location argument.
22717
22718         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22719         make all the code call directly LookupType in RootContext and take
22720         this chance to pass the Location information everywhere.
22721
22722         * Everywhere: pass Location information.
22723
22724 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22725
22726         * class.cs (Constructor.Define): Updated way of detecting the
22727         length of the parameters.
22728
22729         (TypeContainer.DefineType): Use basename as the type name for
22730         nested types.
22731
22732         (TypeContainer.Define): Do not recursively define types here, as
22733         definition is taken care in order by the RootContext.
22734
22735         * tree.cs: Keep track of namespaces in a per-file basis.
22736
22737         * parameter.cs (Parameter.ComputeSignature): Update to use
22738         DeclSpace. 
22739
22740         (Parameters.GetSignature): ditto.
22741
22742         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22743         instead of a TypeContainer.
22744
22745         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22746         resolve names.  Because we need to be resolve in our context, not
22747         our parents.
22748
22749         * driver.cs: Implement response files.
22750
22751         * class.cs (TypeContainer.DefineType): If we are defined, do not
22752         redefine ourselves.
22753
22754         (Event.Emit): Emit the code for add/remove handlers.
22755         (Event.Define): Save the MethodBuilders for add/remove.
22756
22757         * typemanager.cs: Use pair here too.
22758
22759         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22760         DictionaryEntry requires the first argument to be non-null.  
22761
22762         (enum_declaration): Compute full name for registering the
22763         enumeration.
22764
22765         (delegate_declaration): Instead of using
22766         formal_parameter_list, use opt_formal_parameter_list as the list
22767         can be empty.
22768
22769         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22770         (EventParsing): New property that controls whether `add' and
22771         `remove' are returned as tokens or identifiers (for events);
22772
22773 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22774
22775         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22776         use MyEventBuilder only and let it wrap the real builder for us.
22777
22778         (MyEventBuilder): Revamp constructor etc.
22779
22780         Implement all operations that we perform on EventBuilder in precisely the same
22781         way here too.
22782
22783         (FindMembers): Update to use the EventBuilder member.
22784
22785         (Event.Emit): Update accordingly.
22786
22787 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22788
22789         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22790         by calling the appropriate methods.
22791
22792         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22793         useful.
22794
22795         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22796
22797 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22798
22799         * delegate.cs (Delegate.Populate): Check that the return type
22800         and various parameters types are indeed accessible.
22801
22802         * class.cs (Constructor.Define): Same here.
22803
22804         (Field.Define): Ditto.
22805
22806         (Event.Define): Ditto.
22807
22808         (Operator.Define): Check that the underlying Method defined itself
22809         correctly - so it's MethodBuilder should not be null.
22810
22811         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22812         expression happens to be null.
22813
22814         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22815         members but as of now we don't seem to be able to do anything really useful with it.
22816
22817         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22818         not the EventBuilder.
22819
22820 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22821
22822         * cs-tokenizer.cs: Add support for defines.
22823         Add support for #if, #elif, #else, #endif
22824
22825         (eval_var): evaluates a variable.
22826         (eval): stubbed for evaluating functions.
22827
22828         * cs-parser.jay: Pass the defines information
22829
22830         * driver.cs: Add --define command line option.
22831
22832         * decl.cs: Move MemberCore here.
22833
22834         Make it the base class for DeclSpace.  This allows us to catch and
22835         report 108 and 109 for everything now.
22836
22837         * class.cs (TypeContainer.Define): Extract all the members
22838         before populating and emit the warning 108 (new keyword required
22839         to override) instead of having each member implement this.
22840
22841         (MemberCore.Define): New abstract method, we will be using this in
22842         the warning reporting engine in Populate.
22843
22844         (Operator.Define): Adjust to new MemberCore protocol. 
22845
22846         * const.cs (Const): This does not derive from Expression, it is a
22847         temporary object we use to create fields, it is a MemberCore. 
22848
22849         * class.cs (Method.Define): Allow the entry point to be in a
22850         specific class.
22851
22852         * driver.cs: Rewrite the argument handler to clean it up a bit.
22853
22854         * rootcontext.cs: Made it just an auxiliary namespace feature by
22855         making everything static.
22856
22857         * driver.cs: Adapt code to use RootContext type name instead of
22858         instance variable.
22859
22860         * delegate.cs: Remove RootContext argument.
22861
22862         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22863         argument. 
22864
22865         * class.cs (Event.Define): The lookup can fail.
22866
22867         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22868
22869         * expression.cs: Resolve the this instance before invoking the code.
22870
22871 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22872
22873         * cs-parser.jay: Add a production in element_access that allows
22874         the thing to become a "type" reference.  This way we can parse
22875         things like "(string [])" as a type.
22876
22877         Note that this still does not handle the more complex rules of
22878         casts. 
22879
22880
22881         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22882
22883         * ecore.cs: (CopyNewMethods): new utility function used to
22884         assemble the list of methods from running FindMembers.
22885
22886         (MemberLookup): Rework FindMembers so that 
22887
22888 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22889
22890         * class.cs (TypeContainer): Remove Delegates who fail to be
22891         defined.
22892
22893         * delegate.cs (Populate): Verify that we dont get null return
22894         values.   TODO: Check for AsAccessible.
22895
22896         * cs-parser.jay: Use basename to emit error 574 (destructor should
22897         have the same name as container class), not the full name.
22898
22899         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22900         possible representation.  
22901
22902         Also implements integer type suffixes U and L.
22903
22904 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22905
22906         * expression.cs (ArrayCreation.DoResolve): We need to do the
22907         argument resolution *always*.
22908
22909         * decl.cs: Make this hold the namespace.  Hold the root context as
22910         well.
22911         (LookupType): Move here.
22912
22913         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22914
22915         * location.cs (Row, Name): Fixed the code, it was always returning
22916         references to the first file.
22917
22918         * interface.cs: Register properties defined through interfaces.
22919
22920         * driver.cs: Add support for globbing on the command line
22921
22922         * class.cs (Field): Make it derive from MemberCore as well.
22923         (Event): ditto.
22924
22925 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22926
22927         * class.cs (Event::Define): Check that the type of the event is a delegate
22928         type else flag error #66.
22929
22930         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22931         same.
22932
22933         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22934         values of EntryPoint, CharSet etc etc.
22935
22936         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22937
22938         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22939         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22940         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22941         which needs this to do its work.
22942
22943         * ../errors/cs0066.cs : Add.
22944
22945 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22946
22947         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22948         helper functions.
22949
22950         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22951         clears out the parameters field.
22952         (MemberSignatureCompare): Cleanup
22953
22954         (MemberCore): New base class used to share code between MethodCore
22955         and Property.
22956
22957         (RegisterRequiredImplementations) BindingFlags.Public requires
22958         either BindingFlags.Instace or Static.  Use instance here.
22959
22960         (Property): Refactored code to cope better with the full spec.
22961
22962         * parameter.cs (GetParameterInfo): Return an empty array instead
22963         of null on error.
22964
22965         * class.cs (Property): Abstract or extern properties have no bodies.
22966
22967         * parameter.cs (GetParameterInfo): return a zero-sized array.
22968
22969         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22970         method modifier validation to the typecontainer so we can reuse
22971         this on properties.
22972
22973         (MethodCore.ParameterTypes): return an empty sized array of types.
22974
22975         (Property.Define): Test property modifier validity.
22976
22977         Add tests for sealed/override too.
22978
22979         (Method.Emit): abstract or extern methods have no bodies.
22980
22981 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22982
22983         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22984         thing.
22985
22986         (Method::Define, ::Emit): Modify accordingly.
22987
22988         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22989
22990         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22991
22992         * makefile: Pass in /unsafe.
22993
22994 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22995
22996         * class.cs (MakeKey): Kill routine.
22997
22998         * class.cs (TypeContainer.Define): Correctly define explicit
22999         method implementations (they require the full interface name plus
23000         the method name).
23001
23002         * typemanager.cs: Deply the PtrHashtable here and stop using the
23003         lame keys.  Things work so much better.
23004
23005         This of course broke everyone who depended on `RegisterMethod' to
23006         do the `test for existance' test.  This has to be done elsewhere.
23007
23008         * support.cs (PtrHashtable): A hashtable that avoid comparing with
23009         the object stupid Equals method (because, that like fails all over
23010         the place).  We still do not use it.
23011
23012         * class.cs (TypeContainer.SetRequiredInterface,
23013         TypeContainer.RequireMethods): Killed these two routines and moved
23014         all the functionality to RegisterRequiredImplementations.
23015
23016         (TypeContainer.RegisterRequiredImplementations): This routine now
23017         registers all the implementations required in an array for the
23018         interfaces and abstract methods.  We use an array of structures
23019         which can be computed ahead of time to reduce memory usage and we
23020         also assume that lookups are cheap as most classes will not
23021         implement too many interfaces.
23022
23023         We also avoid creating too many MethodSignatures.
23024
23025         (TypeContainer.IsInterfaceMethod): Update and optionally does not
23026         clear the "pending" bit if we find that there are problems with
23027         the declaration.
23028
23029         (TypeContainer.VerifyPendingMethods): Update to report errors of
23030         methods that look like implementations but are not.
23031
23032         (TypeContainer.Define): Add support for explicit interface method
23033         implementation. 
23034
23035 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23036
23037         * typemanager.cs: Keep track of the parameters here instead of
23038         being a feature of the TypeContainer.
23039
23040         * class.cs: Drop the registration of parameters here, as
23041         InterfaceMethods are also interface declarations.
23042
23043         * delegate.cs: Register methods with the TypeManager not only with
23044         the TypeContainer.  This code was buggy.
23045
23046         * interface.cs: Full registation here.
23047
23048 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23049
23050         * expression.cs: Remove reducer for binary expressions, it can not
23051         be done this way.
23052
23053         * const.cs: Put here the code that used to go into constant.cs
23054
23055         * constant.cs: Put here the code for constants, this is a new base
23056         class for Literals.
23057
23058         * literal.cs: Make Literal derive from Constant.
23059
23060 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23061
23062         * statement.cs (Return.Emit): Report error 157 if the user
23063         attempts to return from a finally block.
23064
23065         (Return.Emit): Instead of emitting a return, jump to the end of
23066         the function.
23067
23068         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23069         LocalBuilder to store the result of the function.  ReturnLabel is
23070         the target where we jump.
23071
23072
23073 2001-12-09  Radek Doulik  <rodo@ximian.com>
23074
23075         * cs-parser.jay: remember alias in current namespace
23076
23077         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23078         namespaces
23079
23080         * class.cs (LookupAlias): lookup alias in my_namespace
23081
23082         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23083         aliases hashtable
23084         (LookupAlias): lookup alias in this and if needed in parent
23085         namespaces
23086
23087 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23088
23089         * support.cs: 
23090
23091         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23092         making things static.  I need this to avoid passing the
23093         TypeContainer when calling ParameterType.
23094
23095         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23096         that did string manipulation to compute the type and then call
23097         GetType.  Use Parameter.ParameterType instead.
23098
23099         * cs-tokenizer.cs: Consume the suffix for floating values.
23100
23101         * expression.cs (ParameterReference): figure out whether this is a
23102         reference parameter or not.  Kill an extra variable by computing
23103         the arg_idx during emission.
23104
23105         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23106         function that returns whether a parameter is an out/ref value or not.
23107
23108         (Parameter.ParameterType): The type of the parameter (base,
23109         without ref/out applied).
23110
23111         (Parameter.Resolve): Perform resolution here.
23112         (Parameter.ExternalType): The full type (with ref/out applied).
23113
23114         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23115         support for expressions on the using statement.
23116
23117 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23118
23119         * statement.cs (Using.EmitLocalVariableDecls): Split the
23120         localvariable handling of the using statement.
23121
23122         (Block.EmitMeta): Keep track of variable count across blocks.  We
23123         were reusing slots on separate branches of blocks.
23124
23125         (Try.Emit): Emit the general code block, we were not emitting it. 
23126
23127         Check the type of the declaration to be an IDisposable or
23128         something that can be implicity converted to it. 
23129
23130         Emit conversions if required.
23131
23132         * ecore.cs (EmptyExpression): New utility class.
23133         (Expression.ImplicitConversionExists): New utility function.
23134
23135 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23136
23137         * statement.cs (Using): Implement.
23138
23139         * expression.cs (LocalVariableReference): Support read only variables.
23140
23141         * statement.cs: Remove the explicit emit for the Leave opcode.
23142         (VariableInfo): Add a readonly field.
23143
23144 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23145
23146         * ecore.cs (ConvCast): new class used to encapsulate the various
23147         explicit integer conversions that works in both checked and
23148         unchecked contexts.
23149
23150         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23151         properly generate the overflow opcodes.
23152
23153 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23154
23155         * statement.cs: The correct type for the EmptyExpression is the
23156         element_type, not the variable type.  Ravi pointed this out.
23157
23158 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23159
23160         * class.cs (Method::Define): Handle PInvoke methods specially
23161         by using DefinePInvokeMethod instead of the usual one.
23162
23163         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23164         above to do the task of extracting information and defining the method.
23165
23166 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23167
23168         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23169         of the condition for string type.
23170
23171         (Emit): Move that here. 
23172
23173         (ArrayCreation::CheckIndices): Keep string literals in their expression
23174         form.
23175
23176         (EmitDynamicInitializers): Handle strings appropriately.
23177
23178 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23179
23180         * codegen.cs (EmitContext): Replace multiple variables with a
23181         single pointer to the current Switch statement.
23182
23183         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23184         EmitContext.
23185
23186 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23187
23188         * statement.cs 
23189
23190         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23191         default'.
23192
23193         (Foreach.Emit): Foreach on arrays was not setting
23194         up the loop variables (for break/continue).
23195
23196         (GotoCase): Semi-implented.
23197
23198 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23199
23200         * attribute.cs (CheckAttribute): Handle system attributes by using
23201         Attribute.GetAttributes to examine information we need.
23202
23203         (GetValidPlaces): Same here.
23204
23205         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23206
23207         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23208
23209         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23210
23211         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23212
23213         (Method::Emit): Handle the case when we are a PInvoke method.
23214
23215 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23216
23217         * expression.cs: Use ResolveWithSimpleName on compound names.
23218
23219 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23220
23221         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23222         before trying to reduce it.
23223
23224         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23225
23226         * constant.cs (LookupConstantValue): Implement.
23227
23228         (EmitConstant): Use the above in emitting the constant.
23229
23230         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23231         that are user-defined by doing a LookupConstantValue on them.
23232
23233         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23234         too, like above.
23235
23236 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23237
23238         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23239
23240         (BaseAccess.DoResolve): Implement.
23241
23242         (MemberAccess.DoResolve): Split this routine into a
23243         ResolveMemberAccess routine that can be used independently
23244
23245 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23246
23247         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23248         As that share bits of the implementation.  Is returns a boolean,
23249         while As returns the Type that is being probed.
23250
23251 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23252
23253         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23254         instead of a Literal - much easier.
23255
23256         (EnumInTransit): Remove - utterly useless :-)
23257
23258         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23259
23260         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23261
23262         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23263         chain when we have no associated expression.
23264
23265 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23266
23267         * constant.cs (Define): Use Location while reporting the errror.
23268
23269         Also emit a warning when 'new' is used and there is no inherited
23270         member to hide.
23271
23272         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23273         populated.
23274
23275         (LookupEnumValue): Implement to lookup an enum member's value and define it
23276         if necessary.
23277
23278         (Populate): Re-write accordingly to use the above routine.
23279
23280 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23281
23282         * expression.cs (This): Fix prototype for DoResolveLValue to
23283         override the base class DoResolveLValue.
23284
23285         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23286         declarations) 
23287
23288         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23289         (we need to load the address of the field here).  This fixes
23290         test-22. 
23291
23292         (FieldExpr.DoResolveLValue): Call the DoResolve
23293         function to initialize the Instance expression.
23294
23295         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23296         correctly the GetEnumerator operation on a value type.
23297
23298         * cs-parser.jay: Add more simple parsing error catches.
23299
23300         * statement.cs (Switch): Add support for string switches.
23301         Handle null specially.
23302
23303         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23304
23305 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23306
23307         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23308
23309         (declare_local_constant): New helper function.
23310
23311         * statement.cs (AddConstant): Keep a separate record of constants
23312
23313         (IsConstant): Implement to determine if a variable is a constant.
23314
23315         (GetConstantExpression): Implement.
23316
23317         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23318
23319         * statement.cs (IsVariableDefined): Re-write.
23320
23321 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23322
23323         * class.cs (TypeContainer::FindMembers): Look for constants
23324         in the case when we are looking for MemberTypes.Field
23325
23326         * expression.cs (MemberAccess::DoResolve): Check that in the
23327         case we are a FieldExpr and a Literal, we are not being accessed
23328         by an instance reference.
23329
23330         * cs-parser.jay (local_constant_declaration): Implement.
23331
23332         (declaration_statement): Implement for constant declarations.
23333
23334 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23335
23336         * statement.cs (Switch): Catch double defaults.
23337
23338         (Switch): More work on the switch() statement
23339         implementation.  It works for integral values now, need to finish
23340         string support.
23341
23342
23343 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23344
23345         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23346         integer literals into other integer literals.  To be used by
23347         switch. 
23348
23349 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23350
23351         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23352         some memory.
23353
23354         (EmitDynamicInitializers): Cope with the above since we extract data
23355         directly from ArrayData now.
23356
23357         (ExpectInitializers): Keep track of whether initializers are mandatory
23358         or not.
23359
23360         (Bounds): Make it a hashtable to prevent the same dimension being 
23361         recorded for every element in that dimension.
23362
23363         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23364         from being found.
23365
23366         Also fix bug which was causing the indices to be emitted in the reverse
23367         order.
23368
23369 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23370
23371         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23372         unfinished.  They do not work, because the underlying code is
23373         sloppy.
23374
23375 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23376
23377         * cs-parser.jay: Remove bogus fixme.
23378
23379         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23380         on Switch statement.
23381
23382 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23383
23384         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23385         the same. 
23386
23387         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23388         parameter. Apparently, any expression is allowed. 
23389
23390         (ValidateInitializers): Update accordingly.
23391
23392         (CheckIndices): Fix some tricky bugs thanks to recursion.
23393
23394         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23395         I was being completely brain-dead.
23396
23397         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23398         and re-write acordingly.
23399
23400         (DelegateInvocation): Re-write accordingly.
23401
23402         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23403
23404         (MakeByteBlob): Handle types more correctly.
23405
23406         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23407         initialization from expressions but it is incomplete because I am a complete
23408         Dodo :-|
23409
23410 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23411
23412         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23413         on If.  Basically, we have to return `true' (ie, we do return to
23414         our caller) only if both branches of the if return.
23415
23416         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23417         short-circuit operators, handle them as short circuit operators. 
23418
23419         (Cast.DoResolve): Resolve type.
23420         (Cast.Cast): Take an expression as the target type.
23421
23422         * cs-parser.jay (cast_expression): Remove old hack that only
23423         allowed a limited set of types to be handled.  Now we take a
23424         unary_expression and we resolve to a type during semantic
23425         analysis.
23426
23427         Use the grammar productions from Rhys to handle casts (this is
23428         not complete like Rhys syntax yet, we fail to handle that corner
23429         case that C# has regarding (-x), but we will get there.
23430
23431 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23432
23433         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23434         field which is an array type.
23435
23436         * cs-parser.jay (declare_local_variables): Support array initialization too.
23437
23438         * typemanager.cs (MakeKey): Implement.
23439
23440         (everywhere): Use the above appropriately.
23441
23442         * cs-parser.jay (for_statement): Update for array initialization while
23443         declaring variables.
23444
23445         * ecore.cs : The error message was correct, it's the variable's names that
23446         were misleading ;-) Make the code more readable.
23447
23448         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23449         the correct type etc.
23450
23451         (ConvertExplicit): Handle Enum types by examining the underlying type.
23452
23453 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23454
23455         * parameter.cs (GetCallingConvention): Always return
23456         CallingConventions.Standard for now.
23457
23458 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23459
23460         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23461         and `r' after calling DoNumericPromotions.
23462
23463         * ecore.cs: Fix error message (the types were in the wrong order).
23464
23465         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23466         BindingFlags.Instance as well 
23467
23468         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23469         implicit int literal conversion in an empty cast so that we
23470         propagate the right type upstream.
23471
23472         (UnboxCast): new class used to unbox value types.
23473         (Expression.ConvertExplicit): Add explicit type conversions done
23474         by unboxing.
23475
23476         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23477         the target type before applying the implicit LongLiterals to ULong
23478         literal cast.
23479
23480 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23481
23482         * cs-parser.jay (for_statement): Reworked the way For works: now
23483         we declare manually any variables that are introduced in
23484         for_initializer to solve the problem of having out-of-band code
23485         emition (that is what got for broken).
23486
23487         (declaration_statement): Perform the actual variable declaration
23488         that used to be done in local_variable_declaration here.
23489
23490         (local_variable_declaration): Do not declare anything, just pass
23491         the information on a DictionaryEntry
23492
23493 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23494
23495         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23496         re-write of the logic to now make it recursive.
23497
23498         (UpdateIndices): Re-write accordingly.
23499
23500         Store element data in a separate ArrayData list in the above methods.
23501
23502         (MakeByteBlob): Implement to dump the array data into a byte array.
23503
23504 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23505
23506         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23507         into CheckIndices.
23508
23509         * constant.cs (Define): Implement.
23510
23511         (EmitConstant): Re-write fully.
23512
23513         Pass in location info.
23514
23515         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23516         respectively.
23517
23518         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23519         DictionaryEntry since we need location info too.
23520
23521         (constant_declaration): Update accordingly.
23522
23523         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23524         code into another method : UpdateIndices.
23525
23526 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23527
23528         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23529         some type checking etc.
23530
23531 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23532
23533         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23534         bits to provide dimension info if the user skips doing that.
23535
23536         Update second constructor to store the rank correctly.
23537
23538 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23539
23540         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23541         and try to implement.
23542
23543         * ../errors/cs0150.cs : Add.
23544
23545         * ../errors/cs0178.cs : Add.
23546
23547 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23548
23549         * statement.cs: Implement foreach on multi-dimensional arrays. 
23550
23551         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23552         name of the params argument.
23553
23554         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23555         initializing the array.
23556
23557         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23558         we can use this elsewhere.
23559
23560         * statement.cs: Finish implementation of foreach for single
23561         dimension arrays.
23562
23563         * cs-parser.jay: Use an out-of-band stack to pass information
23564         around, I wonder why I need this.
23565
23566         foreach_block: Make the new foreach_block the current_block.
23567
23568         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23569         function used to return a static Parameters structure.  Used for
23570         empty parameters, as those are created very frequently.
23571
23572         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23573
23574 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23575
23576         * interface.cs : Default modifier is private, not public. The
23577         make verify test passes again.
23578
23579 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23580
23581         * support.cs (ReflectionParameters): Fix logic to determine
23582         whether the last parameter is a params one. Test 9 passes again.
23583
23584         * delegate.cs (Populate): Register the builders we define with
23585         RegisterParameterForBuilder. Test 19 passes again.
23586
23587         * cs-parser.jay (property_declaration): Reference $6 instead
23588         of $$ to get at the location.
23589
23590         (indexer_declaration): Similar stuff.
23591
23592         (attribute): Ditto.
23593
23594         * class.cs (Property): Register parameters for the Get and Set methods
23595         if they exist. Test 23 passes again.
23596
23597         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23598         call to EmitArguments as we are sure there aren't any params arguments. 
23599         Test 32 passes again.
23600
23601         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23602         IndexOutOfRangeException. 
23603
23604         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23605         Test 33 now passes again.
23606
23607 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23608
23609         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23610         broke a bunch of things.  Will have to come up with a better way
23611         of tracking locations.
23612
23613         * statement.cs: Implemented foreach for single dimension arrays.
23614
23615 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23616
23617         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23618         an error.  This removes the lookup from the critical path.
23619
23620         * cs-parser.jay: Removed use of temporary_loc, which is completely
23621         broken. 
23622
23623 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23624
23625         * support.cs (ReflectionParameters.ParameterModifier): Report
23626         whether the argument is a PARAMS argument or not.
23627
23628         * class.cs: Set the attribute `ParamArrayAttribute' on the
23629         parameter argument.
23630
23631         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23632         and cons_param_array_attribute (ConstructorInfo for
23633         ParamArrayAttribute)., 
23634
23635         * codegen.cs: Emit the return using the `Return' statement, that
23636         way we can report the error correctly for missing return values. 
23637
23638         * class.cs (Method.Emit): Clean up.
23639
23640         * expression.cs (Argument.Resolve): Take another argument: the
23641         location where this argument is used.  Notice that this is not
23642         part of the "Argument" class as to reduce the size of the
23643         structure (we know the approximate location anyways).
23644
23645         Test if the argument is a variable-reference, if not, then
23646         complain with a 206.
23647
23648         (Argument.Emit): Emit addresses of variables.
23649
23650         (Argument.FullDesc): Simplify.
23651
23652         (Invocation.DoResolve): Update for Argument.Resolve.
23653
23654         (ElementAccess.DoResolve): ditto.
23655
23656         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23657         method should be virtual, as this method is always virtual.
23658
23659         (NewDelegate.DoResolve): Update for Argument.Resolve.
23660
23661         * class.cs (ConstructorInitializer.DoResolve): ditto.
23662
23663         * attribute.cs (Attribute.Resolve): ditto.
23664
23665 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23666
23667         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23668
23669         * expression.cs (ParameterReference): Drop IStackStorage and implement
23670         IAssignMethod instead. 
23671
23672         (LocalVariableReference): ditto.
23673
23674         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23675         IAssignMethod instead. 
23676
23677 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23678
23679         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23680         enumerations that are used in heavily used structures derive from
23681         byte in a laughable and pathetic attempt to reduce memory usage.
23682         This is the kind of pre-optimzations that you should not do at
23683         home without adult supervision.
23684
23685         * expression.cs (UnaryMutator): New class, used to handle ++ and
23686         -- separatedly from the other unary operators.  Cleans up the
23687         code, and kills the ExpressionStatement dependency in Unary.
23688
23689         (Unary): Removed `method' and `Arguments' from this class, making
23690         it smaller, and moving it all to SimpleCall, so I can reuse this
23691         code in other locations and avoid creating a lot of transient data
23692         strucutres when not required.
23693
23694         * cs-parser.jay: Adjust for new changes.
23695
23696 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23697
23698         * enum.cs (Enum.Populate): If there is a failure during
23699         definition, return
23700
23701         * cs-parser.jay (opt_enum_base): we used to catch type errors
23702         here, but this is really incorrect.  The type error should be
23703         catched during semantic analysis.
23704
23705 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23706
23707         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23708         current_local_parameters as expected since I, in my stupidity, had forgotten
23709         to do this :-)
23710
23711         * attribute.cs (GetValidPlaces): Fix stupid bug.
23712
23713         * class.cs (Method::Emit): Perform check on applicability of attributes.
23714
23715         (Constructor::Emit): Ditto.
23716
23717         (Field::Emit): Ditto.
23718
23719         (Field.Location): Store location information.
23720
23721         (Property, Event, Indexer, Operator): Ditto.
23722
23723         * cs-parser.jay (field_declaration): Pass in location for each field.
23724
23725         * ../errors/cs0592.cs : Add.
23726
23727 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23728
23729         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23730
23731         (InitCoreTypes): Update accordingly.
23732
23733         (RegisterAttrType, LookupAttr): Implement.
23734
23735         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23736         info about the same.
23737
23738         (Resolve): Update to populate the above as necessary.
23739
23740         (Error592): Helper.
23741
23742         (GetValidPlaces): Helper to the above.
23743
23744         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23745
23746         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23747
23748 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23749
23750         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23751
23752         * ../errors/cs0617.cs : Add.
23753
23754 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23755
23756         * enum.cs (Emit): Rename to Populate to be more consistent with what
23757         we expect it to do and when exactly it is called.
23758
23759         * class.cs, rootcontext.cs : Update accordingly.
23760
23761         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23762         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23763
23764         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23765
23766         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23767         of a fieldinfo using the above, when dealing with a FieldBuilder.
23768
23769 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23770
23771         * ../errors/cs0031.cs : Add.
23772
23773         * ../errors/cs1008.cs : Add.
23774
23775         * ../errrors/cs0543.cs : Add.
23776
23777         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23778         enum type.
23779
23780         (FindMembers): Implement.
23781
23782         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23783         enums and delegates too.
23784
23785         (enum_types): Rename to builder_to_enum.
23786
23787         (delegate_types): Rename to builder_to_delegate.
23788
23789         * delegate.cs (FindMembers): Implement.
23790
23791 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23792
23793         * typemanager.cs (IsEnumType): Implement.
23794
23795         * enum.cs (Emit): Re-write parts to account for the underlying type
23796         better and perform checking etc.
23797
23798         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23799         of the underlying type.
23800
23801         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23802         value
23803
23804         * enum.cs (error31): Helper to report error #31.
23805
23806         * cs-parser.jay (enum_declaration): Store location of each member too.
23807
23808         * enum.cs (member_to_location): New hashtable. 
23809
23810         (AddEnumMember): Update location hashtable.
23811
23812         (Emit): Use the location of each member while reporting errors.
23813
23814 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23815
23816         * cs-parser.jay: A for_initializer if is a
23817         local_variable_declaration really ammount to have an implicit
23818         block with the variable declaration and no initializer for for.
23819
23820         * statement.cs (For.Emit): Cope with null initializers.
23821
23822         This fixes the infinite loop on for initializers.
23823
23824 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23825
23826         * enum.cs: More cleanup.
23827
23828         * ecore.cs: Remove dead code.
23829
23830         * class.cs (Property.Emit): More simplification.
23831         (Event.Emit): ditto.
23832
23833         Reworked to have less levels of indentation.
23834
23835 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23836
23837         * class.cs (Property): Emit attributes.
23838
23839         (Field): Ditto.
23840
23841         (Event): Ditto.
23842
23843         (Indexer): Ditto.
23844
23845         (Operator): Ditto.
23846
23847         * enum.cs (Emit): Ditto.
23848
23849         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23850         Enums too.
23851
23852         * class.cs (Field, Event, etc.): Move attribute generation into the
23853         Emit method everywhere.
23854
23855         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23856         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23857         as we had no way of defining nested enums !
23858
23859         * rootcontext.cs : Adjust code accordingly.
23860
23861         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23862
23863 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23864
23865         * expression.cs (EvalConstantExpression): Move into ecore.cs
23866
23867         * enum.cs (Enum): Rename some members and make them public and readonly
23868         according to our convention.
23869
23870         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23871         nothing else.
23872
23873         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23874
23875         (Enum::Emit): Write a simple version for now which doesn't try to compute
23876         expressions. I shall modify this to be more robust in just a while.
23877
23878         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23879
23880         (TypeContainer::CloseType): Create the Enum types too.
23881
23882         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23883
23884         * expression.cs (EvalConstantExpression): Get rid of completely.
23885
23886         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23887         user-defined values and other cases.
23888
23889         (IsValidEnumLiteral): Helper function.
23890
23891         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23892         out there in the case we had a literal FieldExpr.
23893
23894         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23895
23896         (Literalize): Revamp a bit to take two arguments.
23897
23898         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23899
23900 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23901
23902         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23903
23904         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23905
23906         (Resolve): Use the above to ensure we have proper initializers.
23907
23908 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23909
23910         * expression.cs (Expression::EvalConstantExpression): New method to 
23911         evaluate constant expressions.
23912
23913         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23914
23915 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23916
23917         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23918         in an array.
23919
23920         (Binary.ResolveOperator): Handle operator != (object a, object b)
23921         and operator == (object a, object b);
23922
23923         (Binary.DoNumericPromotions): Indicate whether the numeric
23924         promotion was possible.
23925
23926         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23927         Implement.  
23928
23929         Made the ArrayAccess implement interface IAssignMethod instead of
23930         IStackStore as the order in which arguments are passed reflects
23931         this.
23932
23933         * assign.cs: Instead of using expr.ExprClass to select the way of
23934         assinging, probe for the IStackStore/IAssignMethod interfaces.
23935
23936         * typemanager.cs: Load InitializeArray definition.
23937
23938         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23939         static data that can be used to initialize arrays. 
23940
23941 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23942
23943         * expression.cs: Handle operator== and operator!= for booleans.
23944
23945         (Conditioal.Reduce): Implement reducer for the ?: operator.
23946
23947         (Conditional.Resolve): Implement dead code elimination.
23948
23949         (Binary.Resolve): Catch string literals and return a new
23950         concatenated string.
23951
23952         (Unary.Reduce): Implement reduction of unary expressions.
23953
23954         * ecore.cs: Split out the expression core handling here.
23955
23956         (Expression.Reduce): New method used to perform constant folding
23957         and CSE.  This is needed to support constant-expressions. 
23958
23959         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23960         targets, and optimize for !x.
23961
23962 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23963
23964         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23965         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23966         set custom atttributes.
23967
23968         * literal.cs (Literal::GetValue): New abstract method to return the actual
23969         value of the literal, cast as an object.
23970
23971         (*Literal): Implement GetValue method.
23972
23973         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23974         expressions to the arraylist but objects of type Argument.
23975
23976         * class.cs (TypeContainer::Emit): Emit our attributes too.
23977
23978         (Method::Emit, Constructor::Emit): Ditto.
23979
23980         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23981         to be ignoring earlier.
23982
23983 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23984
23985         * attribute.cs (AttributeSection::Define): Implement to do the business
23986         of constructing a CustomAttributeBuilder.
23987
23988         (Attribute): New trivial class. Increases readability of code.  
23989
23990         * cs-parser.jay : Update accordingly.
23991
23992         (positional_argument_list, named_argument_list, named_argument): New rules
23993
23994         (attribute_arguments): Use the above so that we are more correct.
23995
23996 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23997
23998         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23999         to perform all checks for a method with a params parameter.
24000
24001         (Invocation::OverloadResolve): Update to use the above method and therefore
24002         cope correctly with params method invocations.
24003
24004         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
24005         params too.
24006
24007         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24008         constructors in our parent too because we can't afford to miss out on 
24009         protected ones ;-)
24010
24011         * attribute.cs (AttributeSection): New name for the class Attribute
24012
24013         Other trivial changes to improve readability.
24014
24015         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24016         use the new class names.
24017
24018 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24019
24020         * class.cs (Method::Define): Complete definition for params types too
24021
24022         (Indexer::Define): Ditto.
24023
24024         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24025         Cope everywhere with a request for info about the array parameter.
24026
24027 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24028
24029         * tree.cs (RecordNamespace): Fix up to check for the correct key.
24030
24031         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
24032         local_variable_type to extract the string corresponding to the type.
24033
24034         (local_variable_type): Fixup the action to use the new helper method.
24035
24036         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24037         go.
24038
24039         * expression.cs : Clean out code which uses the above.
24040
24041 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24042
24043         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24044         and bale out if necessary by returning a false.
24045
24046         (RegisterProperty): Ditto.
24047
24048         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24049         and print out appropriate error messages.
24050
24051         * interface.cs (everywhere): Ditto.
24052
24053         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24054         location to constructor.
24055
24056         * class.cs (Property, Event, Indexer): Update accordingly.
24057
24058         * ../errors/cs111.cs : Added.
24059
24060         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24061         of a method, as laid down by the spec.
24062
24063         (Invocation::OverloadResolve): Use the above method.
24064
24065 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24066
24067         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24068         now take a TypeContainer and a Parameters object.
24069
24070         (ParameterData): Modify return type of ParameterModifier method to be 
24071         Parameter.Modifier and not a string.
24072
24073         (ReflectionParameters, InternalParameters): Update accordingly.
24074
24075         * expression.cs (Argument::GetParameterModifier): Same here.
24076
24077         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24078         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24079         symbol in it at all so maybe this is only for now.
24080
24081 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24082
24083         * support.cs (InternalParameters): Constructor now takes an extra argument 
24084         which is the actual Parameters class.
24085
24086         (ParameterDesc): Update to provide info on ref/out modifiers.
24087
24088         * class.cs (everywhere): Update call to InternalParameters to pass in
24089         the second argument too.
24090
24091         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24092         to return the modifier info [ref/out etc]
24093
24094         (InternalParameters, ReflectionParameters): Implement the above.
24095
24096         * expression.cs (Argument::ParameterModifier): Similar function to return
24097         info about the argument's modifiers.
24098
24099         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24100         too.
24101
24102         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24103         a new SetFormalParameters object which we pass to InternalParameters.
24104
24105 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24106
24107         * expression.cs (NewArray): Merge into the ArrayCreation class.
24108
24109 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24110
24111         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24112         NewUserdefinedArray into one as there wasn't much of a use in having
24113         two separate ones.
24114
24115         * expression.cs (Argument): Change field's name to ArgType from Type.
24116
24117         (Type): New readonly property which returns the proper type, taking into 
24118         account ref/out modifiers.
24119
24120         (everywhere): Adjust code accordingly for the above.
24121
24122         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24123         whether we are emitting for a ref or out parameter.
24124
24125         * expression.cs (Argument::Emit): Use the above field to set the state.
24126
24127         (LocalVariableReference::Emit): Update to honour the flag and emit the
24128         right stuff.
24129
24130         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24131
24132         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24133
24134         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24135
24136         (ReflectionParameters, InternalParameters): Implement the above method.
24137
24138         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24139         reporting errors.
24140
24141         (Invocation::FullMethodDesc): Ditto. 
24142
24143 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24144
24145         * cs-parser.jay: Add extra production for the second form of array
24146         creation. 
24147
24148         * expression.cs (ArrayCreation): Update to reflect the above
24149         change. 
24150
24151         * Small changes to prepare for Array initialization.
24152
24153 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24154
24155         * typemanager.cs (ImplementsInterface): interface might be null;
24156         Deal with this problem;
24157
24158         Also, we do store negative hits on the cache (null values), so use
24159         this instead of calling t.GetInterfaces on the type everytime.
24160
24161 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24162
24163         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24164
24165         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24166         split functionality out into different classes.
24167
24168         (New::FormArrayType): Move into NewBuiltinArray.
24169
24170         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24171         quite useless.
24172
24173         (NewBuiltinArray): New class to handle creation of built-in arrays.
24174
24175         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24176         account creation of one-dimensional arrays.
24177
24178         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24179
24180         (NewUserdefinedArray::DoResolve): Implement.
24181
24182         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24183
24184         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24185         we maintain inside the TypeManager. This is necessary to perform lookups on the
24186         module builder.
24187
24188         (LookupType): Update to perform GetType on the module builders too.     
24189
24190         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24191
24192         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24193
24194 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24195
24196         * expression.cs (New::DoResolve): Implement guts of array creation.
24197
24198         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24199
24200 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24201
24202         * expression.cs: Fix bug I introduced lsat night that broke
24203         Delegates. 
24204
24205         (Expression.Resolve): Report a 246 error (can not resolve name)
24206         if we find a SimpleName in the stream.
24207
24208         (Expression.ResolveLValue): Ditto.
24209
24210         (Expression.ResolveWithSimpleName): This function is a variant of
24211         ResolveName, this one allows SimpleNames to be returned without a
24212         warning.  The only consumer of SimpleNames is MemberAccess
24213
24214 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24215
24216         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24217         might arrive here.  I have my doubts that this is correct.
24218
24219         * statement.cs (Lock): Implement lock statement.
24220
24221         * cs-parser.jay: Small fixes to support `lock' and `using'
24222
24223         * cs-tokenizer.cs: Remove extra space
24224
24225         * driver.cs: New flag --checked, allows to turn on integer math
24226         checking. 
24227
24228         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24229         Threading.Monitor.Exit 
24230
24231 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24232
24233         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24234         Expression Class to be IndexerAccess.
24235
24236         Notice that Indexer::DoResolve sets the eclass to Value.
24237
24238 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24239
24240         * class.cs (TypeContainer::Emit): Emit code for indexers.
24241
24242         * assign.cs (IAssignMethod): New interface implemented by Indexers
24243         and Properties for handling assignment.
24244
24245         (Assign::Emit): Simplify and reuse code. 
24246
24247         * expression.cs (IndexerAccess, PropertyExpr): Implement
24248         IAssignMethod, clean up old code. 
24249
24250 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24251
24252         * typemanager.cs (ImplementsInterface): New method to determine if a type
24253         implements a given interface. Provides a nice cache too.
24254
24255         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24256         method.
24257
24258         (ConvertReferenceExplicit): Ditto.
24259
24260         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24261         various methods, with correct names etc.
24262
24263         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24264         Operator.UnaryNegation.
24265
24266         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24267         we have a unary plus or minus operator.
24268
24269         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24270         UnaryMinus.
24271
24272         * everywhere : update accordingly.
24273
24274         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24275         respectively.
24276
24277         * class.cs (Method::Define): For the case where we are implementing a method
24278         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24279         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24280
24281 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24282
24283         * interface.cs (FindMembers): Implement to work around S.R.E
24284         lameness.
24285
24286         * typemanager.cs (IsInterfaceType): Implement.
24287
24288         (FindMembers): Update to handle interface types too.
24289
24290         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24291         use IsAssignableFrom as that is not correct - it doesn't work.
24292
24293         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24294         and accordingly override EmitStatement.
24295
24296         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24297         using the correct logic :-)
24298
24299 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24300
24301         * ../errors/cs-11.cs : Add to demonstrate error -11 
24302
24303 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24304
24305         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24306         then pass this as a hint to ResolveLValue.
24307
24308         * expression.cs (FieldExpr): Add Location information
24309
24310         (FieldExpr::LValueResolve): Report assignment to readonly
24311         variable. 
24312
24313         (Expression::ExprClassFromMemberInfo): Pass location information.
24314
24315         (Expression::ResolveLValue): Add new method that resolves an
24316         LValue. 
24317
24318         (Expression::DoResolveLValue): Default invocation calls
24319         DoResolve. 
24320
24321         (Indexers): New class used to keep track of indexers in a given
24322         Type. 
24323
24324         (IStackStore): Renamed from LValue, as it did not really describe
24325         what this did.  Also ResolveLValue is gone from this interface and
24326         now is part of Expression.
24327
24328         (ElementAccess): Depending on the element access type
24329
24330         * typemanager.cs: Add `indexer_name_type' as a Core type
24331         (System.Runtime.CompilerServices.IndexerNameAttribute)
24332
24333         * statement.cs (Goto): Take a location.
24334
24335 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24336
24337         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24338         if two delegates are compatible.
24339
24340         (NewDelegate::DoResolve): Update to take care of the case when
24341         we instantiate a delegate from another delegate.
24342
24343         * typemanager.cs (FindMembers): Don't even try to look up members
24344         of Delegate types for now.
24345
24346 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24347
24348         * delegate.cs (NewDelegate): New class to take care of delegate
24349         instantiation.
24350
24351         * expression.cs (New): Split the delegate related code out into 
24352         the NewDelegate class.
24353
24354         * delegate.cs (DelegateInvocation): New class to handle delegate 
24355         invocation.
24356
24357         * expression.cs (Invocation): Split out delegate related code into
24358         the DelegateInvocation class.
24359
24360 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24361
24362         * expression.cs (New::DoResolve): Implement delegate creation fully
24363         and according to the spec.
24364
24365         (New::DoEmit): Update to handle delegates differently.
24366
24367         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24368         because of which we were printing out arguments in reverse order !
24369
24370         * delegate.cs (VerifyMethod): Implement to check if the given method
24371         matches the delegate.
24372
24373         (FullDelegateDesc): Implement.
24374
24375         (VerifyApplicability): Implement.
24376
24377         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24378         delegate invocations too.
24379
24380         (Invocation::Emit): Ditto.
24381
24382         * ../errors/cs1593.cs : Added.
24383
24384         * ../errors/cs1594.cs : Added.
24385
24386         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24387
24388 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24389
24390         * typemanager.cs (intptr_type): Core type for System.IntPtr
24391
24392         (InitCoreTypes): Update for the same.
24393
24394         (iasyncresult_type, asynccallback_type): Ditto.
24395
24396         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24397         correct.
24398
24399         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24400         too.
24401
24402         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24403         the builders for the 4 members of a delegate type :-)
24404
24405         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24406         type.
24407
24408         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24409
24410         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24411
24412 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24413
24414         * statement.cs (Break::Emit): Implement.   
24415         (Continue::Emit): Implement.
24416
24417         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24418         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24419         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24420         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24421         end loop
24422
24423         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24424         properties that track the label for the current loop (begin of the
24425         loop and end of the loop).
24426
24427 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24428
24429         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24430         use of emitting anything at all.
24431
24432         * class.cs, rootcontext.cs : Get rid of calls to the same.
24433
24434         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24435
24436         (Populate): Define the constructor correctly and set the implementation
24437         attributes.
24438
24439         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24440         have been defined.
24441
24442         (AddDelegateType): Implement.
24443
24444         (IsDelegateType): Implement helper method.
24445
24446         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24447
24448         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24449         and accordingly handle it.
24450
24451         * delegate.cs (Populate): Take TypeContainer argument.
24452         Implement bits to define the Invoke method. However, I still haven't figured out
24453         how to take care of the native int bit :-(
24454
24455         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24456         Qualify the name of the delegate, not its return type !
24457
24458         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24459         conversion.
24460
24461         (StandardConversionExists): Checking for array types turns out to be recursive.
24462
24463         (ConvertReferenceExplicit): Implement array conversion.
24464
24465         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24466
24467 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24468
24469         * cs-parser.jay (delegate_declaration): Store the fully qualified
24470         name as it is a type declaration.
24471
24472         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24473         readonly.
24474
24475         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24476         as TypeContainer::DefineType.
24477
24478         (Populate): Method in which all the definition of the various methods (Invoke)
24479         etc is done.
24480
24481         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24482         see.
24483
24484         (CloseDelegate): Finally creates the delegate.
24485
24486         * class.cs (TypeContainer::DefineType): Update to define delegates.
24487         (Populate, Emit and CloseType): Do the same thing here too.
24488
24489         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24490         delegates in all these operations.
24491
24492 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24493
24494         * expression.cs: LocalTemporary: a new expression used to
24495         reference a temporary that has been created.
24496
24497         * assign.cs: Handle PropertyAccess back here, so that we can
24498         provide the proper semantic access to properties.
24499
24500         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24501         a few more explicit conversions. 
24502
24503         * modifiers.cs: `NEW' modifier maps to HideBySig.
24504
24505         * expression.cs (PropertyExpr): Make this into an
24506         ExpressionStatement, and support the EmitStatement code path. 
24507
24508         Perform get/set error checking, clean up the interface.
24509
24510         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24511         them into toplevel access objects.
24512
24513 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24514
24515         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24516         SRE.
24517
24518         * typemanager.cs: Keep track here of our PropertyBuilders again to
24519         work around lameness in SRE.
24520
24521 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24522
24523         * expression.cs (LValue::LValueResolve): New method in the
24524         interface, used to perform a second resolution pass for LValues. 
24525
24526         (This::DoResolve): Catch the use of this in static methods.
24527
24528         (This::LValueResolve): Implement.
24529
24530         (This::Store): Remove warning, assigning to `this' in structures
24531         is 
24532
24533         (Invocation::Emit): Deal with invocation of
24534         methods on value types.  We need to pass the address to structure
24535         methods rather than the object itself.  (The equivalent code to
24536         emit "this" for structures leaves the entire structure on the
24537         stack instead of a pointer to it). 
24538
24539         (ParameterReference::DoResolve): Compute the real index for the
24540         argument based on whether the method takes or not a `this' pointer
24541         (ie, the method is static).
24542
24543         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24544         value types returned from functions when we need to invoke a
24545         method on the sturcture.
24546
24547
24548 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24549
24550         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24551         defining the type in the Modulebuilder or Typebuilder. This is to take
24552         care of nested types which need to be defined on the TypeBuilder using
24553         DefineNestedMethod.
24554
24555         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24556         methods in RootContext, only ported to be part of TypeContainer.
24557
24558         (TypeContainer::GetInterfaceOrClass): Ditto.
24559
24560         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24561
24562         * interface.cs (Interface::DefineInterface): New method. Does exactly
24563         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24564         too.
24565
24566         (Interface::GetInterfaces): Move from RootContext here and port.
24567
24568         (Interface::GetInterfaceByName): Same here.
24569
24570         * rootcontext.cs (ResolveTree): Re-write.
24571
24572         (PopulateTypes): Re-write.
24573
24574         * class.cs (TypeContainer::Populate): Populate nested types too.
24575         (TypeContainer::Emit): Emit nested members too.
24576
24577         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24578         instead just use the name argument passed in as it is already fully
24579         qualified.
24580
24581         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24582         to TypeContainer mapping to see if a type is user-defined.
24583
24584         * class.cs (TypeContainer::CloseType): Implement. 
24585
24586         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24587         the default constructor.
24588
24589         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24590         twice.
24591
24592         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24593
24594         * interface.cs (CloseType): Create the type here.
24595
24596         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24597         the hierarchy.
24598
24599         Remove all the methods which are now in TypeContainer.
24600
24601 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24602
24603         * delegate.cs (Define): Re-write bits to define the delegate
24604         correctly.
24605
24606 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24607
24608         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24609
24610         * expression.cs (ImplicitReferenceConversion): handle null as well
24611         as a source to convert to any reference type.
24612
24613         * statement.cs (Return): Perform any implicit conversions to
24614         expected return type.  
24615
24616         Validate use of return statement.  
24617
24618         * codegen.cs (EmitContext): Pass the expected return type here.
24619
24620         * class.cs (Method, Constructor, Property): Pass expected return
24621         type to EmitContext.
24622
24623 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24624
24625         * expression.cs: Make DoResolve take an EmitContext instead of a
24626         TypeContainer.
24627
24628         Replaced `l' and `location' for `loc', for consistency.
24629
24630         (Error, Warning): Remove unneeded Tc argument.
24631
24632         * assign.cs, literal.cs, constant.cs: Update to new calling
24633         convention. 
24634
24635         * codegen.cs: EmitContext now contains a flag indicating whether
24636         code is being generated in a static method or not.
24637
24638         * cs-parser.jay: DecomposeQI, new function that replaces the old
24639         QualifiedIdentifier.  Now we always decompose the assembled
24640         strings from qualified_identifier productions into a group of
24641         memberaccesses.
24642
24643 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24644
24645         * rootcontext.cs: Deal with field-less struct types correctly now
24646         by passing the size option to Define Type.
24647
24648         * class.cs: Removed hack that created one static field. 
24649
24650 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24651
24652         * statement.cs: Moved most of the code generation here. 
24653
24654 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24655
24656         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24657         seem very right.
24658
24659         (ElementAccess): Remove useless bits for now - keep checks as the spec
24660         says.
24661
24662 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24663
24664         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24665         and start performing checks according to the spec.
24666
24667 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24668
24669         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24670         rank_specifiers instead.
24671
24672         (rank_specifiers): Change the order in which the rank specifiers are stored
24673
24674         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24675
24676         * expression.cs (ElementAccess): Implement the LValue interface too.
24677
24678 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24679
24680         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24681         except that user defined conversions are not included.
24682
24683         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24684         perform the conversion of the return type, if necessary.
24685
24686         (New::DoResolve): Check whether we are creating an array or an object
24687         and accordingly do the needful.
24688
24689         (New::Emit): Same here.
24690
24691         (New::DoResolve): Implement guts of array creation.
24692
24693         (New::FormLookupType): Helper function.
24694
24695 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24696
24697         * codegen.cs: Removed most of the code generation here, and move the
24698         corresponding code generation bits to the statement classes. 
24699
24700         Added support for try/catch/finalize and throw.
24701
24702         * cs-parser.jay: Added support for try/catch/finalize.
24703
24704         * class.cs: Catch static methods having the flags override,
24705         virtual or abstract.
24706
24707         * expression.cs (UserCast): This user cast was not really doing
24708         what it was supposed to do.  Which is to be born in fully resolved
24709         state.  Parts of the resolution were being performed at Emit time! 
24710
24711         Fixed this code.
24712
24713 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24714
24715         * expression.cs: Implicity convert the result from UserCast.
24716
24717 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24718
24719         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24720         prevented it from working correctly. 
24721
24722         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24723         merely ConvertImplicit.
24724
24725 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24726
24727         * typemanager.cs: Make the LookupTypeContainer function static,
24728         and not per-instance.  
24729
24730         * class.cs: Make static FindMembers (the one that takes a Type
24731         argument). 
24732
24733         * codegen.cs: Add EmitForeach here.
24734
24735         * cs-parser.jay: Make foreach a toplevel object instead of the
24736         inline expansion, as we need to perform semantic analysis on it. 
24737
24738 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24739
24740         * expression.cs (Expression::ImplicitUserConversion): Rename to
24741         UserDefinedConversion.
24742
24743         (Expression::UserDefinedConversion): Take an extra argument specifying 
24744         whether we look for explicit user conversions too.
24745
24746         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24747
24748         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24749
24750         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24751         with the appropriate arguments.
24752
24753         * cs-parser.jay (cast_expression): Record location too.
24754
24755         * expression.cs (Cast): Record location info.
24756
24757         (Expression::ConvertExplicit): Take location argument.
24758
24759         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24760         to determine if we are doing explicit conversions.
24761
24762         (UserCast::Emit): Update accordingly.
24763
24764         (Expression::ConvertExplicit): Report an error if everything fails.
24765
24766         * ../errors/cs0030.cs : Add.
24767
24768 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24769
24770         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24771         virtual and newslot bits. 
24772
24773         * class.cs (TypeContainer::RegisterRequiredImplementations):
24774         Record methods we need.
24775
24776         (TypeContainer::MakeKey): Helper function to make keys for
24777         MethodBases, since the Methodbase key is useless.
24778
24779         (TypeContainer::Populate): Call RegisterRequiredImplementations
24780         before defining the methods.   
24781
24782         Create a mapping for method_builders_to_methods ahead of time
24783         instead of inside a tight loop.
24784
24785         (::RequireMethods):  Accept an object as the data to set into the
24786         hashtable so we can report interface vs abstract method mismatch.
24787
24788 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24789
24790         * report.cs: Make all of it static.
24791
24792         * rootcontext.cs: Drop object_type and value_type computations, as
24793         we have those in the TypeManager anyways.
24794
24795         Drop report instance variable too, now it is a global.
24796
24797         * driver.cs: Use try/catch on command line handling.
24798
24799         Add --probe option to debug the error reporting system with a test
24800         suite. 
24801
24802         * report.cs: Add support for exiting program when a probe
24803         condition is reached.
24804
24805 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24806
24807         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24808         we do a forcible conversion regardless of type, to check if 
24809         ForceConversion returns a null.
24810
24811         (Binary::error19): Use location to report error.
24812
24813         (Unary::error23): Use location here too.
24814
24815         * ../errors/cs0019.cs : Check in.
24816
24817         * ../errors/cs0023.cs : Check in.
24818
24819         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24820         case of a non-null MethodInfo object with a length of 0 !
24821
24822         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24823         an applicable member - according to the spec :-)
24824         Also fix logic to find members in base types.
24825
24826         (Unary::ResolveOperator): Same here.
24827
24828         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24829         as I was getting thoroughly confused between this and error19 :-)
24830
24831         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24832         (::FindMostEncompassedType): Implement.
24833         (::FindMostEncompassingType): Implement.
24834         (::StandardConversionExists): Implement.
24835
24836         (UserImplicitCast): Re-vamp. We now need info about most specific
24837         source and target types so that we can do the necessary conversions.
24838
24839         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24840         mathematical union with no duplicates.
24841
24842 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24843
24844         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24845         in order from base classes to child classes, so that we can in
24846         child classes look up in our parent for method names and
24847         attributes (required for handling abstract, virtual, new, override
24848         constructs: we need to instrospect our base class, and if we dont
24849         populate the classes in order, the introspection might be
24850         incorrect.  For example, a method could query its parent before
24851         the parent has any methods and would determine that the parent has
24852         no abstract methods (while it could have had them)).
24853
24854         (RootContext::CreateType): Record the order in which we define the
24855         classes.
24856
24857 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24858
24859         * class.cs (TypeContainer::Populate): Also method definitions can
24860         fail now, keep track of this.
24861
24862         (TypeContainer::FindMembers): Implement support for
24863         DeclaredOnly/noDeclaredOnly flag.
24864
24865         (Constructor::Emit) Return the ConstructorBuilder.
24866
24867         (Method::Emit) Return the MethodBuilder. 
24868         Check for abstract or virtual methods to be public.
24869
24870         * rootcontext.cs (RootContext::CreateType): Register all the
24871         abstract methods required for the class to be complete and the
24872         interface methods that must be implemented. 
24873
24874         * cs-parser.jay: Report error 501 (method requires body if it is
24875         not marked abstract or extern).
24876
24877         * expression.cs (TypeOf::Emit): Implement.
24878
24879         * typemanager.cs: runtime_handle_type, new global type.
24880
24881         * class.cs (Property::Emit): Generate code for properties.
24882
24883 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24884
24885         * expression.cs (Unary::ResolveOperator): Find operators on base type
24886         too - we now conform exactly to the spec.
24887
24888         (Binary::ResolveOperator): Same here.
24889
24890         * class.cs (Operator::Define): Fix minor quirk in the tests.
24891
24892         * ../errors/cs0215.cs : Added.
24893
24894         * ../errors/cs0556.cs : Added.
24895
24896         * ../errors/cs0555.cs : Added.
24897
24898 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24899
24900         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24901         single integer which is really efficient
24902
24903 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24904
24905         *  expression.cs (Expression::ImplicitUserConversion): Use location
24906         even in the case when we are examining True operators.
24907  
24908         * class.cs (Operator::Define): Perform extensive checks to conform
24909         with the rules for operator overloading in the spec.
24910
24911         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24912         some of the other conversions mentioned in the spec.
24913
24914         * typemanager.cs (array_type): New static member for the System.Array built-in
24915         type.
24916
24917         (cloneable_interface): For System.ICloneable interface.
24918
24919         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24920         we start resolving the tree and populating types.
24921
24922         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24923  
24924 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24925
24926         * expression.cs (Expression::ExprClassFromMemberInfo,
24927         Expression::Literalize): Create literal expressions from
24928         FieldInfos which are literals.
24929
24930         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24931         type casts, because they were wrong.  The test suite in tests
24932         caught these ones.
24933
24934         (ImplicitNumericConversion): ushort to ulong requires a widening
24935         cast. 
24936
24937         Int32 constant to long requires widening cast as well.
24938
24939         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24940         for integers because the type on the stack is not i4.
24941
24942 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24943
24944         * expression.cs (report118): require location argument. 
24945
24946         * parameter.cs: Do not dereference potential null value.
24947
24948         * class.cs: Catch methods that lack the `new' keyword when
24949         overriding a name.  Report warnings when `new' is used without
24950         anything being there to override.
24951
24952         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24953
24954         * class.cs: Only add constructor to hashtable if it is non-null
24955         (as now constructors can fail on define).
24956
24957         (TypeManager, Class, Struct): Take location arguments.
24958
24959         Catch field instance initialization in structs as errors.
24960
24961         accepting_filter: a new filter for FindMembers that is static so
24962         that we dont create an instance per invocation.
24963
24964         (Constructor::Define): Catch errors where a struct constructor is
24965         parameterless 
24966
24967         * cs-parser.jay: Pass location information for various new
24968         constructs. 
24969
24970         * delegate.cs (Delegate): take a location argument.
24971
24972         * driver.cs: Do not call EmitCode if there were problesm in the
24973         Definition of the types, as many Builders wont be there. 
24974
24975         * decl.cs (Decl::Decl): Require a location argument.
24976
24977         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24978         into integers, and find the most appropiate integer for it.
24979
24980         * literal.cs: Implement ULongLiteral.
24981
24982         * rootcontext.cs: Provide better information about the location of
24983         failure when CreateType fails.
24984
24985 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24986
24987         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24988         as well.
24989
24990         * expression.cs (Binary::CheckShiftArguments): Add missing type
24991         computation.
24992         (Binary::ResolveOperator): Add type to the logical and and logical
24993         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24994         before.
24995
24996         (Binary::DoNumericPromotions): In the case where either argument
24997         is ulong (and most signed types combined with ulong cause an
24998         error) perform implicit integer constant conversions as well.
24999
25000 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25001
25002         * expression.cs (UserImplicitCast): Method should always be
25003         non-null. 
25004         (Invocation::BetterConversion): Simplified test for IntLiteral.
25005
25006         (Expression::ImplicitNumericConversion): Split this routine out.
25007         Put the code that performs implicit constant integer conversions
25008         here. 
25009
25010         (Expression::Resolve): Become a wrapper around DoResolve so we can
25011         check eclass and type being set after resolve.
25012
25013         (Invocation::Badness): Remove this dead function
25014
25015         (Binary::ResolveOperator): Do not compute the expensive argumnets
25016         unless we have a union for it.
25017
25018         (Probe::Emit): Is needs to do an isinst and then
25019         compare against null.
25020
25021         (::CanConvert): Added Location argument.  If the Location argument
25022         is null (Location.Null), then we do not report errors.  This is
25023         used by the `probe' mechanism of the Explicit conversion.  We do
25024         not want to generate an error for something that the user
25025         explicitly requested to be casted.  But the pipeline for an
25026         explicit cast first tests for potential implicit casts.
25027
25028         So for now, if the Location is null, it means `Probe only' to
25029         avoid adding another argument.   Might have to revise this
25030         strategy later.
25031
25032         (ClassCast): New class used to type cast objects into arbitrary
25033         classes (used in Explicit Reference Conversions).
25034
25035         Implement `as' as well.
25036
25037         Reverted all the patches from Ravi below: they were broken:
25038
25039                 * The use of `level' as a mechanism to stop recursive
25040                   invocations is wrong.  That was there just to catch the
25041                   bug with a strack trace but not as a way of addressing
25042                   the problem.
25043
25044                   To fix the problem we have to *understand* what is going
25045                   on and the interactions and come up with a plan, not
25046                   just get things going.
25047
25048                 * The use of the type conversion cache that I proposed
25049                   last night had an open topic: How does this work across
25050                   protection domains.  A user defined conversion might not
25051                   be public in the location where we are applying the
25052                   conversion, a different conversion might be selected
25053                   (ie, private A->B (better) but public B->A (worse),
25054                   inside A, A->B applies, but outside it, B->A will
25055                   apply).
25056
25057                 * On top of that (ie, even if the above is solved),
25058                   conversions in a cache need to be abstract.  Ie, `To
25059                   convert from an Int to a Short use an OpcodeCast', not
25060                   `To convert from an Int to a Short use the OpcodeCast on
25061                   the variable 5' (which is what this patch was doing).
25062
25063 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25064
25065         * expression.cs (Invocation::ConversionExists): Re-write to use
25066         the conversion cache
25067
25068         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25069         cache all conversions done, not just user-defined ones.
25070
25071         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25072         to determine if a conversion exists instead of acutually trying to 
25073         perform the conversion. It's faster too.
25074
25075         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25076         and only then attempt the implicit conversion.
25077
25078 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25079
25080         * expression.cs (ConvertImplicit): Use a cache for conversions
25081         already found. Check level of recursion and bail out if necessary.
25082
25083 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25084
25085         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25086         Export standard methods that we expect for string operations.
25087
25088         * statement.cs (Block::UsageWarning): Track usage of variables and
25089         report the errors for not used variables.
25090
25091         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25092         operator. 
25093
25094 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25095
25096         * codegen.cs: remove unnneded code 
25097
25098         * expression.cs: Removed BuiltinTypeAccess class
25099
25100         Fix the order in which implicit conversions are
25101         done.  
25102
25103         The previous fixed dropped support for boxed conversions (adding a
25104         test to the test suite now)
25105
25106         (UserImplicitCast::CanConvert): Remove test for source being null,
25107         that code is broken.  We should not feed a null to begin with, if
25108         we do, then we should track the bug where the problem originates
25109         and not try to cover it up here.
25110
25111         Return a resolved expression of type UserImplicitCast on success
25112         rather than true/false.  Ravi: this is what I was talking about,
25113         the pattern is to use a static method as a "constructor" for
25114         objects. 
25115
25116         Also, do not create arguments until the very last minute,
25117         otherwise we always create the arguments even for lookups that
25118         will never be performed. 
25119
25120         (UserImplicitCast::Resolve): Eliminate, objects of type
25121         UserImplicitCast are born in a fully resolved state. 
25122
25123         * typemanager.cs (InitCoreTypes): Init also value_type
25124         (System.ValueType). 
25125
25126         * expression.cs (Cast::Resolve): First resolve the child expression.
25127
25128         (LValue): Add new method AddressOf to be used by
25129         the `&' operator.  
25130
25131         Change the argument of Store to take an EmitContext instead of an
25132         ILGenerator, because things like FieldExpr need to be able to call
25133         their children expression to generate the instance code. 
25134
25135         (Expression::Error, Expression::Warning): Sugar functions for
25136         reporting errors.
25137
25138         (Expression::MemberLookup): Accept a TypeContainer instead of a
25139         Report as the first argument.
25140
25141         (Expression::ResolvePrimary): Killed.  I still want to improve
25142         this as currently the code is just not right.
25143
25144         (Expression::ResolveMemberAccess): Simplify, but it is still
25145         wrong. 
25146
25147         (Unary::Resolve): Catch errors in AddressOf operators.
25148
25149         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25150         index to a byte for the short-version, or the compiler will choose
25151         the wrong Emit call, which generates the wrong data.
25152
25153         (ParameterReference::Emit, ::Store): same.
25154
25155         (FieldExpr::AddressOf): Implement.
25156
25157         * typemanager.cs: TypeManager: made public variable instead of
25158         property.
25159
25160         * driver.cs: document --fatal.
25161
25162         * report.cs (ErrorMessage, WarningMessage): new names for the old
25163         Error and Warning classes.
25164
25165         * cs-parser.jay (member_access): Turn built-in access to types
25166         into a normal simplename
25167
25168 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25169
25170         * expression.cs (Invocation::BetterConversion): Fix to cope
25171         with q being null, since this was introducing a bug.
25172
25173         * expression.cs (ConvertImplicit): Do built-in conversions first.
25174
25175 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25176
25177         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25178
25179 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25180
25181         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25182         I had introduced long ago (what's new ?).
25183
25184         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25185         the work of all the checking. 
25186         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25187         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25188
25189         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25190         that is the right way. 
25191
25192         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25193         overloading resolution. Use everywhere instead of cutting and pasting code.
25194
25195         (Binary::ResolveOperator): Use MakeUnionSet.
25196
25197         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25198         we have to convert to bool types. Not complete yet.
25199
25200 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25201
25202         * typemanager.cs (TypeManager::CSharpName): support ushort.
25203
25204         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25205         to provide an expression that performsn an implicit constant int
25206         conversion (section 6.1.6).
25207         (Expression::ConvertImplicitRequired): Reworked to include
25208         implicit constant expression conversions.
25209
25210         (Expression::ConvertNumericExplicit): Finished.
25211
25212         (Invocation::Emit): If InstanceExpression is null, then it means
25213         that we perform a call on this.
25214
25215 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25216
25217         * expression.cs (Unary::Emit): Remove some dead code.
25218         (Probe): Implement Resolve and Emit for `is'.
25219         (Expression::ConvertImplicitRequired): Attempt to do constant
25220         expression conversions here.  Maybe should be moved to
25221         ConvertImplicit, but I am not sure.
25222         (Expression::ImplicitLongConstantConversionPossible,
25223         Expression::ImplicitIntConstantConversionPossible): New functions
25224         that tell whether is it possible to apply an implicit constant
25225         expression conversion.
25226
25227         (ConvertNumericExplicit): Started work on explicit numeric
25228         conversions.
25229
25230         * cs-parser.jay: Update operator constants.
25231
25232         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25233         (Parameters::GetSignature): Hook up VerifyArgs here.
25234         (Parameters::VerifyArgs): Verifies that no two arguments have the
25235         same name. 
25236
25237         * class.cs (Operator): Update the operator names to reflect the
25238         ones that the spec expects (as we are just stringizing the
25239         operator names).
25240
25241         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25242         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25243         previous usage did only work for our methods.
25244         (Expression::ConvertImplicit): Handle decimal implicit numeric
25245         conversions as well.
25246         (Expression::InternalTypeConstructor): Used to invoke constructors
25247         on internal types for default promotions.
25248
25249         (Unary::Emit): Implement special handling for the pre/post
25250         increment/decrement for overloaded operators, as they need to have
25251         the same semantics as the other operators.
25252
25253         (Binary::ResolveOperator): ditto.
25254         (Invocation::ConversionExists): ditto.
25255         (UserImplicitCast::Resolve): ditto.
25256
25257 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25258
25259         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25260         operator, return after emitting body. Regression tests pass again !
25261
25262         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25263         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25264         (Invocation::OverloadResolve): Ditto.
25265         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25266
25267         * everywhere : update calls to the above methods accordingly.
25268
25269 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25270
25271         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25272
25273         * expression.cs (ExpressionStatement): New base class used for
25274         expressions that can appear in statements, so that we can provide
25275         an alternate path to generate expression that do not leave a value
25276         on the stack.
25277
25278         (Expression::Emit, and all the derivatives): We no longer return
25279         whether a value is left on the stack or not.  Every expression
25280         after being emitted leaves a single value on the stack.
25281
25282         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25283         facilties of ExpressionStatement if possible.
25284
25285         * cs-parser.jay: Update statement_expression.
25286
25287 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25288
25289         * driver.cs: Change the wording of message
25290
25291 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25292
25293         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25294         the type of the expression to the return type of the method if
25295         we have an overloaded operator match ! The regression tests pass again !
25296         (Unary::ResolveOperator): Ditto.
25297
25298         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25299         to find "op_Implicit", not "implicit" ;-)
25300         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25301         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25302
25303         * everywhere : Correct calls to the above accordingly.
25304
25305         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25306         (ConvertImplicit): Do user-defined conversion if it exists.
25307
25308 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25309
25310         * assign.cs: track location.
25311         (Resolve): Use implicit conversions on assignment.
25312
25313         * literal.cs: Oops.  Not good, Emit of short access values should
25314         pass (Bytes) or the wrong argument will be selected.
25315
25316         * expression.cs (Unary::Emit): Emit code for -expr.
25317
25318         (Unary::ResolveOperator): Handle `Substract' for non-constants
25319         (substract from zero from the non-constants).
25320         Deal with Doubles as well. 
25321
25322         (Expression::ConvertImplicitRequired): New routine that reports an
25323         error if no implicit conversion exists. 
25324
25325         (Invocation::OverloadResolve): Store the converted implicit
25326         expressions if we make them
25327
25328 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25329
25330         * class.cs (ConstructorInitializer): Take a Location argument.
25331         (ConstructorBaseInitializer): Same here.
25332         (ConstructorThisInitializer): Same here.
25333
25334         * cs-parser.jay : Update all calls accordingly.
25335
25336         * expression.cs (Unary, Binary, New): Take location argument.
25337         Update accordingly everywhere.
25338
25339         * cs-parser.jay : Update all calls to the above to take a location
25340         argument.
25341
25342         * class.cs : Ditto.
25343
25344 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25345
25346         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25347         (Invocation::BetterConversion): Same here
25348         (Invocation::ConversionExists): Ditto.
25349
25350         (Invocation::ConversionExists): Implement.
25351
25352 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25353
25354         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25355         Also take an additional TypeContainer argument.
25356
25357         * All over : Pass in TypeContainer as argument to OverloadResolve.
25358
25359         * typemanager.cs (CSharpName): Update to check for the string type and return
25360         that too.
25361
25362         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25363         a given method.
25364
25365 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25366
25367         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25368         (Invocation::BetterFunction): Implement.
25369         (Invocation::BetterConversion): Implement.
25370         (Invocation::ConversionExists): Skeleton, no implementation yet.
25371
25372         Okay, things work fine !
25373
25374 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25375
25376         * typemanager.cs: declare and load enum_type, delegate_type and
25377         void_type. 
25378
25379         * expression.cs (Expression::Emit): Now emit returns a value that
25380         tells whether a value is left on the stack or not.  This strategy
25381         might be reveted tomorrow with a mechanism that would address
25382         multiple assignments.
25383         (Expression::report118): Utility routine to report mismatches on
25384         the ExprClass.
25385
25386         (Unary::Report23): Report impossible type/operator combination
25387         utility function.
25388
25389         (Unary::IsIncrementableNumber): Whether the type can be
25390         incremented or decremented with add.
25391         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25392         complemented. 
25393         (Unary::ResolveOperator): Implement ++, !, ~,
25394
25395         (Invocation::Emit): Deal with new Emit convetion.
25396
25397         * All Expression derivatives: Updated their Emit method to return
25398         whether they leave values on the stack or not.
25399
25400         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25401         stack for expressions that are statements. 
25402
25403 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25404
25405         * expression.cs (LValue): New interface.  Must be implemented by
25406         LValue objects.
25407         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25408         LValue interface.
25409
25410         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25411         interface for generating code, simplifies the code.
25412
25413 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25414
25415         * expression.cs (everywhere): Comment out return statements in ::Resolve
25416         methods to avoid the warnings.
25417
25418 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25419
25420         * driver.cs (parse): Report error 2001 if we can not open the
25421         source file.
25422
25423         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25424         not resolve it.
25425
25426         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25427         object. 
25428
25429         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25430         otherwise nested blocks end up with the same index.
25431
25432         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25433
25434         * expression.cs:  Instead of having FIXMEs in the Resolve
25435         functions, throw exceptions so it is obvious that we are facing a
25436         bug. 
25437
25438         * cs-parser.jay (invocation_expression): Pass Location information.
25439
25440         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25441         Use a basename for those routines because .NET does not like paths
25442         on them. 
25443
25444         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25445         already defined.
25446
25447 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25448
25449         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25450         are loading the correct data types (throws an exception if not).
25451         (TypeManager::InitCoreTypes): Use CoreLookupType
25452
25453         * expression.cs (Unary::ResolveOperator): return the child
25454         expression for expressions which are just +expr.
25455         (Unary::ResolveOperator): Return negative literals for -LITERAL
25456         expressions (otherwise they are Unary {Literal}).
25457         (Invocation::Badness): Take into account `Implicit constant
25458         expression conversions'.
25459
25460         * literal.cs (LongLiteral): Implement long literal class.
25461         (IntLiteral): export the `Value' of the intliteral. 
25462
25463 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25464
25465         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25466
25467         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25468         instead of 'Operator'
25469
25470         * expression.cs (Binary::ResolveOperator): Update accordingly.
25471         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25472         and 'Minus'
25473
25474         * cs-parser.jay (unary_expression): Update to use the new names.
25475
25476         * gen-treedump.cs (GetUnary): Same here.
25477
25478         * expression.cs (Unary::Resolve): Implement.
25479         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25480         operators are found instead of making noise ;-)
25481         (Unary::ResolveOperator): New method to do precisely the same thing which
25482         Binary::ResolveOperator does for Binary expressions.
25483         (Unary.method, .Arguments): Add.
25484         (Unary::OperName): Implement.   
25485         (Unary::ForceConversion): Copy and Paste !
25486
25487         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25488         a unary operator.
25489
25490         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25491         for the inbuilt operators. Only overloading works for now ;-)
25492
25493 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25494
25495         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25496         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25497
25498         * expression.cs (This::Emit): Implement. 
25499         (This::Resolve): Implement.
25500         (TypeOf:Resolve): Implement.
25501         (Expression::ResolveSimpleName): Add an implicit this to instance
25502         field references. 
25503         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25504         Bind instance variable to Field expressions.
25505         (FieldExpr::Instance): New field used to track the expression that
25506         represents the object instance.
25507         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25508         binding 
25509         (FieldExpr::Emit): Implement.
25510
25511         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25512         the last instruction contains a return opcode to avoid generating
25513         the last `ret' instruction (this generates correct code, and it is
25514         nice to pass the peverify output).
25515
25516         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25517         initializer for static and instance variables.
25518         (Constructor::Emit): Allow initializer to be null in the case of
25519         static constructors.  Only emit initializer for instance
25520         constructors. 
25521
25522         (TypeContainer::FindMembers): Return a null array if there are no
25523         matches.
25524
25525         Also fix the code for the MemberTypes.Method branch, as it was not
25526         scanning that for operators (or tried to access null variables before).
25527
25528         * assign.cs (Assign::Emit): Handle instance and static fields. 
25529
25530         * TODO: Updated.
25531
25532         * driver.cs: Stop compilation if there are parse errors.
25533
25534         * cs-parser.jay (constructor_declaration): Provide default base
25535         initializer for non-static constructors.
25536         (constructor_declarator): Do not provide a default base
25537         initializers if none was specified.
25538         Catch the fact that constructors should not have parameters.
25539
25540         * class.cs: Do not emit parent class initializers for static
25541         constructors, that should be flagged as an error.
25542
25543 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25544
25545         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25546         Move back code into TypeContainer::Populate.
25547
25548 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25549
25550         * class.cs (TypeContainer::AddConstructor): Fix the check to
25551         compare against Name, not Basename. 
25552         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25553
25554         * cs-parser.jay : Update accordingly.
25555
25556         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25557         for methods, don't forget to look into the operators too.
25558         (RegisterMethodBuilder): Helper method to take care of this for
25559         methods, constructors and operators.
25560         (Operator::Define): Completely revamp.
25561         (Operator.OperatorMethod, MethodName): New fields.
25562         (TypeContainer::Populate): Move the registering of builders into
25563         RegisterMethodBuilder.
25564         (Operator::Emit): Re-write.
25565
25566         * expression.cs (Binary::Emit): Comment out code path to emit method
25567         invocation stuff for the case when we have a user defined operator. I am
25568         just not able to get it right !
25569
25570 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25571
25572         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25573         argument. 
25574
25575         (Expression::MemberLookup): Provide a version that allows to
25576         specify the MemberTypes and BindingFlags. 
25577
25578         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25579         so it was not fetching variable information from outer blocks.
25580
25581         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25582         Beforefieldinit as it was buggy.
25583
25584         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25585         that Ravi put here.  
25586
25587         * class.cs (Constructor::Emit): Only emit if block is not null.
25588         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25589         deal with this by semantically definining it as if the user had
25590         done it.
25591
25592         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25593         constructors as we now "emit" them at a higher level.
25594
25595         (TypeContainer::DefineDefaultConstructor): Used to define the
25596         default constructors if none was provided.
25597
25598         (ConstructorInitializer): Add methods Resolve and Emit. 
25599
25600         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25601
25602 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25603
25604         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25605         the default constructor builder with our hashtable for methodbuilders
25606         to methodcores.
25607
25608         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25609         and argument_count is 0 in which case we have a match.
25610         (Binary::ResolveOperator): More null checking and miscellaneous coding
25611         style cleanup.
25612
25613 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25614
25615         * rootcontext.cs (IsNameSpace): Compare against null.
25616
25617         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25618
25619         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25620         and Unary::Operator.
25621
25622         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25623         accordingly.
25624
25625         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25626         we have overloaded operators.
25627         (Binary::ResolveOperator): Implement the part which does the operator overload
25628         resolution.
25629
25630         * class.cs (Operator::Emit): Implement.
25631         (TypeContainer::Emit): Emit the operators we have too.
25632
25633         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25634         the case when we have a user-defined operator.
25635
25636 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25637
25638         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25639
25640 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25641
25642         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25643         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25644         (Constructor::Emit): Implement.
25645         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25646         if we have no work to do. 
25647         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25648         Emit method.
25649
25650         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25651         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25652
25653         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25654         of parent.parent.
25655
25656 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25657
25658         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25659         in the source.
25660         (Tree::RecordNamespace): Method to do what the name says ;-)
25661         (Tree::Namespaces): Property to get at the namespaces hashtable.
25662
25663         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25664         keep track.
25665
25666         * rootcontext.cs (IsNamespace): Fixed it :-)
25667
25668 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25669
25670         * class.cs (TypeContainer::FindMembers): Add support for
25671         constructors. 
25672         (MethodCore): New class that encapsulates both the shared aspects
25673         of a Constructor and a Method.  
25674         (Method, Constructor): Factored pieces into MethodCore.
25675
25676         * driver.cs: Added --fatal which makes errors throw exceptions.
25677         Load System assembly as well as part of the standard library.
25678
25679         * report.cs: Allow throwing exceptions on errors for debugging.
25680
25681         * modifiers.cs: Do not use `parent', instead use the real type
25682         container to evaluate permission settings.
25683
25684         * class.cs: Put Ravi's patch back in.  He is right, and we will
25685         have to cope with the
25686
25687 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25688
25689         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25690         FamORAssem, not FamANDAssem.
25691
25692 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25693
25694         * driver.cs: Added --parse option that only parses its input files
25695         and terminates.
25696
25697         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25698         incorrect.  IsTopLevel is not used to tell whether an object is
25699         root_types or not (that can be achieved by testing this ==
25700         root_types).  But to see if this is a top-level *class* (not
25701         necessarly our "toplevel" container). 
25702
25703 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25704
25705         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25706         parent instead of a direct call to GetType.
25707
25708 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25709
25710         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25711         Modifiers.TypeAttr. This should just be a call to that method.
25712
25713         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25714         object so that we can determine if we are top-level or not.
25715
25716         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25717         TypeContainer too.
25718
25719         * enum.cs (Enum::Define): Ditto.
25720
25721         * modifiers.cs (FieldAttr): Re-write.
25722
25723         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25724         (TypeContainer::HaveStaticConstructor): New property to provide access
25725         to precisely that info.
25726
25727         * modifiers.cs (MethodAttr): Re-write.
25728         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25729
25730         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25731         of top-level types as claimed.
25732
25733 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25734
25735         * expression.cs (MemberLookup): Fruitless attempt to lookup
25736         constructors.  Maybe I need to emit default constructors?  That
25737         might be it (currently .NET emits this for me automatically).
25738         (Invocation::OverloadResolve): Cope with Arguments == null.
25739         (Invocation::EmitArguments): new function, shared by the new
25740         constructor and us.
25741         (Invocation::Emit): Handle static and instance methods.  Emit
25742         proper call instruction for virtual or non-virtual invocations.
25743         (New::Emit): Implement.
25744         (New::Resolve): Implement.
25745         (MemberAccess:Resolve): Implement.
25746         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25747         to track instances.
25748         (FieldExpr::Resolve): Set type.
25749
25750         * support.cs: Handle empty arguments.
25751                 
25752         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25753         SimpleLookup): Auxiliary routines to help parse a qualifier
25754         identifier.  
25755
25756         Update qualifier_identifier rule.
25757
25758         * codegen.cs: Removed debugging messages.
25759
25760         * class.cs: Make this a global thing, this acts just as a "key" to
25761         objects that we might have around.
25762
25763         (Populate): Only initialize method_builders_to_methods once.
25764
25765         * expression.cs (PropertyExpr): Initialize type from the
25766         PropertyType. 
25767
25768         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25769         Resolve pattern.  Attempt to implicitly convert value to boolean.
25770         Emit code.
25771
25772         * expression.cs: Set the type for the int32/int32 argument case.
25773         (Binary::ResolveOperator): Set the return type to boolean for
25774         comparission operators
25775
25776         * typemanager.cs: Remove debugging print code.
25777
25778         (Invocation::Resolve): resolve type.
25779
25780         * class.cs: Allocate a MemberInfo of the correct size, as the code
25781         elsewhere depends on the test to reflect the correct contents.
25782
25783         (Method::) Keep track of parameters, due to System.Reflection holes
25784
25785         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25786         mapping here.
25787
25788         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25789         of the exact size and return that.
25790
25791         (Class::LookupMethodByBuilder): New function that maps
25792         MethodBuilders to its methods.  Required to locate the information
25793         on methods because System.Reflection bit us again.
25794
25795         * support.cs: New file, contains an interface ParameterData and
25796         two implementations: ReflectionParameters and InternalParameters
25797         used to access Parameter information.  We will need to grow this
25798         as required.
25799
25800         * expression.cs (Invocation::GetParameterData): implement a cache
25801         and a wrapper around the ParameterData creation for methods. 
25802         (Invocation::OverloadResolve): Use new code.
25803
25804 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25805
25806         * class.cs (TypeContainer::EmitField): Remove and move into 
25807         (Field::Define): here and modify accordingly.
25808         (Field.FieldBuilder): New member.
25809         (TypeContainer::Populate): Update accordingly.
25810         (TypeContainer::FindMembers): Implement.
25811
25812 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25813
25814         * statement.cs: (VariableInfo::VariableType): New field to be
25815         initialized with the full type once it is resolved. 
25816
25817 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25818
25819         * parameter.cs (GetParameterInfo): Use a type cache to compute
25820         things only once, and to reuse this information
25821
25822         * expression.cs (LocalVariableReference::Emit): Implement.
25823         (OpcodeCast::Emit): fix.
25824
25825         (ParameterReference::Resolve): Implement.
25826         (ParameterReference::Emit): Implement.
25827
25828         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25829         that are expressions need to stay as Expressions.
25830
25831         * typemanager.cs (CSharpName): Returns the C# name of a type if
25832         possible. 
25833
25834         * expression.cs (Expression::ConvertImplicit): New function that
25835         implements implicit type conversions.
25836
25837         (Expression::ImplicitReferenceConversion): Implements implicit
25838         reference conversions.
25839
25840         (EmptyCast): New type for transparent casts.
25841
25842         (OpcodeCast): New type for casts of types that are performed with
25843         a sequence of bytecodes.
25844
25845         (BoxedCast): New type used for casting value types into reference
25846         types.  Emits a box opcode.
25847
25848         (Binary::DoNumericPromotions): Implements numeric promotions of
25849         and computation of the Binary::Type.
25850
25851         (Binary::EmitBranchable): Optimization.
25852
25853         (Binary::Emit): Implement code emission for expressions.
25854
25855         * typemanager.cs (TypeManager): Added two new core types: sbyte
25856         and byte.
25857
25858 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25859
25860         * class.cs (TypeContainer::FindMembers): Method which does exactly
25861         what Type.FindMembers does, only we don't have to use reflection. No
25862         implementation yet.
25863
25864         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25865         typecontainer objects as we need to get at them.
25866         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25867
25868         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25869         typecontainer object.
25870
25871         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25872         of just a Report object.
25873
25874 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25875
25876         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25877         "remove_"
25878         (TypeContainer::Populate): Now define the delegates of the type too.
25879         (TypeContainer.Delegates): Property to access the list of delegates defined
25880         in the type.
25881
25882         * delegates.cs (Delegate::Define): Implement partially.
25883
25884         * modifiers.cs (TypeAttr): Handle more flags.
25885
25886 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25887
25888         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25889         and not <=
25890         (Operator::Define): Re-write logic to get types by using the LookupType method
25891         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25892         (Indexer::Define): Ditto.
25893         (Event::Define): Ditto.
25894         (Property::Define): Ditto.
25895
25896 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25897
25898         * class.cs (TypeContainer::Populate): Now define operators too. 
25899         (TypeContainer.Operators): New property to access the list of operators
25900         in a type.
25901         (Operator.OperatorMethodBuilder): New member to hold the method builder
25902         for the operator we are defining.
25903         (Operator::Define): Implement.
25904
25905 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25906
25907         * class.cs (Event::Define): Make the prefixes of the accessor methods
25908         addOn_ and removeOn_ 
25909
25910         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25911         of the location being passed in too. Ideally, this should go later since all
25912         error reporting should be done through the Report object.
25913
25914         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25915         (Populate): Iterate thru the indexers we have and define them too.
25916         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25917         for the get and set accessors.
25918         (Indexer::Define): Implement.
25919
25920 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25921
25922         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25923         my previous implementation, did not work.
25924
25925         * typemanager.cs: Add a couple of missing types (the longs).
25926
25927         * literal.cs: Use TypeManager.bool_type instead of getting it.
25928
25929         * expression.cs (EventExpr): New kind of expressions.
25930         (Expressio::ExprClassFromMemberInfo): finish
25931
25932 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25933
25934         * assign.cs: Emit stores to static fields differently.
25935
25936 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25937
25938         * Merge in changes and adjust code to tackle conflicts. Backed out my
25939         code in Assign::Resolve ;-) 
25940
25941 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25942
25943         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25944         instead Report.Error and also pass in the location.
25945         (CSharpParser::Lexer): New readonly property to return the reference
25946         to the Tokenizer object.
25947         (declare_local_variables): Use Report.Error with location instead of plain 
25948         old error.
25949         (CheckDef): Ditto.
25950
25951         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25952         (Operator.CheckBinaryOperator): Ditto.
25953
25954         * cs-parser.jay (operator_declarator): Update accordingly.
25955
25956         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25957         (CheckBinaryOperator): Same here.
25958
25959         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25960         on the name without any prefixes of namespace names etc. This is because we
25961         already might have something already fully qualified like 
25962         'System.Console.WriteLine'
25963
25964         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25965
25966 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25967
25968         * cs-tokenizer.cs (location): Return a string which also contains
25969         the file name.
25970
25971         * expression.cs (ElementAccess): New class for expressions of the
25972         type 'element access.'
25973         (BaseAccess): New class for expressions of the type 'base access.'
25974         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25975         respectively.
25976
25977         * cs-parser.jay (element_access): Implement action.
25978         (base_access): Implement actions.
25979         (checked_expression, unchecked_expression): Implement.
25980
25981         * cs-parser.jay (local_variable_type): Correct and implement.
25982         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25983
25984         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25985
25986         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25987         name and the specifiers.
25988
25989         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25990
25991         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25992         making them all public ;-)
25993
25994         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25995         class anyways.
25996
25997 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25998
25999         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26000         PropertyExprs.
26001         (FieldExpr, PropertyExprs): New resolved expressions.
26002         (SimpleName::MemberStaticCheck): Perform static checks for access
26003         to non-static fields on static methods. Maybe this should be
26004         generalized for MemberAccesses. 
26005         (SimpleName::ResolveSimpleName): More work on simple name
26006         resolution. 
26007
26008         * cs-parser.jay (primary_expression/qualified_identifier): track
26009         the parameter index.
26010
26011         * codegen.cs (CodeGen::Save): Catch save exception, report error.
26012         (EmitContext::EmitBoolExpression): Chain to expression generation
26013         instead of temporary hack.
26014         (::EmitStatementExpression): Put generic expression code generation.
26015
26016         * assign.cs (Assign::Emit): Implement variable assignments to
26017         local variables, parameters and fields.
26018
26019 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
26020
26021         * statement.cs (Block::GetVariableInfo): New method, returns the
26022         VariableInfo for a variable name in a block.
26023         (Block::GetVariableType): Implement in terms of GetVariableInfo
26024
26025         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26026         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26027
26028 2001-09-06  Ravi Pratap  <ravi@ximian.com>
26029
26030         * cs-parser.jay (operator_declaration): Continue on my quest : update
26031         to take attributes argument.
26032         (event_declaration): Ditto.
26033         (enum_declaration): Ditto.
26034         (indexer_declaration): Ditto.
26035
26036         * class.cs (Operator::Operator): Update constructor accordingly.
26037         (Event::Event): Ditto.
26038
26039         * delegate.cs (Delegate::Delegate): Same here.
26040
26041         * enum.cs (Enum::Enum): Same here.
26042
26043 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26044
26045         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26046
26047         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26048
26049         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26050         being passed around as an arraylist.
26051         (Attributes::AddAttribute): Method to add attribute sections.
26052
26053         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26054         (struct_declaration): Update accordingly.
26055         (constant_declaration): Update.
26056         (field_declaration): Update.
26057         (method_header): Update.
26058         (fixed_parameter): Update.
26059         (parameter_array): Ditto.
26060         (property_declaration): Ditto.
26061         (destructor_declaration): Ditto.
26062
26063         * class.cs (Struct::Struct): Update constructors accordingly.
26064         (Class::Class): Ditto.
26065         (Field::Field): Ditto.
26066         (Method::Method): Ditto.
26067         (Property::Property): Ditto.
26068         (TypeContainer::OptAttribute): update property's return type.
26069
26070         * interface.cs (Interface.opt_attributes): New member.
26071         (Interface::Interface): Update to take the extra Attributes argument.
26072
26073         * parameter.cs (Parameter::Parameter): Ditto.
26074
26075         * constant.cs (Constant::Constant): Ditto.
26076
26077         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26078         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26079         the attributes as a parameter.
26080         (InterfaceProperty): Update constructor call.
26081         (InterfaceEvent): Ditto.
26082         (InterfaceMethod): Ditto.
26083         (InterfaceIndexer): Ditto.
26084
26085         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26086         pass the attributes too.
26087         (interface_event_declaration): Ditto.
26088         (interface_property_declaration): Ditto.
26089         (interface_method_declaration): Ditto.
26090         (interface_declaration): Ditto.
26091
26092 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26093
26094         * class.cs (Method::Define): Track the "static Main" definition to
26095         create an entry point. 
26096
26097         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26098         EntryPoint if we find it. 
26099
26100         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26101         (EmitContext::ig): Make this variable public.
26102
26103         * driver.cs: Make the default output file be the first file name
26104         with the .exe extension.  
26105
26106         Detect empty compilations
26107
26108         Handle various kinds of output targets.  Handle --target and
26109         rename -t to --dumper.
26110
26111         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26112         methods inherited from Expression return now an Expression.  This
26113         will is used during the tree rewriting as we resolve them during
26114         semantic analysis.
26115
26116         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26117         the spec.  Missing entirely is the information about
26118         accessability of elements of it.
26119
26120         (Expression::ExprClassFromMemberInfo): New constructor for
26121         Expressions that creates a fully initialized Expression based on
26122         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26123         a Type.
26124
26125         (Invocation::Resolve): Begin implementing resolution of invocations.
26126
26127         * literal.cs (StringLiteral):  Implement Emit.
26128
26129 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26130
26131         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26132         member.
26133
26134 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26135
26136         * cs-parser.jay (attribute_arguments): Implement actions.
26137         (attribute): Fix bug in production. Implement action.
26138         (attribute_list): Implement.
26139         (attribute_target): Implement.
26140         (attribute_target_specifier, opt_target_specifier): Implement
26141         (CheckAttributeTarget): New method to check if the attribute target
26142         is valid.
26143         (attribute_section): Implement.
26144         (opt_attributes): Implement.
26145
26146         * attribute.cs : New file to handle attributes.
26147         (Attribute): Class to hold attribute info.
26148
26149         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26150         (attribute_section): Modify production to use 2 different rules to 
26151         achieve the same thing. 1 s/r conflict down !
26152         Clean out commented, useless, non-reducing dimension_separator rules.
26153
26154         * class.cs (TypeContainer.attributes): New member to hold list
26155         of attributes for a type.
26156         (Struct::Struct): Modify to take one more argument, the attribute list.
26157         (Class::Class): Ditto.
26158         (Field::Field): Ditto.
26159         (Method::Method): Ditto.
26160         (Property::Property): Ditto.
26161
26162         * cs-parser.jay (struct_declaration): Update constructor call to
26163         pass in the attributes too.
26164         (class_declaration): Ditto.
26165         (constant_declaration): Ditto.
26166         (field_declaration): Ditto.
26167         (method_header): Ditto.
26168         (fixed_parameter): Ditto.
26169         (parameter_array): Ditto.
26170         (property_declaration): Ditto.
26171
26172         * constant.cs (Constant::Constant): Update constructor similarly.
26173         Use System.Collections.
26174
26175         * parameter.cs (Parameter::Parameter): Update as above.
26176
26177 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26178
26179         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26180         (TypeContainer.delegates): New member to hold list of delegates.
26181
26182         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26183         this time as I seem to be on crack ;-)
26184
26185 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26186
26187         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26188         tell whether an identifier represents a namespace.
26189
26190         * expression.cs (NamespaceExpr): A namespace expression, used only
26191         temporarly during expression resolution.
26192         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26193         utility functions to resolve names on expressions.
26194
26195 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26196
26197         * codegen.cs: Add hook for StatementExpressions. 
26198
26199         * class.cs: Fix inverted test for static flag in methods.
26200
26201 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26202
26203         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26204         to make it coincide with MS' number.
26205         (Operator::CheckBinaryOperator): Ditto.
26206
26207         * ../errors/errors.txt : Remove error numbers added earlier.
26208
26209         * ../errors/cs1019.cs : Test case for error # 1019
26210
26211         * ../errros/cs1020.cs : Test case for error # 1020
26212
26213         * cs-parser.jay : Clean out commented cruft.
26214         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26215         used anywhere - non-reducing rule.
26216         (namespace_declarations): Non-reducing rule - comment out.
26217
26218         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26219         with TypeContainer::AddEnum.
26220
26221         * delegate.cs : New file for delegate handling classes.
26222         (Delegate): Class for declaring delegates.
26223
26224         * makefile : Update.
26225
26226         * cs-parser.jay (delegate_declaration): Implement.
26227
26228 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26229
26230         * class.cs (Event::Define): Implement.
26231         (Event.EventBuilder): New member.
26232
26233         * class.cs (TypeContainer::Populate): Update to define all enums and events
26234         we have.
26235         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26236         readonly fields for all these cases ?
26237
26238 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26239
26240         * class.cs (Property): Revamp to use the convention of making fields readonly.
26241         Accordingly modify code elsewhere.
26242
26243         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26244         the Define method of the Property class.
26245
26246         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26247         trivial bug.
26248         (TypeContainer::Populate): Update to define all the properties we have. Also
26249         define all enumerations.
26250
26251         * enum.cs (Define): Implement.
26252
26253 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26254
26255         * cs-parser.jay (overloadable_operator): The semantic value is an
26256         enum of the Operator class.
26257         (operator_declarator): Implement actions.
26258         (operator_declaration): Implement.
26259
26260         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26261         validity of definitions.
26262         (Operator::CheckBinaryOperator): Static method to check for binary operators
26263         (TypeContainer::AddOperator): New method to add an operator to a type.
26264
26265         * cs-parser.jay (indexer_declaration): Added line to actually call the
26266         AddIndexer method so it gets added ;-)
26267
26268         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26269         already taken care of by the MS compiler ?  
26270
26271 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26272
26273         * class.cs (Operator): New class for operator declarations.
26274         (Operator::OpType): Enum for the various operators.
26275
26276 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26277
26278         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26279         ostensibly handle this in semantic analysis.
26280
26281         * cs-parser.jay (general_catch_clause): Comment out
26282         (specific_catch_clauses, specific_catch_clause): Ditto.
26283         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26284         (catch_args, opt_catch_args): New productions.
26285         (catch_clause): Rewrite to use the new productions above
26286         (catch_clauses): Modify accordingly.
26287         (opt_catch_clauses): New production to use in try_statement
26288         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26289         and re-write the code in the actions to extract the specific and
26290         general catch clauses by being a little smart ;-)
26291
26292         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26293         Hooray, try and catch statements parse fine !
26294
26295 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26296
26297         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26298         string from the hashtable of variables.
26299
26300         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26301         I end up making that mistake ;-)
26302         (catch_clauses): Fixed gross error which made Key and Value of the 
26303         DictionaryEntry the same : $1 !!
26304
26305 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26306
26307         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26308
26309         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26310         when the add and remove accessors are specified. 
26311
26312 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26313
26314         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26315         information about indexer_declarator.
26316         (indexer_declarator): Implement actions.
26317         (parsing_indexer): New local boolean used to keep track of whether
26318         we are parsing indexers or properties. This is necessary because 
26319         implicit_parameters come into picture even for the get accessor in the 
26320         case of an indexer.
26321         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26322
26323         * class.cs (Indexer): New class for indexer declarations.
26324         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26325         (TypeContainer::indexers): New member to hold list of indexers for the
26326         type.
26327
26328 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26329
26330         * cs-parser.jay (add_accessor_declaration): Implement action.
26331         (remove_accessor_declaration): Implement action.
26332         (event_accessors_declaration): Implement
26333         (variable_declarators): swap statements for first rule - trivial.
26334
26335         * class.cs (Event): New class to hold information about event
26336         declarations.
26337         (TypeContainer::AddEvent): New method to add an event to a type
26338         (TypeContainer::events): New member to hold list of events.
26339
26340         * cs-parser.jay (event_declaration): Implement actions.
26341
26342 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26343
26344         * cs-parser.jay (dim_separators): Implement. Make it a string
26345         concatenating all the commas together, just as they appear.
26346         (opt_dim_separators): Modify accordingly
26347         (rank_specifiers): Update accordingly. Basically do the same
26348         thing - instead, collect the brackets here.
26349         (opt_rank_sepcifiers): Modify accordingly.
26350         (array_type): Modify to actually return the complete type string
26351         instead of ignoring the rank_specifiers.
26352         (expression_list): Implement to collect the expressions
26353         (variable_initializer): Implement. We make it a list of expressions
26354         essentially so that we can handle the array_initializer case neatly too.
26355         (variable_initializer_list): Implement.
26356         (array_initializer): Make it a list of variable_initializers
26357         (opt_array_initializer): Modify accordingly.
26358
26359         * expression.cs (New::NType): Add enumeration to help us
26360         keep track of whether we have an object/delegate creation
26361         or an array creation.
26362         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26363         members to hold data about array creation.
26364         (New:New): Modify to update NewType
26365         (New:New): New Overloaded contructor for the array creation
26366         case.
26367
26368         * cs-parser.jay (array_creation_expression): Implement to call
26369         the overloaded New constructor.
26370
26371 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26372
26373         * class.cs (TypeContainer::Constructors): Return member
26374         constructors instead of returning null.
26375
26376 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26377
26378         * typemanager.cs (InitCoreTypes): Initialize the various core
26379         types after we have populated the type manager with the user
26380         defined types (this distinction will be important later while
26381         compiling corlib.dll)
26382
26383         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26384         on Expression Classification.  Now all expressions have a method
26385         `Resolve' and a method `Emit'.
26386
26387         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26388         generation from working.     Also add some temporary debugging
26389         code. 
26390
26391 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26392
26393         * codegen.cs: Lots of code generation pieces.  This is only the
26394         beginning, will continue tomorrow with more touches of polish.  We
26395         handle the fundamentals of if, while, do, for, return.  Others are
26396         trickier and I need to start working on invocations soon.
26397
26398         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26399         s.InitStatement. 
26400
26401         * codegen.cs (EmitContext): New struct, used during code
26402         emission to keep a context.   Most of the code generation will be
26403         here. 
26404
26405         * cs-parser.jay: Add embedded blocks to the list of statements of
26406         this block.  So code generation proceeds in a top down fashion.
26407
26408 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26409
26410         * statement.cs: Add support for multiple child blocks.
26411
26412 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26413
26414         * codegen.cs (EmitCode): New function, will emit the code for a
26415         Block of code given a TypeContainer and its ILGenerator. 
26416
26417         * statement.cs (Block): Standard public readonly optimization.
26418         (Block::Block constructors): Link children. 
26419         (Block::Child): Child Linker.
26420         (Block::EmitVariables): Emits IL variable declarations.
26421
26422         * class.cs: Drop support for MethodGroups here, delay until
26423         Semantic Analysis.
26424         (Method::): Applied the same simplification that I did before, and
26425         move from Properties to public readonly fields.
26426         (Method::ParameterTypes): Returns the parameter types for the
26427         function, and implements a cache that will be useful later when I
26428         do error checking and the semantic analysis on the methods is
26429         performed.
26430         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26431         and made a method, optional argument tells whether this is a class
26432         or a structure to apply the `has-this' bit.
26433         (Method::GetCallingConvention): Implement, returns the calling
26434         convention. 
26435         (Method::Define): Defines the type, a second pass is performed
26436         later to populate the methods.
26437
26438         (Constructor::ParameterTypes): implement a cache similar to the
26439         one on Method::ParameterTypes, useful later when we do semantic
26440         analysis. 
26441
26442         (TypeContainer::EmitMethod):  New method.  Emits methods.
26443
26444         * expression.cs: Removed MethodGroup class from here.
26445
26446         * parameter.cs (Parameters::GetCallingConvention): new method.
26447
26448 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26449
26450         * class.cs (TypeContainer::Populate): Drop RootContext from the
26451         argument. 
26452
26453         (Constructor::CallingConvention): Returns the calling convention.
26454         (Constructor::ParameterTypes): Returns the constructor parameter
26455         types. 
26456
26457         (TypeContainer::AddConstructor): Keep track of default constructor
26458         and the default static constructor.
26459
26460         (Constructor::) Another class that starts using `public readonly'
26461         instead of properties. 
26462
26463         (Constructor::IsDefault): Whether this is a default constructor. 
26464
26465         (Field::) use readonly public fields instead of properties also.
26466
26467         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26468         track of static constructors;  If none is used, turn on
26469         BeforeFieldInit in the TypeAttributes. 
26470
26471         * cs-parser.jay (opt_argument_list): now the return can be null
26472         for the cases where there are no arguments. 
26473
26474         (constructor_declarator): If there is no implicit `base' or
26475         `this', then invoke the default parent constructor. 
26476
26477         * modifiers.cs (MethodAttr): New static function maps a set of
26478         modifiers flags into a MethodAttributes enum
26479         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26480         MethodAttr, TypeAttr to represent the various mappings where the
26481         modifiers are used.
26482         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26483
26484 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26485
26486         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26487         method arguments.
26488
26489         * interface.cs (PopulateIndexer): Implemented the code generator
26490         for interface indexers.
26491
26492 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26493
26494         * interface.cs (InterfaceMemberBase): Now we track the new status
26495         here.  
26496
26497         (PopulateProperty): Implement property population.  Woohoo!  Got
26498         Methods and Properties going today. 
26499
26500         Removed all the properties for interfaces, and replaced them with
26501         `public readonly' fields. 
26502
26503 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26504
26505         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26506         initialize their hashtables/arraylists only when they are needed
26507         instead of doing this always.
26508
26509         * parameter.cs: Handle refs and out parameters.
26510
26511         * cs-parser.jay: Use an ArrayList to construct the arguments
26512         instead of the ParameterCollection, and then cast that to a
26513         Parameter[] array.
26514
26515         * parameter.cs: Drop the use of ParameterCollection and use
26516         instead arrays of Parameters.
26517
26518         (GetParameterInfo): Use the Type, not the Name when resolving
26519         types. 
26520
26521 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26522
26523         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26524         and instead use public readonly fields.
26525
26526         * class.cs: Put back walking code for type containers.
26527
26528 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26529
26530         * class.cs (MakeConstant): Code to define constants.
26531
26532         * rootcontext.cs (LookupType): New function.  Used to locate types 
26533
26534
26535 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26536
26537         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26538         this System.Reflection code is.  Kudos to Microsoft
26539
26540         * typemanager.cs: Implement a type cache and avoid loading all
26541         types at boot time.  Wrap in LookupType the internals.  This made
26542         the compiler so much faster.  Wow.  I rule!
26543
26544         * driver.cs: Make sure we always load mscorlib first (for
26545         debugging purposes, nothing really important).
26546
26547         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26548         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26549
26550         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26551         on namespaces that have been imported using the `using' keyword.
26552
26553         * class.cs (TypeContainer::TypeAttr): Virtualize.
26554         (Class::TypeAttr): Return attributes suitable for this bad boy.
26555         (Struct::TypeAttr): ditto.
26556         Handle nested classes.
26557         (TypeContainer::) Remove all the type visiting code, it is now
26558         replaced with the rootcontext.cs code
26559
26560         * rootcontext.cs (GetClassBases): Added support for structs. 
26561
26562 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26563
26564         * interface.cs, statement.cs, class.cs, parameter.cs,
26565         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26566         Drop use of TypeRefs, and use strings instead.
26567
26568 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26569
26570         * rootcontext.cs: 
26571
26572         * class.cs (Struct::Struct): set the SEALED flags after
26573         checking the modifiers.
26574         (TypeContainer::TypeAttr): new property, returns the
26575         TypeAttributes for a class.  
26576
26577         * cs-parser.jay (type_list): Oops, list production was creating a
26578         new list of base types.
26579
26580         * rootcontext.cs (StdLib): New property.
26581         (GetInterfaceTypeByName): returns an interface by type name, and
26582         encapsulates error handling here.
26583         (GetInterfaces): simplified.
26584         (ResolveTree): Encapsulated all the tree resolution here.
26585         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26586         types. 
26587
26588         * driver.cs: Add support for --nostdlib, to avoid loading the
26589         default assemblies.
26590         (Main): Do not put tree resolution here. 
26591
26592         * rootcontext.cs: Beginning of the class resolution.
26593
26594 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26595
26596         * rootcontext.cs: Provide better error reporting. 
26597
26598         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26599
26600         * rootcontext.cs (CreateInterface): Handle the case where there
26601         are no parent interfaces.
26602
26603         (CloseTypes): Routine to flush types at the end.
26604         (CreateInterface): Track types.
26605         (GetInterfaces): Returns an array of Types from the list of
26606         defined interfaces.
26607
26608         * typemanager.c (AddUserType): Mechanism to track user types (puts
26609         the type on the global type hash, and allows us to close it at the
26610         end). 
26611
26612 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26613
26614         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26615         RecordInterface instead.
26616
26617         * cs-parser.jay: Updated to reflect changes above.
26618
26619         * decl.cs (Definition): Keep track of the TypeBuilder type that
26620         represents this type here.  Not sure we will use it in the long
26621         run, but wont hurt for now.
26622
26623         * driver.cs: Smaller changes to accomodate the new code.
26624
26625         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26626         when done. 
26627
26628         * rootcontext.cs (CreateInterface):  New method, used to create
26629         the System.TypeBuilder type for interfaces.
26630         (ResolveInterfaces): new entry point to resolve the interface
26631         hierarchy. 
26632         (CodeGen): Property, used to keep track of the code generator.
26633
26634 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26635
26636         * cs-parser.jay: Add a second production for delegate_declaration
26637         with `VOID'.
26638
26639         (enum_body): Put an opt_comma here instead of putting it on
26640         enum_body or enum_member_declarations so we can handle trailing
26641         commas on enumeration members.  Gets rid of a shift/reduce.
26642
26643         (type_list): Need a COMMA in the middle.
26644
26645         (indexer_declaration): Tell tokenizer to recognize get/set
26646
26647         * Remove old targets.
26648
26649         * Re-add the parser target.
26650
26651 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26652
26653         * cs-parser.jay: Add precendence rules for a number of operators
26654         ot reduce the number of shift/reduce conflicts in the grammar.
26655
26656 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26657
26658         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26659         and put it here.
26660
26661         Get rid of old crufty code.
26662
26663         * rootcontext.cs: Use this to keep track of the parsed
26664         representation and the defined types available to the program. 
26665
26666         * gen-treedump.cs: adjust for new convention.
26667
26668         * type.cs: Split out the type manager, and the assembly builder
26669         from here. 
26670
26671         * typemanager.cs: the type manager will live here now.
26672
26673         * cil-codegen.cs: And the code generator here. 
26674
26675 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26676
26677         * makefile: Fixed up for easy making.
26678
26679 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26680
26681         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26682         the 
26683
26684         (unary_expression): Expand pre_increment_expression and
26685         post_decrement_expression to reduce a shift/reduce.
26686
26687 2001-07-11  Simon Cozens
26688
26689         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26690
26691         Improve allow_keyword_as_indent name.
26692
26693 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26694
26695         * Adjustments for Beta2. 
26696
26697 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26698
26699         * decl.cs: Added `Define' abstract method.
26700         (InTransit): new property, used to catch recursive definitions. 
26701
26702         * interface.cs: Implement `Define'. 
26703
26704         * modifiers.cs: Map Modifiers.constants to
26705         System.Reflection.TypeAttribute flags.
26706
26707         * class.cs: Keep track of types and user-defined types.
26708         (BuilderInit): New method for creating an assembly
26709         (ResolveType): New function to launch the resolution process, only
26710         used by interfaces for now.
26711
26712         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26713         that are inserted into the name space. 
26714
26715 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26716
26717         * ARGH.  I have screwed up my tree so many times due to the use of
26718         rsync rather than using CVS.  Going to fix this at once. 
26719
26720         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26721         load types.
26722
26723 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26724
26725         * Experiment successful: Use System.Type rather that our own
26726         version of Type.  
26727
26728 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26729
26730         * cs-parser.jay: Removed nsAliases from here.
26731
26732         Use new namespaces, handle `using XXX;' 
26733
26734         * namespace.cs: Reimplemented namespace handling, use a recursive
26735         definition of the class.  Now we can keep track of using clauses
26736         and catch invalid using clauses.
26737
26738 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26739
26740         * gen-treedump.cs: Adapted for all the renaming.
26741
26742         * expression.cs (Expression): this class now has a Type property
26743         which returns an expression Type.
26744
26745         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26746         `Type', as this has a different meaning now in the base
26747
26748 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26749
26750         * interface.cs, class.cs: Removed from all the sources the
26751         references to signature computation, as we can not do method
26752         signature computation during the parsing time, as we are not
26753         trying to solve at that point distinguishing:
26754
26755         class X {
26756                 void a (Blah x) {}
26757                 void a (NS.Blah x) {}
26758         }
26759
26760         Which depending on the context might be valid or not, as we do not
26761         know if Blah is the same thing as NS.Blah at that point.
26762
26763         * Redid everything so the code uses TypeRefs now instead of
26764         Types.  TypeRefs are just temporary type placeholders, that need
26765         to be resolved.  They initially have a pointer to a string and the
26766         current scope in which they are used.  This is used later by the
26767         compiler to resolve the reference to an actual Type. 
26768
26769         * DeclSpace is no longer a CIR.Type, and neither are
26770         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26771         are all DeclSpaces, but no Types. 
26772
26773         * type.cs (TypeRefManager): This implements the TypeRef manager,
26774         which keeps track of all the types that need to be resolved after
26775         the parsing has finished. 
26776
26777 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26778
26779         * ARGH.  We are going to have to store `foreach' as a class rather
26780         than resolving it, as we need to verify error 1579 after name
26781         resolution.   *OR* we could keep a flag that says `This request to
26782         IEnumerator comes from a foreach statement' which we can then use
26783         to generate the error.
26784
26785 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26786
26787         * class.cs (TypeContainer.AddMethod): we now add methods to the
26788         MethodGroup instead of the method hashtable.  
26789
26790         * expression.cs: Add MethodGroup abstraction, which gets us one
26791         step closer to the specification in the way we handle method
26792         declarations.  
26793
26794         * cs-parser.jay (primary_expression): qualified_identifier now
26795         tried to match up an identifier to a local variable reference or
26796         to a parameter reference.
26797
26798         current_local_parameters is now a parser global variable that
26799         points to the current parameters for the block, used during name
26800         lookup.
26801
26802         (property_declaration): Now creates an implicit `value' argument to
26803         the set accessor.
26804
26805 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26806
26807         * parameter.cs: Do not use `param' arguments as part of the
26808         signature, per the spec.
26809
26810 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26811
26812         * decl.cs: Base class for classes, structs and interfaces.  This
26813         is the "Declaration Space" 
26814
26815         * cs-parser.jay: Use CheckDef for checking declaration errors
26816         instead of having one on each function.
26817
26818         * class.cs: Factor out some code for handling error handling in
26819         accordance to the "Declarations" section in the "Basic Concepts"
26820         chapter in the ECMA C# spec.
26821
26822         * interface.cs: Make all interface member classes derive from
26823         InterfaceMemberBase.
26824
26825 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26826
26827         * Many things: all interfaces are parsed and generated in
26828         gen-treedump.  Support for member variables, constructors,
26829         destructors, properties, constants is there.
26830
26831         Beginning of the IL backend, but very little done, just there for
26832         testing purposes. 
26833
26834 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26835
26836         * cs-parser.jay: Fix labeled statement.
26837
26838         * cs-tokenizer.cs (escape): Escape " and ' always.
26839         ref_line, ref_name: keep track of the line/filename as instructed
26840         by #line by the compiler.
26841         Parse #line.
26842
26843 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26844
26845         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26846         to match the values in System.CodeDOM.
26847
26848         Divid renamed to Divide.
26849
26850         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26851         statements. 
26852         (Statements.set): remove.
26853
26854         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26855         statements. 
26856
26857         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26858         falseStatements always have valid values. 
26859
26860         * cs-parser.jay: Use System.CodeDOM now.
26861