2007-08-07 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / mcs / ChangeLog
1 2007-08-07  Miguel de Icaza  <miguel@novell.com>
2
3         * class.cs: Add a little bit of help to help narrow down problems.
4
5         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
6         not try to copy in that case. 
7
8         * driver.cs: When building SMCS, include a new different set of
9         default assemblies here.   Do this here so we can control whether
10         to include the default assemblies with /noconfig.
11
12 2007-08-03  Marek Safar  <marek.safar@gmail.com>
13
14         A fix for bug #81979
15         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
16         only.
17
18 2007-08-03  Marek Safar  <marek.safar@gmail.com>
19
20         A fix for bug #82300
21
22         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
23         we are in probing scope.
24
25 2007-08-03  Marek Safar  <marek.safar@gmail.com>
26
27         A fix for bug #82301
28
29         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
30         (Statement.CloneTo): Clone and not map children blocks.
31
32 2007-08-03  Marek Safar  <marek.safar@gmail.com>
33
34         A fix for bug #82299
35
36         * expression.cs (LocalVariableReference.CloneTo): Remap local info
37         variable too.
38         
39         * statement.cs (Statement.CloneTo): Clone variables before statements
40         to allow remaping of local variables.
41
42 2007-08-03  Marek Safar  <marek.safar@gmail.com>
43
44         A fix for bug #82296
45
46         * anonymous.cs,
47         * report.cs: Log crash details for future clone problems.
48         
49         * statement.cs (Return.Clone): Don't clone non-existent expression.
50
51 2007-08-03  Raja R Harinath  <harinath@gmail.com>
52
53         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
54         (Class.AddBasesForPart): Move CS0537 check here from ...
55         * cs-parser.jay (class_declaration): ... here.  Move calling of
56         'AddBasesForPart' to ...
57         (class_bases): ... here.
58         (struct_declaration, interface_declaration): Update to changes.
59
60 2007-08-02  Marek Safar  <marek.safar@gmail.com>
61
62         A fix for bug #81923
63
64         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
65         conversion is allowed.
66
67 2007-08-02  Marek Safar  <marek.safar@gmail.com>
68
69         A fix for bug #81564
70
71         * ecore.cs (EventExpr): Add IsBase handling.
72
73         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
74         too.    
75         
76 2007-08-02  Raja R Harinath  <harinath@gmail.com>
77
78         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
79         * cs-parser.jay: Some whitespace cleanups.
80         (current_delegate): New.
81         (type_name): New.
82         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
83         a dummy code block, and use 'type_name' instead of 'member_name'.
84         (interface_declaration, class_declaration): Likewise.
85         (delegate_declaration): Likewise.  Rearrange slightly and use
86         'current_delegate'.
87         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
88         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
89
90 2007-08-02  Marek Safar  <marek.safar@gmail.com>
91
92         A fix for bug #82039
93
94         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
95         available.
96
97         * typemanager.cs (CSharpName): Split to string overload.
98
99 2007-08-02  Marek Safar  <marek.safar@gmail.com>
100
101         * expression.cs,
102         * report.cs: Updated warning CS0472.
103
104 2007-08-01  Marek Safar  <marek.safar@gmail.com>
105
106         A fix for bug #82181
107         * cs-parser.jay,
108         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
109
110 2007-08-01  Marek Safar  <marek.safar@gmail.com>
111
112         A fix for bug #82277
113         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
114
115 2007-08-01  Marek Safar  <marek.safar@gmail.com>
116
117         ** C# 3.0 Type Inference (major bits are working)
118         
119         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
120         (.ImplicitStandardConversionExists): Uses compatible.
121         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
122         (.InferReturnType): New method.
123         (.Compatible): Refactored.
124         (.ResolveParameters): Uses factory to create resolved parameters.
125         (.CompatibleMethod): Add probing mode support.
126         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
127         clearly distinguish between 2 different operations.
128         (LambdaMethod): Moved to lambda.cs.
129         (AnonymousMethod): Removed unused fields and methods.
130         (AnonymousDelegate): Simplified.
131         
132         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
133         
134         * convert. cs (ImplicitConversionStandard): Compatible works differently.
135         
136         * delegate.cs (Delegate): New mehods to reduce code duplication.
137         (.GetConstructor): New method.
138         (.GetInvokeMethod): New method.
139         (DelegateCreation): Updated.
140         
141         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
142         does not exist.
143         (OverloadResolve): Made probing little bit faster.
144         
145         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
146         when probing is on.
147         
148         * generic.cs (TypeInferenceContext): Dummy implementation.
149         
150         * iterators.cs: Updated after Resolve/Define rename.
151         
152         * lambda.cs (LambdaExpression)
153         (.ResolveParameters): Handles both type of arguments and type inference too.
154         
155         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
156         (InflateTypes): Updated.
157         
158         * support.cs (InflateTypes): Changed signature and updated.
159         
160         * typemanager.cs (LookupMemberCache): Better dynamic type check.
161         (MemberLookup_FindMembers): More MS tricks.
162         (GetParameterData): Ditto.
163         (GetDelegateParameters): Uses quick path for dynamic types.
164         
165 2007-08-01  Marek Safar  <marek.safar@gmail.com>
166
167         * class.cs (MethodData.Define): EmitContext is required for generic stuff
168         only.
169
170 2007-07-31  Marek Safar  <marek.safar@gmail.com>
171
172         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
173         syntax.
174         
175 2007-07-26  Jb Evain  <jbevain@novell.com>
176
177         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
178         which takes a boolean 'report_errors', similar to the GetMethod.
179         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
180         in .net 2.1, do not report errors here.
181
182         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
183         System.Runtime.CompilerServices.RequiredAttributeAttribute and
184         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
185         in .net 2.1.
186
187         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
188         of the type InternalsVisibleToAttribute before the first call
189         to CoreLookupType which is allowed to fail (third boolean parameter
190         to true). Because, during the resolution for a type that is not
191         immediately found, we try to check if the type is not defined in
192         a friend assembly, and to do so, we need the
193         InternalVisibleToAttribute.
194
195 2007-07-23  Miguel de Icaza  <miguel@novell.com>
196
197         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
198         feature that allows structs to be compared against null and inline
199         the result as true or false.
200
201         Notice that the same code is not permitted inside a generic block
202         of code that would do:
203
204         class Foo<T> where T : struct {
205             bool Eval (T x)
206             {
207                  return x == null;
208             }
209         }
210
211         It is only allowed if the type of T is not bound (no where
212         clause).   In my opinion, this CSC 2 behavior is broken but people
213         seem to be using it (IronRuby does, a few bug reports on bugzilla
214         have it and some people have complained about it).
215
216         All of the users that depend on this behavior have code that is
217         very likely broken. 
218         
219         * report.cs (Warning, Error): make these take object arguments,
220         not strings, as that allows us to take advantage of Format.
221
222 2007-07-20  William Holmes  <billholmes54@gmail.com>
223
224         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
225           Left member variable for the Count.
226         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
227           MemberName.CountTypeArguments to avoid a NRE. 
228
229         This code is contributed under the MIT X11 license
230
231 2007-07-18  Marek Safar  <marek.safar@gmail.com>
232
233         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
234
235 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
236
237         * doc.cs : generic method arguments are written as ``x while generic
238           type arguments are `x. Combined with the previous change, fixed bug
239           #79706.
240
241 2007-07-18  Raja R Harinath  <rharinath@novell.com>
242
243         Fix #82120
244         * expression.cs (Binary.ResolveOperator): When converting
245         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
246
247 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
248
249         * doc.cs : when T: or whatever x: is specified, it does not really
250           check the doc comment's syntax correctness. Fixed bug #82006.
251
252 2007-07-18  Marek Safar  <marek.safar@gmail.com>
253
254         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
255         LambdaExpression better.
256         
257         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
258         
259         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
260         
261         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
262         as it can be generated.
263         
264         * expression.cs (Invocation.Error_InvalidArguments): Show correct
265         modifiers.
266         
267         * lambda.cs (LambdaExpression): Refactored to share same code with
268         AnonymousMethodExpression.
269         
270 2007-07-17  Marek Safar  <marek.safar@gmail.com>
271
272         * anonymous.cs (MakeName): Include host name for easier debugging.
273         (LambdaMethod): New class for lambda spcecific stuff.
274         
275         * attribute.cs: Set EmitContext return type.
276
277         * class.cs: Set EmitContext return type.
278         
279         * codegen.cs (EmitContext): Return type cannot be null to stop messing
280         with null/void meaning.
281         
282         * iterators.cs (ContainerType): Implemented.
283         
284         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
285         
286         * statement.cs (Return): Updated to lambda expressions.
287         (Block.CloneTo): Parent can be null.
288                 
289 2007-07-13  Marek Safar  <marek.safar@gmail.com>
290
291         A fix for bug #81917
292         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
293         
294         * class.cs (FixedField): Check whether field is in unsafe scope.
295
296         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
297         (FieldExpr.Emit): Fixed buffers cannot be volatile.
298
299         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
300         FieldExpr.
301         
302         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
303                 
304 2007-07-13  Marek Safar  <marek.safar@gmail.com>
305
306         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
307         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
308         from Report class.
309
310 2007-07-13  Marek Safar  <marek.safar@gmail.com>
311
312         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
313         
314 2007-07-13  Marek Safar  <marek.safar@gmail.com>
315
316         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
317         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
318         
319         * codegen.cs(EmitContext): Add ProbingMode flag.
320         
321         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
322         
323         * driver.cs: For now set both warning values.
324         
325         * ecore.cs (SimpleName): Name is readonly.
326         (MethodGroup.OverloadResolve): One quick path for probing.
327         
328         * expression.cs (Unary): Set Oper r/o.
329         (Binary): Set Oper r/o.
330         (ParameterReference): Set few instance variables as r/o.
331         (ParameterReference.DoResolveBase): Don't capture aruments when 
332         the probing is on.
333         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
334         (Arglist): arguments are private.
335         (SizeOf): type is private and r/o.
336         (MemberAccess): arguments are private.
337
338         * report.cs: Enhanced reporting on/off capabilities.
339         
340         * lambda.cs: Uses ec.IsInProbingMode.
341         (ContextualReturn): Derives from return.
342         
343         * rootcontext.cs: For now set both warning values.
344         
345         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
346         copy if one exists.
347         (Return.Resolve): Don't die immediately.
348         (Block.Resolve): Speed-up probing.
349         (Block.CloneTo): Clone only child blocks.
350
351 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
352
353         * iterators.cs: reverted Miguel's latest change (r81925) as it
354         breaks the build in System.
355
356 2007-07-13  Miguel de Icaza  <miguel@novell.com>
357
358         * iterators.cs (Yield.CheckContext): Check for the iterator type
359         also here as we can call into Yield even in codepaths that are not
360         directly checked by
361         (MethodOrOperator is the only path that was checked).
362
363         In addition to the standard check, use a more specific check for
364         constructors to report a more verbose error. 
365
366 2007-07-12  Miguel de Icaza  <miguel@novell.com>
367
368         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
369         report the warning and continue 
370
371         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
372         values on the stack on the call to Emit.   Use EmitStatement if
373         possible, or using Emit + Pop if not possible.   Fixes #82064
374
375 2007-07-12  Raja R Harinath  <rharinath@novell.com>
376
377         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
378         avoid try...finally in some cases.
379
380 2007-07-10  Marek Safar  <marek.safar@gmail.com>
381
382         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
383         
384         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
385         instead of method. Re-use standard error handling.
386         (ConstructorInitializer.Emit): Simplified.
387         
388         * delegate.cs: Updated after Invocation.EmitCall change.
389         
390         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
391         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
392         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
393         method and don't permanently changing input arguments.
394         (MethodGroupExpr): Introduced resolved best_candidate, when method group
395         is resolved it has one of the candidates is the best one which is later
396         used to emit. Removed a few unused method.
397         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
398
399         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
400         (Binary.ResolveOperator): Ditto.
401         (ConditionalLogicalOperator.DoResolve): Ditto.
402         (Invocation): Uses method group.
403         (Invocation.DoResolve): Simplified.
404         (Invocation.EmitCall): Removed useless is_static.
405         (Invocation.Emit): Delegate to method group.
406         (Invocation.EmitStatement): Simplified.
407         (New): Uses method group.
408         (MemberAccess.DoResolve): Don't destroy original expression.
409         
410         * statement.cs (ForEach.Resolve): Use null for no method arguments.
411         
412 2007-07-04  Marek Safar  <marek.safar@gmail.com>
413
414         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
415         
416         * anonymous.cs,
417         * lambda.cs: Add custom error message type.
418
419 2007-07-03  Marek Safar  <marek.safar@gmail.com>
420
421         * lambda.cs: Simplified little bit.
422         
423         * parameter.cs: Introduced ImplicitLambdaParameter.
424         (Parameters.CreateFullyResolved): New factory instead of ctor.
425         
426         * anonymous.cs,
427         * class.cs,
428         * delegate.cs: Updated parameter creation.
429         
430 2007-07-03  Marek Safar  <marek.safar@gmail.com>
431
432         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
433         arguments.
434         
435         * generic.cs: Synchronized with gmcs.
436         
437 2007-07-03  Marek Safar  <marek.safar@gmail.com>
438
439         * class.cs (Indexer): Check return type as soon as possible.
440         
441         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
442         members too.
443         
444         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
445         
446         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
447         
448         * parameter.cs (Parameter): Use expression type when it is available.
449         
450         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
451         method modifier for the first parameter only.
452
453 2007-06-24  Marek Safar  <marek.safar@gmail.com>
454
455         A fix for bug #81938
456         * typemanager.cs (ChangeType): Fixed couple of char conversions.
457         
458         * constant.cs: Tide up an exception message.
459
460 2007-06-22  Marek Safar  <marek.safar@gmail.com>
461
462         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
463         an uninitialized variable is used.
464         
465         * expression.cs (LocalVariableReference.DoResolve): Ditto.
466
467 2007-06-22  Marek Safar  <marek.safar@gmail.com>
468
469         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
470         not found error handling.
471
472         * expression.cs (ArrayCreation): Removed redundant fields and little bit
473         simplified.
474         (ArrayCreation.ResolveArrayElement): To be ready to customization.
475         (ArrayCreation.DoResolve): Simplified.
476         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
477         its own resolve process.
478         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
479
480 2007-06-20  Marek Safar  <marek.safar@gmail.com>
481
482         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
483         more error details.
484         
485 2007-06-20  Marek Safar  <marek.safar@gmail.com>
486
487         * cs-tokenizer.cs: Removed var related stuff.
488         
489         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
490         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
491         a type and a keyword at same time.
492         
493         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
494         matches to "var".
495         
496         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
497         implicitly typed arrays, more changes will follow.
498         
499         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
500         
501 2007-06-19  Marek Safar  <marek.safar@gmail.com>
502
503         * ecore.cs (VarExpr): Removed Handled field.
504         
505         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
506         build-in assign functionality.
507         (ForEach.Resolve): Removed all implicitly typed local variable code and
508         simplified.
509         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
510         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
511
512 2007-06-18  Marek Safar  <marek.safar@gmail.com>
513
514         * assign.cs: Removed implicitly typed local variable check.
515         
516         * expression.cs (LocalVariableReference.DoResolve): Add check for self
517         referencing implicitly typed local variable.
518         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
519         variable here.
520         
521         * statement.cs (Fixed): Removed unsupported implicitly typed local
522         variable code.
523
524 2007-06-15  Marek Safar  <marek.safar@gmail.com>
525
526         * decl.cs (MemberName): Moved all Unbound stuff to parser.
527
528 2007-06-14  Marek Safar  <marek.safar@gmail.com>
529
530         A fix for bugs #81855 and #76274
531         * attribute.cs (AttachTo): Always set owner for global attributes to
532         prefined owner.
533         
534         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
535         usefull too.
536         
537         * cs-parser.jay: Assembly and module attributes must precede all other
538         elements except using clauses and extern alias declarations.
539
540 2007-06-13  Marek Safar  <marek.safar@gmail.com>
541
542         A fix for bug #81748
543         * cs-tokenizer.cs,
544         * expression.cs: More checks for non ISO-1 features.
545
546 2007-06-12  Marek Safar  <marek.safar@gmail.com>
547
548         A fix for bug #81807
549         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
550         present inside switch statement and it is required by nullable check.
551
552 2007-06-12  Marek Safar  <marek.safar@gmail.com>
553
554         A fix for bug #81840
555         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
556         when type matching fails.
557         
558         * namespace.cs: Tiny error message change.
559
560 2007-06-12  Marek Safar  <marek.safar@gmail.com>
561
562         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
563         reporting. Added automatic property check.
564         
565         * class.cs: Updated after CheckAbstractAndExtern relocation.
566         (AEventPropertyAccessor.GetSignatureForError): Customized.
567         
568 2007-06-11  Marek Safar  <marek.safar@gmail.com>
569
570         * class.cs (DefineBaseTypes): Base type can be undefined.
571         
572         * ecore.cs (TypeLookup): Minor refactoring.
573         (DoResolveAsTypeStep): Removed redundant check.
574
575         * namespace.cs (Lookup): Removed redundant check.
576                 
577         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
578         ResolveAsTypeTerminal step.
579         (BootstrapCorlib_*): Simplified.
580         (PopulateCoreType): Core types can be now external.
581
582 2007-06-07  Marek Safar  <marek.safar@gmail.com>
583
584         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
585          verification only.
586          (InferTypeArguments): Infers anonymous expression type arguments.
587          (Compatible): Split to Compatible and InferTypeArguments. 
588         
589         * lambda.cs: Updated.
590
591 2007-06-08  Marek Safar  <marek.safar@gmail.com>
592
593         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
594
595 2007-06-07  Raja R Harinath  <harinath@gmail.com>
596
597         Fix #80477, cs0135-2.cs, cs0135-3.cs
598         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
599         names to the "known" variables list.
600         (Block.CheckInvariantMeaningInBlock): Handle the fact the
601         parameter names are also "known".
602         (Block.CheckError136): Remove.
603         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
604         null.
605
606 2007-06-07  Marek Safar  <marek.safar@gmail.com>
607
608         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
609
610 2007-06-06  Marek Safar  <marek.safar@gmail.com>
611
612         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
613         internal error not an user error.
614          
615         * expression.cs (IsApplicable): Refactored to make debugging easier.
616
617         * support.cs: More tricks for non-mono runtimes.
618         
619         * typemanager.cs (CoreLookupType): Made public.
620         (InitSystemCore): All linq specific stuff moved to linq.cs
621
622 2007-06-05  Marek Safar  <marek.safar@gmail.com>
623
624         * typemanager.cs (CSharpSignature): One more missing build-in types
625         replacement.
626         More tricks for non-mono runtime.
627
628 2007-06-05  Raja R Harinath  <harinath@gmail.com>
629
630         * statement.cs (Block.CheckError136_InParents): Remove.
631         (Block.AddVariable): Use GetParameterInfo instead.
632         (ToplevelBlock.ProcessArguments): Likewise.
633
634 2007-06-04  Raja R Harinath  <rharinath@novell.com>
635
636         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
637         information too.
638         (ToplevelBlock.GetParameterInfo): Split out of ...
639         (ToplevelBlock.GetParameterRefernce): ... this.
640         (ToplevelBlock.ParameterMap): Remove.
641         * expression.cs (ParameterReference): Update to use
642         ToplevelParameterInfo.
643
644         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
645         regression.
646
647         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
648         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
649
650         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
651         (ToplevelBlock.ProcessParameters) ... here.
652         (ToplevelBlock..ctor): Invoke it.
653
654         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
655         new parameters.
656
657         * statement.cs (IKnownVariable): New interface.
658         (LocalInfo): Implement it.
659         (ToplevelParameterInfo): New class.
660         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
661         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
662         GetKnownVariableInfo.
663
664 2007-06-03  Raja R Harinath  <harinath@gmail.com>
665
666         Partly speed up CS0136 error checks.
667         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
668         'recurse' parameter.
669         (Block.DoCheckError136): Only check errors in parameters.  Move
670         local variable checks ...
671         (Block.AddVariable): ... here, and ...
672         (ToplevelBlock.ResolveMeta): ... here.
673
674 2007-06-02  Raja R Harinath  <harinath@gmail.com>
675
676         * statement.cs (Block.IsChildOf): Remove.
677
678         * statement.cs (Statement.Clone): Move special case code ...
679         (Block.CloneTo): ... here.
680
681 2007-05-29  Raja R Harinath  <rharinath@novell.com>
682
683         * statement.cs (ToplevelBlock.container): Remove field.  It's
684         redundant with 'Parent'.
685         (ToplevelBlock.ContainerBlock): Remove accessor.
686         (ToplevelBlock..ctor): Update to changes.  Register anonymous
687         child with parent here, ...
688         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
689         current_block.
690         (start_anonymous): Don't save current_block.
691         (top_current_block): Remove.
692
693         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
694         (Block.Resolve): Update to changes.
695         (Block..ctor): Move setting of "correct" 'Toplevel'
696         and 'Explicit' fields to ...
697         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
698
699 2007-05-27  Raja R Harinath  <harinath@gmail.com>
700
701         Kill Block.Implicit
702         * statement.cs (Block.Implicit): Remove.
703         (Block): Update to changes.
704         * flowanalysis.cs: Likewise.
705
706         Mildly speed up CheckInvariantMeaningInBlock
707         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
708         Recursively call AddKnownVariable to all enclosing blocks.
709         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
710         Remove recursive calls.
711         (Block): Update to changes.
712
713         New ExplicitBlock invariants
714         * statement.cs (Block.Explicit): New field.  It points to the
715         immediately enclosing non-implicit block.
716         (Block..ctor): Maintain the invariant.
717         * cs-parser.jay: Take advantage of invariant.
718
719         Introduce ExplicitBlock
720         * statement.cs (ExplicitBlock): New.
721         (ToplevelBlock): Derive from it.
722         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
723         sense of flag.
724         (Block.Implicit): Update to changes.
725         * cs-parser.jay: Update to changes.
726
727         Remove unused field
728         * codegen.cs (EmitContext.IsLastStatement): Remove.
729         * statement.cs (Block.DoEmit): Update to changes.
730
731 2007-05-25  Raja R Harinath  <rharinath@novell.com>
732
733         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
734         modifying current_block directly.
735
736 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
737         
738         * class.cs: Implemented automatic properties (C# 3.0)
739           Thanks to Marek for the help.
740
741 2007-05-23  Raja R Harinath  <rharinath@novell.com>
742
743         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
744         variable as assigned, note also that all its components are
745         assigned too.
746         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
747
748 2007-05-19  Marek Safar  <marek.safar@gmail.com>
749
750         * anonymous.cs, class.cs: Emit Compiler generated attribute when
751         member is marked as compiler generated.
752         
753         * decl.cs (MemberCore): Refactored ModFlags into property.
754
755         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
756         (Check): Check only accessibility modifiers.
757
758 2007-05-18  Raja R Harinath  <rharinath@novell.com>
759
760         Track all assignable slots in one bit array
761         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
762         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
763         logic from VariableMap constructor here.  Use the same 'offset'
764         variable that's later used for computing offsets of local
765         variables.
766         * flowanalysis.cs (UsageVector.parameters): Remove.
767         (UsageVector): Update to changes.
768         (VariableMap): Remove.
769
770         Avoid creating ParameterMap in every block
771         * statement.cs (Block.ParameterMap): Move ...
772         (ToplevelBlock.ParameterMap): ... here.
773         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
774         only once.
775         * flowanalysis.cs (FlowBranching.param_map): Remove.
776         (FlowBranching.UsageVector): Update to changes.
777         (FlowBranchingToplevel.CheckOutParameters): Likewise.
778
779         * statement.cs (Block.CloneTo): Clone Toplevel field too.
780
781         * expression.cs (ParameterReference): Distinguish between block
782         where parameter was referenced and declared.
783
784 2007-05-18  Marek Safar  <marek.safar@gmail.com>
785
786         * flowanalysis.cs, statement.cs: Put back improved error handling.
787
788 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
789         
790         * assign.cs:
791         * expression.cs:
792           Imporved object and collection initialization (C# 3.0).
793
794 2007-05-15  Marek Safar  <marek.safar@gmail.com>
795
796         A fix for bug #81380
797         * expression.cs (Is.DoResolve): Only value types have constant `is'
798         behaviour.
799
800 2007-05-15  Raja R Harinath  <rharinath@novell.com>
801
802         * statement.cs (ToplevelBlock.child): Remove.
803
804 2007-05-15  Raja R Harinath  <harinath@gmail.com>
805
806         Rationalize ResolveMeta: refactoring
807         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
808         out constant handling code into ...
809         (Block.DoResolveConstants): ... this.
810
811         Rationalize ResolveMeta: kill local_map
812         * statement.cs (Block.local_map, Block.LocalMap): Remove.
813         (Block.AssignableSlots): New.
814         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
815         for locals -- move code from VariableMap here.  Avoid unnecessary
816         allocations.
817         * flowanalysis.cs (FlowBranching.local_map): Remove.
818         (FlowBranching..ctor): Use Block.AssignableSlots.
819         (VariableMap): Remove unused constructors.
820
821 2007-05-11  Raja R Harinath  <rharinath@novell.com>
822
823         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
824
825 2007-05-11  Marek Safar  <marek.safar@gmail.com>
826
827         * typemanager.cs (IsFriendAssembly): Should not be called for building
828         assembly.
829
830 2007-05-09  Marek Safar  <marek.safar@gmail.com>
831
832         * literal.cs (NullConstant): Print null in all cases.
833         
834         * expression.cs (Binary.ResolveOperator): Implemented delegate
835          comparison based on C# 2.0 changes.
836
837 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
838
839         This code is contributed under the MIT X11 license
840         
841         The following enables support for several C# 3.0 language features:
842         
843         * cs-tokenizer.cs: Added support for the "var" keyword.
844         
845         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
846           Added VarExpr class to facilitate type inferencing.
847         
848         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
849           to support anonymous types.
850         
851         * assign.cs: Added support for type inferencing and initialization.
852         
853         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
854         
855         * expression.cs: Added implicit array support to ArrayCreation.
856           Added 5 types and 1 interface:
857           
858           IInitializable                Implementing classes can inject initializing
859                                         statements after object instantiation.
860           
861           Initializer                   Stores data for object initialization.
862           
863           AnonymousType                 An expression for anonymous types.
864           
865           AnonymousTypeParameter        Stores data about an anonymous type's field.
866           
867           NewInitialize                 An expression for object initialization.
868           
869           CollectionInitialize          An expression for collection initialization.
870         
871         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
872           statements.
873
874 2007-05-06  Marek Safar  <marek.safar@gmail.com>
875
876         A fix for bug #81500
877         * cs-tokenizer.cs: Add special handling for coalescing operator.
878
879 2007-05-06  Marek Safar  <marek.safar@gmail.com>
880
881         A fix for bug #81529
882         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
883         its value from base class until it is redefined.
884
885 2007-05-02  Raja R Harinath  <rharinath@novell.com>
886
887         Fix regression in cs0631-3.cs
888         * cs-parser.jay (operator_declarator): Add opt_attributes to error
889         fallback.  Make error fallback catch more cases.
890
891 2007-05-01  Miguel de Icaza  <miguel@novell.com>
892
893         * cs-parser.jay: Allow parameters in operator declarations to have
894         attributes. 
895
896 2007-04-27  Miguel de Icaza  <miguel@novell.com>
897
898         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
899         exists. 
900
901         * lambda.cs (ContextualReturn.Resolve): An expression is valid
902         inside the ContextualReturn, it does not have to be an
903         ExpressionStatement. 
904
905 2007-04-24  Miguel de Icaza  <miguel@novell.com>
906
907         * lambda.cs (ContextualReturn.Resolve): if the return type is not
908         set, set it.
909
910 2007-04-23  Miguel de Icaza  <miguel@novell.com>
911
912         * anonymous.cs (AnonymousContainer): split the virtual Resolve
913         method in two methods: ResolveNoDefine and Resolve.
914
915         ResolveNoDefine will stop just after ResolveTopBlock has been
916         called.   
917
918         Resolve will then continue by creating a method and issuing the
919         call to method.Define ().
920
921         (AnonymousMethod): Split and implement the new Resolve and
922         ResolveNoDefine as well.
923
924         * lambda.cs (LambdaExpression): Split the anonymous method
925         resolution code into a separate routine (CoreCompatibilityTest)
926         from DoCompatibleTest.
927
928         (LambdaExpression.TryBuild): New method, this method tries to
929         build the LambdaExpression with the given set of types to be used
930         as the types for the various parameters of the lambda expression. 
931
932         If the compilation succeed with the given types, the infered type
933         of the Anonymous method is returned, otherwise null is returned.
934
935 2007-04-23  Marek Safar  <marek.safar@gmail.com>
936
937         A fix for bug #81414
938         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
939
940 2007-04-22  Miguel de Icaza  <miguel@novell.com>
941
942         * cs-tokenizer.cs: Change various identifiers here from the
943         camelCasing to the recommended Linux-like style for instance
944         variables from the Coding Guidelines. 
945
946 2007-04-19  Martin Baulig  <martin@ximian.com>
947
948         * convert.cs
949         (Convert.ImplicitReferenceConversionCore): Allow conversions from
950         System.Enum to System.ValueType.
951
952 2007-04-13  Martin Baulig  <martin@ximian.com>
953
954         Rewrote implicit reference conversions.  We need to distinguish
955         between implicit reference conversions (13.1.4) and implicit
956         boxing conversions (13.1.5).
957
958         According to the spec, there's an an implicit conversion
959         "From a one-dimensional array-type S[] to IList<T> and base
960         interfaces of this interface, provided there is an implicit
961         reference conversion from S to T."  Note that this does not
962         include boxing conversions.
963
964         * convert.cs
965         (Convert.ImplicitTypeParameterBoxingConversion): New method.
966         (Convert.ImplicitReferenceConversion): Split into
967         ImplicitReferenceConversionCore() and
968         ImplicitBoxingConversionExist().
969         (Convert.ImplicitReferenceConversionExists): Use the new
970         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
971
972 2007-04-12  Martin Baulig  <martin@ximian.com>
973
974         * convert.cs (Convert.ImplicitReferenceConversion): Move the
975         `TypeManager.null_type' checks up to the top of the method.
976
977 2007-04-11  Marek Safar  <marek.safar@gmail.com>
978
979         A fix for bug #81350
980         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
981         extension methods.
982
983 2007-04-11  Martin Baulig  <martin@ximian.com>
984
985         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
986         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
987         to make this work for generic classes; fixes #79561.
988
989 2007-04-11  Martin Baulig  <martin@ximian.com>
990
991         * expression.cs (As): Add support for nullable types; fixes #79371.
992
993 2007-04-11  Martin Baulig  <martin@ximian.com>
994
995         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
996         `type.FullName' is null; fixes #80243.
997
998 2007-04-11  Martin Baulig  <martin@ximian.com>
999
1000         * expression.cs (Invocation.IsApplicable): Don't modify the method
1001         if type inference succeeded, but the method was not applicable.
1002         Fixes #81250.
1003
1004 2007-04-10  Marek Safar  <marek.safar@gmail.com>
1005
1006         A fix for bug #81324
1007         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
1008         internal and external namespaces containers.
1009
1010 2007-04-10  Martin Baulig  <martin@ximian.com>
1011
1012         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
1013         TypeManager.DropGenericMethodArguments() so we also call
1014         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
1015
1016 2007-04-10  Martin Baulig  <martin@ximian.com>
1017
1018         * iterators.cs (Iterator.CreateIterator): Don't crash if
1019         `method.ReturnType' is null.  This happens if something went wrong
1020         while resolving that typ (we already reported an error in this case).
1021
1022 2007-04-10  Martin Baulig  <martin@ximian.com>
1023
1024         * expression.cs (New.DoResolve): Don't call CheckComImport() on
1025         generic interfaces; report the CS0144 directly.
1026
1027 2007-04-10  Martin Baulig  <martin@ximian.com>
1028
1029         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
1030         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
1031
1032 2007-04-10  Martin Baulig  <martin@ximian.com>
1033
1034         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
1035
1036 2007-04-09  Raja R Harinath  <rharinath@novell.com>
1037
1038         A better fix
1039         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
1040         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
1041
1042         Fix #81338
1043         * statement.cs (For.Resolve): If resolution fails, use
1044         KillFlowBranching.
1045
1046 2007-04-08  Marek Safar  <marek.safar@gmail.com>
1047
1048         * anonymous.cs (MakeName): Make faster and zero-based.
1049         (VerifyExplicitParameterCompatibility): Back to mode where generic
1050         parameter is ignored.
1051         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
1052
1053         * class.cs (EmitType): Method can emit another new method.
1054
1055         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
1056
1057         * driver.cs: Updated.
1058
1059         * lambda.cs: Reuse predefined empty parameters.
1060
1061         * parameter.cs: Updated
1062
1063         * support.cs: Implemented InflateTypes.
1064
1065         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
1066         (InitSystemCore): Introduced to isolate 3.0 dependencies.
1067
1068 2007-04-03  Martin Baulig  <martin@ximian.com>
1069
1070         Fix #80632.
1071
1072         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
1073         version of TypeManager.IsOverride() which also works with generic
1074         types.  
1075
1076 2007-04-03  Martin Baulig  <martin@ximian.com>
1077
1078         Fix #81044.
1079
1080         * convert.cs
1081         (Convert.ExplicitReferenceConversion): We need to cast when
1082         converting from IList<T> to S[].
1083
1084 2007-04-01  Marek Safar  <marek.safar@gmail.com>
1085
1086         * decl.cs (FindExtensionMethods): Consider all candidates with same name
1087         at this level.
1088         
1089         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
1090
1091 2007-03-31  Marek Safar  <marek.safar@gmail.com>
1092
1093         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
1094         argument and return type inferring.
1095
1096         * codegen.cs (InferReturnType): Flag whether return can be inferred.
1097         (ReturnType): Turned to property.
1098
1099         * statement.cs (Return): Implemented return type inferring.
1100
1101         * support.cs (ReflectionParameters): Use local types if possible.
1102
1103 2007-03-30  Raja R Harinath  <rharinath@novell.com>
1104
1105         * flowanalysis.cs (FlowBranching.Reachability): Remove.
1106         (FlowBranching.UsageVector): Update to changes.
1107
1108         Prepare to kill 'Reachability'
1109         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
1110         argument of constructor.
1111
1112 2007-03-29  Raja R Harinath  <rharinath@novell.com>
1113
1114         Prepare to kill 'Reachability'
1115         * flowanalysis.cs (UsageVector.is_unreachable): New.
1116         (UsageVector): Update to maintain 'is_unreachable' in parallel to
1117         'reachability', and verify they're consistent.
1118
1119         Fix #81121
1120         * expression.cs (New.EmitStatement): Handle type parameters here too.
1121
1122 2007-03-29  Martin Baulig  <martin@ximian.com>
1123
1124         Fix #79148.
1125
1126         * anonymous.cs
1127         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
1128         CompilerGeneratedClass.
1129         (ScopeInfo.EmitScopeInstance): Make this protected.
1130         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
1131         `ec.CurrentAnonymousMethod.Scope == Scope'.
1132
1133         * statement.cs (Block.ScopeInfo): Make this a property.
1134
1135 2007-03-27  Raja R Harinath  <harinath@gmail.com>
1136
1137         Prepare to kill 'Reachability'
1138         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
1139         (FlowBranching.UsageVector.Reachability): Remove property.
1140         (FlowBranching.UsageVector.IsUnreachable): New property.
1141         (FlowBranching.UsageVector.ResetBarrier): New.
1142         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
1143         * codegen.cs, statement.cs: Update to changes.
1144
1145 2007-03-27  Martin Baulig  <martin@ximian.com>
1146
1147         Fix #81209.
1148
1149         * decl.cs
1150         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
1151         generic types.
1152
1153 2007-03-26  Raja R Harinath  <rharinath@novell.com>
1154
1155         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
1156         instead of TriState.  Remove all mention of TriState.
1157
1158         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
1159         replaced by a boolean.  Add boolean 'is_unreachable' field, check
1160         and maintain invariants.
1161
1162 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1163
1164         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
1165
1166 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1167
1168         * expression.cs: Stop using obsolete 2.0 opcodes.
1169
1170 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1171
1172         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
1173         one of the latests Martin's fixes.
1174
1175 2007-03-23  Miguel de Icaza  <miguel@novell.com>
1176
1177         * expression.cs: On BigEndian systems, swap the bytes, temporary
1178         solution until we get a new bitconverter class.
1179
1180 2007-03-23  Martin Baulig  <martin@ximian.com>
1181
1182         Fix #81158.
1183
1184         * decl.cs (MemberCache.AddMembers): Add generic methods both as
1185         "Method" and "Method`1".  Normally, a cache lookup is done on the
1186         "Method" form (ie. without the generic arity), but this one makes
1187         lookups on the full form work as well.
1188
1189 2007-03-22  Raja R Harinath  <rharinath@novell.com>
1190
1191         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
1192         unused properties.
1193
1194 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
1195         * class.cs: 
1196         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
1197         ordered_member_list, to TypeBuilder to store members to be defined
1198         in the order they were parsed in.
1199         - ordered_explicit_member_list contains all properties indexers
1200           and methods that are defined as explicit implementation of an
1201           interface or base class.
1202         - ordered_member_list contains all properties indexers and methods
1203           that are not defined as explicit implementation of an interface
1204           or base class.
1205
1206         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
1207         functionality in these removed classes has been replaced with 
1208         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
1209         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
1210
1211         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
1212         to CheckForDuplications inside GetMethod and SetMethod Define Method
1213         to handle method property and indexer name conflicts.
1214
1215         Fixes #79434
1216
1217         All code is contributed under the MIT/X11 license.
1218
1219 2007-03-20  Martin Baulig  <martin@ximian.com>
1220
1221         * class.cs (TypeContainer.Interfaces): Removed; they're now
1222         included in `TypeContainer.Types'.
1223
1224 2007-03-20  Martin Baulig  <martin@ximian.com>
1225
1226         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
1227
1228         * class.cs (TypeContainer.CreateType): New public method.  This is
1229         now called before DefineType() to create the TypeBuilders.
1230         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
1231         has already been created by CreateType().
1232         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
1233         don't resolve our base classes here; this has been moved into
1234         DefineBaseTypes().  We're now called from CreateType().
1235         (TypeContainer.DefineBaseTypes): New private method; resolve our
1236         base classes here.  We're now called from DefineType().
1237
1238         * rootcontext.cs
1239         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
1240         our types first to create all the TypeBuilders.  After that, call
1241         TypeContainer.DefineType() on all the types which'll resolve their
1242         base classes and setup the resolve order.
1243
1244 2007-03-20  Martin Baulig  <martin@ximian.com>
1245
1246         * class.cs (TypeContainer.Enums): Removed; they're now included in
1247         `TypeContainer.Types'.  
1248
1249 2007-03-20  Martin Baulig  <martin@ximian.com>
1250
1251         * class.cs
1252         (TypeContainer.DefineType): Don't call ResolveMembers() here.
1253         (TypeContainer.DoResolveMembers): Call DefineType() on our
1254         `compiler_generated' classes; moved here from DefineNestedTypes().
1255
1256         * rootcontext.cs
1257         (RootContext.ResolveTree): Call ResolveMembers() on all
1258         TypeContainer's in the `type_container_resolve_order'.
1259
1260 2007-03-19  Marek Safar  <marek.safar@gmail.com>
1261
1262         * class.cs: Use corlib to handle InternalMethodImplAttribute.
1263
1264 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1265
1266         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
1267         implementation flags.
1268
1269 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1270
1271         * class.cs: More optimizations for type parameters.
1272
1273 2007-03-15  Marek Safar  <marek.safar@gmail.com>
1274
1275         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
1276
1277         * ecore.cs, parameter.cs: More common code for both corlibs.
1278
1279         * typemanager.cs (IsGenericMethod): Simplified.
1280
1281 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1282
1283         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1284         'returns'.
1285         * statement.cs, iterators.cs, lambda.cs: Update to changes.
1286
1287         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
1288         unconditionally.  Simplify explanation.
1289         (Try.Resolve, Using.Resolve): Likewise.
1290
1291 2007-03-15  Martin Baulig  <martin@ximian.com>
1292
1293         Fix #80731.
1294
1295         * decl.cs (DeclSpace): If we're a partial class, use our
1296         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
1297
1298 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1299
1300         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1301         'throws'.
1302         (FlowBranching.UsageVector): Update to changes.
1303         (FlowBranching.MergeSiblings): Likewise.
1304         * statement.cs: Likewise.
1305
1306 2007-03-15  Martin Baulig  <martin@ximian.com>
1307
1308         Fix #79302.
1309
1310         * decl.cs
1311         (MemberCache): Added a special .ctor for type parameters.
1312
1313         * typemanager.cs
1314         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
1315         `MemberCache'.  
1316
1317 2007-03-09  Martin Baulig  <martin@ximian.com>
1318
1319         * enum.cs (Enum): Make this a TypeContainer.
1320         (EnumMember): Derive from `Const'.
1321
1322         * const.cs
1323         (Const.DoResolveValue): New protected virtual method; move most of
1324         the functionality of ResolveValue() here so we can override it in
1325         `EnumMember'.
1326         (Const.CreateConstantReference): Make this virtual.
1327
1328         * class.cs (Kind): Add `Kind.Enum'.
1329         (TypeContainer.Emit): Don't emit the enums here; they're already
1330         in the `RootContext.typecontainer_resolve_order'.
1331
1332         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
1333         here; they're already in the `typecontainer_resolve_order'.
1334
1335         * ecore.cs (EnumConstant.ConvertImplicitly): Add
1336         TypeManager.DropGenericTypeArguments().
1337
1338         * typemanager.cs
1339         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
1340         (TypeManager.IsEnumType): Likewise.
1341         (TypeManager.EnumToUnderlying): Likewise.
1342         (TypeManager.IsEqual): Add support for enums.
1343
1344 2007-03-12  Raja R Harinath  <rharinath@novell.com>
1345
1346         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
1347         DefaultParameterValueAttribute to be undefined, say if System.dll
1348         is not referenced.
1349
1350 2007-03-11  Marek Safar  <marek.safar@gmail.com>
1351
1352         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
1353         any mscorlib.
1354
1355 2007-03-10  Marek Safar  <marek.safar@gmail.com>
1356
1357         * class.cs, parameter.cs: Unified parameters verification.
1358
1359 2007-03-08  Martin Baulig  <martin@ximian.com>
1360
1361         * cs-parser.jay (constructor_header): Pass the location to the
1362         newly created TopLevelBlock.
1363
1364 2007-03-07  Martin Baulig  <martin@ximian.com>
1365
1366         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
1367
1368 2007-03-06  Miguel de Icaza  <miguel@novell.com>
1369
1370         * convert.cs (ExplicitReferenceConversionExists): Sync this method
1371         with the changes from David, fixes the build.
1372
1373 2007-03-05  David Mitchell  <dmitchell@logos.com>
1374
1375         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
1376         and its base interfaces to a one-dimensional array type S[],
1377         provided there is an implicit or explicit reference conversion
1378         from S to T.
1379
1380 2007-03-03  Marek Safar  <marek.safar@gmail.com>
1381
1382         * cs-tokenizer.cs: Implemented basic linq grammar.
1383
1384         * driver.cs: Set linq lang version on demand.
1385
1386 2007-02-26  Marek Safar  <marek.safar@gmail.com>
1387
1388         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
1389
1390 2007-02-25  Marek Safar  <marek.safar@gmail.com>
1391
1392         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
1393         (Fixes #80455)
1394
1395         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
1396         here.
1397         Check property and event extern attributes.
1398
1399         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
1400         charset.
1401
1402 2007-02-24  Marek Safar  <marek.safar@gmail.com>
1403
1404         A fix for bug #80407
1405         * ecore.cs: Don't report ambiguity error when methods have same parent.
1406
1407 2007-02-23  Marek Safar  <marek.safar@gmail.com>
1408
1409         A fix for bug #80878
1410         * class.cs, cs-parser.jay: Event property can host anonymous methods.
1411
1412 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1413
1414         * attribute.cs: Enable ExtensionAttribute presence test.
1415
1416 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1417
1418         * class.cs: Warn about missing GetHashCode only when Equals is override.
1419
1420         * decl.cs: Check accessibility of type arguments.
1421
1422         * typemanager.cs: Correctly report nullable array.
1423
1424 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1425
1426         * class.cs, report.cs: Capture more details when things go wrong.
1427
1428 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1429
1430         A fix for bug #80650
1431         * cs-parser.jay: Anonymous container starts at constructor declaration
1432         and not at block beginning because it has to be usable in constructor
1433         initializer.
1434
1435         * statement.cs: Use context location and not block one for error reporting.
1436
1437 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1438
1439         A fix for bug #78712
1440         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
1441         too.
1442
1443 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1444
1445         A fix for bug #80493 by Atsushi Enomoto
1446         * cs-parser.jay: Ignore invalid attribute target.
1447
1448 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1449  
1450         * cs-tokenizer.cs: Ignore '\0' as white space character.
1451
1452 2007-02-17  Miguel de Icaza  <miguel@novell.com>
1453
1454         * cs-parser.jay: Add support for lambda expressions to the mcs
1455         compiler as well.
1456
1457         * lambda.cs: Only clone when we are probing, not on the final call
1458         (Compatible is the final call). 
1459
1460         * statement.cs (CloneContext): Introduce class to provide block
1461         remapping during clone.
1462
1463         All statements Clone themselves now.
1464
1465         (Clone): special handling for blocks, when we clone a block, we
1466         register the block inside this routine, as children of the block
1467         might trigger a lookup. 
1468         
1469         * expression.cs: Add support for CloneContext in all expressions. 
1470         
1471 2007-02-17  Marek Safar  <marek.safar@gmail.com>
1472  
1473         A fix for bug #80493
1474         * statement.cs: Report ambiguous warning when interfaces are not related.
1475
1476 2007-02-15  Marek Safar  <marek.safar@gmail.com>
1477
1478         C# 3.0 extension methods.
1479
1480         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
1481         cannot be used directly.
1482
1483         * class.cs (Class.Emit): Emit extension attribute if any class method
1484         is extension method.
1485         (Method.Define): Add basic extension method validation conditions.
1486         (Method.Emit): Emit extension attribute for method.
1487
1488         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
1489         extension method exists. Currently we follow same approach as Microsoft
1490         does, emit even if a method or a class are private but this can change
1491         later.
1492
1493         * cs-parser.jay: Add handling of `this' keyword in method parameters
1494         context.
1495
1496         * decl.cs (DeclSpace.IsStaticClass): New property.
1497         (MemberCache.FindExtensionMethods): Looks for extension methods with
1498         defined name and extension type.
1499
1500         * doc.cs: Updated after OverloadResolve changes.
1501
1502         * driver.cs: Add new soft reference to System.Core.dll.
1503
1504         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
1505         (ExtensionMethodGroupExpr): Represents group of extension methods.
1506
1507         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
1508         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
1509         to MethodGroupExpr and made non-static for easier customization.
1510         (Invocation.DoResolve): Add extension method lookup when no standard
1511         method was found.
1512         (MemberAccess.DoResolve): Try extension methods if no member exists.
1513
1514         * modifiers.cs: Add METHOD_EXTENSION modifier.
1515
1516         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
1517         as well as candidate extension type.
1518         (ComputeNamespaces): When assembly constains extension methods registers
1519         them.
1520         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
1521         extension method lookup.
1522         (Namespace.LookupExtensionMethod): Looks for extension method in this
1523         namespace.
1524         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
1525         find a method which matches name and extensionType.
1526
1527         * parameter.cs (Parameter): Add This modifer.
1528         (HasExtensionMethodModifier): New property.
1529         (Resolve): Add extension parameter check.
1530         (ModFlags): turned to property to exclude this modifier as it is not real
1531         parameter modifier.
1532         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
1533
1534         * support.cs (ParameterData): Add ExtensionMethodType.
1535         (ReflectionParameters): Implemented ExtensionMethodType interface property.
1536
1537         * typemanager.cs: Add type and ctor extension attribute type.
1538
1539 2007-02-15  Miguel de Icaza  <miguel@novell.com>
1540
1541         * report.cs (DisableErrors, EnableErrors): used to prevent error
1542         output when we are "trying" to compile various methods with
1543         different types. 
1544
1545         * ecore.cs (Expression): Add Clone method that calls the virtual
1546         CloneTo method.  The current CloneTo method in Expression throws
1547         an exception so we can track down all the places where this must
1548         be implemented (not using abstract, because that would be a lot of
1549         up-front-work before we can start testing the implementation
1550         idea). 
1551
1552         Important: we only need Clone capabilities for expressions created
1553         by the parser, as the expressions we will be cloning are
1554         expressions in the pre-resolved state.   This vastly simplifies
1555         the work required. 
1556         
1557         (SimpleName): Add CloneTo that does nothing.
1558         (EmptyCast): Add CloneTo.
1559         
1560         * expression.cs (Binary): Implement CloneTo.
1561         (Invocation.IsApplicable): Store the current ec in
1562         EmitContext.TempEc and restore it on return.  This is used so we
1563         do not have to sprinkle hundres of methods with an extra
1564         EmitContext, we know that the only user is the lambda expression
1565         ImplicitConversionExists code. 
1566         
1567         (Argument): Add Cloning capabilities.
1568         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
1569         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
1570         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
1571         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
1572         IndexerAccess): Add Clone capability.
1573
1574         (LocalVariableReference, This): TODO: needs cloned Block mapping.
1575
1576         (Argument): Add cloning capability.
1577
1578         * assign.cs (Assign): Implement CloneTo.
1579
1580         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
1581         
1582         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
1583         version by calling Convert with the EmitContext (that we are
1584         currently storing in ec, this is not great, but will do for now,
1585         to avoid passing EmitContext parameters to hundreds of functions
1586         that do not need them now).
1587
1588         (SetExpression): Remove, it is not needed.
1589         
1590         (ContextualReturn): Implement CloneTo.
1591
1592         * statement.cs (Statement): Implement cloning infrastructure,
1593         similar to expressions.
1594
1595         (Block): Partial implementation of Clone for statements.
1596
1597         (Return): Implement clone.
1598         
1599         * constant.cs (Constant.CloneTo): New method, does nothing.
1600
1601         * codegen.cs (TempEc): Add a static EmitContext as a temporary
1602         solution, until we decide how to exactly do this.  
1603         
1604 2007-02-14  Marek Safar  <marek.safar@gmail.com>
1605  
1606         A fix for bug #80493
1607         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
1608         a property is override we need to use second accessor.
1609
1610 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1611  
1612         A fix for bug #80418
1613         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1614         methods.
1615
1616 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1617
1618         Another fix for bug #80749
1619         * pending.cs: Abstract class has priority over interfaces.
1620
1621 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1622
1623         Another fix for bug #80749
1624         * pending.cs: Abstract class has priority over interfaces.
1625
1626 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1627
1628         Another fix for bug #80749
1629         * pending.cs: Abstract class has priority over interfaces.
1630
1631 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1632
1633         Another fix for bug #80749
1634         * pending.cs: Abstract class has priority over interfaces.
1635
1636 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1637
1638         * class.cs Better error message.
1639
1640         * driver.cs: Add shorter versions of -optimize option.
1641
1642 2007-02-13  Martin Baulig  <martin@ximian.com>
1643
1644         * class.cs (Constructor.Emit): Check the return value of
1645         ec.ResolveTopBlock() and return on error.
1646
1647 2007-02-13  Raja R Harinath  <rharinath@novell.com>
1648
1649         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1650         message to fix error message regression.
1651
1652 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1653
1654         * delegate.cs: Delegate creation expression cannot be of Nullable type.
1655
1656 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1657
1658         A fix for bug #80749
1659         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1660         its parent container.
1661
1662         * class.cs (DefineFieldInitializers): Each initializer can has different
1663         resolve context.
1664
1665         * const.cs: Updated.
1666
1667 2007-02-11  Miguel de Icaza  <miguel@novell.com>
1668
1669         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1670         now all the heavy lifting to check that embedded statements or
1671         expressions have the right form is done in the ContextualReturn.
1672
1673         (ContextualReturn): New class.  
1674
1675         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1676         method that can be invoked to report 201, so we do not replicate
1677         this everywhere.
1678
1679         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1680         
1681         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1682         treating tabs as spaces. 
1683
1684 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1685
1686         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1687         * assign.cs: Use full implicit conversion for right side check.
1688
1689 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1690
1691         * statement.cs (Switch): Switch over boolean type is not standardized.
1692
1693 2007-02-08  Marek Safar  <marek.safar@gmail.com>
1694
1695         A fix for bug #80755
1696         * decl.cs (FindBaseEvent): Don't use method cache for events.
1697
1698 2007-02-07  Marek Safar  <marek.safar@gmail.com>
1699
1700         * cs-parser.jay: Better syntax error handling.
1701
1702         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1703         instead of underlying type value.
1704
1705 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1706
1707         * driver.cs: Check define identifier before is registered.
1708
1709         * namespace.cs: Use existing error message.
1710
1711         * report.cs: New warning.
1712
1713 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1714
1715         A fix for bug #80742
1716         * expression.cs: Delegate Invoke method can be called directly.
1717
1718 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1719
1720         A fix for bug #80676
1721         * class.cs (IsEntryPoint): The Main method can have params modifier.
1722
1723 2007-02-04  Miguel de Icaza  <miguel@novell.com>
1724
1725         * parameter.cs (Parameter, Parameters): Add Clone method.
1726
1727         * anonymous.cs (Compatible): Turn method into virtual method, so
1728         LambdaExpression can implement a different behavior.
1729
1730         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1731         out the basic checking here, so it can be used by
1732         LambdaExpressions.
1733         
1734         * lambda.cs: Introduce "Compatible" function that will do the
1735         heavy lifting.
1736
1737 2007-02-02  Marek Safar  <marek.safar@gmail.com>
1738
1739         * attribute.cs: Unified one error message.
1740
1741         * class.cs (Class): Use type attributes and not properties to test static
1742         class.
1743         (IsEntryPoint): Don's pass local variable.
1744
1745         * convert.cs: Removed duplicate check.
1746
1747         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1748
1749         * driver.cs: Don't crash when soft reference does not exist.
1750
1751         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1752         (UsingEntry): Removed redundant allocation.
1753
1754         * parameter.cs: Add fast path for type parameters.
1755
1756         * support.cs: Don't allocate attribute when it's not used.
1757
1758 2007-01-30  Miguel de Icaza  <miguel@novell.com>
1759
1760         * anonymous.cs
1761         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1762         this into a virtual method, so we can override it in LambdaExpression.
1763
1764         * driver.cs: Improve diagnostics in case of failure. 
1765
1766         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1767         write a function that is slightly more complex and that parses:
1768
1769         type identifier [, type identifier]* )
1770
1771         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1772         this expression:
1773
1774                 (canEmpty ? i >= 0 : i > 0)
1775
1776 2007-01-30  Raja R Harinath  <rharinath@novell.com>
1777
1778         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1779         exception on possibly valid code.
1780
1781 2007-01-29  Raja R Harinath  <rharinath@novell.com>
1782
1783         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1784         Push/PopPosition.
1785         (parse_opt_type_arguments): Remove.  It's almost the same as
1786         parse_less_than.
1787         (parse_namespace_or_typename): Use parse_less_than.
1788
1789 2007-01-28  Miguel de Icaza  <miguel@novell.com>
1790
1791         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1792         this bug took a few hours to find, because the state saved and
1793         restored by PushPosition and PopPosition was ignoring the state of
1794         parse_generic_less_than.
1795
1796         I can also now remove the handling of OP_LT and OP_GT, this solves
1797         the big mistery.
1798         
1799         * cs-tokenizer.cs: store the location for the ARROW token, we use
1800         that in the parser.
1801
1802         (PushPosition, PopPosition): save/restore also `current_token',
1803         restore `parse_generic_less_than' (was missing).
1804
1805         (parse_opt_type_arguments): use parse_type, not
1806         parse_namespace_or_typename to parse types.
1807
1808         * lambda.cs: Empty new file, will eventually have the lambda
1809         expression implementation.
1810
1811         * lambda.test: used to test the internal tokenizer. 
1812
1813         * report.cs (FeatureIsNotISO1): Rename from
1814         FeatureIsNotStandardized, because it was about the language level
1815         (1 vs 2) it was not about standarization.
1816
1817         (FeatureRequiresLINQ): New.
1818
1819         * support.cs (SeekableStreamReader): Only require that the reader
1820         is a TextReader, not a StreamReader, so we can plug StringReader. 
1821
1822         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1823         given position in the input stream the following tokens can be
1824         parsed as a type followed by an identifier.
1825
1826         (is_punct): after a '(' if parse_type_and_parameter returns true,
1827         then return a special token OPEN_PARENS_LAMBDA which is used to
1828         avoid reduce/reduce errors in the grammar for the
1829         lambda_expression rules.
1830
1831         (parse_type): implement a type parser inside the
1832         tokenizer, the parser only returns true or false depending on
1833         whether the input at a given position can be parsed as a type.
1834
1835         (peek_token): new method used during type parsing.
1836
1837 2007-01-28  Raja R Harinath  <rharinath@novell.com>
1838
1839         Fix #80531
1840         * anonymous.cs (ScopeInfo.InflateParameters): New.
1841         (AnonymousContainer.Resolve): Use it to redirect types of
1842         delegate parameters.
1843
1844 2007-01-27  Raja R Harinath  <rharinath@novell.com>
1845
1846         Fix #80530
1847         * expression.cs (Error_InvalidArguments): Don't use two different
1848         messages for CS1503.  Use ExtraInformation and
1849         SymbolRelatedToPreviousError instead.
1850
1851         Fix #80358
1852         * decl.cs (DeclSpace.initialize_type_params): Don't access
1853         'type_params' of a partial class directly.
1854
1855 2007-01-26  Miguel de Icaza  <miguel@novell.com>
1856
1857         * constant.cs: Removed a handful of out-of-range checks that were
1858         not necessary. 
1859
1860 2007-01-25  Marek Safar  <marek.safar@gmail.com>
1861
1862         * expression.cs (CheckUselessComparison): Add additional check for char
1863         constants.
1864
1865         * namespace.cs: Fixed typo.
1866
1867 2007-01-23  Miguel de Icaza  <miguel@novell.com>
1868
1869         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1870         gone, instead we inline the test, preventing the needless casts to
1871         longs, ulongs and doubles for the parameters, avoiding calls to
1872         methods that overchecked stuff, and instead inlined things
1873         nicely. 
1874
1875 2007-01-20  Marek Safar  <marek.safar@gmail.com>
1876
1877         * cs-parser.jay: Better parameter error handling.
1878
1879 2007-01-17  Marek Safar  <marek.safar@gmail.com>
1880
1881         A fix for bug #80368, #80522
1882         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1883         whether array initializer contains constants only.
1884         (ArrayCreation.Emit): Use better formula to decide when
1885         are array initializers for static initialization.
1886         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1887         have to emit even constants otherwise they are pre-initialized.
1888
1889 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
1890             Raja R Harinath  <rharinath@novell.com>
1891
1892         Fix emit order of 'get' vs. 'set'.
1893         * support.cs (Accessors): New.
1894         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1895         Note the order in which accessors are declared in the source.
1896         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1897         Refactored from Property.Define and Indexer.Define.
1898         (PropertyBase.DefineAccessors): New helper that calls the above in
1899         appropriate order as noted by the parser.
1900         (Property.Define, Indexer.Define): Update to changes.
1901         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1902
1903 2007-01-17  Raja R Harinath  <rharinath@novell.com>
1904
1905         Fix cs0029-6.cs and gcs0029-2.cs (regression)
1906         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1907         there's an implicit conversion from the current type to the target
1908         type before converting the underlying constant.
1909
1910 2007-01-16  Marek Safar  <marek.safar@gmail.com>
1911
1912         * const.cs (ResolveValue): Updated after constant conversion was made more
1913         generic.
1914
1915         * constant.cs (GetAttributableValue): constant to object conversion is
1916         used for attributes only.
1917         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1918         constant conversions.
1919         (LongConstant.ConvertImplicitly): Ditto.
1920
1921         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1922         (ImplicitConversionStandard): Handle constant conversion as extra step.
1923         It solves the issue when constant conversion was called indirectly like
1924         inside array initializer and constant folding was skipped.
1925
1926         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1927         this change.
1928
1929         * statement.cs(ImplicitConversionStandard): Updated after constant
1930         conversion was made more generic.
1931
1932 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
1933
1934         * expression.cs (As.DoResolve): Use GenericConstraints instead of
1935         Constraints, solves the problem where the compiler incorrectly
1936         reported that a type parameter was not constrained to a class (Bug
1937         80518)
1938
1939 2007-01-14  Marek Habersack  <grendello@gmail.com>
1940
1941         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1942
1943 2007-01-14  Marek Safar  <marek.safar@gmail.com>
1944
1945         A fix for bug #80368
1946         * assign.cs (FieldInitializer): New class implements field
1947         initializer statement.
1948
1949         * attribute.cs: Update after FieldMember rename.
1950
1951         * class.cs (PropertyBasedMember): New common class for property based
1952         types.
1953         (InterfaceMemberBase): New base class for all members which can be used as
1954         an interface members.
1955         (MethodCore): Moved really common code to InterfaceMemberBase.
1956         (Method.Define): Equal and GetHasCode detection is relevant for methods
1957         only.
1958         (MethodData.Define): Don't assume that public event implements an
1959         interface automatically.
1960         (MethodData.DefineMethodBuilder): Issue an error even if only extern
1961         modifier is used.
1962         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1963         (FieldMember): Merged with FieldBase.
1964         (EventProperty.AEventPropertyAccessor): New specialization to check whether
1965         event extern modifier can be used.
1966         (EventField.EventFieldAccessor): Moved event field specific code here.
1967         (Event.AllowedModifiers): Even event can be extern.
1968         (Event.FindOutBaseMethod): New override specific to events.
1969         (Indexer.parameters): Reintroduce parameters because base class holds
1970         only properties common data.
1971         (Indexer.CheckForDuplications): Indexers are threated as methods so we
1972         need do extra parameters check.
1973
1974         * const.cs: Update after FieldMember rename.
1975
1976         * decl.cs (MemberCache.FindBaseEvent): New method.
1977
1978         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1979         to reflect that indexer is now derived from PropertyBased.
1980
1981         * ecore.cs (GetMemberType): Made public.
1982         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1983         obsolete event.
1984
1985         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1986         
1987         * typemanager.cs (CSharpSignature): Correctly print event accessors.
1988         (RegisterEvent): Removed.
1989         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1990         (GetPrivateFieldOfEvent): Renamed to GetEventField.
1991
1992 2007-01-11  Raja R Harinath  <rharinath@novell.com>
1993
1994         Fix #80249
1995         * statement.cs (CollectionForeach.TryType): Prefer generic
1996         GetEnumerator over non-generic variant.  Fix code to follow comments.
1997
1998 2007-01-09  Raja R Harinath  <rharinath@novell.com>
1999
2000         Fix #80446
2001         * support.cs (ReflectionParameter): Don't use an invalid index on
2002         the generic parameter data.
2003
2004 2007-01-08  Miguel de Icaza  <miguel@novell.com>
2005
2006         * driver.cs: Just add a tiny bit of infrastructure.
2007
2008 2007-01-02  Marek Safar  <marek.safar@gmail.com>
2009
2010         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
2011         where field type is struct from current assembly.
2012         
2013         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
2014         it is possible.
2015
2016 2007-01-02  Marek Safar  <marek.safar@gmail.com>
2017
2018         A fix for bug #80381
2019         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
2020         the core types.
2021
2022         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
2023         messages.
2024         (Namespace.LookupType): Always use core types from corlib when speficied.
2025
2026         * report.cs: A new warning.
2027
2028         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
2029         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
2030         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
2031
2032         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
2033         (InitCoreTypes): Set expression type of object_type and value_type
2034         immediately after lookup.
2035
2036 2007-01-01  Miguel de Icaza  <miguel@novell.com>
2037
2038         * cs-tokenizer.cs: Accept Pc class characters (Connector
2039         Punctuation) as valid identifiers.  Fixes #78259
2040
2041         * expression.cs (Invocation.DoResolve): Moved the check for the
2042         use of `this' for doing method calls to the Invocation resolution
2043         step, after overload resolution has taken place instead of doing
2044         the check at the low-level `This.DoResolve' level.
2045
2046         The `This.DoResolve'(appens before overload resolution, so it has
2047         no way of knowing if the method that will be called will be
2048         instace or static, triggering an erroneous report for cs0188 (Bug
2049         78113).
2050
2051         We now do the check for instance method invocations after we know
2052         what method will be called.
2053
2054         (This.CheckThisUsage): Move the actual use of this structure
2055         checking into its own method and expose it. 
2056
2057         * Everywhere that called Error_ValueCannotBeConverted: pass a new
2058         EmitContext.
2059
2060         Exceptions: Null.ConvertImplicitly,
2061         Constant.ImplicitConversionRequired as there are too many call
2062         sites for passing the ec. 
2063
2064         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
2065         EmitContext, if the value is null, then we do not try to provide
2066         the extra information from the error (If a userdefined conversion
2067         exists, as UserDefinedConversion requires a non null-EmitContext).
2068
2069         Fixes: #80347
2070
2071 2006-12-30  Raja R Harinath  <rharinath@novell.com>
2072
2073         * flowanalysis.cs (MyBitVector): Document some invariants.
2074         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
2075         introduced below, and add a couple of others, 
2076
2077 2006-12-30  Marek Safar  <marek.safar@gmail.com>
2078
2079         * attribute.cs (GetMethodObsoleteAttribute): Uses new
2080         GetPropertyFromAccessor and GetEventFromAccessor.
2081         
2082         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
2083         overrides non-obsolete one.
2084         (Indexer.Define): Error message has been moved to the parser.
2085
2086         * cs-parser.jay: Better syntax errors handling.
2087
2088         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
2089         when an invocation has no arguments.
2090
2091         * ecore.cs: Removed not used caching.
2092
2093         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
2094         implementation.
2095
2096         * report.cs: Add a new warning.
2097
2098         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
2099
2100         * typemanager.cs (enumeration_type): Removed.
2101         (CSharpSignature): Reuses IsSpecialMethod.
2102         (IsEqual): Hack for MS BCL.
2103         (GetPropertyFromAccessor): New method.
2104         (GetEventFromAccessor): New method.
2105         (IsSpecialMethod): Fixed to handle more cases.
2106
2107 2006-12-30  Marek Safar  <marek.safar@gmail.com>
2108
2109         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
2110         Made white spaces array static.
2111
2112         * ecore.cs (RemoveGenericArity): Optimized.
2113
2114         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
2115         10 times faster).
2116         (MyBitVector.initialize_vector): Simplified.
2117
2118 2006-12-22  Miguel de Icaza  <miguel@novell.com>
2119
2120         * ecore.cs: Am not entirely happy with this hack, but it seems to
2121         address the issue in 80257 (a small test case for
2122         CreativeDocs.NET). 
2123
2124         I set the MethodGroupExpr.Type to an internal compiler type
2125         (itself in this case) to force the resolution to take place.   Why
2126         it does not take place with a null is beyond me.
2127
2128 2006-12-20  Marek Safar  <marek.safar@gmail.com>
2129
2130         A fix for bug #80288
2131         * expression.cs (ResolveOperator): Consider user defined conversion for
2132         logical and operator too.
2133         (EmitBranchable): Optimization for logical and when full constant folding
2134         could not be applied but one operand is constant.
2135
2136 2006-12-19  Marek Safar  <marek.safar@gmail.com>
2137
2138         * class.cs (GetClassBases): Write 5 times every day, will never use
2139         FullName for error reporting.
2140
2141         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
2142
2143 2006-12-19  Martin Baulig  <martin@ximian.com>
2144
2145         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
2146         the symbol file info here.
2147
2148 2006-12-18  Marek Safar  <marek.safar@gmail.com>
2149
2150         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
2151         of `elseif' is taking then following sections are not taking.
2152         Fixes an issue reported on mono mailing list.
2153
2154 2006-12-18  Marek Safar  <marek.safar@gmail.com>
2155
2156         A fix for bug #80300
2157         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
2158         a caller is not taking.
2159
2160 2006-12-18  Raja R Harinath  <rharinath@novell.com>
2161
2162         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
2163         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
2164         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
2165         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
2166         * class.cs: Update to changes.
2167
2168 2006-12-17  Marek Safar  <marek.safar@gmail.com>
2169
2170         A fix for bug #79934
2171         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
2172         partial container.
2173
2174         * class.cs (ResolveMembers): Register an iterator in current container and
2175         not in shared one.
2176
2177 2006-12-16  Raja R Harinath  <rharinath@novell.com>
2178
2179         Fix test-543.cs
2180         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
2181         satisfy a params annotated parameter.
2182
2183 2006-12-16  Marek Safar  <marek.safar@gmail.com>
2184
2185         A fix for bug #77014
2186         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
2187         paramters correctly and not rely on hacks in Parameters class.
2188         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
2189         at any possition.
2190         (Invocation.VerifyArgumentsCompat): Ditto.
2191         (Invocation.EmitArguments): Changed to correctly emit params arguments at
2192         any possition.
2193
2194         * parameter.cs (HasParams): Don't assume that params is the last one.
2195
2196         * support.cs (ReflectionParameters.ctor): Look for params attribute
2197         correctly.
2198         (ReflectionParameters.ParameterType): Removed hack when we returned last
2199         parameter for out of range parameters.
2200         (ParameterName, ParameterModifier): Ditto.
2201
2202 2006-12-14  Marek Safar  <marek.safar@gmail.com>
2203
2204         A fix for bug #79987
2205         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
2206         when assembly is not CLS compliant but type is. I have no idea why is this
2207         allowed.
2208
2209         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
2210
2211 2006-12-13  Miguel de Icaza  <miguel@novell.com>
2212
2213         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
2214         in struct constructors, they are basically no-ops.
2215
2216 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2217
2218         * cs-tokenizer.cs (Position): Save preprocessor status too.
2219
2220 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2221
2222         A fix for bug #77794
2223         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
2224
2225 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2226
2227         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
2228         Fixes #69299.
2229         (pp_expr): Report error for an invalid expression.
2230         (handle_preprocessing_directive): Simplified; add more error checking.
2231
2232 2006-12-11  Marek Safar  <marek.safar@gmail.com>
2233
2234         A fix for bug #74939
2235         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
2236         directives handling.
2237
2238 2006-12-10  Marek Safar  <marek.safar@gmail.com>
2239
2240         A fix for bugs #80093, and #75984
2241         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
2242         logic, it seems to me as it worked before "by coincidence".
2243         (xtoken): Simplified to use reworked handle_preprocessing_directive.
2244         (cleanup): Enabled endif check.
2245
2246 2006-12-09  Marek Safar  <marek.safar@gmail.com>
2247
2248         A fix for bug #80162
2249         * statement.cs (CollectionForeach.TryType): Generics and non-generics
2250         enumerators are never ambiguous.
2251
2252 2006-12-08  Raja R Harinath  <rharinath@novell.com>
2253
2254         Fix #80060
2255         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
2256
2257 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2258
2259         A fix for bug #80144
2260         * class.cs (EventProperty.Define): Explicit implementation means
2261         that an even is used.
2262
2263 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2264
2265         Fixes the operators implementation (part II)
2266
2267         * cfold.cs (DoConstantNumericPromotions): Renamed to
2268         DoBinaryNumericPromotions and simplified.
2269         (BinaryFold): Couple of conversion fixes; simplified.
2270
2271         * constant.cs, ecore.cs, literal.cs
2272         (ToType): Renamed to ConvertImplicitly.
2273         (Reduce): Renamed to ConvertExplicitly.
2274
2275         * class.cs, convert.cs: Updated.
2276
2277         * expression.cs: TryReduce doesn't throw an exception.
2278
2279 2006-12-01  Marek Safar  <marek.safar@gmail.com>
2280
2281         A fix for bug #80108
2282         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
2283         compatible.
2284
2285 2006-11-30  Marek Safar  <marek.safar@gmail.com>
2286
2287         Fixes unary operators implementation (part I)
2288         Also fixes #80026
2289
2290         * cfold.cs (Error_CompileTimeOverflow): Made internal
2291
2292         * const.cs (IConstant): Changed to use reference to constant and
2293         not constant itself.
2294         Updated IConstant implementations.
2295
2296         * constant.cs (CreateConstant): New factory method.
2297         Updated IConstant implementation.
2298
2299         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
2300
2301         * ecore.cs: Updated to use CreateConstantReference.
2302
2303         * enum.cs: Reflects IConstant changes.
2304
2305         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
2306
2307         * literal.cs (NullConstant): Change to be independently usable.
2308
2309 2006-11-29  Martin Baulig  <martin@ximian.com>
2310
2311         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
2312         we need to emit the scope initializer before calling the base .ctor.
2313
2314         * anonymous.cs: Merged back from the new anonymous methods branch.
2315         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
2316
2317         * expression.cs (ParameterReference.DoResolveBase): Create a
2318         "normal" ScopeInfo when capturing parameters rather than using the
2319         root scope; this makes things work with anonymous methods having
2320         parameters.
2321
2322         * statement.cs
2323         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
2324
2325 2006-11-22  Marek Safar  <marek.safar@gmail.com>
2326
2327         A fix for bug #79987
2328         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
2329         check to a base class.
2330         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
2331         only when assembly has missing attribute.
2332         * report.cs: Update.
2333
2334 2006-11-21  Marek Safar  <marek.safar@gmail.com>
2335
2336         * cs-tokenizer.cs: Merged with gmcs version.
2337
2338 2006-11-20  Marek Safar  <marek.safar@gmail.com>
2339
2340         * cs-tokenizer.cs,
2341         * cs-parser.jay: Better error message when partial keyword is misplaced.
2342
2343 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
2344
2345         A fix for bug #79810
2346         report.cs: CS1058 only applies to 2.0 profile (gmcs).
2347         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
2348         a RuntimeWrappedException by default.
2349
2350 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2351
2352         A fix for bug #79843
2353         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
2354         implementation.
2355         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
2356
2357 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2358
2359         * driver.cs, namespace.cs: Uses faster IndexOf version.
2360
2361 2006-11-17  Marek Safar  <marek.safar@gmail.com>
2362
2363         A fix for bug #79941
2364         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
2365         operators.
2366         (Operator.Define): Implicit/Explicit operator of same type is duplicate
2367         even if internal name is different.
2368         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
2369         (UserDefinedConversion): Simplified as the operators cannot be internal.
2370         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
2371         conversions.
2372         (MethodLookup): Replaced EmitContext with parentType.
2373         * expression.cs: Updated.
2374
2375 2006-11-09  Raja R Harinath  <rharinath@novell.com>
2376
2377         * driver.cs (BadAssembly): Handle all the ugliness of
2378         DefineDynamicAssembly.
2379
2380 2006-11-08  Raja R Harinath  <rharinath@novell.com>
2381
2382         Address parts of #58244 -- most of what's left is in the runtime
2383         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
2384         CS1509 error checks, and handle them for all assembly loads, not
2385         just the first invocation.
2386         (LoadModule): Likewise.  Move handling of 'adder_method' ...
2387         * codegen.cs (AssemblyClass.AddModule): ... here.
2388
2389 2006-11-02  Marek Safar  <marek.safar@gmail.com>
2390
2391         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
2392         IEnumerable<T> is ambiguous.
2393
2394 2006-10-31  Marek Safar  <marek.safar@gmail.com>
2395
2396         A fix for bug #67689
2397         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
2398         GetEnumerator is ambiguous.
2399
2400         * report.cs: Add new warning.
2401
2402 2006-10-29  Marek Safar  <marek.safar@gmail.com>
2403
2404         A fix for bug #78602
2405         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2406         to protected member can be nested type.
2407
2408 2006-10-28  Marek Safar  <marek.safar@gmail.com>
2409
2410         A fix for bug #78965
2411         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2412         to protected member must derive from current type.
2413
2414 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2415
2416         assign.cs: Reuses error method.
2417
2418         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
2419         instead of type for constants.
2420         (Expression.Error_ValueAssignment): Common error method.
2421
2422         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
2423         for any assignment.
2424
2425 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2426
2427         A fix for bug #79081
2428         * expression.cs (MemberAccess.DoResolve): Check nested type
2429         accessibility.
2430
2431 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
2432
2433         * doc.cs : nested delegates were not handled. Fixed bug #79754.
2434
2435 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2436
2437         A fix for bug #76591
2438         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
2439
2440 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2441
2442         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
2443         type forwarder of the same type multiple times.
2444
2445 2006-10-26  Raja R Harinath  <rharinath@novell.com>
2446
2447         Fix #78820
2448         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
2449         instance as an rvalue, even when we later resolve as an lvalue.
2450
2451 2006-10-25  Martin Baulig  <martin@ximian.com>
2452
2453         * anonymous.cs: Fix #79673.
2454
2455 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
2456
2457         A fix for bug #79666
2458         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
2459         ignored when is optimized (= default value) as its value is already set.
2460
2461 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2462
2463         A fix for bug #79724
2464         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
2465         TypeContainer for type lookup.
2466
2467 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2468
2469         A fix for bug #79231
2470         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
2471         * expression.cs (OverloadResolve): Always convert type name for
2472         an error message.
2473         (ResolveNamespaceOrType): Don't confuse a nested type with any 
2474         other member.
2475
2476 2006-10-18  Martin Baulig <martin@ximian.com>
2477
2478         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
2479
2480 2006-10-17  Miguel de Icaza  <miguel@novell.com>
2481
2482         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
2483         an int32, but requesting an int64 from the conversion
2484
2485 2006-10-12  Martin Baulig  <martin@ximian.com>
2486
2487         * anonymous.cs
2488         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
2489         
2490 2006-10-12  Martin Baulig  <martin@ximian.com>
2491
2492         * statement.cs
2493         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
2494
2495 2006-10-11  Miguel de Icaza  <miguel@novell.com>
2496
2497         * convert.cs: Remove broken code: I was doing the "Existance"
2498         tests for Implicit conversions.
2499
2500 2006-10-10  Miguel de Icaza  <miguel@novell.com>
2501
2502         * convert.cs: Added one missing case in
2503         ImplicitStandardConversionExists uint64 to intptr.
2504
2505         Fixes #59800
2506         
2507         * typemanager.cs (uintptr_type): another core known type.   
2508
2509         * ecore.cs (OperatorCast): routine used to do cast operations that
2510         depend on op_Explicit.  We could change some of the Decimal
2511         conversions to use this.
2512
2513         This one has a probe mechanism that checks both types for an op_
2514         which it coudl be used to eliminate two classes: CastToDecimal
2515         and CastFromDecimal.
2516
2517         * convert.cs: Implement the conversions documented in #59800
2518         
2519 2006-10-10  Martin Baulig  <martin@ximian.com>
2520
2521         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
2522         before RootScope.ResolveMembers().
2523
2524         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
2525         `CurrentType' if appropriate.
2526
2527 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
2528
2529         A fix for bug #78568
2530         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
2531         when contains binary operators.
2532         * cs-parser.jay: Updated.
2533
2534 2006-10-09  Martin Baulig  <martin@ximian.com>
2535
2536         * delegate.cs
2537         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
2538         moved that into Define() and also do the other type parameter
2539         checks there.  Fixes #79094.  Added gtest-292.cs.
2540
2541         * expression.cs
2542         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
2543         since that doesn't include type parameters; don't use `Ldelema'
2544         for type parameters.  Fixes #78980.  Added gtest-293.cs.
2545
2546 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
2547
2548         A fix for #77796
2549         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
2550         conversion is allowed.
2551
2552 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2553
2554         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
2555         error reporting when no error occurs.
2556
2557 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2558
2559         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
2560         does not exist.
2561
2562 2006-10-06  Raja R Harinath  <rharinath@novell.com>
2563
2564         Fix #79584
2565         * class.cs (DefineTypeBuilder): Check circular dependencies before
2566         setting the parent of the TypeBuilder.
2567         (CheckRecursiveDefinition): Don't use 'BaseType', since
2568         it may not be valid until after DefineTypeBuilder.  Use
2569         'base_type' instead.
2570
2571 2006-10-04  Martin Baulig  <martin@ximian.com>
2572
2573         Merged the Anonymous Methods patch.
2574
2575         * anonymous.cs, iterators.cs: The new anonymous methods code.
2576
2577         * statement.cs (Variable): New public abstract class.
2578         (LocalInfo.Variable): New public property.
2579         (LocalInfo.ResolveVariable): New public method.
2580         (Block.Flags): Add `IsIterator'.
2581         (Block.AddVariable): Improved the CS0136 check.
2582         (Block.AnonymousChildren): New public property.
2583         (Block.AddAnonymousChild): New public method.
2584         (ToplevelBlock): Update to use the new anonymous method framework.
2585         (ToplevelBlock.ctor): `container' is now a `Block' and not a
2586         `ToplevelBlock'; this is required to correctly implement the
2587         CS0136 check.
2588         (Fixed, Using): Use `TemporaryVariable' instead of directly
2589         creating the `LocalBuilder'.
2590
2591         * parameter.cs (Parameter.ResolveVariable): New public method.
2592         (Parameters.ResolveVariable): Likewise.
2593
2594         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
2595
2596         * class.cs (TypeContainer): Replaced the `iterators' list and
2597         corresponding methods with a list of `CompilerGeneratedClass'es.
2598         (TypeContainer.ResolveMembers): New public method.
2599         (Method): `IIteratorContainer' has been replaced by
2600         `IAnonymousHost'.
2601
2602         * expression.cs (VariableReference): New public abstract base
2603         class for `LocalVariableReference', `ParameterReference' and
2604         `This'.
2605
2606         * codegen.cs (EmitContext): Removed `capture_context',
2607         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
2608         (EmitContext.EmitThis): Removed.
2609
2610         * cs-parser.jay: Replace `iterator_container' with
2611         `anonymous_host'.       
2612
2613 2006-10-04  Martin Baulig  <martin@ximian.com>
2614
2615         * generic.cs (GenericMethod): Don't make this abstract.
2616         (Constraints.Clone): Added dummy implementation.
2617
2618 2006-10-04  Raja R Harinath  <harinath@gmail.com>
2619
2620         Fix #79577
2621         * namespace.cs (LookForAnyGenericType): Avoid nullref on
2622         'declspaces'.  Avoid allocating arrays willy-nilly.
2623
2624         Fix #79553
2625         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2626         cases out of the switch.
2627
2628 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2629
2630         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2631         message when non-generic type is used with the type arguments.
2632         * expression.cs: Updated.
2633
2634 2006-09-28  Raja R Harinath  <rharinath@novell.com>
2635
2636         Fix #79013
2637         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2638         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2639         Change semantics slightly.  Don't insist on having only one
2640         temporary EmptyExpression -- just throttle the creation of new ones.
2641
2642         Fix #79451
2643         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2644         non-interfaces too.  If no methods are found, don't try to create
2645         a MethodGroupExpr.
2646
2647 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2648
2649         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2650         generic type.
2651
2652         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2653         us produce better error message.
2654
2655 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
2656
2657         * expression.cs (Binary.ResolveOperator): Warn about a side effect
2658         of the `|' operator.
2659
2660         * report.cs: A new warning added.
2661
2662 2006-09-27  Martin Baulig  <martin@ximian.com>
2663
2664         * generic.cs (GenericMethod): Don't make this abstract.
2665
2666 2006-09-27  Martin Baulig  <martin@ximian.com>
2667
2668         * report.cs
2669         (InternalErrorException): Added overloaded ctor taking a params array.
2670
2671 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
2672
2673         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2674         Fixed the cases when same error was reported twice.
2675
2676         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2677         now report symbol information.
2678
2679 2006-09-25  Martin Baulig  <martin@ximian.com>
2680
2681         * class.cs: Completely unified with the gmcs version.
2682
2683 2006-09-25  Martin Baulig  <martin@ximian.com>
2684
2685         * typemanager.cs (TypeManager.IsNullableType): New public function.
2686         (TypeManager.IsNullableTypeOf): Likewise.
2687         (TypeManager.IsNullableValueType): Likewise.
2688
2689         * class.cs (MethodCore): Added the `GenericMethod' argument from
2690         gmcs and also unified all classes derived from `MethodCore' with gmcs.
2691
2692 2006-09-24  Raja R Harinath  <harinath@gmail.com>
2693
2694         * convert.cs: Unify with gmcs version.
2695
2696 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2697
2698         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2699         verify them as well.
2700
2701         * report.cs: New warning.
2702
2703 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2704
2705         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2706         for anonymous block with out argument.
2707
2708 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2709
2710         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2711         not used private events only.
2712
2713 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
2714
2715         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2716
2717         * const.cs (Const.Define): Check for constant type.
2718         (Const.IsConstantTypeValid): Looks for valid constant types.
2719
2720         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2721
2722         * ecore.cs (EmptyConstantCast): New common class for all constant based
2723         EmptyCast(s).
2724
2725         * expression.cs (Is.DoResolve): Handle null constant especially.
2726         (New.DoResolve): Check for new void().
2727         (MemberAccess.DoResolve): Cope with all kind of nulls.
2728
2729         * literal.cs (NullConstant): Uses EmptyConstantCast.
2730         (NullDefault): Based on EmptyConstantCast.
2731         (NullLiteral): Uses EmptyConstantCast.
2732
2733         * statement.cs (Block.ResolveMeta): Check for constant type.
2734
2735 2006-09-22  Martin Baulig  <martin@ximian.com>
2736
2737         * delegate.cs, attribute.cs: Merged with the gmcs versions.
2738
2739 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2740
2741         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2742         not the null type.
2743
2744         Fix part of #79451
2745         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2746         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
2747         code slightly.
2748
2749 2006-09-22  Martin Baulig  <martin@ximian.com>
2750
2751         * ecore.cs: Merged with the gmcs version.
2752
2753         * generic.cs (ConstructedType): New dummy class.
2754         (TypeArguments): Don't make this abstract.
2755
2756         * typemanager.cs
2757         (TypeManager.IsGenericTypeDefinition): New method.
2758         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2759
2760 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2761
2762         * expression.cs (ComposedCast): Check for arrays of TypedReference
2763         before creating the type, not after.
2764
2765 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
2766
2767         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2768         after ToType change.
2769
2770         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2771         when constant must be implicitly convertible.
2772
2773         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2774
2775         * ecore.cs (NullCast): Derives from NullConstant.
2776
2777         * expression.cs (Is.DoResolve): Removed useless variables.
2778         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2779         (New.Constantify): Add enum support.
2780         (MemberAccess.DoResolve): Add warning when accessing null constant or
2781         variable.
2782
2783         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2784         property.
2785
2786         * literal.cs (NullConstant): New abstract class with common
2787         functionality for all null specializations.
2788         (NullDefault): Represents default(X) when result can be
2789         reduced to null.
2790         (NullLiteral): Updated.
2791
2792         * report.cs: Add new warning.
2793
2794 2006-09-21  Martin Baulig  <martin@ximian.com>
2795
2796         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2797
2798 2006-09-21  Martin Baulig  <martin@ximian.com>
2799
2800         * generic.cs (GenericConstraints): New dummy class.
2801         (Constraints): Likewise.
2802         (TypeParameter): Likewise.
2803         (TypeParameterName): Likewise.
2804         (GenericMethod): Likewise.
2805
2806         * typemanager.cs (TypeManager.GetGenericArguments): New method.
2807
2808         * decl.cs: Merged with the gmcs version.
2809
2810 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2811
2812         * generic.cs (TypeParameter): Implement IMemberContainer.
2813         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
2814
2815         * rootcontext.cs: Unify with gmcs version.
2816
2817         * report.cs: Unify with gmcs version.
2818         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2819         from gmcs/generics.cs.
2820         * generics.cs (TypeParameter): New dummy class.
2821
2822         * support.cs: Unify with gmcs version.
2823
2824 2006-09-20  Raja R Harinath  <rharinath@novell.com>
2825
2826         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2827         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2828
2829         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2830         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2831         * mcs.exe.sources: Add generic.cs.
2832
2833         * codegen.cs: Unify with gmcs version.
2834
2835         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2836         (EmitContext): Add GenericDeclContainer implementation.
2837         * decl.cs (MemberCore, DeclSpace): Likewise.
2838         * namespace.cs: Remove #ifdef GMCS_SOURCE.
2839
2840         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2841         MCS TypeManager has a corresponding dummy method.
2842
2843 2006-09-19  Martin Baulig  <martin@ximian.com>
2844
2845         * expression.cs: Completely merged with the gmcs version.
2846
2847 2006-09-19  Martin Baulig  <martin@ximian.com>
2848
2849         * expression.cs (Invocation): Merged with the gmcs version.
2850         (ArrayAccess.GetStoreOpcode): Likewise.
2851
2852 2006-09-19  Martin Baulig  <martin@ximian.com>
2853
2854         * typemanager.cs
2855         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2856         (TypeManager.IsGenericMethodDefinition): Likewise.
2857
2858 2006-09-19  Martin Baulig  <martin@ximian.com>
2859
2860         * typemanager.cs
2861         (TypeManager.IsEqual): Moved the gmcs implementation here.
2862         (TypeManager.DropGenericTypeArguments): Likewise.
2863         (TypeManager.DropGenericMethodArguments): Likewise.
2864         (TypeManager.GetTypeArguments): Moved here from gmcs.
2865         (TypeManager.HasGenericArguments): Likewise.
2866
2867 2006-09-19  Martin Baulig  <martin@ximian.com>
2868
2869         * expression.cs (Binary): Merged with the gmcs version.
2870
2871 2006-09-19  Martin Baulig  <martin@ximian.com>
2872
2873         * expression.cs (Probe, As, Is): Merged with the gmcs version.
2874
2875 2006-09-19  Martin Baulig  <martin@ximian.com>
2876
2877         * typemanager.cs: Merged with the gmcs version.
2878
2879 2006-09-16  Raja R Harinath  <rharinath@novell.com>
2880
2881         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2882         * driver.cs: Likewise.
2883
2884 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
2885
2886         A fix for #79401
2887         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2888         only if parent type is class.
2889         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2890         update.
2891
2892 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
2893
2894         * cs-parser.jay,
2895         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2896         keywords are used.
2897         * typemanager.cs(CSharpName): Converts NullType to null.
2898
2899 2006-09-15  Martin Baulig  <martin@ximian.com>
2900
2901         * typemanager.cs
2902         (TypeManager.GetMethodName): Added mcs implementation.
2903         (TypeManager.IsEqual): Likewise.
2904
2905         * ecore.cs
2906         (SimpleName.RemoveGenericArity): Added dummy implementation.
2907
2908         * pending.cs: Merged with the gmcs version.     
2909
2910 2006-09-15  Martin Baulig  <martin@ximian.com>
2911
2912         * statement.cs: Merge with the gmcs version.
2913
2914 2006-09-15  Martin Baulig  <martin@ximian.com>
2915
2916         * statement.cs (Switch): Merge with the gmcs implementation
2917         (without nullables), which is newer.
2918
2919 2006-09-15  Martin Baulig  <martin@ximian.com>
2920
2921         * statement.cs (Block.Variables): Make this public.
2922         (ToplevelBlock.Parameters): Make this a property.
2923         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2924
2925 2006-09-15  Martin Baulig  <martin@ximian.com>
2926
2927         * namespace.cs: Merge with the gmcs version.
2928
2929 2006-09-15  Martin Baulig  <martin@ximian.com>
2930
2931         * decl.cs (MemberName): Minor code cleanups.
2932
2933 2006-09-15  Martin Baulig  <martin@ximian.com>
2934
2935         * parameter.cs: Merge with the gmcs version.
2936
2937 2006-09-15  Martin Baulig  <martin@ximian.com>
2938
2939         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2940         and an error in mcs.
2941
2942 2006-09-15  Martin Baulig  <martin@ximian.com>
2943
2944         * flowanalysis.cs: Merged from GMCS; added the generics code into
2945         a `GMCS_SOURCE' conditional so we can share this file.
2946
2947 2006-09-08  Martin Baulig  <martin@ximian.com>
2948
2949         * typemanager.cs (TypeManager.interlocked_type): New public field.
2950         (TypeManager.int_interlocked_compare-exchange): New public field.
2951         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2952         enumerator types here and call InitGenericCoreTypes().
2953         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2954         after calling InitEnumUnderlyingTypes().
2955
2956         * rootcontext.cs
2957         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2958         `classes_second_stage'. 
2959
2960 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
2961
2962         * assign.cs, ecore.cs, expression.cs: Share error message text.
2963         * class.cs (FieldMember.Define): Check for varible of static type.
2964         * driver.cs (LoadAssembly): Uses error output for errors.
2965         * statement.cs: Updated.
2966
2967 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
2968
2969         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2970         type instance.
2971
2972 2006-09-07  Martin Baulig  <martin@ximian.com>
2973
2974         * driver.cs
2975         (MainDriver): Revert r62663 from Marek; see #70506 for details.
2976
2977 2006-08-29  Miguel de Icaza  <miguel@novell.com>
2978
2979         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2980         
2981 2006-08-17  Miguel de Icaza  <miguel@novell.com>
2982
2983         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2984         #52019 and #79064, the use of the \uXXXX sequence in source code
2985         to represent unicode characters.
2986
2987 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
2988
2989         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2990         support.
2991         * class.cs, ecore.cs, statement.cs: Merged to one error message.
2992
2993 2006-08-13  Miguel de Icaza  <miguel@novell.com>
2994
2995         * assign.cs: Catch attempts to assign to a method groups in += and
2996         report as 1656
2997
2998 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
2999
3000         A fix for #79056
3001         * cs-parser.jay: Don't destroy current array type by typeof of array's.
3002
3003 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
3004
3005         * class.cs (Method.Define): Issue a warning when generic method looks like
3006         an entry point.
3007         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
3008         as well.
3009
3010 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
3011  
3012         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
3013         looking for ctor.
3014         * decl.cs (MemberCache.FindMembers): When container is interface we need to
3015         search all base interfaces as a member can be ambiguous.
3016         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
3017         Constructor member type filter. 
3018         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
3019         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
3020         reporting for returned memberinfos.
3021         * report.cs: Updated.
3022         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
3023         version to work on all runtimes.
3024         (TypeManager.RealMemberLookup): Removed members filtering.
3025
3026 2006-08-08  Raja R Harinath  <rharinath@novell.com>
3027
3028         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
3029         (PropertyExpr.EmitAssign): Likewise.
3030         * expression.cs (Indirection.EmitAssign): Likewise.
3031         (LocalVariableReference.EmitAssign): Likewise.
3032         (ParameterReference.EmitAssign): Likewise.
3033         (Invocation.EmitArguments): Likewise.
3034         (ArrayAccess.EmitAssign): Likewise.
3035         (IndexerAccess.EmitAssign): Likewise.
3036         (This.EmitAssign): Likewise.
3037         (ConditionalLogicalOperator.Emit): Likewise.
3038
3039         Fix #79026
3040         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
3041         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
3042         leave it in after returning it.
3043         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
3044
3045 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
3046
3047         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
3048         message.
3049
3050 2006-08-03  Raja R Harinath  <rharinath@novell.com>
3051
3052         Fix cs0146-3.cs and cs0146-4.cs.
3053         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
3054         enclosing types don't depend on the current type.
3055
3056 2006-08-02  Raja R Harinath  <rharinath@novell.com>
3057
3058         Fix #77963
3059         * class.cs (TypeContainer.DoDefineMembers): Use
3060         FindBaseMemberWithSameName on Parent, since we're interested in
3061         whether we hide inherited members or not.
3062         (FindBaseMemberWithSameName): Make slightly more robust.
3063
3064         Fix the non-generic testcase from #77396
3065         * decl.cs (DeclSpace.DeclContainer): Remove override.
3066
3067         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
3068         declspaces for doppelgangers too.
3069         (UsingEntry): Implement IResolveContext.
3070         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
3071         'this' as the resolve context.
3072         (LocalAliasEntry): Likewise.
3073
3074         Implement parts of #77403
3075         * roottypes.cs (RootDeclSpace): New.  Used to represent the
3076         toplevel declaration space.  Each namespace declaration introduces
3077         a "partial" root declaretion space.
3078         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
3079         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
3080         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
3081         from 'current_namespace.SlaveDeclSpace'.
3082         (namespace_declaration): Likewise.
3083         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
3084         check.  It can't happen now.
3085         * decl.cs (DeclSpace.LookupType): Likewise.
3086         * driver.cs (MainDriver): Sanity check.
3087
3088 2006-08-01  Raja R Harinath  <rharinath@novell.com>
3089
3090         * decl.cs (DeclSpace.FindNestedType): Remove.
3091         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
3092         LookupTypeContainer to get the container of the nested type.
3093         * class.cs (TypeContainer.FindNestedType): Make non-override.
3094
3095 2006-07-31  Raja R Harinath  <rharinath@novell.com>
3096
3097         * decl.cs (DeclSpace.PartialContainer): Move field from ...
3098         * class.cs (TypeContainer.PartialContainer): ... here.
3099         (TypeContainer.AddBasesForPart): New helper.
3100         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
3101         instead.
3102         * cs-parser.jay (current_class): Convert to DeclSpace.
3103         (struct_declaration, interface_declaration, class_declaration):
3104         Use AddBasesForPart instead of .Bases directly.
3105         * const.cs, iterators.cs: Update to changes.
3106
3107 2006-07-28  Raja R Harinath  <rharinath@novell.com>
3108
3109         * class.cs (TypeContainer.AddMemberType): Rename from
3110         AddToTypeContainer.
3111         (TypeContainer.AddMember): Rename from AddToMemberContainer.
3112         (AddTypeContainer): New.  Combine AddClassOrStruct and
3113         AddInterface.
3114         (AddPartial): Update.  Add 'is_partial' argument.
3115         * roottypes.cs: Update to changes.
3116         * cs-parser.jay (push_current_class): New helper for handling
3117         current_container and current_class.
3118         (struct_declaration, interface_declaration, class_declaration):
3119         Use it.
3120
3121 2006-07-26  Raja R Harinath  <rharinath@novell.com>
3122
3123         * roottypes.cs: Rename from tree.cs.
3124
3125         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
3126         * tree.cs (Tree, ITreeDump): Remove types.
3127         * rootcontext.cs (tree, Tree): Remove fields.
3128         (root, ToplevelTypes): New.
3129         * *.cs: Update to rename.
3130
3131         * tree.cs (Tree.RecordDecl): Remove.
3132         (RootTypes.AddToTypeContainer): Record the toplevel type in its
3133         namespace here.
3134         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
3135
3136 2006-07-23  Raja R Harinath  <harinath@gmail.com>
3137
3138         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
3139         DoFlowAnalysis and OmitStructFlowAnalysis here.
3140         (ec.With): Rename from WithUnsafe and generalize.
3141         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
3142         (ec.WithFlowAnalyis): New.
3143         * ecore.cs, expression.cs, statement.cs: Update.
3144
3145 2006-07-22  Raja R Harinath  <harinath@gmail.com>
3146
3147         * statement.cs (Block.ResolveMeta): Simplify slightly.
3148
3149         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
3150         multiple boolean fields.  Convert InUnsafe, constant_check_state,
3151         check_state to flags.
3152         (CheckState, ConstantCheckState): Update.
3153         (InUnsafe): New read-only property.
3154         (FlagsHandle): Rename from CheckStateHandle and convert to handle
3155         arbitrary flags.
3156         (WithUnsafe): New helper similar to WithCheckState.
3157         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
3158         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
3159
3160 2006-07-21  Raja R Harinath  <rharinath@novell.com>
3161
3162         Make comparisons use the same IL irrespective of whether they're
3163         in a 'checked' or 'unchecked' context: one of the issues in #78899
3164         * codegen.cs (EmitContext.CheckState): Make read-only property.
3165         (EmitContext.ConstantCheckState): Likewise.
3166         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
3167         helper that implement a save/restore stack for CheckState
3168         values.  This is the only way to change check-state.
3169         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
3170         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
3171         (CheckedExpr.EmitBranchable): New forwarding method.
3172         (UnCheckedExpr): Likewise.
3173         * statement.cs (Block.ResolveMeta): Use WithCheckState.
3174         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
3175         (Checked.Resolve, checked.DoEmit): Likewise.
3176
3177 2006-07-20  Miguel de Icaza  <miguel@novell.com>
3178
3179         * anonymous.cs: Cache the resolved anonymous delegate, and return
3180         this so that the ResolveTopBlock is only triggered once, not
3181         twice.
3182
3183         Currently we trigger ResolvetopBlock twice due to a first pass of
3184         argument check compatibility, and a second pass that does the
3185         actual resolution.   
3186         
3187 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
3188
3189         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
3190         modifiers.
3191         * rootcontext.cs (Reset): Add helper_classes.
3192
3193 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
3194
3195         A fix for #78860
3196         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
3197         correctly.
3198
3199 2006-07-13  Miguel de Icaza  <miguel@novell.com>
3200
3201         * statement.cs (Lock): Handle expressions of type
3202         TypeManager.null_type specially.  Fixes #78770
3203
3204 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
3205
3206         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
3207         to an event.
3208
3209 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
3210
3211         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
3212         for accessors as well.
3213         * ecore.cs (EventExpr): Add AccessorTable.
3214
3215 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
3216
3217         A fix for #78738
3218         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
3219         for CS0122 where appropriate.
3220         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
3221         level attributes.
3222         (Filter): Assembly can be null in the case of top level attributes.
3223
3224 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
3225
3226         A fix for #78690
3227
3228         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
3229         is done at global level.
3230
3231 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3232
3233         A fix for #77002, Implemented TypeForwarder support.
3234
3235         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
3236         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
3237         * typemanager.cs (): Add type_forwarder_attr_type.
3238
3239 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3240
3241         * report.cs: Add CS0469 warning.
3242
3243 2006-06-21  Martin Baulig  <martin@ximian.com>
3244
3245         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
3246         the `try'-block, so we also report CS0016 etc. there.
3247
3248 2006-06-21  Martin Baulig  <martin@ximian.com>
3249
3250         * delegate.cs
3251         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
3252
3253 2006-06-21  Martin Baulig  <martin@ximian.com>
3254
3255         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
3256         also report CS1686 for parameters.
3257
3258 2006-06-21  Martin Baulig  <martin@ximian.com>
3259
3260         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
3261         instead of an error if the value is not implicitly convertible to
3262         the switch types; fixes #77964.
3263
3264 2006-06-21  Raja R Harinath  <rharinath@novell.com>
3265
3266         Fix #78673
3267         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
3268         FieldBuilder is null.
3269
3270         Fix #78662
3271         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
3272         'left' and 'right' before error-checking.
3273
3274 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
3275
3276         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
3277         Fixed bug #78601.
3278         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
3279         (FieldExpr.DoResolve): likewise.
3280         (PropertyExpr.InstanceResolve): likewise.
3281         (EventExpr.InstanceResolve): likewise. 
3282
3283 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
3284
3285         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
3286         attribute applicable tests for attribute argument.
3287
3288 2006-06-02  Raja R Harinath  <rharinath@novell.com>
3289
3290         Fix #78079
3291         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
3292         (Binary.OverloadResolve_PredefinedIntegral): New.
3293         (Binary.OverloadResolve_PredefinedFloating): New.
3294         (Binary.OverloadResolve_PredefinedString): New.
3295         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
3296         Follow the standard more closely, and treat numeric promotions in
3297         terms of overload resolution.
3298         (Binary.CheckShiftArguments): Simplify.
3299
3300 2006-06-01  Raja R Harinath  <rharinath@novell.com>
3301
3302         * flowanalysis.cs (MyBitVector): Simplify representation.
3303         (MyBitVector.Clone): Avoid allocating BitArray.
3304         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
3305         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
3306         (*): Update.  Change all references to MyBitVector.And and
3307         MyBitVector.Or to &= and |=.
3308
3309 2006-05-29  Raja R Harinath  <rharinath@novell.com>
3310
3311         Fix cs0231-[34].cs.
3312         * cs-parser.jay (formal_parameter_list): Extend the pattern below
3313         to param arguments too.
3314
3315 2006-05-26  Miguel de Icaza  <miguel@novell.com>
3316
3317         * cs-parser.jay: Catch another parsing form for arglist being
3318         followed by other arguments.  Fixes #78313.
3319
3320 2006-05-24  Raja R Harinath  <rharinath@novell.com>
3321
3322         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
3323         checking of out parameters to ...
3324         (FlowBranchingToplevel.Merge): ... here.
3325         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
3326         set, propagate the origin upward, and only complain if there was
3327         no other error.
3328         (FlowBranchingException.AddContinueOrigin): Likewise.
3329         (FlowBranchingException.AddReturnOrigin): Likewise.
3330         (FlowBranchingException.AddGotoOrigin): Likewise.       
3331
3332 2006-05-23  Raja R Harinath  <rharinath@novell.com>
3333
3334         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
3335         unreachable, skip it.
3336         (FlowBranchingException.Merge): Always propagate jumps, even if
3337         the finally block renders subsequent code unreachable.
3338
3339 2006-05-18  Raja R Harinath  <rharinath@novell.com>
3340
3341         Fix #77601
3342         * statement.cs (Goto.Resolve): Move responsibility for resolving
3343         'goto' to FlowBranching.AddGotoOrigin.
3344         (Goto.SetResolvedTarget): New.  Callback to set the
3345         LabeledStatement that's the target of the goto.
3346         (Goto.DoEmit): Use Leave instead of Br when crossing an
3347         unwind-protect boundary.
3348         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
3349         LookupLabel and adjust to new semantics.
3350         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
3351         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
3352         Goto.SetResolvedTarget to update target.
3353         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
3354         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
3355         AddBreakOrigin & co.  Delay propagation until ...
3356         (FlowBranchingException.Merge): ... this.
3357
3358         * statement.cs (Block.Resolve): Always depend on flow-branching to
3359         determine unreachability.  Kill workaround that originally emitted
3360         only one statement after an "unreachable" label (see infloop in
3361         test-515.cs).
3362
3363         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
3364         This is still "wrong", but anything better would probably need a
3365         multi-pass algorithm.
3366         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
3367         usage vector.  Force current usage vector to be reachable, to
3368         optimistically signify backward jumps.
3369         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
3370         detected.
3371         (FlowBranchingLabeled.Merge): New.  If no backward jump was
3372         detected, return the original salted-away usage vector instead,
3373         updated with appropriate changes.  Print unreachable warning if
3374         necessary.
3375         * statement.cs (Block.Resolve): Don't print unreachable warning on
3376         a labeled statement.
3377
3378 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
3379
3380         * driver.cs: Pass filename without path to AssemblyBuilder's 
3381         AddResourceFile. Fixes bug #78407.
3382
3383 2006-05-17  Raja R Harinath  <rharinath@novell.com>
3384
3385         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
3386         * flowanalysis.cs (FlowBranchingLabeled): ... here.
3387         (FlowBranching.MergeChild): Overwrite
3388         reachability information from Labeled branchings too.
3389
3390 2006-05-16  Raja R Harinath  <rharinath@novell.com>
3391
3392         * statement.cs (Goto.Resolve): Merge jump origins here ...
3393         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
3394
3395         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
3396         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
3397         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
3398         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
3399         here, ...
3400         * statement.cs (Goto.Resolve): ... not here.
3401         (Goto.Emit): Remove CS1632 check.
3402
3403 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
3404
3405         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
3406         error message.
3407
3408 2006-05-11  Raja R Harinath  <rharinath@novell.com>
3409
3410         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
3411         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
3412         (FlowBranchingException.Label): Likewise.
3413
3414         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
3415         given value.
3416         (MyBitVector.Or): Use it to avoid losing information (Count).
3417         (FlowBranching.MergeOrigins): Likewise.
3418
3419         * flowanalysis.cs (UsageVector.IsDirty): Remove.
3420         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
3421         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
3422         (UsageVector.ToString): Simplify.
3423         (UsageVector.MergeSiblings): Move here from ...
3424         (FlowBranching.Merge): ... here.
3425         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
3426         not a MyBitVector.
3427
3428 2006-05-10  Raja R Harinath  <rharinath@novell.com>
3429
3430         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
3431         null bitvector is treated as all-true.
3432
3433         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
3434         (MyBitVector): Rationalize invariants.  'vector != null' implies
3435         that we have our own copy of the bitvector.  Otherwise,
3436         'InheritsFrom == null' implies all inherited bits are true.
3437
3438 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
3439
3440         * statement.cs (LocalInfo): Add IsConstant.
3441         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
3442         local variable for constants.
3443
3444 2006-05-09  Raja R Harinath  <rharinath@novell.com>
3445
3446         * flowanalysis.cs (MyBitVector.Empty): New.
3447         (MyBitVector): Don't allow InheritedFrom to be null.
3448         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
3449         (UsageVector, FlowBranching): Update to changes.
3450
3451         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
3452         recursion.  The 'Parent == null' condition isn't sufficient for
3453         anonymous methods.
3454         (FlowBranching.AddBreakOrigin): Likewise.
3455         (FlowBranching.AddContinueOrigin): Likewise.
3456         (FlowBranching.AddReturnOrigin): Likewise.
3457         (FlowBranching.StealFinallyClauses): Likewise.
3458         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
3459         (FlowBranching.CheckOutParameters): Likewise.
3460         (FlowBranchingToplevel): Terminate all the above recursions here.
3461         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
3462         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
3463
3464         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
3465         toplevel block.
3466         (FlowBranchingToplevel): New.  Empty for now.
3467         (FlowBranching.MergeTopBlock): Update.
3468         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
3469         branching for the anonymous delegate.
3470         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
3471
3472         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
3473         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
3474         information at the start of the merge.  Reorganize.
3475
3476 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3477
3478         * class.cs (MethodData.Define): Method cannot implement interface accessor.
3479
3480 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3481
3482         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
3483         to newly introduced ctor.
3484
3485         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
3486         message to one place.
3487         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
3488         global namespace.
3489
3490 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3491
3492         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
3493
3494         * ecore.cs (Expression.ResolveAsConstant): Updated.
3495
3496         * statement.cs (ResolveMeta): Updated.
3497
3498 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3499
3500         * cs-parser.jay: __arglist cannot be used in initializer.
3501
3502 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3503
3504         A fix for #77879
3505         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
3506         private types.
3507
3508 2006-05-05  Raja R Harinath  <rharinath@novell.com>
3509
3510         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
3511         (LabeledStatement): Add 'name' parameter.
3512         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
3513         (Block.AddLabel): Update to changes.
3514         * cs-parser.jay (labeled_statement): Likewise.
3515
3516         * flowanalysis.cs (BranchingType.Labeled): New.
3517         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
3518         (FlowBranchingLabeled): New.  Does nothing for now, but will
3519         eventually handle 'goto' flows.
3520         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
3521         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
3522         that's terminated ...
3523         (Block.Resolve): ... here.
3524
3525         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
3526         (UsageVector.MergeFinallyOrigins): Likewise.
3527         (FlowBranching.InTryOrCatch): Likewise.
3528         (FlowBranching.AddFinallyVector): Likewise.
3529         (FlowBranchingException): Update to changes.
3530
3531         Fix #78290
3532         * statement.cs (Return.Resolve): Move error checking to ...
3533         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
3534         (FlowBranchingException): Handle return origins like break and
3535         continue origins.
3536         (FlowBranching.UsageVector.CheckOutParameters): Remove.
3537
3538 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3539
3540         A fix for #76122
3541         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
3542         filter.
3543
3544 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3545
3546         A fix for #77543
3547         * class.cs (MethodData.Define): Do public accessor check only when method
3548         implements an interface.
3549
3550 2006-05-04  Raja R Harinath  <rharinath@novell.com>
3551
3552         Remove special handling of 'break'
3553         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
3554         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
3555         (UsageVector.Break): Remove.
3556         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
3557         reachability.
3558         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
3559
3560         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
3561         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
3562
3563 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3564
3565         A fix for #75726
3566         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
3567         be the interface member.
3568
3569 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3570
3571         A fix for #60069
3572         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
3573         for emitting small (int) values.
3574
3575 2006-05-03  Raja R Harinath  <rharinath@novell.com>
3576
3577         Fix #59427
3578         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
3579         control-flow passes through the 'finally' after merging-in all the
3580         control-flows from 'try' and the 'catch' clauses.
3581
3582         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
3583         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
3584         always true at the only non-recursive entry point.
3585         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
3586         FlowBranchingBreakable.
3587         (FlowBranchingLoop): Remove.
3588         * statement.cs (Return.DoResolve): Update to changes.
3589
3590         Fix #76471, #76665
3591         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
3592         (FlowBranching.CreateBranching): Handle it: create a
3593         FlowBranchingContinuable.
3594         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
3595         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
3596         except that it handles the 'continue' command.
3597         (FlowBranching.UsageVector.MergeOrigins): Rename from
3598         MergeBreakOrigins.
3599         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
3600         except that it overrides AddContinueOrigin.
3601         (FlowBranchingException): Override AddContinueOrigin, similar to
3602         AddBreakOrigin.
3603         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
3604         Create a new branching around the embedded statement.
3605         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
3606         control flow after the embedded statement.
3607         (Continue.Resolve): Move all error checking to AddContinueOrigin.
3608
3609         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3610         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3611         FlowBranchingBreakable.
3612         (FlowBranchingSwitch): Remove.
3613
3614         Fix test-503.cs
3615         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
3616         error reporting to ...
3617         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3618         Rename from 'AddBreakVector'.  Add new location argument.  Return
3619         a bool indicating whether the 'break' crosses an unwind-protect.
3620         (FlowBranchingException.AddBreakOrigin): Add.
3621         (FlowBranchingException.Merge): Propagate 'break's to surrounding
3622         flowbranching after updating with the effects of the 'finally'
3623         clause.
3624         (FlowBranchingBreakable): New common base class for
3625         FlowBranchingLoop and FlowBranchingSwitch.
3626
3627         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3628         embedded statement.
3629         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3630
3631 2006-05-02  Raja R Harinath  <rharinath@novell.com>
3632
3633         * statement.cs (Do.Resolve): If the loop is infinite, set the
3634         barrier.
3635         (While.Resolve, For.Resolve): Set a barrier after the embedded
3636         statement.  There's no direct control flow that goes from the end
3637         of the embedded statement to the end of the loop.
3638         * flowanalysis.cs (FlowBranching.Infinite): Remove.
3639         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
3640         above ensure that the reachability is correctly computed.
3641
3642         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3643         (UsageVector.MergeBreakOrigins): If the current path is
3644         unreachable, treat it as if all parameters/locals are initialized.
3645         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
3646         infinite loops before merging-in break origins.
3647
3648         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3649         (Reachability.Reachable): Split part into ...
3650         (Reachability.Unreachable): ... this.  Simplify.
3651         (Reachability.IsUnreachable): Use 'Unreachable' instead.
3652
3653         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3654         (Reachability.SetThrowsSometimes): Likewise.
3655         (FlowBranchingBlock.MergeTopBlock): Don't compare against
3656         TriState.Always, use corresponding property.
3657         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3658         (Block.Resolve): Likewise.  Remove some redundant checks.
3659
3660 2006-05-02  Raja R Harinath  <harinath@gmail.com>
3661
3662         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3663         (Reachability.Meet): Don't bother checking AlwaysThrows --
3664         barrier is always set.
3665         (FlowBranchingBlock.Merge): Likewise.
3666
3667 2006-05-01  Raja R Harinath  <harinath@gmail.com>
3668
3669         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3670         checks for unreachable.
3671
3672 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
3673
3674         A fix for #77980
3675         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3676
3677         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3678         whether field is really assigned.
3679
3680 2006-04-30  Raja R Harinath  <harinath@gmail.com>
3681
3682         * flowanalysis.cs (Reachability): Make 4-argument constructor
3683         private.
3684         (Reachability.Meet): Rename from 'And'.  Remove static variant.
3685         (Reachability.Always): Rename from the highly misleading
3686         'Reachability.Never'.
3687         (FlowBranching.Merge): Update to changes.  Mark an impossible
3688         situation with a 'throw'.
3689         (*): Update to changes.
3690
3691 2006-04-29  Raja R Harinath  <harinath@gmail.com>
3692
3693         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3694         Remove 'Undefined'.
3695         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3696         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3697         (*): Update to changes.
3698         * statement.cs: Update to changes.
3699
3700 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
3701
3702         A fix for #78049
3703         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3704
3705 2006-04-28  Raja R Harinath  <harinath@gmail.com>
3706
3707         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3708         dummy UsageVector.
3709
3710         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3711         argument to two arguments: an usage-vector and a bool.  Move call
3712         to FlowBranching.Merge () ...
3713         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3714
3715         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3716         handling of loop and switch reachability to ...
3717         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3718
3719 2006-04-27  Raja R Harinath  <harinath@gmail.com>
3720
3721         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3722         handling to FlowBranchingLoop.InLoop.
3723         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3724
3725 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
3726
3727         A fix for #78115
3728         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3729         anonymous method is allowed from AnonymousContainer here.
3730
3731         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3732
3733 2006-04-24  Raja R Harinath  <rharinath@novell.com>
3734
3735         Fix #78156
3736         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3737
3738 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
3739
3740         A fix for #49011.
3741         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3742         (DoubleConstant.Reduce): Ditto.
3743
3744 2006-04-23  Raja R Harinath  <rharinath@novell.com>
3745
3746         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3747         Remove 'lvalue_right_side' argument.  Move parts to ...
3748         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3749         (LocalVariable.DoResolveLValue): ... these.
3750
3751 2006-04-21  Raja R Harinath  <rharinath@novell.com>
3752
3753         Fix cs1655.cs
3754         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3755         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3756         (LocalVariableReference.DoResolveBase): Use it to implement new
3757         CS1655 check.
3758         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3759         (Argument.Resolve): Simplify.  Move CS1510 check ...
3760         * ecore.cs (Expression.ResolveLValue): ... here.
3761         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3762         (PropertyExpr.DoResolveLValue): Likewise.
3763         (FieldExpr.Report_AssignToReadonly): Likewise.
3764         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
3765         LValueMemberAccess or LValueMemberOutAccess on instance depending
3766         on it.
3767         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3768         DoResolve as appropriate.
3769
3770 2006-04-20  Raja R Harinath  <rharinath@novell.com>
3771
3772         Fix #75800
3773         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3774         implicit conversions on 'out' and 'ref' arguments.
3775
3776         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3777         improve clarity.  Remove dead code.
3778
3779         Fix #66031
3780         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3781         (Catch.Resolve): Resolve VarBlock if it exists.
3782
3783 2006-04-19  Miguel de Icaza  <miguel@novell.com>
3784
3785         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3786         twice, this was some residual code, the enumerator was emitted
3787         properly in the two branche of if later.
3788
3789 2006-04-19  Raja R Harinath  <rharinath@novell.com>
3790
3791         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
3792         cast is never an lvalue.
3793         (Cast.DoResolve, Cast.ResolveRest): Combine.
3794         (Argument.Emit): Simplify slightly.  Move 'Expr is
3795         IMemoryLocation' check ...
3796         (Argument.Resolve): ... here.
3797         (Argument.Error_LValueRequired): Remove.  Inline into only user.
3798
3799         Simplifications.  Fix cs0191-2.cs
3800         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3801         CS1649 and CS1651 to ...
3802         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
3803         the actual selection of the error code and message to a lookup
3804         table.  Add a dummy return value to simplify callsites.
3805         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3806         readonly fields of other instances of the same type.  Move CS0197
3807         warning from ...
3808         * expression.cs (Argument.Resolve): ... here.  Simplify code.
3809         Ensure that ec.InRefOutArgumentResolving is only set during LValue
3810         resolution of an out or ref argument.  The code simplification
3811         above uses this invariant.
3812
3813 2006-04-18  Raja R Harinath  <rharinath@novell.com>
3814
3815         Possibly fix #77752.  Fix cs1690-[4-7].cs.
3816         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3817         CheckMarshallByRefAccess.  Drop parameter.
3818         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
3819         warning.
3820         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3821         InstanceExpression.
3822         * report.cs (AllWarnings): Add CS1690.
3823         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3824         for ref access too.
3825         (LocalVariableReference.DoResolveBase): Update.
3826
3827 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3828
3829         * class.cs (MethodOrOperator): Moved common parts from method class.
3830         detect obsolete attributes.
3831         (Method.Define): Simplified as it reuses code from base.
3832         (Constructor.ValidAttributeTargets): Fixed issue found during
3833         refactoring.
3834         (Destructor.ValidAttributeTargets): Fixed issue found during
3835         refactoring.
3836         (Operator): Finished refactoring set off by #78020. Operator class is now
3837         ordinary method class.
3838
3839         * anonymous.cs: Updated.
3840
3841         * decl.cs (DeclSpace): Add IsGeneric
3842
3843 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3844
3845         * class.cs (Constructor.Emit): Don't emit the attributes twice.
3846
3847 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3848
3849         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3850         detect obsolete attributes.
3851         (Method.CreateEmitContext): Moved to MethodOrOperator.
3852
3853 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3854
3855         A fix for #78048.
3856         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3857         customized exception to make crash detection easier.
3858         (MethodOrOperator): Started to work on new base class for methods and
3859         operators.
3860         (Method): Derives from MethodOrOperator.
3861         (Constructor.Emit): Emits its own attributes.
3862         (AbstractPropertyEventMethod.Emit): Ditto.
3863         (Operator): Derives from MethodOrOperator, will refactor fully in extra
3864         patch.
3865         (Operator.Emit): It's temporary more tricky than should be.
3866         
3867         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3868
3869         * report.cs (InternalErrorException): Add ctor with inner exception.
3870
3871 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
3872
3873         A fix for #76744.
3874         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3875         only not visible.
3876
3877 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
3878
3879         A fix for #77916.
3880         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3881         array.
3882
3883 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3884
3885         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3886         attribute is present and Guid not.
3887         (Interface.ApplyAttributeBuilder): Ditto.
3888
3889         * attribute.cs: Add error message.
3890
3891 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3892
3893         A fix for #78020.
3894
3895         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3896         sources (it's composite) so hold them in extra array as they are used in
3897         Emit phase only. It worked in the previous versions by mistake.
3898         (Attribute.Emit): Emit attribute for more owners when exist.
3899
3900         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3901         it has now different behaviour.
3902
3903 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
3904
3905         * constant.cs (Constant.IsDefaultInitializer): New method.
3906
3907         * class.cs: Updated.
3908
3909         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3910         re-initialize default values. It saves KBs almost for every assembly.
3911         Thanks Zoltan for the idea.
3912         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3913         (ArrayCreation.DoResolve): Resolve only once.
3914         (ArrayCreation.Emit): Emit static initializer only when it is faster.
3915         (ArrayCreation.GetAttributableValue): Cope with optimized values.
3916
3917 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
3918
3919         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3920         From #77961.
3921
3922 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3923
3924         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3925         in an embedded statement too.
3926
3927 2006-04-01  Raja R Harinath  <rharinath@novell.com>
3928
3929         Fix #77958
3930         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3931
3932 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3933
3934         A fix for #77966.
3935
3936         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3937         was not specified.
3938
3939         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3940
3941 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
3942
3943         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3944         phase.
3945
3946         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3947         LocalTemporary change.
3948
3949         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3950         TypeContainer.
3951         (ClassOrStruct.DefineFieldInitializers): Implemented static field
3952         initializers optimization.
3953         (ClassOrStruct.TypeAttr): Moved from modifiers.
3954         (Constructor.CheckBase): Don't crash when static ctor has parameters.
3955         (FieldBase.ResolveInitializer): Resolves initializer.
3956         (FieldBase.HasDefaultInitializer): New property.
3957
3958         * cs-parser.jay: Removed message.
3959
3960         * expression.cs (CompilerGeneratedThis): New specialization.
3961
3962         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3963
3964 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
3965
3966         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3967
3968 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3969
3970         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3971         be now EnumConstants only.
3972
3973 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3974
3975         * attribute.cs, driver.cs: Reset more caches.
3976
3977 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3978
3979         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3980
3981 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3982
3983         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3984         for easier reuse. Updated all overrides.
3985         (IntegralConstant): New base class for all integral constants.
3986         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3987         of the constant range, report custom error.
3988         (UIntConstant.Reduce): Fixed uint conversion.
3989
3990         * ecore.cs, literal.cs: Reduce updates.
3991
3992 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3993
3994         A fix for #75813.
3995
3996         * class.cs (Constructor.Define): Removed extra if for default ctors.
3997         A patch from Atsushi Enomoto.
3998
3999 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4000
4001         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
4002         GetAttributableValue.
4003
4004         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
4005         when required.
4006
4007         * convert.cs (ImplicitConversionRequired): Error message moved to
4008         DoubleLiteral.
4009
4010         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
4011         automatic implicit conversion of an output value.
4012         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
4013
4014         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
4015         conversion.
4016         (TypeOf.GetAttributableValue): Add extra handling for object type.
4017
4018         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
4019         special error message.
4020
4021 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
4022
4023         * class.cs (Constructor.Emit): Don't crash when struct ctor is
4024         InternalCall.
4025         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
4026         compatible with MS runtime.
4027
4028 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
4029
4030         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
4031         attribute arguments here.
4032
4033         * class.cs (Indexer.Define): The check was moved to attribute class.
4034
4035 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
4036
4037         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
4038         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
4039         easier.
4040
4041 2006-03-22  Raja R Harinath  <rharinath@novell.com>
4042
4043         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
4044         mcs to keep code differences small.
4045         * attribute.cs (Attribute.GetParameterDefaultValue): New.
4046         * typemanager.cs (parameter_default_value_attribute_type): New.
4047         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
4048         CS1908 check.
4049
4050 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
4051
4052         * expression.cs (StringConcat.Append): Reverted back to no warning state.
4053
4054 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
4055
4056         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
4057
4058         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
4059         the blocks too.
4060
4061 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
4062
4063         * doc-bootstrap.cs : fix build.
4064
4065 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
4066
4067         * expression.cs (StringConcat.Append): Issue a warning when empty string
4068         is going to append.
4069
4070 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
4071
4072         * assign.cs (CompoundAssign.ResolveSource): Removed.
4073
4074         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
4075         clean up.
4076
4077         * class.cs (TypeContainer.FindMethods): Removed.
4078         (TypeContainer.CheckMemberUsage): Made static.
4079
4080         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
4081
4082         * constant.cs (CheckRange): Removed unused type argument.
4083         (CheckUnsigned): Removed unused type argument.
4084
4085         * cs-parser.jay: Updated after MemberAccess clean up.
4086         Uses Length for empty string test.
4087
4088         * cs-tokenizer.cs: Uses Length for empty string test.
4089         (IsCastToken): Made static.
4090         (is_hex): Made static.
4091         (real_type_suffix): Made static.
4092
4093         * decl.cs (SetupCache): Made static.
4094         (OnGenerateDocComment): Removed unused ds argument.
4095
4096         * delegate.cs (VerifyDelegate): Removed unused argument.
4097
4098         * doc.cs: Uses Length for empty string test.
4099
4100         * driver.cs: Uses Length for empty string test.
4101
4102         * enum.cs (IsValidEnumType): Made static
4103
4104         * expression.cs (EnumLiftUp): Removed unused argument.
4105         (ResolveMethodGroup): Ditto.
4106         (BetterConversion): Ditto.
4107         (GetVarargsTypes): Ditto.
4108         (UpdateIndices): Ditto.
4109         (ValidateInitializers): Ditto.
4110         (MemberAccess.ctor): Ditto.
4111         (GetIndexersForType): Ditto.
4112
4113         * flowanalysis.cs: (MergeFinally): Removed unused argument.
4114
4115         * iterators.cs: Updated after MemberAccess clean up.
4116
4117         * location.cs: Uses Length for empty string test.
4118
4119         * namespace.cs: Uses Length for empty string test.
4120
4121          * report.cs (CheckWarningCode): Made static.
4122
4123         * statement.cs (LabeledStatement): Removed unused argument.
4124
4125         * typemanager.cs (FilterNone): Removed.
4126
4127 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4128
4129         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
4130         obsolete.
4131
4132         * class.cs: Updated.
4133
4134 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4135
4136         * cs-parser.jay.cs: __arglist is not allowed for delegates.
4137
4138 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4139
4140         A fix for #77822.
4141
4142         * expression.cs (VerifyArgumentsCompat): Reverted to double error
4143         reporting, it's more tricky than I thought.
4144
4145 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4146
4147         A fix for #77816.
4148
4149         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
4150         host container.
4151         (AnonymousMethod.ImplicitStandardConversionExists): New method.
4152         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
4153         Add more error reporting; Fixed issue with params.
4154
4155         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
4156
4157         * cs-parser.jay: AnonymousMethod requires host container.
4158
4159         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
4160
4161 2006-03-18  Raja R Harinath  <harinath@gmail.com>
4162
4163         * class.cs: Change 'TypeContainer ds' constructor argument to
4164         'DeclSpace parent'.  Some classes were missed below due to
4165         different naming convention.
4166
4167         * class.cs (MemberCore.Parent): Delete.  This makes the
4168         ParentContainer changes below enforceable by the compiler.
4169
4170         Treat pointers to enclosing declaration space as 'DeclSpace', not
4171         'TypeContainer'.
4172         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
4173         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
4174
4175         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
4176         of TypeContainer.
4177         (Block.AddThisVariable): Likewise.
4178         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
4179         (AbstractPropertyEventMethod.Emit): Likewise.
4180         (AbstractPropertyEventMethod.EmitMethod): Likewise.
4181         (GetMethod.Define, SetMethod.Define): Likewise.
4182         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
4183         (DelegateMethod.EmitMethod): Likewise.
4184
4185         Fix regression test-partial-13.cs.
4186         Rationalize use of PartialContainer.  Ensure that the partial
4187         class semantics can be tied to type-correctness, i.e., any
4188         violation will cause a compile error.
4189         * class.cs, const.cs: Access all fields that belong to class
4190         TypeContainer via ParentContainer.  Arguments of EmitContexts and
4191         Resolve()-like functions still use 'Parent'.
4192
4193         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
4194         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
4195         (PropertyMethod.CheckModifiers): Remove unused argument.
4196         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
4197         DeclSpace.
4198
4199 2006-03-17  Raja R Harinath  <harinath@gmail.com>
4200
4201         Make semantics of PartialContainer simpler.
4202         * decl.cs (DeclSpace.IsPartial): Remove.
4203         * class.cs (TypeContainer.IsPartial): Likewise.
4204         (TypeContainer..ctor): Set PartialContainer to point to self.
4205         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
4206         (TypeContainer.FindNestedType): Likewise.
4207         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
4208
4209 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
4210
4211         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
4212
4213 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
4214
4215         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
4216         classes.
4217
4218 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
4219
4220         * class.cs (Operator.Define): An error for base conversion was not
4221         reported correctly.
4222
4223 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
4224
4225         * iterator.cs : yield break is allowed in try statement which has
4226           catch clauses. Fixed bug #77767.
4227
4228 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
4229
4230         A fix for #77593, #77574.
4231
4232         * class.cs (MethodCore.CheckBase): Another if for operator.
4233
4234 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
4235
4236         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
4237         were not resolved
4238
4239         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
4240         (DelegateCreation.ImplicitStandardConversionExists): New method for just
4241         conversion test.
4242         
4243         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
4244         not needed.
4245
4246         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
4247         Updated after another emitcontext usage was clean up. It should help us to
4248         synchronize with gmcs easier.
4249
4250 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
4251
4252         A fix for #77353.
4253
4254         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
4255         (Event.Define): ditto
4256         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
4257
4258         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
4259         Removed redundant code and set NewSlot for Invoke method too.
4260
4261         * parameter.cs (Parameters.ctor): Add custom, type ctor.
4262         (Parameters.MergeGenerated): New method. Use this method when you merge
4263         compiler generated argument with user arguments.
4264
4265 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
4266
4267         * attribute.cs (ResolveAsTypeTerminal): Removed.
4268
4269         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
4270         specialization for predefined types; 30% speed up.
4271         Finally placed obsolete check to right place.
4272         (Expression.ResolveType): Removed.
4273
4274         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
4275         Updated after ResolveType was removed.
4276
4277         * expression.cs (Cast.ctor): Check void cast.
4278         (Binary.ResolveAsTypeTerminal): Is never type.
4279         (Conditional.ResolveAsTypeTerminal): Is never type.
4280
4281         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
4282
4283 2006-03-01  Raja R Harinath  <rharinath@novell.com>
4284
4285         Fix #77679.
4286         * expression.cs (ParameterReference.DoResolveBase): Change return
4287         type to bool.
4288         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
4289         Update.
4290
4291         Fix #77628.
4292         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
4293
4294         Fix #77642.
4295         * typemanager.cs (GetFullNameSignature): Don't nullref on
4296         protected accessors.
4297
4298 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
4299
4300         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
4301         these two separated members to simplify the code.
4302         (Attribute.Resolve): Refactored to use new fields and methods.
4303         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
4304         implemented obsolete attribute checking.
4305         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
4306         implemented obsolete checking again. It look line never ending quest ;-)
4307         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
4308
4309         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
4310
4311         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
4312
4313         *class.cs (Property.Define): Add RegisterProperty call.
4314
4315         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
4316         argument groups (only 2).
4317
4318         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
4319         encoding expression to arguments.
4320         (Expression.ExprClassToResolveFlags): Just turned to property.
4321
4322         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
4323         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
4324         optimized as well as implemented support for zero-length attributes.
4325
4326         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
4327         Add caching of PropertyInfo's.
4328
4329 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4330
4331         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
4332         error multiple times.
4333
4334 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4335
4336         New partial class implementation.
4337         A fix for #77027, #77029, #77403
4338
4339         * attribute.cs (Attributable): Made attributes protected.
4340
4341         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
4342         the replacements of ClassPart and PartialContainer.
4343         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
4344         (TypeContainer.AddInterface): Ditto.
4345         (TypeContainer.AddPartial): The main method for partial classes. It checks
4346         for errors and merges ModFlags and attributes. At the end class is added to
4347         partial_parts list.
4348         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
4349         required here.
4350         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
4351         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
4352         from the rest of partial classes.
4353         (TypeContainer.GetClassBases): Simplified.
4354         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
4355         DefineType.
4356         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
4357         (TypeContainer.HasExplicitLayout): Uses Flags now.
4358         (PartialContainer): Removed.
4359         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
4360         (StaticClass): Was merged with Class.
4361         (Class.GetClassBases): class and static class bases are verified here.
4362         (Class.TypeAttr): Added static attributes when class is static.
4363         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
4364         (MemberBase): In some cases we need to call parent container for partial
4365         class. It should be eliminated but it's not easy now.
4366
4367         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
4368
4369         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
4370         partial classed to accumulate class comments.
4371         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
4372
4373         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
4374
4375         * driver.cs (MainDriver): Tree.GetDecl was removed.
4376
4377         * modifiers.cs (Modifiers): Add partial modifier.
4378
4379         * tree.cs (Tree.decl): Removed.
4380         (RootTypes): Started to use this class more often for root types
4381         specializations.
4382
4383 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4384
4385         A fix for #77615
4386
4387         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
4388         external interface does not have an attribute.
4389
4390 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4391
4392         Another prerequisites for new partial classs implementation.
4393         
4394         * attribute.cs (Attribute.Equal): Implemented.
4395         (Attribute.Emit): Changed as attributes can be applied more than twice.
4396         (Attributes.Emit): Check for duplicate attributes here.
4397
4398         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
4399         as a parameter, clean-up.
4400
4401 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4402
4403         A fix for #77485
4404
4405         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
4406         contains obsolete attribute check which can in some cases look for base
4407         type of current class which is not initialized yet.
4408         (TypeContainer.BaseType): Replacement of ptype.
4409
4410         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
4411
4412 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4413
4414         First of prerequisites for new partial classs implemention.
4415         
4416         * attribute.cs (Attributable): Extended by ResolveContext;
4417         Attributes finally have correct context for resolving in all cases.
4418         (AttachTo): Attribute owner is assigned here.
4419
4420         * codegen.cs (IResolveContext): Introduce new interface to hold
4421         all information needed in resolving phase.
4422         (EmitContext): Implements IResolveContext; more clean-up needed here.
4423         
4424         * decl.cs (MemberCore): Implemented IResolveContext.
4425
4426         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
4427         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
4428         parameter.cs, statement.cs, tree.cs, typemanager.cs:
4429         Refactored to use new IResolveContext instead of EmitContext; cleanup
4430
4431 2006-02-06  Miguel de Icaza  <miguel@novell.com>
4432
4433         * codegen.cs (EmitScopeInitFromBlock): check here the
4434         capture_context, there is no need to make two calls to the
4435         EmitContext. 
4436
4437         * anonymous.cs: Add some debugging messages that might help me
4438         track other instances of this problem in the future (the
4439         regression of test 467).
4440
4441         * cs-parser.jay: track the variable block, as we need to initalize
4442         any captured variables declared in this block for the "catch"
4443         portion of the "Try" statement.
4444
4445         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
4446         scope initialization for captured variables. 
4447
4448         Also, move the emit for the variables after the block location has
4449         been marked.
4450
4451 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
4452
4453         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
4454
4455 2006-02-02  Miguel de Icaza  <miguel@novell.com>
4456
4457         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
4458         commit yesterday, the initialization for the roots is necessary.
4459         What is not necessary is the scope activation.
4460
4461 2006-02-02  Raja R Harinath  <rharinath@novell.com>
4462
4463         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
4464         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
4465         CS0206 checks.
4466         (Argument.Resolve): Remove CS0206 checks.
4467
4468 2006-02-01  Miguel de Icaza  <miguel@novell.com>
4469
4470         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
4471         scopes for all the roots, the scopes will now be emitted when the
4472         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
4473
4474         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
4475         code.  This reduces a lot of existing cruft.
4476         
4477         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
4478         that the ScopeInfo is generated as we enter the scope, not at the
4479         time of use, which is what we used to do before.
4480
4481         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
4482         every time a Block is about to be emitted if we have a
4483         CaptureContext. 
4484
4485 2006-02-01  Raja R Harinath  <rharinath@novell.com>
4486
4487         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4488         (Reset): Update.
4489         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
4490
4491         * typemanager.cs (cons_param_array_attribute): Make private.
4492         (Reset): Set it to null.
4493         (InitCoreHelpers): Don't initialize it.
4494         (ConsParamArrayAttribute): New.  Initialize it as needed.
4495         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
4496
4497 2006-01-31  Miguel de Icaza  <miguel@novell.com>
4498
4499         * expression.cs: There might be errors reported during the
4500         selection of applicable methods.  If there are errors, do not
4501         continue execution as it will lead the compiler to crash.
4502
4503 2006-01-30  Miguel de Icaza  <miguel@novell.com>
4504
4505         * expression.cs: Member access is not allowed on anonymous
4506         methods.  Fixes #77402.
4507
4508 2006-01-30  Raja R Harinath  <rharinath@novell.com>
4509
4510         Fix #77401
4511         * cs-parser.jay (VariableDeclaration): Don't set
4512         current_array_type to null.
4513         (field_declaration, event_declaration, declaration_statement):
4514         Set it to null here.
4515
4516 2006-01-28  Raja R Harinath  <harinath@gmail.com>
4517
4518         * typemanager.cs (GenericParameterPosition): New.
4519         * doc.cs: Use it.
4520
4521 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
4522
4523         * doc.cs : To process "include" elements, first we should create
4524           another list than XmlNodeList, because it could result in node
4525           removal, which could result in that the XmlNodeList gives up
4526           yielding next node.
4527
4528           (Also made code identical to gmcs again.)
4529
4530 2006-01-25  Miguel de Icaza  <miguel@novell.com>
4531
4532         * ecore.cs: Introduce an error report that we were not catching
4533         before, if not silent, we must report the error.  Gonzalo ran into
4534         it.
4535
4536 2006-01-23  Miguel de Icaza  <miguel@novell.com>
4537
4538         A fix for bug: #76957
4539         
4540         * iterators.cs (MoveNextMethod.CreateMethodHost): call
4541         ComputeMethodHost before creating the method, this is a new
4542         requirement. 
4543
4544         * anonymous.cs (AnonymousContainer): Now we track all the scopes
4545         that this method references (RegisterScope).  The actual scope
4546         where the method is hosted is computed with the ComputeMethodHost
4547         before we create the method.
4548
4549         Moved the Deepest routine here.
4550
4551         (AnonymousContainer.ComputeMethodHost): New routine used to
4552         compute the proper ScopeInfo that will host the anonymous method.
4553
4554         (ScopeInfo): Deal with multiple roots.  The problem was that we
4555         did not have a unique root where all ScopeInfos could be hanged
4556         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
4557         of roots.  
4558
4559         Remove AdjustMethodScope which is now computed at the end.  Remove
4560         LinkScope which did a partial link, instead link all ScopeInfos
4561         before code generation from the new "LinkScopes" routine. 
4562
4563         Simplify all the Add* routines as they no longer need to maintain
4564         the tree, they just need to record that they are using variables
4565         from a ScopeInfo.
4566
4567         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
4568         routines to produce the forest of ScopeInfo trees.
4569
4570         * class.cs (TypeContainer.AppendMethod): This is just like
4571         AddMethod, but ensures that an interface implementation method
4572         (IEnumerable.XXX) is not inserted at the beginning of the queue of
4573         methods, but at the end.
4574
4575         We use this functionality to ensure that the generated MoveNext
4576         method in the iterator class is resolved/emitted before the
4577         enumerator methods created.   
4578
4579         This is required because the MoveNext method computes the right
4580         ScopeInfo for the method.  And the other methods will eventually
4581         need to resolve and fetch information computed from the anonymous
4582         method. 
4583
4584 2006-01-21  Raja R Harinath  <harinath@gmail.com>
4585             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
4586
4587         Fix rest of #76995.
4588         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
4589         the 'aliases' hash.
4590         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
4591         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
4592
4593 2006-01-18  Raja R Harinath  <rharinath@novell.com>
4594
4595         Fix #76656, cs0231-2.cs.
4596         * cs-parser.jay (formal_parameter_list): Make error case catch
4597         more issues.
4598         (parenthesized_expression_0): Add CS1026 check.
4599         (invocation_expression): Remove unused { $$ = lexer.Location }.
4600
4601 2006-01-17  Raja R Harinath  <rharinath@novell.com>
4602
4603         Fix #76824.
4604         * cs-parser.jay (statement_expression): Don't list out the
4605         individual statement-expressions.  Convert syntax error into
4606         CS0201 check.
4607
4608 2006-01-16  Raja R Harinath  <rharinath@novell.com>
4609
4610         Fix #76874.
4611         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4612         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
4613         CheckIntermediateModification.
4614         (FieldExpr.DoResolve): Add new two-argument version that
4615         allows us to resolve the InstanceExpression as an lvalue.
4616         The one-argument variant is now just a wrapper.
4617         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4618         Resolve the lhs as an lvalue if the it has a value type.
4619         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4620         from Assign.DoResolve.
4621         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4622         resolved as an lvalue.
4623         (PropertyExpr.DoResolve): Update.
4624         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4625         has a value type.  Move CS1612 check here from
4626         CheckIntermediateModification.
4627         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4628         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
4629         'right_side' of a ResolveLValue on an 'out' argument.
4630         (EmptyExpression.LValueMemberAccess): New.  Used as the
4631         'right_side' of a propagated ResolveLValue on a value type.
4632         (LocalVariableReference.DoResolveBase): Recognize
4633         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4634         Add CS1654 check.
4635         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4636         EmptyExpression.Null.
4637
4638 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
4639
4640         * typemanager.cs : added IsGenericParameter(). In mcs it always
4641           return false.
4642         * doc.cs : for generic parameters, use GenericParameterPosition,
4643           not FullName.
4644
4645 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
4646
4647         * expression.cs: Fix Console.WriteLine ((this = x).foo);
4648
4649 2006-01-12  Miguel de Icaza  <miguel@novell.com>
4650
4651         This fixes the problem where we used ldfld instead of ldflda to
4652         load the "THIS" pointer on captured parameters, when THIS is a
4653         value type.  See bug #77205.
4654         
4655         * iterators.cs (CapturedThisReference.Emit): Pass false to
4656         EmitThis (we do not need the address).
4657
4658         * codegen.cs (EmitThis): it needs to know whether we need the
4659         address of `this' or not.  This is used by value types.  
4660
4661         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4662         every other call passes false.
4663
4664 2006-01-12  Raja R Harinath  <rharinath@novell.com>
4665
4666         Fix #77221.
4667         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4668         GetOverride.
4669         * expression.cs (Invocation.OverloadResolve): Update.
4670         (Invocation.DoResolve): Avoid double resolution of invocation.
4671
4672 2006-01-11  Raja R Harinath  <rharinath@novell.com>
4673
4674         Fix #77180.
4675         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4676         unary negation of floating point types as 0-expr; negation cannot
4677         overflow in floating point types.
4678
4679         Fix #77204.
4680         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4681         on operands of 'void' type.
4682
4683         Fix #77200.
4684         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4685         and ExclusiveOr for boolean constants too.
4686
4687 2006-01-09  Raja R Harinath  <rharinath@novell.com>
4688
4689         Fix #75636.
4690         * expression.cs (Invocation.OverloadResolve): Replace reflected
4691         override methods with their base virtual methods, rather than
4692         skipping over them.
4693         * typemanager.cs (TypeManager.GetOverride): New.
4694
4695 2006-01-05  Jb Evain  <jbevain@gmail.com>
4696
4697         * class.cs (Property.Define, Indexer.Define): do not tag the
4698         properties as SpecialName | RTSpecialName.
4699
4700 2006-01-04  Miguel de Icaza  <miguel@novell.com>
4701
4702         * class.cs (MethodCore.IsDuplicateImplementation): This method was
4703         doing a low-level comparission of parameter types.  It was lacking
4704         a check for __argslist. 
4705
4706 2005-12-30  Miguel de Icaza  <miguel@novell.com>
4707
4708         * expression.cs (ParameterReference.DoResolveBase): Allow
4709         reference parameters if they are local to this block. 
4710
4711         This allows the ref and out parameters of a delegate to be used in
4712         an anonymous method, for example:
4713
4714         delegate void set (out int x);
4715
4716         set s = delegate (out int x){
4717                 x = 0;
4718         };
4719
4720         This is used by functionality introduced late in the C# language.
4721         
4722         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4723         method that take ref and out parameters. 
4724
4725         Fixes #77119 which was a late change in the spec.
4726
4727 2005-12-23  Miguel de Icaza  <miguel@novell.com>
4728
4729         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4730         parent if its the same scope.  Fixes #77060.
4731
4732 2005-12-21  Miguel de Icaza  <miguel@novell.com>
4733
4734         * driver.cs: Report the case of no source files and no -out:
4735         argument provided.
4736
4737 2005-12-20  Raja R Harinath  <rharinath@novell.com>
4738
4739         Fix #77035.
4740         * expression.cs (ComposedCast.GetSignatureForError): Define.
4741
4742 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4743
4744         Fix #76995
4745
4746         * namespace.cs (NamespaceEntry): Add extern_aliases as a
4747         ListDictionary, to contain the ExternAliasEntry entries (in
4748         addition to the NamespaceEntry.aliases hashtable). This field is
4749         shared between the original entry and its doppelganger (bodyless 
4750         copy of it).
4751         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4752         extern_aliases field.
4753         (NamespaceEntry.Lookup): Move the IsImplicit check after the
4754         lookup in extern_aliases.
4755
4756 2005-12-16  Raja R Harinath  <rharinath@novell.com>
4757
4758         Fix #77006.
4759         * class.cs (TypeContainer.Mark_HasEquals): New.
4760         (TypeContainer.Mark_HasGetHashCode): New.
4761         (ClassPart): Override them.
4762         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4763
4764         Fix #77008.
4765         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4766         'parent' argument to the base constructor.
4767
4768         Remove all mention of TypeContainer from decl.cs.
4769         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4770         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4771         (DeclSpace.DeclSpace): Likewise.
4772         (DeclSpace.DefineMembers): Remove unused argument.
4773         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
4774         debugging check -- we don't care if the debug code throws an
4775         InvalidCastException instead of an InternalErrorException.
4776         * class.cs (TypeContainer.DefineMembers): Update to changes.
4777         (TypeContainer.DoDefineMembers): Likewise.
4778         (TypeContainer.GetMethods): Likewise.
4779         (PropertyMember.Define): Likewise.
4780         (MemberBase.Parent): New property that forwards to
4781         MemberCore.Parent, but ensures that we get a TypeContainer.
4782         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4783         (RootContext.PopulateTypes): Likewise.  Remove special case code
4784         for !RootContext.StdLib: DefineMembers is idempotent.
4785
4786 2005-12-14  Miguel de Icaza  <miguel@novell.com>
4787
4788         * convert.cs (ExplicitConversionCore): Check the return value from
4789         ExplicitConversionCore which can return null on failure.  Fixes #76914
4790
4791 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
4792
4793         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4794
4795 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
4796
4797         * doc.cs : The search for referenced namespace was insufficient to
4798           get global one as it used to do. Fixed bug #76965.
4799
4800 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
4801
4802         * doc.cs : check name in cref in the last phase that whether it is
4803           namespace or not.
4804
4805 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4806
4807         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4808           Mono.C5.
4809
4810 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4811
4812         * doc.cs : so it turned out that we cannot skip override check for 
4813           interface members. Fixed bug #76954.
4814
4815 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4816
4817         * cs-tokenizer.cs : fixed bug #75984:
4818           - #warning and #error should not be handled when the source line
4819             is disabled.
4820           - #line is not checked strictly when the source line is disabled.
4821           - #define and #undef is on the other hand checked strictly at any
4822             state.
4823
4824 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
4825
4826         * cs-tokenizer.cs : missing Location (actually, filename) in one of
4827           CS1027 report.
4828
4829 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4830
4831         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4832
4833         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4834         event initializers.
4835         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4836         (FieldBase.Initializer): Initializer is now optional.
4837         (EventField.Define): Only event field can have initializer.
4838
4839         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4840
4841         * const.cs (Const): Reuse initializer.
4842
4843         * cs-parser.jay: Updated after FieldBase changes.
4844         Added current_array_type to simplify array initializers.
4845
4846         * ecore.cs (NullCast.IsDefaultValue): Implemented.
4847
4848         * expression.cs, iterators.cs: Updated.
4849
4850         * namespace.cs (NamespaceEntry): Made UsingFound private.
4851
4852 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4853
4854         * parameterCollection.cs: Obsolete, removed.
4855         * parser.cs: Obsolete, removed.
4856
4857 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4858
4859         Fix #76849.
4860         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4861
4862         * enum.cs (Enum.Define): Set obsolete context here.
4863
4864 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4865
4866         * doc.cs :
4867           - FindDocumentedMember() now expects 1) paramList as null
4868             when "we don't have to check the number of parameters" and
4869             2) Type.EmptyTypes when "there is no arguments".
4870           - Introduced FoundMember struct to hold the exact type which was
4871             used to find the documented member (the above change broke
4872             test-xml-044; it might be better just to use DeclaringType than
4873             what MS does, like this change does, but it depends on usage.)
4874
4875 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4876
4877         * doc.cs : documented member might be from DeclaringType for nested
4878           types. Fixed bug #76782.
4879
4880 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
4881
4882         * anonymous.cs: Have the param code handle leaving copies on the
4883         stack etc. Allows anonymous params to take part in the assignment
4884         code (++, +=, etc). Fixes bug #76550
4885
4886         * expression.cs: Handle the prepare_for_load/leave_copy by passing
4887         it down to the anon code.
4888
4889         * iterators.cs: Use dummy var here
4890
4891         * codegen.cs: Handle new vars
4892
4893 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4894
4895         Fix #76849.
4896         * class.cs (MethodData.Define): Set proper Obsolete context.
4897
4898         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4899         obsolete context.
4900         (FieldExpr.DoResolve): Ditto.
4901
4902 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4903
4904         Fix #76849.
4905         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4906         parent is not obsolete.
4907
4908 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
4909
4910         * doc.cs : (FindDocumentedMember) find parameterless members first
4911           and get CS0419 in the early stage. Fixed first case of bug #76727.
4912
4913 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
4914
4915         Fix #76859.
4916         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4917         no error was reported.
4918
4919         *expression.cs (Binary.DoResolve): left can be null.
4920
4921 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
4922
4923         Fix #76783.
4924         * class.cs (MethodData.Emit): Parameters should be labeled first.
4925
4926 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
4927
4928         Fix #76761.
4929         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4930
4931 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
4932
4933         * attribute.cs (AreParametersCompliant): Moved to Parameter.
4934
4935         * class.cs (MethodCore): Parameter clean up.
4936         (IMethodData): Added ParameterInfo.
4937         (MethodData): Parameter clean up.
4938         (Indexer.Define): Parameter clean up.
4939
4940         * anonymous.cs,
4941         * codegen.cs,
4942         * cs-parser.jay,
4943         * decl.cs,
4944         * doc.cs,
4945         * ecore.cs,
4946         * flowanalysis.cs,
4947         * iterators.cs,
4948         * pending.cs,
4949         * statement.cs,
4950         * typemanager.cs: Parameter clean up.
4951
4952         * delegate.cs (Define): Get rid of duplicated code.
4953
4954         * expression.cs (ParameterReference): Removed useless parameters
4955         and simplified.
4956         (Invocation): Ditto.
4957
4958         * parameter.cs (ParamsParameter): New class, params specialization.
4959         (ArglistParameter): Attemp to separate arglist.
4960         (Parameter): Refactored to be reusable and faster.
4961         (Parameter.Modifier): Made understandable.
4962         (Parameters): Changed to be used as a class for `this' assembly
4963         parameters. Refactored to use new specialized classes.
4964
4965         * support.cs (ParameterData): Added Types property.
4966         (InternalParameters): Deleted.
4967
4968 2005-08-20  Martin Baulig  <martin@ximian.com>
4969
4970         Merging this patch from GMCS to fix #75867.
4971
4972         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4973         scope if we don't already have it.
4974
4975 2005-11-17  Martin Baulig  <martin@ximian.com>
4976
4977         * anonymous.cs
4978         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4979         inherit the scope from our parent.  Fixes #76653.
4980
4981 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4982
4983         * doc.cs : the previous patch does not actually fix the bug.
4984           PropertyInfo override check is now implemented and really fixed it.
4985         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4986
4987 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4988
4989         * doc.cs : apply "override filter" also to properties.
4990           Fixed bug #76730.
4991
4992 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4993
4994         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4995           no need to check overrides. For classes, omit those results from 
4996           interfaces since they must exist in the class. Fixed bug #76726.
4997
4998 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4999
5000         * typemanager.cs : (GetFullNameSignature) differentiate indexers
5001           with different parameters. Fixed the second problem in #76685.
5002
5003 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5004
5005         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
5006           get expected 'protected' access in CheckValidFamilyAccess()).
5007           Fixed bug #76692.
5008
5009 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5010
5011         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
5012           Fixed bug #76705.  CS1569 was incorrectly commented out.
5013
5014 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
5015
5016         * doc.cs : use Invocation.IsOverride() to do real override check.
5017         * expression.cs : made Invocation.IsOverride() internal.
5018
5019 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
5020
5021         * doc.cs : use TypeManager.FindMembers() instead of (possible)
5022           TypeBuilder.FindMembers() and filter overriden base members out.
5023           Fixed bug #76990.
5024
5025 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5026
5027         * doc.cs : ref/out parameters are represented as '@' (instead of
5028           '&' in type FullName). Fixed bug #76630 (additionally crefs).
5029
5030 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5031
5032         * doc.cs : when there was no '.' in cref to methods in doc comment,
5033           then parameters were missing in the output. Fixed bug #76691.
5034
5035 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5036
5037         * driver.cs : don't output docs when there is an error.
5038           Fixed bug #76693.
5039
5040 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5041
5042         * doc.cs :
5043           Now it should detect indexers. Fixed primary concern in bug #76685.
5044           Fixed CS0419 message to not show the identical member signature in
5045           the message.
5046
5047 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5048
5049         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
5050           instead of Type.FindMembers() since it does not handle events.
5051           Fixed bug #71604.
5052
5053 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
5054
5055         * codegen.cs: Fixed typo (speficied -> specified).
5056
5057 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
5058
5059         Fix #76369.
5060         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
5061
5062 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
5063
5064         * attribute.cs: Changed error message.
5065
5066         * cs-tokenizer.cs: One more check.
5067
5068 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
5069
5070         * statement.cs (Block.Resolve): Ignore empty statement.
5071
5072 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
5073
5074         * report.cs: Made error/warning methods more strict to avoid
5075         their misuse.
5076
5077         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
5078         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
5079         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
5080         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
5081
5082 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
5083
5084         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
5085         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
5086
5087         * class.cs (TypeContainer.IsComImport): New property.
5088         (Constructor.Define): Create proper ctor for ComImport types.
5089
5090         * expression.cs (New.CheckComImport): Fixed.
5091
5092 2005-11-07  Miguel de Icaza  <miguel@novell.com>
5093
5094         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
5095         that a parameter has been captured does not mean that we do not
5096         have to do the rest of the processing.  This fixes the second part
5097         of #76592.  If there was another anonymous method capturing
5098         values in the past, the Scope would never be set for the second
5099         method that captured the same parameter.
5100
5101         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
5102         properly manipulate the stack.   Second part of fix for #76592.
5103
5104         * expression.cs (New): Add support for invoking "new" on
5105         interfaces that have been flagged with the ComImport attribute and
5106         the CoClass.  Fixes #76637 
5107
5108         * statement.cs (Try.DoEmit): When a variable is captured, do not
5109         try to emit the vi.LocalBuilder variable as it has been captured.
5110         Create a temporary variable and store the results on the
5111         FieldBuilder.  Fixes #76642
5112
5113 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
5114
5115         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
5116
5117         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
5118
5119         * expression.cs (Binary.DoResolve): Added && optimalization.
5120     
5121         * typemanager.cs (AddUserType): Removed useless argument.
5122
5123 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
5124
5125         * statement.cs (Block.variables): Uses ListDictionary.
5126
5127 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
5128
5129         Fix #75969.
5130         * class.cs (PartialContainer.EmitType): Customized to emit
5131         security attributes.
5132         (ClassPart.ApplyAttributeBuilder): Transform security attribute
5133         for partial classes.
5134
5135 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
5136
5137         Fix #76599.
5138         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
5139         access has to be fixed.
5140         
5141         * typemanager.cs (IsUnmanagedType): Wrong common field type.
5142
5143 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
5144
5145         Fix #76590.
5146         * ecore.cs (NullCast.Reduce): Implemented.
5147
5148         * expression.cs (ArrayCreation.CheckIndices): Correcly check
5149         constant type.
5150         
5151         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
5152         properly.
5153         (Foreach.Resolve): Catch null properly.
5154
5155 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
5156  
5157         * cs-tokenizer.cs: Warning text fix.
5158
5159         * driver.cs: AllWarningNumbers exposed on public interface.
5160
5161         * report.cs (): Reviewed warning numbers.
5162         (IsValidWarning): Use binary search.
5163
5164 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
5165  
5166         * driver.cs: Implemeted resource visibility.
5167         (Resources): New class for code sharing between /res: and
5168         /linkres:
5169  
5170 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
5171
5172         Fix #76568.
5173         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
5174         folding.
5175         
5176         * convert (Convert.ImplicitReferenceConversion): NullCast holds
5177         contants only.
5178         
5179         * ecore.cs (NullCast): Child is contant only.
5180         
5181         * literal.cs (NullLiteral.Reduce): null can be converted to any
5182         reference type.
5183
5184 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
5185
5186         * driver.cs: Use Encoding.Default as default code page instead
5187           of ISO-28591.
5188
5189 2005-10-27  Raja R Harinath  <rharinath@novell.com>
5190
5191         Fix #76085.
5192         * expression.cs (Invocation.Error_InvalidArguments): Handle
5193         __arglist parameters.
5194         (Invocation.VerifyArgumentsCompat): Likewise.
5195         * support.cs (ReflectionParameters.GetSignatureForError): Print
5196         __arglist parameters.
5197         (InternalParamters.GetSignatureForError): Likewise.
5198         * parameter.cs (Parameters.GetSignatureForError): Likewise.
5199
5200 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
5201
5202         * attribute.cs (GetPropertyValue): Made public.
5203
5204         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
5205         Resolve.
5206         Add new property WrapNonExceptionThrows to handle 2.0 assembly
5207         attribute.
5208         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
5209         is not defined.
5210         
5211         * driver.cs: Reflect method name change.
5212         
5213         * statement.cs (Try.Resolve): Warn when try has both general
5214         exception handlers.
5215         
5216         * typemanager.cs: runtime_compatibility_attr_type new predefined
5217         type.
5218
5219 2005-10-26  Raja R Harinath  <harinath@gmail.com>
5220
5221         Fix #76419.
5222         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
5223         treat it as an empty parameter list.
5224
5225 2005-10-26  Raja R Harinath  <rharinath@novell.com>
5226
5227         Fix #76271.     
5228         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
5229         ResolveAsTypeStep silent.
5230         * statement.cs (Block.AddConstant): Mark block as used.
5231         (Block.ResolveMeta): Avoid piling on error messages
5232         if a constant initializer resolution fails.
5233
5234 2005-10-25  Raja R Harinath  <rharinath@novell.com>
5235
5236         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
5237         Remove.
5238         (NamespaceEntry.VerifyAllUsing): New.
5239         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
5240         behaviour.  Delegates actual resolution of alias to ...
5241         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
5242         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
5243         Update.
5244         * driver.cs (Driver.MainDriver): Update.
5245         
5246         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
5247         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
5248         property.
5249         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
5250         Remove.
5251         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
5252         RootNamespace.DefineNamespacesForAll.
5253
5254 2005-10-24  Raja R Harinath  <harinath@gmail.com>
5255
5256         * typemanager.cs (assemblies, external_aliases, modules)
5257         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
5258         (ComputeNamespaces, GetRootNamespace): Remove extra staging
5259         overhead.  Move resposibility ...
5260         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
5261         * driver.cs, attribute.cs, codegen.cs: Update to changes.
5262
5263 2005-10-23  Raja R Harinath  <harinath@gmail.com>
5264
5265         * namespace.cs (RootNamespace.all_namespaces): Renamed from
5266         cached_namespaces.  Improve usage.
5267         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
5268         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
5269         Move from GlobalRootNamespace and simplify.
5270         (RootNamespace.Global): Make instance variable.
5271         (RootNamespace.RootNamespace): Add "alias name" parameter.
5272         (GlobalRootNamespace): Simplify drastically.
5273         (Namespace.Lookup): Don't use GetNamespace.
5274         * typemanager.cs (GetRootNamespace): Rename from
5275         ComputeNamespaceForAlias.
5276         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
5277
5278 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5279
5280         * anonymous.cs (AnonymousContainer): Don't crash when container
5281         doesn't exist.
5282
5283 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5284
5285         * expression.cs (Binary.DoResolve): Warn when comparing same
5286         values.
5287
5288 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5289
5290         Fix #76486.
5291         * expression.cs (Binary.DoResolve): It looks like there are no
5292         convetsion rules in enum context.
5293
5294 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5295
5296         Add support for extern alias qualifiers.
5297         * typemanager.cs: Move some LookupTypeReflection code
5298         to namespace.cs, to have cleaner code. Added some methods
5299         to help us keep track of the extern aliased references.
5300         * driver.cs: Add suport for extern alias assemblies on command
5301         line and check for their warnings/errors. Also keep track of the
5302         extern aliased assemblies.
5303         * namespace.cs: Move the global functionality of Namespace
5304         to GlobalRootNamespace/RootNamespace. Now the global namespace
5305         is GlobalRootNamespace.Globa. Also the code moved from 
5306         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
5307         Finally added LocalAliasEntry (AliasEntry before) and
5308         ExternAliasEntry, to handle alias statements.
5309         * cs-parser.jay: Add support in the grammar for extern alias
5310         statement.
5311         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
5312         Update callings to Namespace (now in GlobalRootNamespace).
5313
5314 2005-10-18  Raja R Harinath  <rharinath@novell.com>
5315
5316         Fix #76371.
5317         * class.cs (TypeContainer.DefineType): Move updating of
5318         topological sort earlier in the code.
5319         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
5320
5321 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
5322
5323         Fix #76273.
5324         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
5325         
5326         * constant.cs (Constant.TryReduce): Moved from Cast class.
5327         (Reduce): Made little bit more OO and fixed missing conversions.
5328         
5329         * ecore.cs (Reduce): Implemented.
5330         (Binary.EnumLiftUp): New method to upgrade values to enum values.
5331         
5332         * literal.cs (Reduce): Implemented.
5333         
5334         * class.cs: Reverted Miguel's wrong commit.
5335
5336 2005-10-14  Miguel de Icaza  <miguel@novell.com>
5337
5338         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
5339
5340 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
5341
5342         * cs-parser.jay, expression.cs : CS0214 was missing error location
5343           for constants. Fixed bug #76404.
5344
5345 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
5346
5347         Fix #76370.
5348         * convert.cs (ExplicitConversionCore): Fixed object->enum
5349         conversion.
5350
5351 2005-10-10  Raja R Harinath  <rharinath@novell.com>
5352
5353         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5354         InstanceExpression.
5355         (PropertyExpr.EmitCall): Likewise.
5356         * expression.cs (Invocation.EmitArguments): Handle case where
5357         arguments == null.
5358         (Invocation.EmitCall): Avoid allocating temporary variable if
5359         there are no arguments.
5360
5361 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5362
5363         Fix #76323.
5364         * convert.cs (ImplicitConversionStandard): Move conversion of
5365         void* to arbitrary pointer types ...
5366         (ExplicitConversionStandard): .. here.
5367         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
5368         error to always print typenames.
5369
5370 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5371
5372         * convert.cs (GetConversionOperator): Rename from
5373         GetConversionOperators.  Move operator selection code from ...
5374         (UserDefinedConversion): ... here.
5375
5376 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
5377
5378         * convert.cs (ExplicitConversionCore): Removed duplicate enum
5379         conversion.
5380
5381 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
5382
5383         * assign.cs (Assign.DoResolve): Error method changed.
5384
5385         * cfold.cs (DoConstantNumericPromotions): Error method changed.
5386         
5387         * const.cs (ResolveValue): Reset in_transit immediately.
5388         
5389         * constant.cs: Error method changed.
5390         
5391         * convert.cs: Removed useless location parameter.
5392         (ExplicitNumericConversion): Don't do double enum check.
5393         (ExplicitConversionCore): Renamed from ExplicitConversion.
5394         (ExplicitUnsafe): Extracted from ExplicitConversion.
5395         (ExplicitConversion): Uses for error reporting.
5396         
5397         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
5398         error messages.
5399         (ResolveBoolean): Uses common error method.
5400         (CastToDecimal): Get rid of ec.
5401         (CastFromDecimal): Optimized.
5402         (ConvCast): Get rid of ec.
5403         
5404         * enum.cs (ResolveValue): Reset in_transit immediately.
5405         (Emit): Return after first error.
5406         
5407         * expression.cs: Convert changes.
5408         
5409         * literal.cs: Error method changed.
5410         
5411         * statement.cs: Error method changed.
5412
5413 2005-10-03  Raja R Harinath  <rharinath@novell.com>
5414
5415         * support.cs (SeekableStreamReader.Position): Don't error out when
5416         the requested position is just beyond the end of the current
5417         buffered data.
5418
5419 2005-09-28  Raja R Harinath  <rharinath@novell.com>
5420
5421         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
5422         try to keep in sync with the byte count of the underlying Stream.
5423         However, this limits us to a window size of 2048 characters: i.e.,
5424         the maximum lookahead of our lexer/parser can be 2048 characters.
5425
5426 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
5427
5428         Fix #76255.
5429         * driver.cs: Fix compilation files with full root path.
5430
5431 2005-09-25  Miguel de Icaza  <miguel@novell.com>
5432
5433         * report.cs (SymbolRelatedToPreviousError): Format the output so
5434         it does not use an open parenthesis that is never closed. 
5435
5436         * driver.cs: Follow coding guidelines
5437
5438 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5439
5440         Fix #72930.
5441         * const.cs (Const.ResolveValue): Check for assigning non-null
5442         value to reference type.
5443
5444 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5445
5446         * anonymous.cs: Implemented ExprClassName.
5447         
5448         * assign.cs (Assign.DoResolve): Don't chrash when type is not
5449         delegate.
5450         
5451         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
5452         check.
5453         
5454         * class.cs (StaticClass.DefineContainerMembers): Report protected
5455         members as error.
5456         
5457         * codegen.cs: if(ed) PRODUCTION.
5458         
5459         * convert.cs (Error_CannotImplicitConversion): Better error
5460         distinction.
5461         
5462         * cs-parser.jay: More error checks.
5463         
5464         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
5465         
5466         * driver.cs (CSCParseOption): Enabled wrong option check.
5467         
5468         * ecore.cs (Expression.ExprClassName): Turned to property.
5469         (MemberExpr.CheckIntermediateModification): For checking boxed
5470         value types     modification.
5471         
5472         * statement.cs (Fixed.Resolve): Expression type must be
5473         convertible to fixed type.
5474         (CollectionForeach.GetEnumeratorFilter,TryType):
5475         Small refactoring for easier error checking.
5476
5477 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
5478
5479         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
5480         attributes.
5481         
5482         * class.cs (GeneratedBaseInitializer): New class for customization
5483         compiler generated initializers.
5484         (MemberBase.DoDefine): Check Obsolete attribute here.
5485         (FieldMember.DoDefine): Ditto.
5486         
5487         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
5488         constants.
5489         
5490         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
5491         (MemberCore.GetObsoleteAttribute): Removed argument.
5492         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
5493         (MemberCore.CheckObsoleteType): New helper.
5494         
5495         * delegate.cs,
5496         * enum.cs,
5497         * statement.cs: Updates after MemberCore changes.
5498         
5499         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
5500         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
5501         
5502         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
5503         obsolete attribute for compiler construct.
5504         (As.DoResolve): Cache result.
5505         
5506         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
5507
5508 2005-09-26  Raja R Harinath  <rharinath@novell.com>
5509
5510         Fix #76133.
5511         * expression.cs (This.VerifyFixed): In a value type T, the type of
5512         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
5513         value type R, 'this' is treated as a value parameter.
5514
5515 2005-09-22  Miguel de Icaza  <miguel@novell.com>
5516
5517         * statement.cs (Lock): Use the TemporaryVariable class instead of
5518         manually using local variables as those do not work when variables
5519         are captured.
5520
5521         * ecore.cs: Moved the TemporaryVariable class from being a nested
5522         class inside Foreach to be a public class that can be employed in
5523         other places. 
5524
5525 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
5526
5527         * cs-parser.jay: interface_accessors replaced by
5528         accessor_declarations.
5529
5530         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
5531         location.
5532         
5533         * statement.cs (GotoCase.Resolve): Convert null constant to
5534         null case.
5535         (SwitchLabel.ResolveAndReduce): Ditto.
5536         (SwitchLabel.NullStringCase): Custom null stamp.
5537         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
5538         
5539         typemanager.cs (CSharpSignature): Don't skip first argument
5540         for full names.
5541
5542 2005-09-18  Miguel de Icaza  <miguel@novell.com>
5543
5544         * driver.cs: Set InEmacs based on the environment variable EMACS. 
5545
5546         * location.cs (InEmacs): in this mode, do not report column
5547         location as it confuses Emacs.
5548
5549 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
5550
5551         * cfold.cs, constant.cs, convert.cs, ecore.cs,
5552         expression.cs, iterators.cs, literal.cs: Store constants and
5553         literals location.
5554         
5555         * class.cs (MemberBase.ShortName): Pass location.
5556         
5557         * cs-parser.jay: Some location fixes.
5558         
5559         * ecore.cs (Expression.Location): Made virtual.
5560
5561 2005-09-05  Miguel de Icaza  <miguel@novell.com>
5562
5563         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
5564         if the underlying types are the same, otherwise we need to produce
5565         code that will do the proper cast.
5566
5567         This was exposed by Marek's constant rewrite which produced
5568         invalid code for the call site:
5569
5570         enum X : long { a }
5571         void Method (X v) {}
5572
5573         Method ((X) 5)
5574
5575         This fixes test-49.cs
5576
5577 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5578
5579         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
5580           Type/Object should be allowed as well. Fixed bug #75968.
5581
5582 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5583
5584         * expression.cs : (Binary.DoResolve): when one is enum constant and
5585           another is constant 0, then return enum one *as enum type*.
5586           Fixed bug 74846.
5587
5588 2005-09-02  Raja R Harinath  <rharinath@novell.com>
5589
5590         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
5591         internal.
5592
5593         Fix #75941.
5594         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
5595         flow-branching for LocalVariableReferences in case we were invoked
5596         from a MemberAccess.
5597         * expression.cs (LocalVariableReference.VerifyAssigned): New.
5598         Carved out of ...
5599         (LocalVariableReference.DoResolveBase): ... this.
5600         (MemberAccess.Resolve): Do the check that was disabled during
5601         SimpleNameResolve.
5602
5603 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5604
5605         * class.cs :
5606           (PartialContainer.Create): check abstract/sealed/static strictly
5607           but abstract/sealed can exist only at one side. Fixed bug #75883.
5608
5609 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
5610
5611         Fix #75945.
5612         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5613         specified, don't default to UnmanagedType.I4.
5614
5615 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5616
5617         * expression.cs : conditional operator should check possibly
5618           incorrect assign expression. Fixed bug #75946.
5619
5620 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5621
5622         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5623           Reverting the change. gmcs is much complex than mcs on this matter.
5624
5625 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5626
5627         * cs-tokenizer.cs : To read another token ahead of the actual 
5628           consumption, use new SavedToken and cache token instead of moving
5629           back the stream with SeekableStreamReader (it seemed problematic).
5630         * cs-parser.jay,
5631           driver.cs : Thus use StreamReader directly.
5632         * support.cs : Thus removed SeekableStreamReader.
5633
5634 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5635
5636         Fix #75934.
5637         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5638         (ScopeInfo.EmitScopeType): Use it to construct field names from
5639         names of captured locals.
5640
5641         Fix #75929.
5642         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5643         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5644         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
5645         (ExplicitConversion): Remove enum cases already handled by
5646         implicit conversion.  Move implicit conversion check to the beginning.
5647         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5648         * expression.cs (ArrayCreation.EmitDynamicInitializers):
5649         Don't treat System.Enum as a struct.
5650
5651 2005-08-30  Jb Evain  <jbevain@gmail.com>
5652
5653         * attribute.cs: handles as expression in parameters.
5654
5655 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5656
5657         Fix #75802.
5658         * class.cs (TypeContainer.VerifyClsName): Don't use a
5659         PartialContainer when verifying CLS compliance.
5660         (AbstractPropertyEventMethod): Set Parent here, ...
5661         (PropertyMethod): ... not here.
5662
5663 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
5664
5665         * attribute.cs : escaped attribute name should not be allowed to be
5666           resolved (e.g. @class as classAttribute). Fixed bug #75930.
5667
5668 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5669
5670         Fix #75927.
5671         * convert.cs (ImplicitStandardConversionExists): Allow zero also
5672         when converting a long constant to unsigned long.
5673         * expression.cs (Invocation.OverloadResolve): Add sanity check to
5674         detect where IsApplicable and VerifyArgumentsCompat disagree.
5675
5676 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5677         and Carlos Alberto Cortez  <carlos@unixmexico.org>
5678
5679         Fix #75848.
5680         * class.cs (TypeContainer.CanElideInitializer): New helper.
5681         (TypeContainer.EmitFieldInitializers): Use it to determine if we
5682         can safely emitting the initializer of a field.
5683
5684 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5685
5686         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5687           allowed inside a switch (without loop). Fixed bug #75433.
5688
5689 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
5690
5691         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5692         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5693
5694 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5695
5696         * driver.cs : kinda reverting the default encoding changes (not exact 
5697           revert since I noticed that "codepage:reset" might not work fine).
5698
5699 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5700
5701         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5702           Location. Now getter and setter store location correctly.
5703           (errors/cs0111-12.cs now reports the expected location.)
5704
5705 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5706
5707         * driver.cs : Use default encoding on the environment.
5708           Removed (now that) extra parameter for SeekableStreamReader.
5709         * support.cs : (SeekableStreamReader) third .ctor() argument for
5710           StreamReader is not required (always true). preamble size could
5711           be acquired in simpler and safe way.
5712
5713 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5714
5715         * cs-parser.jay: report CS0642 at warning level 3
5716           and report CS0642 for an if else statement also
5717           fixes bug #74745. Patch by John Luke (and a bit
5718           modified by me).
5719           Removed extra CS0642 warning check for "while",
5720           "for" and "fixed".
5721         * statement.cs: In Block.Resolve(), CS0642 check
5722           is reimplemented to check a sequence of an empty
5723           statement and a block.
5724
5725           Both fix bug #66777.
5726
5727 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
5728
5729         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5730         detection until I fix it.
5731         
5732         * cs-tokenizer.cs: Changed error message.
5733         
5734         * cs-parser.jay: Fixed 2 error locations.
5735         
5736         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5737         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5738         properties.
5739         
5740         * enum.cs (GetSignatureForError): Fixed.
5741         
5742         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5743         method detection.
5744         
5745         * class.cs,
5746         * typemanager.cs (RegisterProperty): Removed.
5747         
5748         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5749
5750 2005-08-24  Raja R Harinath  <rharinath@novell.com>
5751
5752         Fix #75874.
5753         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5754         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5755
5756 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5757
5758         * expression.cs : tiny fix is required for not warning positive ulong.
5759           See test-441.cs.
5760
5761 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5762
5763         * expression.cs : add CS0652 check for constant and integral
5764           expression. Fixed bug #53974.
5765
5766 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5767
5768         * expression.cs : in DoNumericPromotions(), check if there is implicit
5769           conversion overload for string (to check CS0034). Fixed bug #52492.
5770
5771 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5772
5773         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5774
5775 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5776
5777         * ecore.cs : report location when it is *not* Null.
5778
5779 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5780
5781         * codegen.cs,
5782           ecore.cs,
5783           flowanalysis.cs,
5784           expression.cs:
5785           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5786           correctly. Fixed bug #75721.
5787
5788 2005-08-23  Raja R Harinath  <rharinath@novell.com>
5789
5790         * support.cs (SeekableStreamReader.Position): Avoid an expensive
5791         loop that performs 'min (pos, char_count)'.
5792
5793         Fix #75862.
5794         * expression.cs (Unary.ResolveOperator): Don't discard implicit
5795         converted value in Operator.OnesComplement.
5796
5797 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
5798
5799         * anonymous.cs: If the anon method is pulled into a helper class,
5800         it needs to be `internal' not `private'. Fixes runtime behavior on
5801         msft. bug #75704
5802
5803 2005-08-20  Martin Baulig  <martin@ximian.com>
5804
5805         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5806         scope if we don't already have it.
5807
5808         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5809         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5810         fixes #75867.
5811
5812 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
5813
5814         Fix #75803
5815         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5816         is a partial class.
5817
5818 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
5819
5820         The big constants rewrite
5821         Fix #75746, #75685 and more
5822         As a side effect saved 1MB for MWF ;-)
5823         
5824         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5825         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5826         enum based for corlib compilation.
5827         
5828         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5829         subtractions.
5830         
5831         * class.cs (FixedField.Define): Use ResolveAsConstant.
5832         
5833         * const.cs (IConstant): Interface constants and enums.
5834         (Const.ResolveValue): New method for constant resolvning.
5835         (ExternalConstant): Constants from imported assemblies.
5836         
5837         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5838         conversion; like enums.
5839         (Constant.ToType): Converts this constant to different type.
5840         (Constant.Increment): Adds 1.
5841         
5842         * convert.cs (ImplicitConversionRequired): Simplified.
5843         
5844         * cs-parser.jay: Create EnumMember directly.
5845         
5846         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5847         
5848         * doc.cs (GenerateEnumDocComment): Removed.
5849         
5850         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5851         (ConvertIntLiteral): Removed.
5852         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5853         
5854         * enum.cs (EnumMember): Implement IConstant.
5855         (Enum.IsValidEnumConstant): Removed.
5856         (Enum.GetNextDefaultValue): Removed.
5857         (Enum.FindMembers): Updated.
5858         (Enum.GenerateDocComment): Iterate enum members.
5859         
5860         * expression.cs (Cast.TryReduce): Handle enums correctly.
5861         (New.Constantify): Made public.
5862         (MemberAccess.DoResolve): Removed contant specific if(s).
5863         
5864         * literal.cs (NullLiteral): Implement new abstract methods.
5865         
5866         * statement.cs (GotoCase.Resolve): Use new constant methods.
5867         (SwitchLabel.ResolveAndReduce): Use new constant methods.
5868         
5869         * typemanager.cs (LookupEnum): Removed.
5870         (IsEnumType): Fixed to work with corlib.
5871         (RegisterConstant): Removed.
5872         (LookupConstant): Removed.
5873         (GetConstant): Changed to work with IConstant.
5874
5875 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
5876
5877         * location.cs : Fixed overflown (>255) column number.
5878
5879 2005-08-03  Raja R Harinath  <rharinath@novell.com>
5880
5881         First cut of the qualified-alias-member feature.
5882         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5883         token.
5884         * cs-parser.jay (DOUBLE_COLON): New token.
5885         (namespace_or_type_name): Add rule for recognizing
5886         qualified-alias-members.
5887         (primary_expression): Likewise.
5888         (element_access): Allow QualifiedAliasMember as a possible
5889         type-bearing expression.
5890         (local_variable_type, local_variable_pointer_type): Likewise.
5891         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
5892         aliases in the current and enclosing namespace declarations.
5893         (NamespaceEntry.UsingAlias): Add CS0440 warning.
5894         * decl.cs (MemberName.is_double_colon): New.
5895         (MemberName.MemberName): Add new constructor for alias-member.
5896         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5897         * expression.cs (QualifiedAliasMember): New expression type.
5898
5899 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5900
5901         * location.cs : it borked when no argument was specified.
5902
5903 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5904
5905         * location.cs : tiny ToString() format fix.
5906
5907 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5908
5909         * statement.cs : oops, it was missing.
5910
5911 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5912
5913         A set of fixes for precise line/column location.
5914
5915         * location.cs :
5916           "token" field now holds a file/line "delta", a line number offset 
5917           from the segment, and a column number. See also:
5918           http://lists.ximian.com/pipermail/mono-devel-list/2004-
5919           December/009508.html
5920           Removed static IsNull. Use instance IsNull property instead.
5921         * cs-tokenizer.cs :
5922           For some tokens it stores Location. For Identifier it stores
5923           LocatedToken which is a pair of string name and location.
5924           Column numbers are adjusted only at getChar().
5925         * report.cs :
5926           Use Location.ToString() for reporting (it now contains column).
5927         * cs-parser.jay :
5928           Largely modified to use LocatedToken instead of
5929           string (IDENTIFIER), and to acquire Location from some tokens.
5930         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5931           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5932           codegen.cs :
5933           Now MemberName holds Location. DeclSpace.ctor() receives Location
5934           as a parameter. Removed extra parameters to all derived classes.
5935           Replaced Location.IsNull() with instance property.
5936         * assign.cs, expression.cs :
5937           Added .ctor() overload that omits Location.
5938         * attribute.cs :
5939           Added "nameEscaped" flag that indicates the identifier was escaped
5940           in the source file. This fixes bug #57047.
5941
5942 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
5943
5944         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5945         New method, looking for lo-case imported cls type.
5946
5947         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5948         here.
5949
5950         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5951
5952         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5953
5954         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5955         all_imported_types.
5956         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5957
5958         Optimized to save 3.5 MB for SWF compilation.
5959
5960 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5961
5962         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5963         (PartialContainer.Create): Moved logic AddToContainer.
5964         (PartialContainer.MarkForDuplicationCheck): Shares name.
5965         
5966         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5967         place.
5968         
5969         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5970         initialization.
5971         (Namespace.GetSignatureForError): New method.
5972         
5973         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5974         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5975
5976 2005-08-01  Raja R Harinath  <rharinath@novell.com>
5977
5978         Fix #75669.
5979         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5980         member lookup rather than qualifier_type, since qualifier_type can
5981         be null.
5982
5983 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5984
5985         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5986         enum member.
5987
5988 2005-07-31  Miguel de Icaza  <miguel@novell.com>
5989
5990         * statement.cs: Copy the local exception into the exception
5991         captured local.  Fixes 75674
5992
5993 2005-07-31  Raja R Harinath  <harinath@gmail.com>
5994
5995         Fix #75658.
5996         * expression.cs (Invocation.OverloadResolve): Don't report error
5997         CS1501 if error CS1502 has been reported.
5998         (New.DoResolve): Delegate CS1501 reporting to
5999         Invocation.OverloadResolve.
6000
6001         Fix #75656.
6002         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
6003         invariant-meaning-in-block property in an enclosing block if
6004         necessary.
6005
6006 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
6007
6008         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
6009         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
6010         (Switch.CheckSwitch): Just save 50kb for SWF.
6011
6012 2005-07-27  Martin Baulig  <martin@ximian.com>
6013
6014         * anonymous.cs (CaptureContext.AddField): Added
6015         `AnonymousContainer am' argument; compute its toplevel scope if
6016         it's not already computed.  Fixes #75649.
6017
6018 2005-07-26  Raja R Harinath  <rharinath@novell.com>
6019
6020         Fix #75628.
6021         * class.cs (Constructor.Emit): Reset block to null if the block
6022         resolve fails.
6023
6024 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
6025
6026         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
6027
6028 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
6029
6030         * class.cs (MethodData.Define): Check whether accessor implementing
6031         interface is public.
6032
6033         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
6034
6035 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
6036
6037         Fix #57245
6038         * namespace.cs (LookupType): Moved same type check to...
6039         
6040         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
6041         with the same name.
6042
6043 2005-07-21  Raja R Harinath  <rharinath@novell.com>
6044
6045         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
6046         already found a typebuilder.
6047         * class.cs (MethodCore.IsDuplicateImplementation): Compare
6048         MemberNames, not strings.
6049
6050         * const.cs (Error_ExpressionMustBeConst): 
6051         Rename from Error_EpressionMustBeConst.
6052         * const.cs, class.cs, statement.cd: Update.
6053
6054 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
6055
6056         Fix #65573
6057
6058         * const.cs (Const.LookupConstantValue): Report missing contant expression
6059         everytime.
6060         (Error_EpressionMustBeConstant): Only one error method.
6061
6062         * class.cs, statement.c: Updated.
6063
6064 2005-07-20  Raja R Harinath  <rharinath@novell.com>
6065
6066         * statement.cs (Block.Flags): Add back HasVarargs.
6067         (Block.flags): Make protected.
6068         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
6069
6070         * typemanager.cs (types, typecontainers, user_types): Remove.
6071         (UserTypes, TypeContainers): Likewise.
6072         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
6073         (CleanUp, Reset): Update.
6074         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
6075         (GetNestedType): Use Type.GetNestedType.
6076         (CoreLookupType): Take two arguments, the namespace and the
6077         basename of the type.  Update to use the Namespace.Lookup
6078         mechanism.
6079         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
6080         (RealMemberLookup): Use IsNestedChildOf instead of playing with
6081         string concatenation and substring matches.
6082         * class.cs, enum.cs, delegate.cs: Update to changes.
6083
6084 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
6085
6086         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
6087         Expression and made virtual.
6088
6089         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
6090         (ImplicitStandardConversionExists): Fixed `byte' typo ?
6091
6092         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
6093
6094         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
6095         error message.
6096
6097         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
6098         change.
6099
6100 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
6101
6102         Fix #57707
6103         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
6104         AssemblyCultureAttribute is not used on executable.
6105
6106         * rootcontext.cs,
6107         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
6108
6109 2005-07-16  Raja R Harinath  <rharinath@novell.com>
6110
6111         Fix #60638.
6112         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
6113         New.  Reports CS0252/CS0253.
6114         Mostly taken from preliminary patch by Duncak Mak.
6115         (Binary.DoResolveOperator): Store results of operator lookup.
6116         Use them to detect if we need to warn about unintended reference
6117         comparisons.
6118
6119 2005-07-15  Raja R Harinath  <rharinath@novell.com>
6120
6121         Fix #72969.
6122         * namespace.cs (Namespace.Lookup): Add back location parameter.
6123         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
6124         * delegate.cs, ecore.cs, expression.cs: Update to changes.
6125
6126         * codegen.cs (EmitContext.DeclSpace): Make readonly.
6127         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
6128         (Namespace.LookupType): ... this.
6129         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
6130         of namespaces.
6131         * typemanager.cs (LookupTypeReflection): Remove buggy code that
6132         purported to handle pointers.
6133         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
6134         CoreLookupType.
6135
6136 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
6137
6138         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
6139         type as namespace.
6140
6141 2005-07-15  Raja R Harinath  <rharinath@novell.com>
6142
6143         * namespace.cs (Namespace.Lookup): Drop location parameter.
6144         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
6145         (NamespaceEntry.Lookup): ... this.
6146         (NamespaceEntry.Error_AmbiguousTypeReference):
6147         Move here from DeclSpace.
6148         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
6149         names ...
6150         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
6151         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
6152         Move to NamespaceEntry.
6153         * delegate.cs, expression.cs: Update to changes.
6154
6155 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
6156
6157         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
6158         CheckAttributeType and refactored.
6159         (Attribute.ResolvePossibleAttributeType): Changed to reuse
6160         ResolveAsTypeTerminal error handling.
6161         (ResolveAsTypeTerminal): Introduced because of global attributes extra
6162         handling.
6163         (GetSignatureForError): Print errors in same way.
6164
6165         * class.cs,
6166         * codegen.cs: Reflect attribute GetSignatureForError change.
6167
6168         * ecore.cs,
6169         * expression.cs: Add silent parameter to ResolveAsTypeStep.
6170
6171         * namespace.cs (UsingEntry): Refactored to make fields private.
6172
6173         * assign.cs,
6174         statement.cs: Error_UnexpectedKind has extra parameter.
6175
6176 2005-07-14  Raja R Harinath  <rharinath@novell.com>
6177
6178         * ecore.cs (IAlias): Remove.
6179         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
6180         that implement the interface.
6181         * namespace.cs (Namespace): Likewise.
6182         (Namespace.declspaces): Renamed from 'defined_names'.
6183         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
6184         DeclSpace instead of an IAlias.
6185         * tree.cs (Tree.AddDecl): Update.
6186
6187 2005-07-12  Raja R Harinath  <rharinath@novell.com>
6188
6189         * statement.cs (Block.Flags); Remove HasVarargs.
6190         (Block.HasVarargs): Move to ToplevelBlock.
6191         (Block.ThisVariable, Block.AddThisVariable): Likewise.
6192         (Block.Variables): Make protected.  Initialize variable hashtable
6193         if necessary.
6194         (Block.AddVariable): Update.
6195         (Block.Resolve): Update to changes.
6196         (ToplevelBlock.HasVarargs): New boolean.
6197         (ToplevelBlock.ThisVariable): Move here from Block.
6198         (ToplevelBlock.AddThisVariable): Likewise.
6199         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
6200         * expression.cs (This.ResolveBase): Update to changes.
6201         (ArglistAccess.DoResolve): Likewise.
6202
6203 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
6204
6205         Fix #75321
6206         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
6207
6208         * class.cs (TypeContainer.VerifyMembers): Distinguish between
6209         not used and not used & assigned.
6210         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
6211
6212 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
6213
6214         Fix #75053
6215         * expression.cs (Is.DoResolve): null is never provided type.
6216
6217 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
6218
6219         Fix #52496
6220         * cs-parser.jay: Less strict event error rule to catch more errors.
6221
6222 2005-07-08  Martin Baulig  <martin@ximian.com>
6223
6224         Fix test-iter-10.cs - distinguish whether we `yield' in a property
6225         gettter (allowed) or setter (not allowed).
6226
6227         * class.cs (Accessor): Implement IIteratorContainer.
6228         (Accessor.Yields): New public field.
6229         (PropertyBase.PropertyMethod.Define): Handle iterators on a
6230         per-accessor basis.
6231
6232         * cs-parser.jay
6233         (get_accessor_declaration, set_accessor_declaration): Set the
6234         `yields' flag on the accessor, not the property.
6235         (property_declaration): Do the iterators check on a per-accessor
6236         basis and not for the whole property.
6237
6238 2005-07-08  Martin Baulig  <martin@ximian.com>
6239
6240         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
6241         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
6242
6243 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
6244
6245         Fix #74975
6246         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
6247         (ExtractSecurityPermissionSet): Cope with self referencing security
6248         attributes properly.
6249
6250         * driver.cs (SetOutputFile): Made public property OutputFile.
6251
6252 2005-07-07  Raja R Harinath  <rharinath@novell.com>
6253
6254         Fix #75486.
6255         * class.cs (TypeContainer.first_nonstatic_field): Rename from
6256         has_nonstatic_fields.  Make into a FieldBase pointer.
6257         (TypeContainer.AddField): Add CS0282 check.
6258         (TypeContainer.EmitType): Update.
6259
6260 2005-07-06  Miguel de Icaza  <miguel@novell.com>
6261
6262         * cs-tokenizer.cs (consume_identifier): Do not create strings to
6263         compare if they start with __.
6264
6265 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6266
6267         * statement.cs (Switch.SwitchGoverningType): Only look at
6268         UserCasts that don't need implicit standard conversions to one of
6269         the allowed switch types (Fixes test-322.cs).
6270         (LocalInfo.Resolve): Re-enable sanity-test.
6271
6272 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
6273
6274         * cs-tokenizer.cs (consume_identifier): Detect double undescores
6275         
6276         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
6277         
6278         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
6279
6280 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6281
6282         Fix #75472.
6283         * ecore.cs (SimpleName.GetSignatureForError): Add.
6284         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
6285         (MemberAccess.GetSignatureForError): Add.
6286
6287 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
6288  
6289         The big error and warning messages review.
6290         
6291         * anonymous.cs,
6292         * assign.cs,
6293         * attribute.cs,
6294         * class.cs,
6295         * codegen.cs,
6296         * convert.cs,
6297         * cs-parser.jay,
6298         * cs-tokenizer.cs,
6299         * decl.cs,
6300         * delegate.cs,
6301         * doc.cs,
6302         * driver.cs,
6303         * ecore.cs,
6304         * enum.cs,
6305         * expression.cs,
6306         * flowanalysis.cs,
6307         * iterators.cs,
6308         * literal.cs,
6309         * location.cs,
6310         * modifiers.cs,
6311         * namespace.cs,
6312         * parameter.cs,
6313         * pending.cs,
6314         * report.cs,
6315         * rootcontext.cs,
6316         * statement.cs,
6317         * support.cs,
6318         * tree.cs,
6319         * typemanager.cs: Updated.
6320         
6321         * class.cs: (MethodCore.SetYields): Moved here to share.
6322         (PropertyMethod.Define): Moved iterator setup here.
6323         
6324         * iterators.cs: Add orig_method to have full access to parent
6325         container.
6326
6327 2005-07-05  Raja R Harinath  <rharinath@novell.com>
6328
6329         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
6330         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
6331         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
6332         variable of struct type.
6333         * expression.cs (Unary.ResolveOperator): Update to change.
6334         (Indirection.VerifyFixed): Likewise.
6335         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
6336         (ParameterReference.VerifyFixed): Value parameters are fixed.
6337         (This.VerifyFixed): Treat 'this' as a value parameter.
6338         * statement.cs (LocalInfo.IsFixed): Remove.
6339
6340 2005-07-01  Martin Baulig  <martin@ximian.com>
6341
6342         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
6343         `ec.EmitThis ()' to get the correct scope.
6344
6345 2005-07-01  Martin Baulig  <martin@ximian.com>
6346
6347         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
6348         instance is a ParameterReference; fixes #75299.
6349
6350 2005-07-01  Martin Baulig  <martin@ximian.com>
6351
6352         Reverted Marek's latest patch (r46725):
6353         - it contains structural changes which are neither mentioned in
6354           the ChangeLog nor explained anywhere; for example the additional
6355           argument of EmitContext's and Iterator's .ctor's and the
6356           TypeContainer.DefineMembers() change.
6357         - structural changes like this should go in in seperate patches
6358           and not be hidden in a huge patch which just seems to affect
6359           warnings and errors.
6360           a big and hard to understand patch.
6361         - it breaks iterators and causes regressions, for instance in
6362           test-iter-03.cs.      
6363
6364 2005-06-30  Raja R Harinath  <rharinath@novell.com>
6365
6366         Fix #75412.
6367         * expression.cs (Indexers.map): Remove.
6368         (Indexers.Append): Filter out inaccessible setters and getters.
6369         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
6370
6371         Fix #75283.
6372         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
6373         Refactored from ...
6374         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
6375         (FieldExpr.Emit, PropertyExpr.Emit): Update.
6376         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
6377         * expression.cs (Invocation.EmitCall): Add CS0120 check.
6378
6379 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
6380
6381         Fix #75322
6382         * class.cs (FieldBase.GetInitializerExpression): One more field
6383         for backup.
6384
6385 2005-06-28  Miguel de Icaza  <miguel@novell.com>
6386
6387         * pending.cs: Do not define a proxy if the base method is virtual,
6388         it will be picked up by the runtime (bug 75270).
6389
6390 2005-06-08  Martin Baulig  <martin@ximian.com>
6391
6392         The big Iterators rewrite :-)
6393
6394         * iterators.cs: Rewrite this to use the anonymous methods framework.
6395
6396         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
6397         before the TypeContainers; see 2test-21.cs.
6398
6399         * class.cs
6400         (TypeContainer.DefineType): Don't create a new EmitContext if we
6401         already have one (this only happens if we're an Iterator).
6402         (TypeContainer.Define): Also call Define() on all our iterators.
6403         (Method.CreateEmitContext): Added support for iterators.
6404
6405         * anonymous.cs
6406         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
6407         (AnonymousContainer.CreateMethodHost): Moved here from
6408         AnonymousMethod and made abstract.
6409         (AnonymousContainer.CreateScopeType): New abstract method.
6410         (AnonymousContainer.IsIterator): New public property.
6411         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
6412         get the ScopeTypeBuilder rather than manually defining it here. 
6413         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
6414         iterators here.
6415
6416         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
6417         before RootContext.DefineTypes().
6418
6419         * codegen.cs (EmitContext.RemapToProxy): Removed.
6420         (EmitContext.CurrentAnonymousMethod): Changed type from
6421         AnonymousMethod -> AnonymousContainer.
6422         (EmitContext.ResolveTopBlock): Protect from being called twice.
6423         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
6424         (EmitContext.EmitThis): Removed the iterators hacks; use the
6425         anonymous methods framework for that.
6426
6427         * statement.cs
6428         (ToplevelBlock.Container): Make this a property, not a field.
6429         (ToplevelBlock.ReParent): New public method; move the
6430         ToplevelBlock into a new container.
6431         (Foreach.TemporaryVariable): Simplify.
6432
6433 2005-06-05  Martin Baulig  <martin@ximian.com>
6434
6435         * statement.cs (LocalInfo.CompilerGenerated): New flag.
6436         (Block.AddTemporaryVariable): New public method; creates a new
6437         `LocalInfo' for a temporary variable.
6438         (Block.EmitMeta): Create the LocalBuilders for all the temporary
6439         variables here.
6440         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
6441         non-iterator variables.
6442
6443 2005-06-05  Martin Baulig  <martin@ximian.com>
6444
6445         * statement.cs (Foreach.TemporaryVariable): Create the
6446         LocalBuilder in the Emit phase and not in Resolve since in some
6447         situations, we don't have an ILGenerator during Resolve; see
6448         2test-19.cs for an example.
6449
6450 2005-06-04  Martin Baulig  <martin@ximian.com>
6451
6452         **** Merged r45395 from GCS ****
6453
6454         The big Foreach rewrite - Part II.
6455
6456         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
6457         with `PropertyInfo ienumerator_getcurrent'.
6458
6459         * codegen.cs (VariableStorage): Removed.
6460
6461         * statement.cs
6462         (Foreach): Derive from Statement, not ExceptionStatement.
6463         (Foreach.CollectionForeach): New nested class.  Moved all the code
6464         dealing with collection foreach here.
6465         (Foreach.ForeachHelperMethods): Removed.
6466         (Foreach.TemporaryVariable): Implement IMemoryLocation.
6467
6468 2005-05-23  Martin Baulig  <martin@ximian.com>
6469
6470         * statement.cs (Try.DoResolve): Don't create a `finally' if we
6471         don't need to.  Fix #75014.
6472
6473 2005-05-20  Martin Baulig  <martin@ximian.com>
6474
6475         Merged r44808 from GMCS.
6476
6477         * class.cs (TypeContainer.CircularDepException): Removed.
6478         (TypeContainer.DefineType): Removed the `InTransit' stuff.
6479         (TypeContainer.CheckRecursiveDefinition): Check for circular class
6480         (CS0146) and interface (CS0529) dependencies here.
6481
6482 2005-06-21  Raja R Harinath  <rharinath@novell.com>
6483
6484         * expression.cs (Invocation.EmitCall): Fix initialization
6485         'this_call' to reflect current behaviour.  Fix indentation.
6486
6487         * convert.cs (FindMostEncompassedType): Add two trivial special
6488         cases (number_of_types == 0 || number_of_types == 1).
6489         (FindMostEncompasingType): Likewise.
6490
6491 2005-06-17  Raja R Harinath  <rharinath@novell.com>
6492
6493         Some cleanups preparing for the fix of #75283.
6494         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
6495         error testing.
6496         (EventExpr.InstanceResolve): Likewise.
6497         (EventExpr.DoResolve): Remove redundant checks.
6498
6499 2005-06-10  Duncan Mak  <duncan@novell.com>
6500
6501         * cs-tokenizer.cs (process_directives): New flag for controlling
6502         the processing of preprocessor directives.
6503         (x_token): After seeing a '#', return Token.NONE instead of going
6504         to handle_preprocessing_directive() when not processing
6505         directives. This avoids unnecessary processing during the token peek in
6506         is_punct().
6507
6508         This fixes #74939.
6509
6510         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
6511         the existing error reporting methods instead of Report.Error.
6512
6513         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
6514         after Raja's rewrite.
6515
6516 2005-06-08  Miguel de Icaza  <miguel@novell.com>
6517
6518         * class.cs: Small fix.
6519
6520 2005-06-08  Raja R Harinath  <rharinath@novell.com>
6521
6522         Fix #75160.
6523         * class.cs (GetPartialBases): Fix return value check of
6524         part.GetClassBases.
6525
6526 2005-06-07  Raja R Harinath  <rharinath@novell.com>
6527
6528         Ensure that partial classes are registered in their enclosing
6529         namespace.  Initial part of fix of #75160.
6530         * tree.cs (Tree.RecordDecl): Add new namespace argument.
6531         Register declspace with namespace here, not in
6532         DeclSpace.RecordDecl.
6533         * cs-parser.jay: Pass namespace to RecordDecl.
6534         * class.cs (PartialContainer.Create): Likewise.
6535         (ClassPart.DefineType): New sanity-check.  Throws an exception if
6536         called.
6537         * decl.cs (Declspace.RecordDecl): Remove.
6538         * namespace.cs (NamespaceEntry.DefineName): Remove.
6539
6540 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
6541
6542         * rootcontext.cs: Reset TargetExt as well.
6543
6544 2005-06-03  Raja R Harinath  <rharinath@novell.com>
6545
6546         * ecore.cs (Expression.Resolve): Emit CS0654 error when
6547         -langversion:ISO-1.
6548
6549 2005-06-02  Raja R Harinath  <rharinath@novell.com>
6550
6551         Fix #75080, cs0119.cs.
6552         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
6553         of ...
6554         (Expression.Resolve): ... this.  Use it.  Remove bogus code
6555         allowing ExprClass.Type and ExprClass.Namespace for
6556         ResolveFlags.VariableOrValue.
6557         (Expression.Resolve) [1-argument variant]: Change default resolve
6558         flags based on language version.
6559         (Expression.Error_UnexpectedKind): Use a simple string array
6560         rather than an ArrayList.
6561         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
6562         not ExprClass.Type.
6563         (TypeOfVoid.DoResolve): Likewise.
6564         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
6565         flags argument -- it always has the same value.
6566
6567 2005-05-31  Raja R Harinath  <rharinath@novell.com>
6568
6569         Fix #75081.
6570         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
6571         Use it in the error message.
6572         * assign.cs, expression.cs, statement.cs: Update.
6573
6574 2005-05-30  Raja R Harinath  <rharinath@novell.com>
6575
6576         Fix #75088.
6577         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
6578         the "almostMatchedMember" case too.
6579         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
6580         that failed the accessibility checks to 'almost_match'.
6581
6582 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
6583
6584         * attribute.cs: Use internal MethodBuilder methods to set
6585         ExactSpelling and SetLastError on PInvoke methods, instead
6586         of passing them via charset.  Fixes #75060.
6587
6588 2005-05-27  Raja R Harinath  <rharinath@novell.com>
6589
6590         * parameter.cs (Parameter): Remove TODO comment.
6591         (Parameter.DefineParameter): Remove Location parameter.
6592         (Parameters.LabelParameters): Likewise.
6593         * class.cs (Constructor.Emit): Update to change.
6594         (MethodData.Emit): Likewise.
6595         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
6596         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
6597
6598 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
6599
6600         * parameter.cs,
6601           Removed Parameters.Location and added Parameter.Location instead.
6602           Removed Location parameter from Emit() and GetSignature().
6603         * anonymous.cs,
6604           class.cs,
6605           cs-parser.jay,
6606           delegate.cs,
6607           iterators.cs,
6608           statement.cs :
6609           Modified all related calls.
6610
6611 2005-05-26  Raja R Harinath  <rharinath@novell.com>
6612
6613         Improve user-defined conversion handling.
6614         * convert.cs (GetConversionOperators): Rewrite.  Return only the
6615         applicable operators.
6616         (AddConversionOperators): New.  Helper for GetConversionOperators.
6617         (FindMostEncompassedType, FindMostEncompassingType): Verify that
6618         there is only one most encompassed/encompassing type.
6619         (FindMostSpecificSource, FindMostSpecificTarget): Remove
6620         "applicable operator" handling.
6621         (UserConversion): Move cache here from GetConversionOperators.
6622         Directly cache the chosen operator, rather than the whole
6623         MethodGroup.
6624         (ExplicitNumericConversion): Fix buggy implementation of Decimal
6625         case.  Allow conversion of decimal to sbyte and byte too.
6626         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6627         New static methods.  Used to avoid allocating EmptyExpressions in
6628         convert.cs.
6629
6630 2005-05-24  Duncan Mak  <duncan@novell.com>
6631
6632         * ecore.cs (CastFromDecimal): New class for casting a decimal to
6633         another class, used in Convert.ExplicitNumericConversion.
6634         (CastToDecimal): New class, similar to above, but casts to
6635         System.Decimal, used in Convert.ImplicitNumericConversion and also
6636         in explicit convesion from double/float to decimal.
6637
6638         * convert.cs (ImplicitNumericConversion): Handle implicit
6639         conversions to System.Decimal.
6640         (ExplicitNumericConversion): handle explicit conversions to
6641         System.Decimal.
6642
6643         This fixes #68711.
6644         
6645 2005-05-20  Miguel de Icaza  <miguel@novell.com>
6646
6647         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6648         know the type at this stage, just break through.   Fixes #75008 
6649
6650 2005-05-19  Martin Baulig  <martin@ximian.com>
6651
6652         * delegate.cs
6653         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6654         to disable error reporting.
6655
6656         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6657         here since we don't want to report an error; see the new test-336.cs.
6658
6659 2005-05-19  Raja R Harinath  <rharinath@novell.com>
6660
6661         * statement.cs (ToplevelBlock.GetParameterReference)
6662         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6663         Move here from class Block.
6664         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6665         * expression.cs (ParameterReference.DoResolveBase): Likewise.
6666
6667 2005-05-18  Martin Baulig  <martin@ximian.com>
6668
6669         Fix #74978.
6670
6671         * flowanalysis.cs
6672         (FlowBranching.Reachability): Add non-static public And() and Or()
6673         methods.
6674         (FlowBranchingSwitch): New class; do the `break_origins' thing
6675         like in FlowBranchingLoop.
6676         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6677         reachability, not just locals and parameters.
6678         (FlowBranching.MergeChild): Remove some of the hacks for loop and
6679         switch; MergeBreakOrigins() now takes care of that.
6680
6681 2005-05-18  Martin Baulig  <martin@ximian.com>
6682
6683         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6684         a loop and may leave it, reset the barrier; fixes #74974.
6685
6686 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
6687         
6688         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6689         is back.
6690         
6691         * cs-parser.jay: Catch more lexical errors.
6692         
6693         * report.cs: Add one more Error method.
6694         
6695         * rootcontext.cs,
6696         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6697
6698 2005-05-17  Martin Baulig  <martin@ximian.com>
6699
6700         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6701         #70970. 
6702
6703 2005-05-16  Raja R Harinath  <rharinath@novell.com>
6704
6705         Fix test-382.cs.  Emit values of decimal constants.
6706         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6707         Carved out of ...
6708         (TypeContainer.AddField): ... this.
6709         (TypeContainer.EmitFieldInitializers): Allow the list of fields
6710         with initializers to include 'Const's.
6711         (ClassPart.RegisterFieldForInitialization): Forward to
6712         PartialContainer.
6713         * const.cs (Const.Const): Pass initializer to base class.
6714         (Const.Define): In case of decimal constants, register them for
6715         initialization in a static constructor.
6716
6717 2005-05-14  Martin Baulig  <martin@ximian.com>
6718
6719         * statement.cs (Block.Resolve): Correctly handle unreachable code;
6720         do not call ResolveUnreachable() on unreachable statements in
6721         here, see the comment in the source code.
6722
6723 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6724
6725         Fix #74934.
6726         * expression.cs (BinaryResolveOperator): If one of the operands of
6727         an equality comparison is 'null' and the other is a pointer type,
6728         convert the null to a NullPointer.
6729         * convert.cs (ImplicitReferenceConversion): If the expression is a
6730         NullLiteral and the target type is a pointer type, return a
6731         NullPointer instead.
6732         (ImplicitConversionStandard): Likewise.
6733
6734 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
6735         
6736         * cs-parser.jay: Set readonly context based on special constructs.
6737         
6738         * expression.cs (LocalVariableReference.DoResolveBase): Improved
6739         readonly variable error handling.
6740         
6741         * rootcontext.cs (EmitCode): Don't verify members when error
6742         occurred.
6743         
6744         * statement.cs (LocalInfo): Add reaodnly context information.
6745         (SetReadOnlyContext, GetReadOnlyContext): New methods.
6746
6747 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6748
6749         * statement.cs (Block.Resolve): Revert change below.  Modify fix
6750         for #74041 to initialize 'resolved' to false only for explicit
6751         blocks.  Fixes #74873.
6752
6753 2005-05-12  Raja R Harinath  <harinath@gmail.com>
6754
6755         Fix #74920.
6756         * typemanager.cs (unmanaged_enclosing_types): New.
6757         (IsUnmanagedType): Avoid infloops by using
6758         'unmanaged_enclosing_types' to talk with recursive invocations.
6759
6760 2005-05-13  Martin Baulig  <martin@ximian.com>
6761
6762         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6763         instance variable, not a local.  Fix #74873.
6764         (Block.ResolveUnreachable): Set it to true here.
6765
6766 2005-05-11  Duncan Mak  <duncan@novell.com>
6767
6768         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6769         continuing to process for 'arg'.
6770         (handle_preprocessing_directive): Check the argument of the #endif
6771         directive and report error CS1025 if there are any trailing
6772         characters.
6773
6774         According to the C# spec, having even whitespace after the #endif
6775         directive is illegal; however, because we call arg.TrimEnd ()
6776         beforehand, we have the same behavior as csc, allowing whitespace
6777         after the directive.
6778
6779         Fixes #74892.
6780
6781 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
6782
6783         Fix #74863.
6784         
6785         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6786         (Constructor.GetObsoleteAttribute): Implemented correctly.
6787
6788 2005-05-10  Martin Baulig  <martin@ximian.com>
6789
6790         * support.cs (ReflectionParameters.ParameterModifier): Use
6791         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6792         and `ParameterAttributes.In'.  Fixes #74884.
6793
6794 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
6795
6796         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6797         
6798         * expression.cs (Argument.GetParameterModifier): Turned to property.
6799         (Invocation.Error_InvalidArguments): Add more descriptive errors.
6800         
6801         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6802         its C# equivalent.
6803         
6804 2005-05-09  Raja R Harinath  <rharinath@novell.com>
6805
6806         Fix #74852.
6807         * decl.cs (MemberCache.AddMethods): Register override methods,
6808         rather than non-override methods.
6809         * typemanager.cs (RegisterOverride): New.
6810         (IsOverride): Update.
6811
6812 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
6813
6814         Fix #73105.
6815         
6816         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6817         recursive declaration.
6818         
6819         * statement.cs (Block.ResolveMeta): Report any error in resolving.
6820         
6821 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
6822
6823         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6824         
6825         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6826
6827 2005-05-05  Raja R Harinath  <rharinath@novell.com>
6828
6829         Fix #74797.
6830         * decl.cs (DeclSpace.FamilyAccessible): 
6831         Use TypeManager.IsNestedFamilyAccessible.
6832
6833         Fix reopened #64812.
6834         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6835         internal'.
6836
6837 2005-05-04  Raja R Harinath  <rharinath@novell.com>
6838             Abin Thomas  <projectmonokochi@rediffmail.com>
6839             Anoob V E  <projectmonokochi@rediffmail.com>
6840             Harilal P R  <projectmonokochi@rediffmail.com>
6841
6842         Fix #64812.
6843         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6844         allow access to all static members.
6845
6846 2005-05-04  Martin Baulig  <martin@ximian.com>
6847
6848         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6849
6850 2005-05-04  Martin Baulig  <martin@ximian.com>
6851
6852         Fix #74655.
6853
6854         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6855         section at the end; make things work if `default' is not the last
6856         section.        
6857
6858 2005-05-04  Martin Baulig  <martin@ximian.com>
6859
6860         Fix #70400.
6861
6862         * statement.cs (Switch): Replaced the `got_default' field with a
6863         `default_section' one.
6864         (Switch.CheckSwitch): Set `default_section' here.
6865         (Switch.Resolve): If we're a constant switch and the constant is
6866         not found, use the default section.
6867
6868 2005-05-03  Martin Baulig  <martin@ximian.com>
6869
6870         * expression.cs (ArrayAccess.EmitGetLength): New public method.
6871
6872         * statement.cs (Foreach.ArrayForeach): New nested class.
6873         (Foreach.TemporaryVariable): New nested class.
6874         (Foreach.EmitArrayForeach): Removed; this is now in the new
6875         ArrayForeach class.
6876
6877 2005-05-03  Raja R Harinath  <rharinath@novell.com>
6878
6879         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
6880         more conservative.
6881         (VerifyPendingMethods): Revert change below.
6882
6883         * typemanager.cs (IsOverride, RegisterNonOverride): New.
6884         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6885         that used to trigger warning -28.  Remove warning -28.
6886         * expression.cs (Invocation.OverloadResolve): Use
6887         TypeManager.IsOverride to distinguish override methods.
6888
6889         Fix #74773.
6890         * pending.cs (VerifyPendingMethods): If a base type implements the
6891         requested interface, don't bother checking individual methods of
6892         the base type.  As a side-effect, this prevents the creation of
6893         unnecessary proxies.
6894
6895 2005-05-02  Martin Baulig  <martin@ximian.com>
6896
6897         Fix #70182.
6898
6899         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6900         Also `And' the locals if the old vector is null.
6901         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6902         null; in this case we basically reset all the variables.        
6903
6904 2005-05-02  Martin Baulig  <martin@ximian.com>
6905
6906         Fix #74529.
6907
6908         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6909         Added `FlowBranching branching' argument; always `and' the
6910         variables instead of `or'ing them unless we're an infinite loop.
6911
6912         * statement.cs (While.Resolve): Create a new sibling unless we're
6913         infinite.       
6914
6915 2005-05-02  Martin Baulig  <martin@ximian.com>
6916
6917         Fix #70140.
6918
6919         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6920         arguments; use it instead of creating a new TopLevelBlock.
6921         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6922         our ConstructorInitializer.
6923
6924         * statement.cs
6925         (TopLevelBlock.TopLevelBranching): New public property.
6926         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6927         and create our `TopLevelBranching'.
6928
6929         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6930         anonymous method host, use `block.TopLevelBranching' rather than
6931         creating a new branching.
6932
6933 2005-04-20  Miguel de Icaza  <miguel@novell.com>
6934
6935         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6936         a ScopeInfo, if any of the current children is a child of the new
6937         entry, move those children there.
6938
6939 2005-04-30  Martin Baulig  <martin@ximian.com>
6940
6941         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6942         at the beginning of a SwitchSection.  Fix #73335.
6943
6944 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
6945
6946         Fix #74378
6947         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6948         
6949         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6950         (FieldExpr.DoResolve): Obsolete members are ignored for field
6951         initializers.
6952         
6953 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
6954
6955         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6956         of arrays detection.
6957
6958         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6959         verification.
6960         (Field.VerifyClsCompliance): Volatile fields are not compliant.
6961
6962         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6963         arrays report.
6964
6965 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
6966
6967         * cs-parser.jay: Use the prefered version of -unsafe in error
6968         message.
6969
6970 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
6971
6972         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6973         circumstances.
6974
6975 2005-04-20  John Luke  <john.luke@gmail.com>
6976
6977         * driver.cs: fix typo in error message, --outout to --output
6978
6979 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
6980
6981         * codegen.cs (InRefOutArgumentResolving): New field.
6982         
6983         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6984         fields outside contructor.
6985         
6986         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6987         
6988 2005-04-19  Miguel de Icaza  <miguel@novell.com>
6989
6990         * anonymous.cs (CaptureContext.EmitParameterInstance): The
6991         parameter code was not completed ever, so it was not as up-to-date
6992         as local variables.  Must finish it.
6993
6994         The bug fix was to compare the Toplevel of the block, not the
6995         current block.  Thanks for Ben for pointing this out. 
6996
6997 2005-04-19  Raja R Harinath  <rharinath@novell.com>
6998
6999         * decl.cs (AddMethods): Use the declaring type of the problem
7000         method to determine if we want to squash a warning.
7001
7002 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
7003
7004         * attribute.cs: Removed debug output.
7005
7006         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
7007         
7008         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
7009         Report.Stderr.
7010         
7011 2005-04-18  Raja R Harinath  <rharinath@novell.com>
7012
7013         Fix #74481.
7014         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
7015         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
7016         all null comparisons against reference types.
7017
7018 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
7019
7020         Fix# 74565
7021         * class.cs (TypeContainer.CircularDepException) New nested
7022         exception class.
7023         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
7024         (TypeContainer.DefineType): Removed error, reset InTransit before
7025         exit.
7026         (Class.DefineType): Throw exception when is in Transit.
7027         Catch exception and report error.
7028         (Struct.DefineType): Throw exception when is in Transit.
7029         Catch exception and report error.
7030         (Interface.DefineType): Throw exception when is in Transit.
7031         Catch exception and report error.
7032
7033         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
7034         handle nested exception handlers.
7035
7036         * flowanalysis.cs (InTryWithCatch): New method, search for try with
7037         a catch.
7038
7039         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
7040         InFinally and InCatch storage.
7041
7042         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
7043         (Catch.Resolve): Set and Restore ec.InCatch.
7044         (Try.Resolve): Set and Restore ec.InFinally.
7045         (Try.HasCatch): True when try has catch.
7046
7047 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
7048
7049         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
7050           for the same event member, so exclude such cases from warning 419.
7051           Fixed bug #74633.
7052
7053 2005-04-16  Miguel de Icaza  <miguel@novell.com>
7054
7055         * expression.cs (Binary.ResolveOperator): Apply patch from John
7056         Luke to fix bug 59864: operators &, | and ^ on enumerations
7057         require that the same enum type on both sides.
7058
7059         * driver.cs: Add warnings to old flag usage, this is to assist
7060         people who produce Makefiles and hope that the Makefiles will be
7061         used on Windows.
7062
7063         * class.cs (TypeContainer.EmitType): Moved the definition of the
7064         special $PRIVATE$ field from the resolve phase to the Emit phase.
7065         During resolve we do not know if we are a struct with
7066         HasExplicitLayout, we know this only after the attributes for the
7067         type are emitted.
7068
7069         Set the FieldOffset to zero on the dummy field that we create for
7070         the class.   Fixes 74590.
7071
7072 2005-04-16  Raja R Harinath  <rharinath@novell.com>
7073
7074         Fix #73834.
7075         * ecore.cs (PropertyExpr.resolved): New.
7076         (DoResolve): Use it to handle a case of double resolution here.
7077         Handle a case of identical-name-and-type-name.
7078         * expression.cs (ArrayCreation.CheckIndices): Avoid double
7079         resolution by storing the results of expression resolution back
7080         into the "probes" array.
7081
7082 2005-04-15  Raja R Harinath  <rharinath@novell.com>
7083
7084         Fix cs0208-7.cs and cs0208-8.cs.
7085         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
7086         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
7087         error reporting to point out the reason a struct is not unmanaged.
7088
7089 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7090
7091         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
7092           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
7093
7094 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7095
7096         Fix #74528.
7097         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
7098         IdenticalNameAndTypeName here.
7099         (EventExpr.InstanceResolve): Likewise.
7100
7101 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
7102
7103         C# 2.0 DefaultCharSetAttribute implementation
7104         
7105         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
7106         which allows us to set GlobalNamespace for every resolve.
7107         (Attribute.ResolveArguments): Cut from Resolve.
7108         (Attribute.GetCharSetValue): Returns CharSet named argument.
7109         (Attribute.DefinePInvokeMethod): Gets default charset from
7110         module settings.
7111         (GlobalAttribute.ResolveAsTypeStep): Override.
7112         (GlobalAttribute.ResolveArguments): Override.
7113         
7114         * class.cs (TypeAttr): Is protected.
7115         
7116         * codegen.cs (ModuleClass.DefaultCharSet): New member.
7117         (ModuleClass.DefaultCharSetType): New memeber.
7118         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
7119         
7120         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
7121         charset from module.
7122         
7123         * delegate.cs (TypeAttr): Override.
7124         (Delegate.DefineType): Use this TypeAttr.
7125         
7126         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
7127         at very early stage (before types are defined) to resolve model
7128         module attributes. It will probably not work with corlib but it
7129         should be ok.
7130         
7131         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
7132         charset from module.
7133         
7134         * typemanager.cs (default_charset_type): New type.
7135
7136 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7137
7138         * decl.cs (MemberCache.AddMethods): Don't warn if
7139         System.Object.Finalize has buggy MethodAttributes.
7140
7141         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
7142         removed below.
7143
7144 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7145
7146         * doc.cs : detect ambiguous reference to overloaded members.
7147           Fixed bug #71603. MS 1.1 csc does not detect it.
7148
7149 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7150
7151         * doc.cs : delegates must not be referenced with parameters.
7152           Fixed bug #71605.
7153
7154 2005-04-12  Miguel de Icaza  <miguel@novell.com>
7155
7156         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
7157
7158 2005-04-10  Miguel de Icaza  <miguel@novell.com>
7159
7160         * driver.cs (MainDriver): Stop processing if the CLS stage found
7161         errors. 
7162
7163         (CompilerCallableEntryPoint.InvokeCompiler): Always
7164         reset after execution;   Take a TextWriter argument for the
7165         output.
7166
7167         * report.cs: Use the error stream instead of hardcoding stderr. 
7168
7169 2005-04-09  Miguel de Icaza  <miguel@novell.com>
7170
7171         * class.cs: Reduce code paths to test, too small of an
7172         optimization to make it worth the extra testing.  Always perform
7173         it. 
7174
7175 2005-04-08  Raja R Harinath  <rharinath@novell.com>
7176
7177         Fix #74510.
7178         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
7179         operators that had errors reported on them.
7180
7181 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
7182
7183         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
7184         argument types.
7185         (Attribute.Resolve): Add named argument type checking.
7186         
7187         * class.cs (FixedField.Define): Use IsPrimitiveType
7188         
7189         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
7190         
7191         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
7192         unsafe parameter types.
7193         
7194         * statement.cs (Using.ResolveExpression): Add better error description.
7195         
7196         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
7197         
7198 2005-04-08  Raja R Harinath  <rharinath@novell.com>
7199
7200         Fix #74484.
7201         * attribute.cs (Attribute.GetAttributeUsage): Resolve
7202         AttributeUsageAttribute in the emitcontext of the attribute class,
7203         not in the emitcontext of the attributable entity it was attached to.
7204         * cs-parser.jay: Use 'current_class', not 'current_container',
7205         when creating a GlobalAttribute.
7206
7207 2005-04-08  Alp Toker  <alp@atoker.com>
7208
7209         * pending.cs: The fix to #58413 failed to compile methods implementing
7210         interfaces with/without params modifiers and vice versa, even though
7211         params modifiers aren't part of the signature. Make the modifier check
7212         less strict as in csc.
7213
7214 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
7215             Anoob V E  <projectmonokochi@rediffmail.com>
7216             Harilal P R  <projectmonokochi@rediffmail.com>
7217
7218         Fix #58413.
7219         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
7220         modifiers of pending methods.
7221         (PendingImplementation.PendingImplementation): Initialize it.
7222         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
7223         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
7224         with ParameterData.  Add check for modifiers.
7225         * class.cs (MethodData.Define): Update to changes.
7226
7227 2005-04-07  Raja R Harinath  <rharinath@novell.com>
7228
7229         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
7230
7231 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
7232
7233         * class.cs (PropertyMethod.Define): Check private accessor in abstract
7234         property.
7235         
7236         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
7237         
7238         * rootcontext.cs,
7239         * typemanager.cs: Registered RequiredAttributeAttribute.
7240         
7241 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
7242
7243         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
7244         Warning CS0169 is back at level 3.
7245         (IMethodData.SetMemberIsUsed): New method.
7246         
7247         * decl.cs (IsUsed): New value; moved from FieldBase.Status
7248         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
7249         
7250         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
7251
7252         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
7253         contants.
7254         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
7255         is used.
7256         
7257         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
7258         is used.
7259         
7260         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
7261         to avoid the problems with nested types.
7262
7263 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
7264             Anoob V.E  <projectmonokochi@rediffmail.com>
7265             Harilal P.R  <projectmonokochi@rediffmail.com>
7266             Raja R Harinath  <rharinath@novell.com>
7267
7268         Fix #73820.
7269         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
7270         attribute.
7271         * typemanager (GetConstructor): Make public.
7272
7273 2005-04-05  John Luke  <john.luke@gmail.com>
7274             Raja R Harinath  <rharinath@novell.com>
7275
7276         Fix #62232.
7277         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
7278         struct too.  Return false quicker in a few cases.
7279         (VerifyUnManaged): Use it.
7280
7281 2005-04-05  Raja R Harinath  <rharinath@novell.com>
7282
7283         Fix #74041.
7284         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
7285         not 'unreachable_seen'.
7286
7287 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
7288
7289         * attribute.cs (Attribute.GetValue): Removed unused.
7290         
7291         * codegen.cs (CodeGen.TrimExt): Removed unused.
7292         
7293         * cs-parser.jay (output): Removed unused.
7294         
7295         * cs-tokenizer.cs (hex_digits): Removed unused.
7296         
7297         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
7298         
7299         * expression.cs (Indirection.LoadExprValue): Removed unused.
7300         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
7301         
7302         * iterators.cs (Iterator.param_types): Removed unused.
7303         
7304         * statement.cs (Goto.block): Removed unused.
7305         (ToplevelBlock.did): Removed unused.
7306         (Switch.ResolveConstantSwitch): Removed unused.
7307
7308 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
7309
7310         * rootcontext.cs: Allow mcs to bootstrap with the compilation
7311         resetting thingy.
7312
7313 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7314
7315         Fix #74232 and cs0208-3.cs.
7316         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
7317         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
7318         unmanaged type.  Don't use FieldBuilders when 't' is a
7319         TypeBuilder.  Use ModFlags and MemberType fields.
7320         * class.cs (MemberBase.member_type): Rename from MemberType.
7321         (MemberBase.MemberType): New property.  Determines member_type on
7322         demand.
7323         (MemberBase.DoDefine): Don't initialize MemberType here.
7324         (FieldMember.Define): Likewise.
7325
7326 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
7327
7328         Fix #74241
7329         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
7330         Attributes are emitted there.
7331         
7332 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7333
7334         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
7335         keyword in 'partial enum' too.
7336         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
7337         is not allowed).
7338         Report from Kamil Skalski <nazgul@omega.pl>.
7339
7340         Fix #74309.
7341         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
7342         have partial containers too.
7343
7344         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
7345         in block' checks to Block.CheckInvariantMeaningInBlock.
7346         * statement.cs (Block.GetKnownVariableInfo): Make private.
7347         (Block.IsVariableUsedInChildBlock): Remove.
7348         (Block.IsVariableUsedInBlock): Likewise.
7349         (Block.CheckInvariantMeaningInBlock): New.  Show location of
7350         conflicting declaration.
7351         (Block.AddVariable): Make error messages less long-winded and more
7352         specific.  Show location of conflicting declaration.
7353         * parameter.cs (Parameters.Location): New readonly property.
7354
7355 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7356
7357         Clean up semantics of invoking ResolveMemberAccess.
7358         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
7359         can have an instance, ensure that we pass in a non-TypeExpression
7360         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
7361         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
7362         argument.  Update to changes and simplify.
7363         (FieldExpr.Emitinstance): Remove CS0120 check.
7364         (PropertyExpr.EmitInstance): Likewise.
7365         * expression.cs (Argument.Resolve): Likewise.
7366         (Invocation.DoResolve): Update to changes in semantics of
7367         InstanceExpression.
7368
7369 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
7370
7371         Fix #74241
7372         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
7373         customization.
7374         
7375         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
7376
7377 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7378
7379         Fix difference in behaviour with commandline invocation.
7380         * driver.cs (Driver.Reset): New.
7381         (CompilerCallableEntryPoint): Call it.
7382
7383         * statement.cs (If.Resolve): Avoid spurious "uninitialized
7384         variable" warnings if the boolean expression failed to resolve.
7385
7386 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
7387
7388         * attribute.cs: Fix the union of several permissions when some of them
7389         are unrestricted (so the result isn't an unrestricted permission set).
7390         Fix #74036.
7391
7392 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7393
7394         * ecore.cs (MemberExpr): New class.  Convert from interface
7395         IMemberExpr.
7396         (MemberExpr.ResolveMemberAccess): Refactor and move here from
7397         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
7398         error checks.
7399         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
7400         (MethodGroupExpr.IsExplicitImpl): Remove.
7401         (Expression.GetFieldFromEvent): Remove.
7402         (SimpleName.MemberStaticCheck): Remove.
7403         (SimpleName.DoSimpleNameResolve): Update to changes.
7404         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
7405         (MemberAccess.IdenticalNameAndTypeName): Remove.
7406         (MemberAccess.error176): Move to MemberExpr.
7407         (MemberAccess.DoResolve): Update to changes.
7408         (BaseAccess.DoResolve): Likewise.
7409
7410 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
7411
7412         C# 2.0 Conditional attribute class implementation
7413         
7414         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
7415         Analyzes class whether it has attribute which has ConditionalAttribute
7416         and its condition is not defined.
7417         
7418         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
7419         (Class.IsExcluded): New method. Search for at least one defined
7420         condition in ConditionalAttribute of attribute class.
7421
7422 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7423
7424         * ecore.cs (PropertyExpr): Derive from Expression, not
7425         ExpressionStatement.
7426         (PropertyExpr.EmitStatement): Remove.
7427
7428 2005-03-29  Raja R Harinath  <rharinath@novell.com>
7429
7430         Fix #74060.
7431         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
7432         internal field "value__" of an enum be private.  The examples for
7433         "value__" that I found on MSDN all used FieldAttributes.Private.
7434
7435         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
7436         Don't mention IL method attribute names.
7437
7438         Fix #47991.  Remove a TODO.
7439         * statement.cs (Block.Toplevel): Make into a field.
7440         (Block.Parameters): Move into ToplevelBlock.
7441         (Block.known_variables): Rename from child_variable_names.
7442         (Block.Block): Remove variants that take Parameters.  Initialize
7443         'Toplevel' with the immediately surrounding toplevel block.
7444         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
7445         LocalInfo parameter.
7446         (Block.GetKnownVariableInfo): New.
7447         (Block.IsVariableNameUsedInChildBlock): Update.
7448         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
7449         the block, even though it may not be in scope.
7450         (Block.AddVariable): Remove Parameters parameter.  Use
7451         Toplevel.Parameters instead.
7452         (Block.AddConstant): Remove Parameters parameter.
7453         (Block.GetParameterReference): Update to use Toplevel.Parameters.
7454         (Block.IsParamaterReference): Likewise.
7455         (Block.IsLocalParameter): Likewise.  Simplify a lot.
7456         (ToplevelBlock.Parameters): New.  Moved from Block.
7457         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
7458         initialize Parameters to a non-null value.
7459         * cs-parser.jay: Update to changes.
7460         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
7461         simple names that mean different things in the same block.  Use
7462         Block.IsVariableNameUsedInBlock.
7463
7464 2005-03-28  Raja R Harinath  <rharinath@novell.com>
7465
7466         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7467         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7468         GetTypeHandle.  It is possible for a reflected type to derive from
7469         a TypeBuilder (e.g., int[] derives from the TypeBuilder
7470         System.Array during mscorlib compilation).
7471         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7472         contain a method_hash, don't create one either.  Don't create a
7473         deep copy of the base cache's method_hash.
7474         (MemberCache.SetupCache): Rename back from DeepCopy.
7475         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7476         already initialized.  If we see an override function, add its
7477         underlying base virtual function to the member_hash too.
7478
7479         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
7480
7481 2005-03-26  Raja R Harinath  <harinath@acm.org>
7482
7483         Fix #73038.
7484         * assign.cs (Assign.DoResolve): When the RHS of an assignment
7485         fails to resolve, ensure that the LHS is still resolved as an
7486         lvalue.
7487
7488 2005-03-25  Raja R Harinath  <harinath@acm.org>
7489
7490         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
7491         ec.ContainerType.
7492         (Enum.current_ec): Remove.
7493         (Enum.LookupEnumValue): Remove EmitContext argument.
7494         Just uses the one created during DefineType.
7495         (Enum.FindMembers): Update.
7496         * expression.cs (MemberAccess.DoResolve): Update.
7497
7498 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
7499
7500         * assign.cs (Assign.DoResolve): Check for CS1717 when
7501         source and target are same (uses Equals).
7502
7503         * expression.cs (LocalVariableReference, ParameterReference,
7504         This): Implemented Equals, GetHashCode.
7505
7506         * statement.cs (Block.GetParameterReference): Removed useless
7507         local variable.
7508
7509 2005-03-22  Raja R Harinath  <rharinath@novell.com>
7510
7511         Fix cs0128.cs
7512         * statement.cs (Block.AddVariable): Ensure that we skip implicit
7513         blocks before deciding whether the error is cs0136 or cs0128.
7514
7515         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
7516         (using_alias_directive, using_namespace_directive): Pass
7517         MemberName, not an expression to Namespace.UsingAlias and
7518         Namespace.Using.
7519         (MakeName): Use the MemberName of the namespace.
7520         * namespace.cs (Namespace.MemberName): New.
7521         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
7522         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
7523         Likewise.
7524         * decl.cs (MemberName.Name): Make readonly.
7525         (MemberName.FromDotted): New "constructor".
7526         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
7527         (MemberCore.Name): Compute from MemberName on demand.
7528         (MemberCore.SetMemberName): Provide a way to change the
7529         MemberName.
7530         (MemberCore.AddToContainer): Don't take a fullname parameter.
7531         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
7532         fully qualified name of the container to the member name.
7533         (TypeContainer.AddToTypeContainer): Use a fully qualified name
7534         only if the type is a member of the root container.
7535         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
7536         MemberName.Left rather than searching for an embedded ".".
7537         (PartialContainer.CreatePart): Update to changes in RootContext.
7538         (MemberBase.ShortName): Turn into a property.  Use
7539         MemberCore.SetMemberName.
7540         (MemberBase.ExplicitInterfaceName): Remove.
7541         (MemberBase.UpdateMemberName): Remove.
7542         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
7543         (PropertyBase.SetMemberName): New override.
7544         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
7545         (Tree.GetDecl): New.
7546         (Tree.AllDecls): Rename from Decls.
7547         * attribute.cs, enum.cs, report.cs: Update to changes.
7548         * driver.cs (MainDriver): Use MemberName.FromDotted on
7549         RootContext.MainClass.
7550
7551 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
7552
7553         * class.cs (FixedField.Define): Check for CS1664 and more sanity
7554         checks.
7555
7556         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
7557
7558 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
7559
7560         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
7561         property accessor modifiers.
7562
7563         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
7564         fixed buffer attribute (CS1716).
7565         (PropertyMethod.HasCustomAccessModifier): When property accessor
7566         has custom modifier.
7567
7568         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
7569         modifiers.
7570         (PropertyExpr.DoResolveLValue): Add CS0272.
7571
7572 2005-03-17  Miguel de Icaza  <miguel@novell.com>
7573
7574         * convert.cs: When converting to a pointer, use the proper Conv.U
7575         or Conv.I depending on the source data type.
7576
7577         * cs-tokenizer.cs: Make the size for large decimal constants,
7578         fixes #72957.
7579
7580 2005-03-17  Martin Baulig  <martin@ximian.com>
7581
7582         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7583         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7584
7585 2005-03-17  Martin Baulig  <martin@ximian.com>
7586
7587         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7588         to bool so we can return an error condition.
7589         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7590         returned an error.
7591
7592 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
7593
7594         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
7595         attributes.
7596
7597 2005-03-16  Raja R Harinath  <rharinath@novell.com>
7598
7599         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
7600         Refactor to avoid traversing the list of assemblies, and to avoid
7601         string concatenation.
7602         * typemanager.cs (guid_attr_type): Remove.
7603         (negative_hits, pointers, references): Remove hashes.
7604         (type_hash): New.
7605         (GetConstructedType): New.  Uses type_hash to handle constructed
7606         types (arrays, references, pointers).
7607         (GetReferenceType, GetPointerType): Use it.
7608         (GetNestedType): New.  Uses type_hash to handle nested types of
7609         reflected types.
7610         (LookupType, LookupTypeDirect): Remove.
7611         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
7612         'types' hash and LookupTypeReflection directly.
7613         (params_string, params_object): Use GetConstructedType.
7614         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
7615         top-level types.
7616         (Namespace.Lookup): Use cached_types.
7617         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7618         provided by old TypeManager.LookupType.
7619         * rootcontext.cs (MakeFQN): Remove.
7620         * decl.cs (DeclSpace.MakeFQN): Likewise.
7621         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7622         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7623         TypeManager.GetConstructedType.
7624         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7625
7626 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
7627
7628         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7629         indexers.
7630
7631         * cs-parser.jay: Reports CS1527 for any namespace element.
7632
7633         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7634         Added CS0407.
7635
7636         * expression.cs (ParameterReference.IsAssigned): Changed error to
7637         CS0269.
7638         (Error_WrongNumArguments): Moved CS0245 detection here.
7639
7640         * statement.cs (Return.Resolve): Add CS1622 report.
7641
7642 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
7643
7644         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7645
7646 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
7647
7648         * attribute.cs expression.cs: Get rid of some allocations.
7649
7650 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
7651
7652         * doc.cs : just eliminate the latest change.
7653
7654 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7655
7656         * doc.cs : commented out the latest change. It breaks xml-030.cs
7657
7658 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7659
7660         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7661           fail. So invoke CreateType() in FindDocumentedType().
7662
7663 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7664
7665         * cs-tokenizer.cs : added IsKeyword().
7666         * doc.cs : Detect keyword incorrectly used as identifier.
7667           Allow identifiers prefixed by @.
7668
7669 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
7670
7671         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7672         It caused exception in namespace resolving (again!).
7673         
7674         * class.cs (Class.ctor): Removed exit.
7675         (PropertyMethod.ctor): ditto.
7676         
7677         * codegen.cs (Codegen.Reset): Reset static data.
7678         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7679         
7680         * cs-tokenizer.cs (Cleanup): Removed.
7681         
7682         * driver.cs (GetSystemDir): Rewrote to one line command.
7683         It caused problem with unloaded dynamic modules.
7684         (UnixParseOption): Removed Exit.
7685         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7686         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7687         Now can be mcs used as library.
7688         
7689         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7690         empty location.
7691         
7692         * location.cs (Reset): Reset static data.
7693         
7694         * namespace.cs (Reset): Reset static data.
7695         
7696         * report.cs (Report.Reset): Reset static data.
7697         
7698         * rootcontext.cs (RootContext.Reset): Reset static data.
7699         
7700         * tree.cs (RootTypes.ctor): Use Location.Null
7701         
7702         * typemanager.cs (TypeManager.Reset): Reset static data.
7703         (CoreLookupType): Removed Exit.
7704         (TypeHandle.Reset): Reset static data.
7705         
7706 2005-03-10  Raja R Harinath  <rharinath@novell.com>
7707
7708         Fix #73516.
7709         * typemanager.cs (ComputeNamespaces): Import namespaces from
7710         referenced modules too.
7711
7712 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7713
7714         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7715         than '.'.
7716
7717 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7718
7719         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7720         enclosing DeclSpace.  This ensures that a name-lookup populates
7721         more caches and there are fewer 'TypeExpression's.  Carve out
7722         nested type lookup into ...
7723         (LookupNestedTypeInHierarchy): ... this.
7724
7725 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7726
7727         Clean up a few partial-class semantics.  
7728         Fixes test-357.cs and cs1618-2.cs.
7729         * cs-parser.jay (struct_declaration): Use 'current_class' as
7730         parent of newly-created struct.  Remove call to Register ().
7731         Use 'pop_current_class' to complete handing the current struct.
7732         (interface_declaration): Likewise.
7733         (class_declaration): Likewise.
7734         (enum_declaration): Use 'current_class' as parent of newly created
7735         enum.
7736         (delegate_declaration): Likewise.
7737         (pop_current_class): New function.  This is used to handle closing
7738         up the 'current_class' and 'current_container', and pointing them
7739         to the enclosing class/container.
7740         (CSharpParser): Initialize 'current_class' too.
7741         * decl.cs (MemberCore): Add check for invariant: a partial
7742         container is not a parsed entity, and thus does not enclose any
7743         parsed members.
7744         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7745         (DeclSpace.BaseTypeExpr): Use it.
7746         (DeclSpace.LookupType): Add check for invariant.
7747         * class.cs (TypeContainer): Add check for invariant: a nested
7748         class should have the same NamespaceEntry as its enclosing class.
7749         (TypeContainer.EmitFieldInitializers): Make virtual.
7750         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7751         MemberCore.
7752         (TypeContainer.Register): Remove.
7753         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7754         null.  Use TypeResolveEmitContext for resolving base types and
7755         interfaces.  Move initialization of Parts.TypeBuilder here from
7756         ...
7757         (TypeContainer.DefineNestedTypes): ... here.
7758         (PartialContainer): Take a Namespace not a NamespaceEntry.
7759         (PartialContainer.Create): Don't use Register.  Call the
7760         appropriate Add... function directly.
7761         (ClassPart): Take both the PartialContainer and the enclosing
7762         class as constructor arguments.
7763         (ClassPart.EmitFieldInitializers): Override.
7764         (ClassPart.PartFindNestedTypes): Remove.
7765         (FieldBase.GetInitializerExpression): Resolve the initializer
7766         expression in the emit context of the enclosing class.
7767         * tree.cs (RootTypes): Remove Register ().
7768         
7769 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
7770
7771         * cs-parser.jay: Removed CS0134.
7772         
7773         * driver.cs: Removed CS1901.
7774         
7775         * expression.cs (SizeOf.DoResolve): Don't report CS0233
7776         for predefined types.
7777
7778 2005-03-07  Duncan Mak  <duncan@novell.com>
7779
7780         * codegen.cs (Save):  Catch UnauthorizedAccessException as
7781         well. Fixes bug #73454.
7782
7783 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
7784
7785         * cs-tokenizer.cs (xtoken): Add CS1035.
7786         
7787         * class.cs (MethodData.Define): Add CS0683.
7788         (FieldMember.ctor): Add CS0681.
7789
7790 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7791
7792         * ecore.cs (SimpleName.DoResolve): Rename from
7793         SimpleName.DoResolveAllowStatic.
7794         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7795         Pass 'intermediate' flag to MemberStaticCheck.
7796         (SimpleName.MemberStaticCheck): Skip "static check" only in case
7797         of "intermediate" lookups via MemberAccess.
7798         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
7799         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7800
7801 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7802
7803         Fix #73394.
7804         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7805         slipped in because of variable names that are identical to a
7806         builtin type's BCL equivalent ('string String;', 'int Int32;').
7807         (PropertyExpr.EmitInstance): Likewise.
7808
7809 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
7810
7811         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7812         
7813         * report.cs (warning_ignore_table): Made public.
7814
7815 2005-03-04  Raja R Harinath  <rharinath@novell.com>
7816
7817         Fix #73282.
7818         * class.cs (MethodData.Emit): Pass 'container' to
7819         container.GetObsoleteAttribute instead of 'container.Parent'.
7820
7821 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
7822
7823         * cs-parser.jay: Add 1534 error test.
7824
7825         * iterators.cs (Yield.CheckContext): Add error 1629.
7826         (Iterator.ctor): Save unsafe modifier.
7827         (MoveNextMethod.DoEmit): Restore unsafe context.
7828
7829         * namespace.cs (UsingAlias): Better error message.
7830
7831 2005-03-03  Dan Winship  <danw@novell.com>
7832
7833         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7834         the warning message [#73219]
7835
7836 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7837
7838         Fix compile with MCS 1.0.0.0.
7839         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7840         w_restore to not depend on string constant folding.
7841
7842 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7843
7844         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
7845         CS0246 check to users who passed 'silent = false'.
7846         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7847         check.
7848         (SimpleName.SimpleNameResolve): Update.
7849         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7850         (MemberAccess.IdenticalNameAndTypeName): Update.
7851         * doc.cs (FindDocumentedTypeNonArray): Update.
7852
7853 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
7854
7855         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7856         * parameters.cs (ComputeAndDefineParameters): Remove.
7857         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7858         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7859         Use GetParameterInfo.
7860
7861 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
7862
7863         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7864
7865 2005-03-02  Raja R Harinath  <rharinath@novell.com>
7866
7867         Unify DeclSpace.LookupType and DeclSpace.FindType.
7868         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
7869         is in charge of defining nested types on demand.
7870         (DeclSpace.LookupType): Use it when the current_type is a
7871         TypeBuilder.  Use LookupTypeDirect for reflected types.
7872         (DeclSpace.FindType): Remove.
7873         (DeclSpace.LookupInterfaceOrClass): Likewise.
7874         (DeclSpace.DefineTypeAndParents): Likewise.
7875         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7876         DeclSpace.LookupType.
7877         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7878         * typemanager.cs (LookupType): Simplify.
7879         (AddUserType): Remove type from negative_hits.
7880         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7881         * class.cs (TypeContainer.FindMembers): Move handling of nested
7882         types ...
7883         (TypeContainer.FindMembers_NestedTypes): ... here.
7884         (TypeContainer.FindNestedType): Implement override.
7885         (ClassPart.FindNestedType): Delegate to PartialContainer.
7886         (ClassPart.PartFindNestedType): Looks up the nested types of the
7887         part alone.
7888
7889 2005-03-02  Martin Baulig  <martin@ximian.com>
7890
7891         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7892         static constructor in static classes.
7893
7894 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7895
7896         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7897         sizeParamIndex is not specified.
7898
7899 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
7900
7901         Fix #73117
7902         * report.cs (WarningMessage.IsEnabled): Missing null check.
7903
7904 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7905
7906         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7907         in the fields and not in the properties.
7908
7909 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
7910
7911         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
7912         fields as well.
7913
7914 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7915
7916         * attribute.cs: Small refactoring (improved robustness).
7917         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7918         (ValidateGuid): Removed.
7919         (Resolve): Removed referenced to above mentioned.
7920         (GetAttributeUsage): Made private and changed to work without
7921         class assistance.
7922         (GetIndexerAttributeValue): Don't crash.
7923         (GetConditionalAttributeValue): Ditto.
7924         (GetClsCompliantAttributeValue): Ditto.
7925         (ExtractSecurityPermissionSet): All attributes exceptions are
7926         error 648.
7927         (GetPropertyValue): New helper.
7928         (GetMethodImplOptions): New method.
7929         (DefinePInvokeMethod): Reuse common code. Implemented handling of
7930         some missing properties.
7931         
7932         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7933         (Method.ApplyAttributeBuilder): Updated.
7934         
7935         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7936         exception.
7937
7938 2005-02-28  Raja R Harinath  <rharinath@novell.com>
7939
7940         Fix #73052.
7941         * report.cs (Report.SymbolRelatedToPreviousError): Handle
7942         non-simple types (array, pointer, reference).
7943
7944 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7945
7946         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7947
7948         * class.cs (MethodCore.IsDuplicateImplementation): Special error
7949         for operators.
7950         (Method.CheckBase): Catch wrong destructor here.
7951         (MethodData.Define): Add errors 550, 668.
7952
7953         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7954
7955         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7956
7957         * pending.cs (VerifyPendingMethods): Add error 551.
7958
7959         * typemanager.cs (CSharpName): Next error report helper.
7960
7961 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
7962
7963         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7964         attributes. Removed useless attribute double check.
7965         It saves almost 2MBs for corlib.
7966
7967 2005-02-25  Raja R Harinath  <rharinath@novell.com>
7968
7969         Fix #72924.
7970         * statement.cs (ExpressionStatement.Resolve): Make robust to being
7971         called twice in case of error.
7972
7973 2005-02-23  Chris Toshok  <toshok@ximian.com>
7974
7975         Fix compiler portions of #72827.
7976         * statement.cs (Block.Emit): call Begin/EndScope on the
7977         EmitContext instead of the ILGenerator.
7978
7979         * codegen.cs (EmitContext.BeginScope): new method, call
7980         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7981         we have one.)
7982         (EmitContext.BeginScope): same, but EndScope and CloseScope
7983
7984         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7985         offset and call the superclass's OpenScope(int) with it.
7986         (SymbolWriter.CloseScope): get the current il
7987         offset and call superclass's CloseScope(int) with it.
7988
7989 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
7990
7991         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7992         CS1677 for out and ref as well.
7993
7994         * class.cs (Method.Define): Add error CS1599 detection.
7995         
7996         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7997         
7998         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7999         
8000         * delegate.cs (Delegate.Define): Add error CS1599 detection.
8001         
8002         * support.cs.cs (ModifierDesc): New helper method.
8003
8004 2005-02-23  Raja R Harinath  <rharinath@novell.com>
8005             Abin Thomas  <projectmonokochi@rediffmail.com>
8006             Anoob V E  <projectmonokochi@rediffmail.com>
8007             Harilal P R  <projectmonokochi@rediffmail.com>
8008
8009         Fix #57851, #72718.
8010         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
8011         MemberLookup (used for error reporting) actually returns a result.
8012         Fix error report number (122, not 112).
8013
8014 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
8015             Anoob V E  <projectmonokochi@rediffmail.com>
8016             Harilal P R  <projectmonokochi@rediffmail.com>
8017
8018         Fix #71134.
8019         * pending.cs (PendingImplementation.GetAbstractMethods):
8020         Find NonPublic members too.
8021
8022 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
8023
8024         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
8025         Fixed error 217.
8026         
8027         * class.cs (MethodCore.CheckMethodAgainstBase):
8028         Add error 239 report.
8029
8030 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8031
8032         Fix #68955.
8033         * expression.cs (Invocation.IsApplicable): Make public.
8034         (Invocation.IsParamsMethodApplicable): Likewise.
8035         * delegate.cs (Delegate.VerifyApplicability): Don't use
8036         Invocation.VerifyArgumentCompat for parameter applicability
8037         testing.  Use Invocation.IsApplicable and
8038         Invocation.IsParamsMethodApplicable.
8039
8040 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
8041
8042         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
8043         
8044         * class.cs (Operator.Define): Add error 217 report.
8045         
8046 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8047
8048         * namespace.cs (UsingEntry.Resolve): Undo change below.
8049
8050 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8051
8052         Fix #72756.
8053         * ecore.cs (Expression.MemberLookupFailed): Add argument to
8054         disable the error message when the extended MemberLookup also
8055         fails.
8056         (Expression.MemberLookupFinal): Update.
8057         (SimpleName.DoSimpleNameResolve): Update.
8058         * expression.cs (MemberAccess.ResolveNamespaceOrType):
8059         Don't use MemberLookupFinal.
8060         (New.DoResolve): Update.
8061         (BaseAccess.CommonResolve): Update.
8062
8063 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8064
8065         Fix #72732.
8066         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
8067         occured previously, don't resolve again.
8068
8069 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
8070
8071         Fix #69949
8072         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
8073         argument. Call ResolveAttributeUsage for unresolved.
8074         when types doesn't match ctor arguments.
8075         
8076         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
8077         for nested attribute classes.
8078         (Class.attribute_usage): Removed.
8079         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
8080         for attribute class.
8081         
8082         * ecore.cs (IsAttribute): Removed.
8083         
8084         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
8085         
8086         * rootcontext.cs (RegisterAttribute): Removed, attributes are
8087         now normal types.
8088         (attribute_types): Removed.
8089         (EmitCode): Global attributes are emited as the latest.
8090
8091 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
8092
8093         * class.cs (EmitFieldInitializers): Don't emit field initializer
8094         for default values when optimilization is on.
8095         
8096         * constant.cs (Constant.IsDefaultValue): New property.
8097         
8098         * driver.cs: Add /optimize handling.
8099         
8100         * constant.cs,
8101         * ecore.cs,
8102         * literal.cs: Implement new IsDefaultValue property.
8103         
8104         * rootcontext.cs (Optimize): New field, holds /optimize option.
8105
8106 2005-02-18  Raja R Harinath  <rharinath@novell.com>
8107
8108         Fix crasher in re-opened #72347.
8109         * namespace.cs (Namespace.Lookup): Return null if
8110         DeclSpace.DefineType returns null.
8111
8112         Fix #72678.
8113         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
8114
8115 2005-02-18  Raja R Harinath  <rharinath@novell.com>
8116
8117         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
8118         now returns null if it cannot resolve to an lvalue.
8119         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
8120         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
8121         returned null.  Remove check for SimpleName.
8122         (EventExpr.DoResolveLValue): New.
8123         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
8124         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
8125         error from ...
8126         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
8127         avoid CS0131 error.
8128         (Unary.ResolveOperator): Move CS0211 check ...
8129         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
8130         CS0131 error.
8131         (Unary.DoResolveLValue): Simplify.
8132         (AddressOf.DoResolveLValue): New.
8133         (ArrayAccess.DoResolveLValue): New.
8134
8135 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
8136
8137         * attribute.cs (Attribute.Resolve): Add arguments casting for
8138         when types doesn't match ctor arguments.
8139
8140 2005-02-16  Raja R Harinath  <rharinath@novell.com>
8141
8142         Fix parts of #63202.
8143         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
8144         lookup of operator in base type.  Ensure that all checks happen
8145         when the operator resolves to an "op_..." method.
8146
8147 2005-02-15  Raja R Harinath  <rharinath@novell.com>
8148
8149         Fix #71992.
8150         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
8151         'ignore_cs0104' parameter.  Pass it to ...
8152         (NamespaceEntry.Lookup): ... this.
8153         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8154         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
8155         (TypeLookupExpression.DoResolveAsTypeStep): Update.
8156         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
8157         Update.  Request that cs0104 errors be ignored.
8158         (ComposedCast.ResolveAsTypeStep): Update.
8159
8160 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8161
8162         Fix #59209.
8163         * expression.cs (Invocation.BetterFunction): Remove support for
8164         comparing virtual functions and their overrides.
8165         (Invocation.IsOverride): New.
8166         (Invocation.OverloadResolve): Don't consider 'override' functions
8167         during candidate selection.  Store them in a lookaside list.
8168         If the selected method is a 'virtual' function, use the list to
8169         find any overrides that are closer to the LHS type.
8170
8171 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
8172
8173         * expression.cs (New.DoResolve): Add complex core type reduction.
8174         (New.Constantify): Converts complex core type syntax like 'new int ()'
8175         to simple constant.
8176         
8177 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8178
8179         * decl.cs (EntryType.EntryType): New constructor to create an
8180         updated copy of a cache entry.
8181         (MemberCache.AddMethods): Use it.
8182         (MemberCache.ClearDeclaredOnly): Remove.
8183         (MemberCache.MemberCache): Update.
8184
8185 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8186
8187         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
8188         variable.  This one is represents the actual low-level declaration
8189         of the method, as opposed to the semantic level `IsStatic'.   
8190
8191         An anonymous method which is hosted into a static method might be
8192         actually an instance method.  IsStatic would reflect the
8193         container, while MethodIsStatic represents the actual code
8194         generated.
8195
8196         * expression.cs (ParameterReference): Use the new MethodIsStatic
8197         instead of IsStatic.
8198
8199         * anonymous.cs (AnonymousMethod.Compatible): Pass the
8200         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
8201         set on the current EmitContext. 
8202
8203         * expression.cs (Cast): Overload DoResolveLValue so we can pass
8204         resolve our casted expression as an LValue.  This triggers the
8205         proper LValue processing that is later required by Assign.
8206
8207         This fixes 72347.
8208
8209         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
8210
8211 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
8212
8213         C# 2.0 Fixed buffer implementation
8214
8215         * anonymous.cs: Update after RegisterHelperClass renaming.
8216
8217         * attribute.cs (AttributeTester.fixed_buffer_cache):
8218         Cache of external fixed buffers.
8219         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
8220         implementation if field is fixed buffer else null.
8221
8222         * class.cs
8223         (TypeContainer.AddField): Accept FieldMember instead of Field.
8224         (FieldBase.IsFieldClsCompliant): Extracted code from
8225         VerifyClsCompliance descendant customization.
8226         (FixedField): New class handles fixed buffer fields.
8227         (FixedFieldExternal): Keeps information about imported fixed
8228         buffer.
8229         (IFixedField): Make access to internal or external fixed buffer
8230         same.
8231
8232         * cs-parser.jay: Add fixed buffer parsing.
8233
8234         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
8235         buffer.
8236
8237         * expression.cs (Indirection): Extended implementation to accept
8238         fixed buffer field.
8239         (PointerArithmetic.Emit): Get element from fixed buffer as well.
8240         (ElementAccess.MakePointerAccess): Get type as parameter.
8241         (DoResolve): Add fixed buffer field expression conversion.
8242         (DoResolveLValue): Ditto.
8243         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
8244         (ArrayPtr): Derives from FixedBufferPtr.
8245         (ArrayPtr.Emit): Add extra emit for array elements.
8246
8247         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
8248
8249         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
8250         for compiler generated types.
8251         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
8252
8253         * statement.cs (Fixed): Refactored to be easier add fixed buffer
8254         and consume less memory.
8255         (Fixed.Resolve): Add fixed buffer case.
8256
8257         * typemanager.cs (compiler_generated_attr_ctor,
8258         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
8259         (HasElementType): Add our own implementation to work on every
8260         runtime.
8261
8262 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8263
8264         * anonymous.cs (CaptureContext): Track whether `this' has been
8265         referenced.   
8266
8267         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
8268         only captured `this' if it was implicitly done (instance
8269         methods/variables were used). 
8270
8271         * codegen.cs (EmitContext.CaptureThis): New method to flag that
8272         `this' must be captured.
8273
8274 2005-01-30  Miguel de Icaza  <miguel@novell.com>
8275  
8276         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
8277         is null it means that there has been no need to capture anything,
8278         so we just create a sibling.
8279
8280         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
8281
8282         Just a partial fix.  The other half is fairly elusive.
8283         
8284 2005-02-10  Raja R Harinath  <rharinath@novell.com>
8285
8286         Fix #52586, cs0121-4.cs.
8287         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
8288         and return a hashtable.
8289         (MemberCache.ClearDeclaredOnly): New.
8290         (MemberCache.MemberCache): Update to change.  Make a deep copy of
8291         the method_hash of a base type too.
8292         (MemberCache.AddMethods): Adapt to having a deep copy of the base
8293         type methods.  Overwrite entries with the same MethodHandle so
8294         that the ReflectedType is correct.  The process leaves in base
8295         virtual functions and their overrides as distinct entries.
8296         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
8297         matters since it was boxed in a ArrayList before.
8298         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
8299         modifier.
8300         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
8301         case of a virtual function and its override (choose the overload
8302         as better).
8303         (Invocation.OverloadResolve): Avoid 'override' members during
8304         'applicable_type' calculation.
8305
8306 2005-02-09  Raja R Harinath  <rharinath@novell.com>
8307
8308         Combine two near-redundant caches.
8309         * typemanager.cs (method_params): Rename from method_internal_params.
8310         (TypeManager.GetParameterData): New.  Replace
8311         Invocation.GetParameterData.
8312         (TypeManager.LookupParametersByBuilder): Remove.
8313         * expression.cs (Invocation.method_parameter_cache): Remove.
8314         (Invocation.GetParameterData): Remove.
8315         Update to changes.
8316         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
8317         Update to changes.
8318
8319 2005-02-08  Raja R Harinath  <rharinath@novell.com>
8320
8321         Fix #72015.
8322         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
8323         TypeManager.multicast_delegate_type is null, resolve it by looking
8324         up "System.MulticastDelegate".
8325         * rootcontext.cs (RootContext.ResolveCore): Simplify.
8326
8327 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
8328             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
8329             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
8330
8331         Fix cs0164.cs.
8332         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
8333         (LabeledStatement.AddReference): New.  Set 'referenced'.
8334         (Goto.Resolve): Use it.
8335
8336 2005-02-05  John Luke  <john.luke@gmail.com>
8337
8338         * driver.cs: remove duplicate -doc line in Usage ()
8339
8340 2005-02-04  Raja R Harinath  <rharinath@novell.com>
8341
8342         * location.cs (Location.AddFile): Fix CS2002 error report.
8343
8344 2005-02-02  Martin Baulig  <martin@ximian.com>
8345
8346         * delegate.cs (Delegate.DefineType): Report an internal error if
8347         TypeManager.multicast_delegate_type is null.  See bug #72015 for
8348         details.        
8349
8350 2005-02-02  Raja R Harinath  <rharinath@novell.com>
8351
8352         Fix a crasher in a variant of #31984.
8353         * const.cs (Constant.CheckBase): New override that defers the
8354         new-or-override check in case the base type hasn't been populated
8355         yet.
8356         (Constant.Define): Ensure the new-or-override check is performed.
8357
8358 2005-02-01  Duncan Mak  <duncan@ximian.com>
8359
8360         * const.cs (LookupConstantValue): Check that `ce' is not null
8361         before calling GetValue ().
8362
8363 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8364
8365         Fix test-334.cs (#69519).
8366         * cs-parser.jay (using_alias_directive): Pass in an expression to
8367         NamespaceEntry.UsingAlias.
8368         (using_namespace_directive): Pass in an expression to
8369         NamespaceEntry.Using.
8370         (namespace_name): Don't flatten to a string.
8371         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
8372         (NamespaceEntry.AliasEntry.Resolve): Lookup using
8373         ResolveAsTypeStep.
8374         (NamespaceEntry.UsingEntry): Likewise.
8375         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
8376         changes.
8377         (NamespaceEntry.LookupForUsing): Remove.
8378         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
8379         names.
8380         (NamespaceEntry.Lookup): Remove support for dotted names.
8381
8382 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8383
8384         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
8385         split into two.
8386         (NamespaceEntry.ImplicitParent): Compute on demand.
8387         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
8388         parallels the current.
8389         (NamespaceEntry.LookupForUsing): Use it.
8390         (NamespaceEntry.Lookup): If the current namespace-entry is
8391         implicit, don't search aliases and using tables.
8392
8393 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8394
8395         Fix #31984.
8396         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
8397         BaseCache here.
8398         (TypeContainer.BaseCache): Compute on demand.
8399         (TypeContainer.FindMembers): Define constants and types if they're
8400         not already created.
8401         (FieldMember.Define): Move resetting of ec.InUnsafe before error
8402         check.
8403         * const.cs (Constant.Define): Make idempotent.
8404
8405 2005-01-29  Miguel de Icaza  <miguel@novell.com>
8406
8407         * pending.cs: Produce better code (no nops produced by using Ldarg
8408         + value).
8409         
8410         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
8411         i - 1' it should be arg + 1.
8412
8413         Fixes bug #71819.
8414
8415 2005-01-28  Raja R Harinath  <rharinath@novell.com>
8416
8417         * attribute.cs (Attribute.CheckAttributeType): Make private
8418         non-virtual.
8419         (Attribute.ResolveType): Make virtual.
8420         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
8421         handling of RootContext.Tree.Types.
8422
8423 2005-01-27  Raja R Harinath  <rharinath@novell.com>
8424
8425         Update attribute-handling to use the SimpleName/MemberAccess
8426         mechanisms.
8427         * cs-parser.jay (attribute): Pass in an expression to the
8428         constructors of Attribute and GlobalAttribute.
8429         * attribute.cs (Attribute): Take an expression for the name.
8430         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
8431         passed in attribute name expression.
8432         (Attribute.CheckAttributeType): Use it.
8433         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
8434         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
8435         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
8436         argument to prevent error messages if the lookup fails.
8437
8438 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
8439
8440         * expression.cs (Indirection): Implemented IVariable interface
8441         to support indirection in AddressOf operator.
8442         (PointerArithmetic.Emit): Add optimalization for case where
8443         result can be precomputed.
8444
8445 2005-01-26  Martin Baulig  <martin@ximian.com>
8446
8447         * class.cs (TypeContainer.AttributeTargets): Return the correct
8448         AttributeTargets depending on our `Kind' instead of throwing an
8449         exception; fixes #71632.
8450
8451 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
8452
8453         Fix #71257
8454         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
8455         constant members.
8456
8457 2005-01-25  Raja R Harinath  <rharinath@novell.com>
8458
8459         Fix #71602.
8460         * expression.cs (MemberAccess.DoResolve): Don't complain with
8461         cs0572 when the LHS of a member access has identical name and type
8462         name.
8463
8464 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
8465
8466         Fix #71651, #71675
8467         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
8468         CreatePermission.
8469         Create custom PermissionSet only for PermissionSetAttribute.
8470
8471 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
8472
8473         Fix #71649
8474         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
8475         delegates in static class.
8476
8477 2005-01-24  Martin Baulig  <martin@ximian.com>
8478
8479         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8480         merging an implicit block, just use its reachability.
8481
8482         * statement.cs (Block.Resolve): Make the unreachable code check
8483         work wrt. implicit blocks; see test-337 from #63842.
8484
8485 2005-01-21  Alp Toker  <alp@atoker.com>
8486  
8487         * cs-parser.jay: destructor_declaration's container is PartialContainer
8488         not Class when partial types are used, so use Kind prop instead of
8489         'is'.
8490         
8491 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
8492
8493         * cs-parser.jay: Improve error reporting when an interface
8494         declares new types.
8495
8496 2005-01-20  Dick Porter  <dick@ximian.com>
8497
8498         * support.cs: SeekableStreamReader fix from Sandor Dobos
8499         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
8500         chars are read.  Fixes bug 70369.
8501
8502 2005-01-20  Raja R Harinath  <rharinath@novell.com>
8503
8504         * cs-parser.jay (catch_clause): Simplify current_block handling
8505         somewhat.
8506
8507 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
8508
8509         * convert.cs (ImplicitStandardConversionExists): Synchronize the
8510         code with ImplicitStandardConversion to handle the implicit
8511         conversion of method groups into valid delegate invocations. 
8512
8513         The problem is that in parameter handling we were using this code
8514         path.  Fixes bug #64698
8515
8516 2005-01-19  Raja R Harinath  <rharinath@novell.com>
8517
8518         * cs-parser.jay: Fix several infelicities.
8519         - Avoid assigning to the parser value stack.  Code like 
8520           '$3 = null' is unclean.  Synthesize a value for the code block
8521           instead. 
8522         - Avoid using oob_stack for storing location information.  Use ...
8523         (_mark_): ... this.  New (empty) rule.  Saves the current location
8524         in $$.
8525         (foreach_statement): Avoid using oob_stack for current_block
8526         handling.  Use technique used in for_statement and
8527         using_statement.  Synthesize a value for the code block to store
8528         additional intermediate information.
8529
8530 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
8531
8532         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
8533         of a different type is only allowed to private fields of a
8534         containing type, not on fields of a base class.
8535
8536         See test-174.cs and error cs0122-9.cs
8537
8538 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8539
8540         Fix test-335.cs (bug #58126).
8541         * cs-parser.jay (argument): Split out non-expression parts of the
8542         rule into 'non_simple_argument'.
8543         (invocation_expression): Support parenthesized invocations with
8544         multiple arguments, and with single non-simple arguments.
8545
8546 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8547
8548         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
8549         places.
8550
8551 2005-01-12  Raja R Harinath  <rharinath@novell.com>
8552
8553         Fix cs0038-1.cs, cs1640-6.cs.
8554         * ecore.cs (Expression.Resolve): Remove special-case for
8555         SimpleName in error-handling.
8556         (Expression.almostMatchedMembers): Relax access permission to
8557         protected.
8558         (Expression.MemberLookupFailed): Handle duplicates in
8559         almostMatchedMembers list.
8560         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
8561         * expression.cs (New.DoResolve): Report CS1540 for more cases.
8562         * typemanager.cs (GetFullNameSignature): Use the MethodBase
8563         overload if the passed in MemberInfo is a MethodBase.
8564
8565 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
8566
8567         Fix #70749
8568         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
8569         for non-CAS & merge permission sets properly.
8570
8571 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8572
8573         Improve standard-compliance of simple name and member access 
8574         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
8575         * ecore.cs (FullNamedExpression): New abstract base class 
8576         for Namespaces and TypeExpressions.
8577         (ResolveFlags.SimpleName): Remove.
8578         (SimpleName): Remove support for dotted names.
8579         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
8580         DeclSpace.FindType and DeclSpace.LookupType.
8581         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
8582         (Expression.ExprClassName): Make member function.
8583         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
8584         a namespace.  Remove creation of dotted "SimpleName"s.
8585         (MemberAccess.DoResolve): Likewise.
8586         * decl.cs (DeclSpace.Cache): Make private.
8587         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
8588         (DeclSpace.FindType): Update.
8589         (DeclSpace.LookupType): Move here from RootContext.  Return a 
8590         FullNamedExpression.
8591         * namespace.cs (Namespace): Derive from FullNamedExpression
8592         so that it can be part of expression resolution.
8593         (Namespace.Lookup): Return an FullNamedExpression.
8594         (NamespaceEntry.LookupAlias): Lookup aliases only in current
8595         namespace.
8596         * rootcontext.cs (NamespaceLookup): Remove.
8597         (LookupType): Move to DeclSpace.
8598         * attribute.cs (CheckAttributeType): Update.
8599         * doc.cs (FindDocumentedType): Remove allowAlias argument.
8600         (FindDocumentedTypeNonArray): Likewise.
8601
8602 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8603
8604         Fix cs0509.cs, cs1632.cs.
8605         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
8606         is the same as IsInterface.
8607         (TypeContainer.GetClassBases): Likewise.
8608         * statement.cs (LabeledStatement.ig): New field.
8609         (LabeledStatement.LabelTarget): Save ILGenerator which created the
8610         label.
8611         (LabeledStatement.DoEmit): Check that the label was created with
8612         the same ILGenerator.
8613
8614 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8615
8616         Fix #71058
8617         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8618         accessors to its properties.
8619
8620         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8621         from accessors to property.
8622         
8623 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8624
8625         Fix #70722
8626         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8627         only for overrides.
8628         
8629 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
8630
8631         * attribute.cs: Check for null and empty strings.  
8632
8633         I have lost another battle to Paolo.
8634
8635 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
8636
8637         Fix #70942
8638         * class.cs (PropertyMethod): Set Parent field in ctors.
8639         (SetMethod.InternalParameters): Add unsafe switch hack.
8640         Override MarkForDuplicationCheck where it is appropriate.
8641
8642         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8643         It says whether container allows members with the same name.
8644         Base default is no.
8645         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8646         Removed is_method parameter.
8647
8648 2005-01-06  Duncan Mak  <duncan@ximian.com>
8649
8650         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8651         because the previous change led to incorrect reporting of CS1032
8652         ("Cannot define/undefine preprocessor symbols after first token in
8653         file"). Instead of using `tokens_seen' as the only flag that
8654         triggers CS1040, introduce `comments_seen'. This new flag is used
8655         to signify having seen comments on the current line, so it is
8656         unset after a newline.
8657
8658 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8659
8660         * doc.cs : When searching for a type, find nested type too.
8661           This fixes bug #71040.
8662
8663 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8664
8665         * doc.cs :
8666           - Warn missing member comment on those classes which also does not
8667             have doc comments. Fixed bug #71041.
8668           - Don't warn missing doc comment on default constructor.
8669             Fixed bug #71042.
8670
8671 2005-01-06  Duncan Mak  <duncan@ximian.com>
8672
8673         * cs-tokenizer.cs (xtoken): After handling traditional C-style
8674         comments, set `tokens_seen' to true. This allows us to detect
8675         misplaced preprocessor directives (i.e. not at the beginning of
8676         the a line, nor after whitespaces). In that case, report error
8677         CS1040. This fixes bug #56460.
8678
8679         * cs-parser.jay (interface_member_declaration): Add checks for
8680         IsExplicitImpl, and report CS0541 error if an interface member is
8681         defined as an explicit interface declaration.
8682
8683 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
8684
8685         Fix #70817
8686         * class.cs (PropertyMethod): Set Parent field in ctors.
8687         (SetMethod.InternalParameters): Add unsafe switch hack.
8688         
8689         * decl.cs (MemberCore.Parent): Cannot be readonly.
8690
8691 2005-01-06  Raja R Harinath  <rharinath@novell.com>
8692
8693         * decl.cs (DeclSpace.ResolveType): Remove.
8694         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8695         Merge in code from ...
8696         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
8697         * class.cs, enum.cs: Update to changes.
8698
8699 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
8700
8701         * anonymous.cs: Ensure that we init the scope of our parent if it
8702         has not been initialized yet.
8703
8704 2004-12-30  Duncan Mak  <duncan@ximian.com>
8705
8706         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8707         if field.FieldBuilder is null. Fixes #70758.
8708
8709         * convert.cs: Fixed some typos and updated some of the comments.
8710         (ImplicitStandardConversionExists):
8711         (TryImplicitIntConversion): If `target_type' is an interface and
8712         the type of `ic' implements this interface, return true or a new
8713         BoxedCast instead of null. This fixes #70468.
8714
8715 2004-12-29  Duncan Mak  <duncan@ximian.com>
8716
8717         * expression.cs (Argument.Emit): Check that Expr is
8718         IMemoryLocation before casting to it, and report CS1510 otherwise.
8719
8720         This fixes #70402.
8721
8722 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
8723
8724         * statement.cs (Block.ThisVariable): remove the recursion here, to
8725         make the --profile more sane.
8726
8727 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
8728
8729         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8730         assembly, by JB Evain.
8731
8732 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8733
8734         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
8735           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8736         "parent" refers to enclosing type/class.  "base" refers to superclass.
8737
8738 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8739
8740         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8741         Ensure that we only have GlobalAttributes.
8742         * attribute.cs (Attribute.Emit): Make non-virtual.
8743         (GlobalAttribute.Emit): Remove.
8744         (Attribute.Resolve): Make virtual.
8745         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
8746         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8747         the argument. Don't create one.
8748         (Attribute.GetObsoleteAttribute): Likewise.
8749         (Attribute.GetClsCompliantAttributeValue): Likewise.
8750         * class.cs, decl.cs: Update to changes.
8751
8752 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
8753
8754         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8755         
8756         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8757         
8758         * statement.cs (Foreach.Resolve): Add error 186 report.
8759
8760 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
8761
8762         * expression.cs (Conditional.DoResolve): Add warning 429.
8763         
8764         * statement.cs (If.Resolve): Add warning 665.
8765
8766 2004-12-16  Raja R Harinath  <rharinath@novell.com>
8767
8768         New invariant: RootContext.Tree.Types.NamespaceEntry == null
8769         except when in the parser, and in GlobalAttribute.
8770         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8771         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8772         RootContext.Tree.Types.NamespaceEntry once work is done.
8773         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
8774         and resets RootContext.Tree.Types.NamespaceEntry.
8775
8776 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
8777
8778         * cs-parser.jay: Don't create a block for every variable.
8779
8780 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
8781
8782         * location.cs: Provide extra information.
8783
8784         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8785         variables from the captured environment, it is the ldarg_0.
8786
8787 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8788
8789         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8790         find a conclusion.
8791         
8792         * class.cs: Changed warning level for 169 to avoid developer
8793         displeasure from warning flooding. It will be changed back when they
8794         fix most of current BCL warnings.
8795         
8796         * RootContext.cs: Pushed default WarningLevel to 3.
8797         
8798         * statement.cs: Removed unused variable.
8799
8800 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8801
8802         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8803         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8804         Add error 502 report.
8805         (StaticClass.DefineType): Add error 441 report.
8806         (Class.AllowedModifiersProp): New virtual property as temporary
8807         extension to AllowedModifiers.
8808         (Class.DefineType): Add error 418 report. Moved ModFlags check here
8809         to share implementation with StaticClass and don't call virtual
8810         methods from ctor.
8811         
8812         * driver.cs (MainDriver): Add error 1558 test.
8813
8814         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8815         report. Moved error 36 test here.
8816
8817         * statement.cs (Throw.Resolve): Add error 724 report.
8818
8819         * typemanager.cs: Add out_attribute_type core type.
8820         
8821 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
8822
8823         * class.cs (TypeContainer.VerifyClsCompliance): Add error
8824         3018 report.
8825         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8826
8827         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8828         3017 report.
8829         
8830         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8831
8832         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
8833         Add error 3023 report.
8834         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8835
8836         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8837         implementation.
8838
8839 2004-12-12  John Luke  <john.luke@gmail.com>
8840
8841         * driver.cs (AddArgs): take -- into account when
8842         adding arguments, fixes bug 65710 
8843
8844 2004-12-12  Martin Baulig  <martin@ximian.com>
8845
8846         * expression.cs (Unary.TryReduceNegative): Added support for
8847         SByteConstant and ByteConstant.
8848         (Unary.Reduce): Check error values from TryReduceNegative().
8849
8850 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
8851
8852         * attributes.cs (Attribute.Resolve): Avoid multiple error report
8853         and report exception as error 182.
8854
8855 2004-12-10  Raja R Harinath  <rharinath@novell.com>
8856
8857         * driver.cs (Main): Fix message when there are warnings.
8858
8859 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
8860
8861         * delegate.cs: Fixed my fix from yesterday, sorry about that.
8862
8863 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
8864
8865         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
8866         Reduced number of warnings.
8867         
8868         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8869
8870 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
8871
8872         * driver.cs: Removed message.
8873
8874         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8875
8876 2004-12-08    <vargaz@freemail.hu>
8877
8878         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8879
8880 2004-12-08  Martin Baulig  <martin@ximian.com>
8881
8882         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8883         instead of a CS3002 for properties and indexer.
8884
8885 2004-12-08  Martin Baulig  <martin@ximian.com>
8886
8887         * decl.cs (MemberName.ToString): Make this work again.
8888
8889 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
8890
8891         * attribute.cs (Resolve): Add error 591 detection.
8892
8893         * class.cs (FieldMember.Define): Add error 1547 detection.
8894         (Indexer.Define): Add error 620 detection.
8895         (Operator.Define): Add error 590 detection.
8896
8897         * ecore.cs: Missing argument for error 79.
8898
8899         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8900         detection.
8901
8902 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
8903
8904         Fix #70106
8905         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8906         only.
8907
8908 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8909
8910         * cs-parser.jay : handle doc comments on implicit/explicit operators.
8911           Some operator comments were suppressed.
8912         * doc.cs : Implicit/explicit operator name in doc comments are like
8913           "op_Explicit(type)~returnType", so added suffix handling.
8914
8915 2004-12-07  Martin Baulig  <martin@ximian.com>
8916
8917         * decl.cs
8918         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8919         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8920         (DeclSpace.ec): New protected field; store the EmitContext here.
8921         (DeclSpace.EmitContext): New public property; moved here from
8922         `TypeContainer'.
8923         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8924         EmitContext.
8925
8926         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8927         (Enum.Emit): Don't create a new EmitContext.
8928
8929         * delegate.cs (Delegate.DefineType): Always create the
8930         EmitContext.
8931
8932         * iterators.cs (Iterators.DefineIterator): Create a new
8933         EmitContext and store it in `ec'.
8934
8935 2004-08-24  Martin Baulig  <martin@ximian.com>
8936
8937         * typemanager.cs
8938         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8939         this for accessibility checks.
8940         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8941         IsNestedFamilyAccessible.
8942         (TypeManager.IsSubclassOf): New method, do what the name actually
8943         says.   
8944
8945 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8946
8947         Fix crash on cs0657-17.cs.
8948         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8949         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8950         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8951         the case where the NamespaceEntry gets overwritten.
8952
8953 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8954
8955         Fixed #69195, #56821
8956         * ecore.cs (ResolveBoolean): Tiny refactoring.
8957
8958         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8959         of right expression resolving when left is false constant and
8960         operator is LogicalAnd OR true constant and operator is LogicalOr.
8961
8962         * statement.cs (ResolveUnreachable): Always reports warning.
8963
8964 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8965
8966         * class.cs: Distinguish between 1721 and 1722 (just a little help
8967         for the programmer).
8968
8969 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
8970
8971         * delegate.cs: Only allow this on new versions of the language. 
8972
8973 2004-12-02  Duncan Mak  <duncan@ximian.com>
8974
8975         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8976         Expression class.
8977         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8978         here as a static method. Take an additional bool out parameter
8979         `must_do_cs1540_check' for signaling to InstanceResolve.
8980         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8981         member field from PropertyExpr class and made it an argument of
8982         the method instead.
8983         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8984         check for MarshalByRefObject, and report CS0122 instead of CS1540.
8985         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8986         and `remove_accessor' as well as InstanceResolve: report CS0122
8987         where applicable.
8988
8989         Fixes #70129.
8990
8991 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8992
8993         Fix test-327.cs, test-328.cs, and put in early infrastructure
8994         for eventually fixing #52697.
8995         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8996         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8997         from other methods.
8998         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8999         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
9000         (VerifyUsing, error246): Update.
9001         * rootcontext.cs (RootContext.NamespaceLookup): Just use
9002         'NamespaceEntry.LookupNamespaceOrType'.
9003
9004 2004-12-03  Martin Baulig  <martin@ximian.com>
9005
9006         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9007         method as our child, call AnonymousMethod.Compatible() on it.
9008
9009 2004-12-03  Raja R Harinath  <rharinath@novell.com>
9010
9011         Disable XML documentation support in 'basic' profile.
9012         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
9013         Redirect XmlElement to System.Object.
9014         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
9015         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
9016         * mcs.exe.sources: Add doc-bootstrap.cs.
9017         * doc-bootstrap.cs: New file.  Contains empty stub implementation
9018         of doc.cs.
9019
9020 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
9021
9022         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
9023           comments are allowed.
9024
9025 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9026
9027         * delegate.cs: Add checks for subtypes in paramaters and return values
9028         in VerifyMethod () to add support for Covariance/Contravariance
9029         in delegates.
9030         
9031 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
9032
9033         * report.cs: Remove extra closing parenthesis.
9034
9035         * convert.cs (Error_CannotImplicitConversion): If the name of the
9036         types are the same, provide some extra information.
9037
9038         * class.cs (FieldBase): Use an unused bit field from the field to
9039         encode the `has_offset' property from the FieldMember.  This saves
9040         a couple of Ks on bootstrap compilation.
9041
9042         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9043         method as our child, return the AnonymousMethod resolved
9044         expression.
9045
9046         * expression.cs (New.DoResolve): Allow return values from
9047         NewDelegate to also include AnonymousMethods.
9048
9049         Fixes #70150.
9050
9051 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
9052
9053         Fix bug #70102
9054         * attribute.cs (Resolve): Improved implementation of params
9055         attribute arguments.
9056
9057         * support.cs (ParameterData): Add HasParams to be faster.
9058
9059 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
9060
9061         all things are for /doc support:
9062
9063         * doc.cs: new file that supports XML documentation generation.
9064         * mcs.exe.sources: added doc.cs.
9065         * driver.cs:
9066           Handle /doc command line option.
9067           Report error 2006 instead of 5 for missing file name for /doc.
9068           Generate XML documentation when required, after type resolution.
9069         * cs-tokenizer.cs:
9070           Added support for picking up documentation (/// and /** ... */),
9071           including a new XmlCommentState enumeration.
9072         * cs-parser.jay:
9073           Added lines to fill Documentation element for field, constant,
9074           property, indexer, method, constructor, destructor, operator, event
9075           and class, struct, interface, delegate, enum.
9076           Added lines to warn incorrect comment.
9077         * rootcontext.cs :
9078           Added Documentation field (passed only when /doc was specified).
9079         * decl.cs:
9080           Added DocComment, DocCommentHeader, GenerateDocComment() and
9081           OnGenerateDocComment() and some supporting private members for
9082           /doc feature to MemberCore.
9083         * class.cs:
9084           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
9085         * delegate.cs:
9086           Added overriden DocCommentHeader.
9087         * enum.cs:
9088           Added overriden DocCommentHeader and GenerateDocComment().
9089
9090 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
9091
9092         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
9093         unwrapping the enumeration values, chain to
9094         DoConstantNumericPromotions again, so we can promote things to the
9095         fundamental types (takes care of enums that are bytes, sbytes).
9096
9097         Fixes bug #62054.
9098
9099 2004-12-01  Raja R Harinath  <rharinath@novell.com>
9100
9101         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
9102         Fix long-standing bug in type-lookup.  Use FindType instead of
9103         LookupType when ec.ResolvingTypeTree.
9104         (Attribute.ResolveType, Attribute.Resolve)
9105         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
9106         Update to changes.
9107         (Attributes.Search): Remove internal version.  Update.
9108         (Attributes.SearchMulti): Update.
9109         (Attributes.GetClsCompliantAttribute): Remove.
9110         (Attributes.GetIndexerNameAttribute): Remove.
9111         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
9112         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
9113         * class.cs (Indexer.Define): Likewise.
9114
9115 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
9116
9117         Fix bug #68790
9118         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
9119         MarshallByReference members access.
9120
9121         * expression.cs: Use CheckMarshallByRefAccess;
9122         Better error CS0197 message.
9123
9124         * report.cs: Print whole related error message.
9125
9126 2004-11-30  Raja R Harinath  <rharinath@novell.com>
9127
9128         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
9129         the current directory to help debugging.
9130
9131 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9132
9133         * class (GetClassBases): Better error 60 report.
9134         (EventProperty): Disabled warning 67 detection.
9135
9136 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9137
9138         Fix bug #60324
9139         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
9140
9141         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
9142         precise values.
9143
9144 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9145
9146         Fix bug #49488
9147         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
9148
9149         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
9150
9151 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
9152
9153         * attribute.cs (Attribute.Resolve): Refine error reporting and
9154         report a cs0117 if the identifier does not exist, to distinguish
9155         from 0617 which is a miss-use of the actual identifier.
9156
9157         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
9158         between cs0070 and cs0079.
9159
9160         * class.cs (MemberBase.DoDefine): When reporting a wrong
9161         accessibility level, we use MethodCore to compare instead of
9162         Method (this was a regression in some refactoring effort).
9163
9164         So now we correctly report cs0056 again.
9165
9166         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
9167         testing the target_type (which was known to be object_type) and
9168         not the source type (which is anonymous_method).
9169
9170         Fixed reporting of error cs1660.
9171
9172         * expression.cs (UserCast.Source): Expose the underlying cast.
9173
9174         * statement.cs (Switch.SwitchGoverningType): Sort the list of
9175         allowed types to find a match to int32 first (most common).
9176
9177         In addition, it ignores any ImplicitUserConversions that did an
9178         internal implicit conversion (as the switch statement allows only
9179         one integral conversion to exist).
9180
9181         * class.cs (PartialContainer.Create): rename `name' to
9182         `member_name' for clarity.  Then replace the string calls with a
9183         call to MemberName.GetPartialName, as now using
9184         MemberName.ToString is an error (this is due to the side effects
9185         it had, that were fixed in the past).
9186
9187         This will restore the error reporting on a number of partial class
9188         errors that were missusing this (and getting an exception as a
9189         results, which is now just a plain textual warning, because
9190         yyparse debug output would crash otherwise).
9191
9192 2004-11-26  Raja R Harinath  <rharinath@novell.com>
9193
9194         * Makefile (PROGRAM_INSTALL_DIR): Remove.
9195
9196 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
9197
9198         * rootcontext.cs (LookupType): Make sure to cache lookups that
9199         don't give us a negative result. This saves about 5% of corlib
9200         compilation time.
9201
9202 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
9203
9204         * report.cs (AbstractMessage.Print): messages are sent to stderr
9205
9206         * class.cs (TypeContainer.GetClassBases): It is an error to have a
9207         non-interface in the list of interfaces (at this point, either
9208         parent was properly set, or a base class is being listed in the
9209         interfaces section).
9210
9211         This flags error 1722, and resolves the crash from bug 69259.
9212
9213 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
9214
9215         * statement.cs (Using.EmitExpressionFinally): make this work right
9216         for valuetypes. Fixes 69926.
9217
9218 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
9219
9220         * const.cs (Const.ChangeType): Cope with the "0 literal can be
9221         converted to an enum" here, before we try to change the underlying
9222         type.  This code exists, but it is a different code path than the
9223         one used while encoding constants.
9224
9225         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
9226         old bug: when converting from the null literal to a pointer,
9227         return an EmptyCast, not the NullLiteral.
9228
9229         This fixes #69921, the recent null_type changes probably made this
9230         bug more prominent.
9231
9232         (ImplicitReferenceConversionExists): In addition, resynchronized
9233         the code here, so it matches the same code in
9234         ImplicitReferenceConversionExists for the `from any class-type S
9235         to any interface-type T'.
9236         
9237
9238 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
9239
9240         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
9241
9242 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
9243
9244         * cs-parser.jay: Use verbosity accordingly. 
9245
9246 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9247
9248         * expression.cs (Unary.ResolveOperator): Do not report warning;
9249         AddressOf reads from variable.
9250         
9251         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
9252
9253 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9254
9255         Fix bug #69462
9256
9257         * attribute.cs (Attributable): Removed CheckTargets.
9258         (Attributes.Emit): Explicit attribute targets are tested here.
9259
9260         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
9261         not enabled for interfaces.
9262
9263         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
9264         (GetAssemblyName): Ouch next bug there.
9265
9266 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9267
9268         * expression.cs: Error 275 added.
9269         
9270 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
9271
9272         Fix bug #69177 (Implemented decimal constant support)
9273
9274         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
9275         (BinaryFold): Add DecimalConstant.
9276
9277         * const.cs (Define): Decimal constant 
9278         (is not constant.
9279         (ChangeType): Add decimal type handling.
9280         (LookupConstantValue): Don't set value for decimal type but
9281         emit DecimalConstantAttribute. Needed for constant optimization.
9282
9283         * constant.cs (ToDecimal): New method.
9284         (ConvertToDecimal): New method.
9285         (IntConstant): Implemented ConvertToDecimal.
9286         (DecimalConstant.Emit): Emit optimized version for decimals in
9287         int range.
9288
9289         * expression.cs (ResolveOperator): Changed order of constant
9290         reduction to work correctly with native types which have
9291         overloaded operators.
9292         (ResolveMemberAccess): Extract constant value from attribute
9293         for decimal type.
9294
9295         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
9296
9297         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
9298         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
9299         (ChangeType): Decimal is special.
9300         (TypeToCoreType): Add decimal type.
9301
9302 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9303
9304         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
9305         decimal types.
9306
9307 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9308
9309         * class.cs (EventField.ApplyAttributeBuilder): Fix error
9310         test cs1667-5.cs.
9311
9312 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9313
9314         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
9315
9316         * pending.cs (PendingImplementation): Grab only interfaces.
9317
9318 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9319
9320         * statement.cs (ForeachHelperMethods): Add location member and
9321         error 202 detection.
9322
9323 2004-11-19  Raja R Harinath  <rharinath@novell.com>
9324
9325         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
9326         automatically handled by executable.make.
9327         (PROGRAM): Make profile-specific.
9328
9329 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
9330
9331         * expression.cs (DoResolveBase): Fixed wrong warning for out
9332         variables.
9333
9334 2004-11-18  Martin Baulig  <martin@ximian.com>
9335
9336         Merged latest changes into gmcs.  Please keep this comment in
9337         here, it makes it easier for me to see what changed in MCS since
9338         the last time I merged.
9339
9340 2004-11-17  Raja R Harinath  <rharinath@novell.com>
9341
9342         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
9343         (TypeHandle.GetMemberCache): New.
9344         (TypeHandle.TypeHandle): Update.
9345         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
9346         (TypeManager.LookupParentInterfacesCache):
9347         Rename from LookupInterfaceCache.  Optimize slightly.
9348         (TypeManager.MemberLookup_FindMembers): Update.
9349         * decl.cs (MemberCache.MemberCache): Set Container to null in the
9350         multi-type variant.
9351         (AddCacheContents): Rename from AddHashtable.
9352         * class.cs (TypeContainer.parent_container): Remove.
9353         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
9354         (TypeContainer.DoDefineMembers): Don't initialize it.
9355         Update to name changes.
9356         
9357 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
9358
9359         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
9360         that factors the code to check access modifiers on override.  
9361
9362         (PropertyBase): Use the code here.
9363
9364         Patch from Lluis S'anchez, fixes bug #69361.
9365
9366 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
9367
9368         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
9369         routine that is used to report the use of a captured variable
9370         whose address has been taken.
9371
9372         There are two checks: one when variables are being captured and
9373         the other check is when the address of a variable is taken. 
9374         
9375         (because an anonymous methods might be resolved before *or* after
9376         the address has been taken) and 
9377
9378         * expression.cs (Conditional.DoResolve): Remove the special
9379         casing that Martin added to trueExpr and falseExpr being both
9380         NullLiteral.  We get the right behavior now just by introducing
9381         the null_type into the compiler. 
9382
9383         * convert.cs (ExplicitConversion): Change the code to use
9384         null_type instead of testing `expr is NullLiteral'.
9385         (ImplicitConversionStandard): use null_type too.
9386         (ImplicitReferenceConversionExists): use null_type too.
9387         (ImplicitReferenceConversion): use null_type too.
9388
9389         * literal.cs: The type of `NullLiteral' is now null_type instead
9390         of object_type. 
9391         (Resolve): Set the type here.
9392
9393         * typemanager.cs: Introduce null_type.
9394
9395 2004-11-17  Martin Baulig  <martin@ximian.com>
9396
9397         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
9398         direction, like FindMembers() does.  Fixes #69546, testcase is in
9399         test-315.cs.    
9400
9401 2004-11-16  Martin Baulig  <martin@ximian.com>
9402
9403         This is based on a patch from Marek Safar, see bug #69082.
9404         Fixes bugs #63705 and #67130.
9405
9406         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
9407         method; create a MemberCache for an interface type and cache the
9408         result.
9409
9410         * decl.cs (IMemberContainer.ParentContainer): Removed.
9411         (IMemberContainer.ParentCache): New property.
9412         (MemberCache.SetupCacheForInterface): Removed.
9413         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
9414         to create a cache for an interface's "parent".
9415
9416         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9417         interfaces too.
9418
9419 2004-11-16  Martin Baulig  <martin@ximian.com>
9420
9421         Merged back from gmcs; these changes already went into gmcs a
9422         couple of weeks ago.
9423
9424         * typemanager.cs
9425         (TypeManager.AddUserType): Removed the `ifaces' argument.
9426         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
9427         `TypeExpr []'.
9428         (TypeManager.AddUserInterface): Removed.
9429         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
9430         `TypeExpr []'.
9431         (TypeManager.GetInterfaces): Likewise.
9432         (TypeManager.GetExplicitInterfaces): Likewise.
9433
9434         * ecore.cs (TypeExpr.GetInterfaces): Removed.
9435
9436         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
9437         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
9438
9439 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
9440
9441         * statement.cs: Avoid adding bools to a hashtable.
9442
9443 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
9444
9445         * expression.cs (Invocation.OverloadResolve): Flag error if we are
9446         calling an unsafe method from a safe location.
9447
9448 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
9449
9450         Fix #69167
9451         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
9452
9453 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
9454
9455         * namespace.cs (VerifyUsing): use GetPartialName instead of
9456         ToString. 
9457
9458 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
9459
9460         * statement.cs (Return.Resolve): Fix regression in typo: if
9461         `in_exc', we have to request a NeedReturnLabel, this was a typo
9462         introduced in the anonymous method check-in.  Fixes #69131.
9463
9464         * Indexers were using the ShortName when defining themselves,
9465         causing a regression in the compiler bootstrap when applying the
9466         patch from 2004-11-02 (first part), now they use their full name
9467         and the bug is gone.
9468
9469 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
9470
9471         * driver.cs: Strip the path from the names of embedded resources. Fixes
9472         #68519.
9473
9474 2004-11-04  Raja R Harinath  <rharinath@novell.com>
9475
9476         Fix error message regression: cs0104-2.cs.
9477         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
9478         (AliasEntry.Resolve): Update.
9479         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
9480         'silent' flag.
9481         (RootContext.LookupType): Update.
9482
9483 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
9484
9485         * cs-parser.jay: Add support for handling accessor modifiers
9486         * class: Add support port accessor modifiers and error checking,
9487         define PropertyMethod.Define as virtual (not abstract anymore)
9488         * ecore.cs: Add checking for proeprties access with access modifiers
9489         * iterators.cs: Modify Accessor constructor call based in the modified
9490         constructor
9491 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
9492
9493         * expression.cs (StringConcat): Handle being called twice,
9494         as when we have a concat in a field init with more than two
9495         ctors in the class
9496
9497 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
9498
9499         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
9500         special case explicit implementations, we should always produce
9501         the .property or .event declaration.
9502         
9503         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
9504         since it will not return correct data if people use this
9505         unresolved in the presence of using statements (see test-313).
9506
9507         * class.cs (MethodData.Define): If we are an explicit interface
9508         implementation, set the method name to the full name of the
9509         interface plus the name of the method.  
9510
9511         Notice that using the method.MethodName.GetFullName() does not
9512         work, as it will only contain the name as declared on the source
9513         file (it can be a shorthand in the presence of using statements)
9514         and not the fully qualifed type name, for example:
9515
9516         using System;
9517
9518         class D : ICloneable {
9519                 object ICloneable.Clone ()  {
9520                 }
9521         }
9522
9523         Would produce a method called `ICloneable.Clone' instead of
9524         `System.ICloneable.Clone'.
9525
9526         * namespace.cs (Alias.Resolve): Use GetPartialName.
9527         
9528 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9529
9530         * cs-parser.jay: Add error 1055 report.
9531
9532 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
9533
9534         * assign.cs (Assign.DoResolve): Only do the transform of
9535         assignment into a New if the types are compatible, if not, fall
9536         through and let the implicit code deal with the errors and with
9537         the necessary conversions. 
9538
9539 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9540
9541         * cs-parser.jay: Add error 1031 report.
9542
9543         * cs-tokenizer.cs: Add location for error 1038.
9544
9545 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9546
9547         * cs-parser.jay: Add error 1016 report.
9548
9549 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9550
9551         * cs-parser.jay: Add errors 1575,1611 report.
9552
9553 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9554
9555         * cs-parser.jay: Add error 1001 report.
9556
9557 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9558
9559         Fix #68850
9560         * attribute.cs (GetMarshal): Add method argument for
9561         caller identification.
9562
9563         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
9564         agument for GetMarshal and RuntimeMissingSupport.
9565
9566 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9567
9568         * attribute.cs (ExtractSecurityPermissionSet): Removed
9569         TypeManager.code_access_permission_type.
9570
9571         * typemanager.cs: Removed TypeManager.code_access_permission_type.
9572
9573 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
9574
9575         * expression.cs (LocalVariableReference.DoResolveLValue): Check
9576         for obsolete use of a variable here.   Fixes regression on errors
9577         cs0619-25 and cs0619-26.
9578
9579 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
9580
9581         Fix #62358, implemented security attribute encoding.
9582
9583         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
9584         Tests permitted SecurityAction for assembly or other types.
9585         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
9586         data from SecurityPermissionAttribute to PermisionSet class.
9587
9588         * class.cs (ApplyAttributeBuilder): Added special handling
9589         for System.Security.Permissions.SecurityAttribute based types.
9590
9591         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
9592         special handling for System.Security.Permissions.SecurityAttribute
9593         based types.
9594
9595         * enum.cs (ApplyAttributeBuilder): Added special handling
9596         for System.Security.Permissions.SecurityAttribute based types.
9597
9598         * parameter.cs (ApplyAttributeBuilder): Added special handling
9599         for System.Security.Permissions.SecurityAttribute based types.
9600
9601         * rootcontext.cs: Next 2 core types.
9602
9603         * typemanager.cs (TypeManager.security_permission_attr_type):
9604         Built in type for the SecurityPermission Attribute.
9605         (code_access_permission_type): Build in type.
9606
9607 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
9608
9609         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9610         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9611         all of this information into
9612         EmitContext.EmitCapturedVariableInstance.
9613         
9614         * codegen.cs (EmitCapturedVariableInstance): move here the
9615         funcionality of emitting an ldarg.0 in the presence of a
9616         remapping.   This centralizes the instance emit code.
9617
9618         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9619         then emit a load of this: it means that we have reached the
9620         topmost ScopeInfo: the one that contains the pointer to the
9621         instance of the class hosting the anonymous method.
9622
9623         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9624         captures to the topmost CaptureContext.
9625
9626 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
9627
9628         * expression.cs (LocalVariableReference): Move the knowledge about
9629         the iterators into codegen's EmitCapturedVariableInstance.
9630
9631 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
9632
9633         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9634         all code paths return a value from an anonymous method (it is the
9635         same as the 161 error, but for anonymous methods).
9636
9637 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
9638
9639         The introduction of anonymous methods in the compiler changed
9640         various ways of doing things in the compiler.  The most
9641         significant one is the hard split between the resolution phase
9642         and the emission phases of the compiler.
9643
9644         For instance, routines that referenced local variables no
9645         longer can safely create temporary variables during the
9646         resolution phase: they must do so from the emission phase,
9647         since the variable might have been "captured", hence access to
9648         it can not be done with the local-variable operations from the runtime.
9649         
9650         * statement.cs 
9651
9652         (Block.Flags): New flag `IsTopLevel' to indicate that this block
9653         is a toplevel block.
9654
9655         (ToplevelBlock): A new kind of Block, these are the blocks that
9656         are created by the parser for all toplevel method bodies.  These
9657         include methods, accessors and anonymous methods.
9658
9659         These contain some extra information not found in regular blocks:
9660         A pointer to an optional CaptureContext (for tracking captured
9661         local variables and parameters).  A pointer to the parent
9662         ToplevelBlock.
9663         
9664         (Return.Resolve): Catch missmatches when returning a value from an
9665         anonymous method (error 1662).
9666         Invoke NeedReturnLabel from the Resolve phase instead of the emit
9667         phase.
9668
9669         (Break.Resolve): ditto.
9670
9671         (SwitchLabel): instead of defining the labels during the
9672         resolution phase, we now turned the public ILLabel and ILLabelCode
9673         labels into methods called GetILLabelCode() and GetILLabel() that
9674         only define the label during the Emit phase.
9675
9676         (GotoCase): Track the SwitchLabel instead of the computed label
9677         (its contained therein).  Emit the code by using
9678         SwitchLabel.GetILLabelCode ().
9679
9680         (LocalInfo.Flags.Captured): A new flag has been introduce to track
9681         whether the Local has been captured or not.
9682
9683         (LocalInfo.IsCaptured): New property, used to tell whether the
9684         local has been captured.
9685         
9686         * anonymous.cs: Vastly updated to contain the anonymous method
9687         support.
9688
9689         The main classes here are: CaptureContext which tracks any
9690         captured information for a toplevel block and ScopeInfo used to
9691         track the activation frames for various local variables.   
9692
9693         Each toplevel block has an optional capture context associated
9694         with it.  When a method contains an anonymous method both the
9695         toplevel method and the anonymous method will create a capture
9696         context.   When variables or parameters are captured, they are
9697         recorded on the CaptureContext that owns them, for example:
9698
9699         void Demo () {
9700              int a;
9701              MyDelegate d = delegate {
9702                  a = 1;
9703              }
9704         }
9705
9706         Here `a' will be recorded as captured on the toplevel
9707         CapturedContext, the inner captured context will not have anything
9708         (it will only have data if local variables or parameters from it
9709         are captured in a nested anonymous method.
9710
9711         The ScopeInfo is used to track the activation frames for local
9712         variables, for example:
9713
9714         for (int i = 0; i < 10; i++)
9715                 for (int j = 0; j < 10; j++){
9716                    MyDelegate d = delegate {
9717                         call (i, j);
9718                    }
9719                 }
9720
9721         At runtime this captures a single captured variable `i', but it
9722         captures 10 different versions of the variable `j'.  The variable
9723         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9724         recorded on a child.  
9725
9726         The toplevel ScopeInfo will also track information like the `this'
9727         pointer if instance variables were referenced (this is necessary
9728         as the anonymous method lives inside a nested class in the host
9729         type of the method). 
9730
9731         (AnonymousMethod): Expanded to track the Toplevel, implement
9732         `AnonymousMethod.Compatible' to tell whether an anonymous method
9733         can be converted to a target delegate type. 
9734
9735         The routine now also produces the anonymous method content
9736
9737         (AnonymousDelegate): A helper class that derives from
9738         DelegateCreation, this is used to generate the code necessary to
9739         produce the delegate for the anonymous method that was created. 
9740
9741         * assign.cs: API adjustments for new changes in
9742         Convert.ImplicitStandardConversionExists.
9743
9744         * class.cs: Adjustments to cope with the fact that now toplevel
9745         blocks are of type `ToplevelBlock'. 
9746
9747         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9748         insteda of standard blocks.
9749
9750         Flag errors if params arguments are passed to anonymous methods.
9751
9752         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9753         `CurrentAnonymousMethod' which points to the current Anonymous
9754         Method.  The variable points to the AnonymousMethod class that
9755         holds the code being compiled.  It is set in the new EmitContext
9756         created for the anonymous method.
9757
9758         (EmitContext.Phase): Introduce a variable and an enumeration to
9759         assist in enforcing some rules about when and where we are allowed
9760         to invoke certain methods (EmitContext.NeedsReturnLabel is the
9761         only one that enfonces this right now).
9762
9763         (EmitContext.HaveCaptureInfo): new helper method that returns
9764         whether we have a CapturedContext initialized.
9765
9766         (EmitContext.CaptureVariable): New method used to register that a
9767         LocalInfo must be flagged for capturing. 
9768
9769         (EmitContext.CapturedParameter): New method used to register that a
9770         parameters must be flagged for capturing. 
9771         
9772         (EmitContext.CapturedField): New method used to register that a
9773         field must be flagged for capturing. 
9774
9775         (EmitContext.HaveCapturedVariables,
9776         EmitContext.HaveCapturedFields): Return whether there are captured
9777         variables or fields. 
9778
9779         (EmitContext.EmitMethodHostInstance): This is used to emit the
9780         instance for the anonymous method.  The instance might be null
9781         (static methods), this (for anonymous methods that capture nothing
9782         and happen to live side-by-side with the current method body) or a
9783         more complicated expression if the method has a CaptureContext.
9784
9785         (EmitContext.EmitTopBlock): Routine that drives the emission of
9786         code: it will first resolve the top block, then emit any metadata
9787         and then emit the code.  The split is done so that we can extract
9788         any anonymous methods and flag any captured variables/parameters.
9789         
9790         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9791         during this phase, the ILGenerator should not be used as labels
9792         and local variables declared here might not be accessible to any
9793         code that is part of an anonymous method.  
9794
9795         Exceptions to this include the temporary variables that are
9796         created by some statements internally for holding temporary
9797         variables. 
9798         
9799         (EmitContext.EmitMeta): New routine, in charge of emitting all the
9800         metadata for a cb
9801
9802         (EmitContext.TemporaryReturn): This method is typically called
9803         from the Emit phase, and its the only place where we allow the
9804         ReturnLabel to be defined other than the EmitMeta.  The reason is
9805         that otherwise we would have to duplicate a lot of logic in the
9806         Resolve phases of various methods that today is on the Emit
9807         phase. 
9808
9809         (EmitContext.NeedReturnLabel): This no longer creates the label,
9810         as the ILGenerator is not valid during the resolve phase.
9811
9812         (EmitContext.EmitThis): Extended the knowledge in this class to
9813         work in anonymous methods in addition to iterators. 
9814
9815         (EmitContext.EmitCapturedVariableInstance): This emits whatever
9816         code is necessary on the stack to access the instance to a local
9817         variable (the variable will be accessed as a field).
9818
9819         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9820         EmitContext.EmitAddressOfParameter): Routines to support
9821         parameters (not completed at this point). 
9822         
9823         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9824         will also remove the parameters.
9825
9826         * convert.cs (Convert): Define a `ConstantEC' which points to a
9827         null.  This is just to prefity some code that uses
9828         ImplicitStandardConversion code and do not have an EmitContext
9829         handy.
9830
9831         The idea is to flag explicitly that at that point in time, it is
9832         known that the conversion will not trigger the delegate checking
9833         code in implicit conversions (which requires a valid
9834         EmitContext). 
9835
9836         Everywhere: pass new EmitContext parameter since
9837         ImplicitStandardConversionExists now requires it to check for
9838         anonymous method conversions. 
9839
9840         (Convert.ImplicitStandardConversionExists): If the type of an
9841         expression is the anonymous_method_type, and the type is a
9842         delegate, we invoke the AnonymousMethod.Compatible method to check
9843         whether an implicit conversion is possible. 
9844
9845         (Convert.ImplicitConversionStandard): Only do implicit method
9846         group conversions if the language level is not ISO_1.
9847
9848         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9849         MethodInfo for the Invoke method.  used by Delegate and
9850         AnonymousDelegate.
9851
9852         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9853         method conversions if the target type is a delegate.
9854
9855         Removed extra debugging nops.
9856
9857         (LocalVariableReference): Turn the `local_info' into a public
9858         field. 
9859
9860         Add `prepared' field, the same hack used for FieldExprs to cope
9861         with composed assignments, as Local variables do not necessarily
9862         operate purely on the stack as they used to: they can be captured
9863         fields. 
9864
9865         Add `temp' for a temporary result, like fields.
9866
9867         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9868
9869         It now copes with Local variables that are captured and emits the
9870         proper instance variable to load it from a field in the captured
9871         case. 
9872
9873         (ParameterReference.DoResolveBase): During the resolve phase,
9874         capture parameters if we are in an anonymous method.
9875
9876         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9877         anonymous method, use the EmitContext helper routines to emit the
9878         parameter reference.
9879
9880         * iterators.cs: Set RemapToProxy to true/false during the
9881         EmitDispose class.
9882
9883         * parameters.cs (GetParameterByName): New helper method. 
9884
9885         * typemanager.cs (anonymous_method_type) a new type that
9886         represents an anonyous method.  This is always an internal type,
9887         used as a fencepost to test against the anonymous-methodness of an
9888         expression. 
9889         
9890 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9891
9892         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9893         561 report.
9894         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9895
9896 2004-10-18  Martin Baulig  <martin@ximian.com>
9897
9898         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9899         `Type' directly, but call ResolveType() on it.
9900         (Catch.Resolve): Likewise.
9901         (Foreach.Resolve): Likewise.
9902
9903 2004-10-18  Martin Baulig  <martin@ximian.com>
9904
9905         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9906         `Type' directly, but call ResolveType() on it.
9907         (Probe.DoResolve): Likewise.
9908         (ArrayCreation.LookupType): Likewise.
9909         (TypeOf.DoResolve): Likewise.
9910         (SizeOf.DoResolve): Likewise.
9911
9912 2004-10-18  Martin Baulig  <martin@ximian.com>
9913
9914         * expression.cs (Invocation.BetterFunction): Put back
9915         TypeManager.TypeToCoreType().
9916
9917 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9918
9919         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9920         the ResolveType.
9921
9922 2004-10-18  Martin Baulig  <martin@ximian.com>
9923
9924         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
9925         `Type' directly, but call ResolveType() on it.
9926
9927 2004-10-18  Martin Baulig  <martin@ximian.com>
9928
9929         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9930         `Type' directly, but call ResolveType() on it.
9931         (MemberBase.DoDefine): Likewise.
9932
9933         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9934         `Type' directly, but call ResolveType() on it.
9935         (ComposedCast.DoResolveAsTypeStep): Likewise.
9936
9937         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9938         `Type' directly, but call ResolveType() on it.
9939
9940 2004-10-17  John Luke  <john.luke@gmail.com>
9941
9942         * class.cs (Operator.GetSignatureForError): use CSharpName
9943
9944         * parameter.cs (Parameter.GetSignatureForError): Returns
9945         correct name even if was not defined.
9946
9947 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9948
9949         Fix #65816.
9950         * class.cs (TypeContainer.EmitContext): New property.
9951         (DefineNestedTypes): Create an emitcontext for each part.
9952         (MethodCore.DoDefineParameters): Use container's emitcontext.
9953         Pass type array to InternalParameters.
9954         (MemberBase.DoDefine): Use container's emitcontext.
9955         (FieldMember.Define): Likewise.
9956         (Event.Define): Likewise.
9957         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9958         Pass type array to InternalParameters.
9959         (SetIndexerMethod.GetParameterInfo): Likewise.
9960         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9961         * delegate.cs (Define): Pass emitcontext to
9962         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9963         array to InternalParameters.
9964         * expression.cs (ParameterReference.DoResolveBase): Pass
9965         emitcontext to GetParameterInfo.
9966         (ComposedCast.DoResolveAsTypeStep): Remove check on
9967         ec.ResolvingTypeTree.
9968         * parameter.cs (Parameter.Resolve): Change argument to
9969         EmitContext.  Use ResolveAsTypeTerminal.
9970         (Parameter.GetSignature): Change argument to EmitContext.
9971         (Parameters.ComputeSignature): Likewise.
9972         (Parameters.ComputeParameterTypes): Likewise.
9973         (Parameters.GetParameterInfo): Likewise.
9974         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9975         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9976         * support.cs (InternalParameters..ctor): Remove variant that takes
9977         a DeclSpace.
9978         * typemanager.cs (system_intptr_expr): New.
9979         (InitExpressionTypes): Initialize it.
9980
9981 2004-10-12  Chris Toshok  <toshok@ximian.com>
9982
9983         * cs-parser.jay: fix location for try_statement and catch_clause.
9984
9985 2004-10-11  Martin Baulig  <martin@ximian.com>
9986
9987         * report.cs: Don't make --fatal abort on warnings, we have
9988         -warnaserror for that.
9989
9990 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9991
9992         More DeclSpace.ResolveType avoidance.
9993         * decl.cs (MemberCore.InUnsafe): New property.
9994         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9995         with newly created EmitContext.
9996         (FieldMember.Define): Likewise.
9997         * delegate.cs (Delegate.Define): Likewise.
9998         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9999         only if normal name-lookup fails.
10000         (TypeExpr.DoResolve): Enable error-checking.
10001         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
10002         (SizeOf.DoResolve): Likewise.
10003         (ComposedCast.DoResolveAsTypeStep): Likewise.
10004         (StackAlloc.DoResolve): Likewise.
10005         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
10006         (Block.Unsafe): New property.
10007         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
10008         (Unsafe): Set 'unsafe' flag of contained block.
10009         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
10010         (Fixed.Resolve): Likewise.
10011         (Catch.Resolve): Likewise.
10012         (Using.ResolveLocalVariableDecls): Likewise.
10013         (Foreach.Resolve): Likewise.
10014
10015 2004-10-05  John Luke <john.luke@gmail.com>
10016
10017         * cs-parser.jay: add location to error CS0175
10018
10019 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
10020
10021         * ecore.cs (Expression.Constantity): Add support for turning null
10022         into a constant.
10023
10024         * const.cs (Const.Define): Allow constants to be reference types
10025         as long as the value is Null.
10026
10027 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
10028
10029         * namespace.cs (NamespaceEntry.Using): No matter which warning
10030         level is set, check if this namespace name has already been added.
10031
10032 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
10033
10034         * expression.cs: reftype [!=]= null should always use br[true,false].
10035         # 67410
10036
10037 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
10038
10039         Fix #67108
10040         * attribute.cs: Enum conversion moved to 
10041         GetAttributeArgumentExpression to be applied to the all
10042         expressions.
10043
10044 2004-10-01  Raja R Harinath  <rharinath@novell.com>
10045
10046         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
10047         * class.c (TypeContainer.DefineType): Flag error if
10048         base types aren't accessible due to access permissions.
10049         * decl.cs (DeclSpace.ResolveType): Move logic to
10050         Expression.ResolveAsTypeTerminal.
10051         (DeclSpace.ResolveTypeExpr): Thin layer over
10052         Expression.ResolveAsTypeTerminal.
10053         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
10054         Refactor code into NestedAccess.  Use it.
10055         (DeclSpace.NestedAccess): New.
10056         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
10057         argument to silence errors.  Check access permissions.
10058         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
10059         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
10060         (Cast.DoResolve): Likewise.
10061         (New.DoResolve): Likewise.
10062         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
10063         (TypeOf.DoResolve): Likewise.
10064
10065         * expression.cs (Invocation.BetterConversion): Return the Type of
10066         the better conversion.  Implement section 14.4.2.3 more faithfully.
10067         (Invocation.BetterFunction): Make boolean.  Make correspondence to
10068         section 14.4.2.2 explicit.
10069         (Invocation.OverloadResolve): Update.
10070         (Invocation): Remove is_base field.
10071         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
10072         (Invocation.Emit): Likewise.
10073
10074 2004-09-27  Raja R Harinath  <rharinath@novell.com>
10075
10076         * README: Update to changes.
10077
10078 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
10079
10080         * cs-parser.jay: Reverted 642 warning fix.
10081
10082 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10083
10084         Fix bug #66615
10085         * decl.cs (FindMemberWithSameName): Indexer can have more than
10086         1 argument.
10087
10088 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10089
10090         * expression.cs (LocalVariableReference.DoResolveLValue):
10091         Do not report warning 219 for out values.
10092         (EmptyExpression.Null): New member to avoid extra allocations.
10093
10094 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10095
10096         * cs-parser.jay: Fix wrong warning 642 report.
10097
10098         * cs-tokenizer.cs (CheckNextToken): New helper;
10099         Inspect next character if is same as expected.
10100
10101 2004-09-23  Martin Baulig  <martin@ximian.com>
10102
10103         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
10104         (Convert.ImplicitReferenceConversionExists): Likewise.
10105
10106 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10107
10108         * class.cs (Operator.Define): Add error 448 and 559 report.
10109
10110 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10111
10112         * class.cs (MemberBase.IsTypePermitted): New protected
10113         method for checking error CS0610.
10114
10115 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10116
10117         * class.cs (TypeContainer.HasExplicitLayout): New property
10118         Returns whether container has StructLayout attribute set Explicit.
10119         (FieldMember): New abstract class for consts and fields.
10120         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
10121         (Field): Reuse FieldMember.
10122
10123         * const.cs (Const): Reuse FieldMember.
10124
10125         * rootcontext.cs: EmitConstants call moved to class.
10126
10127 2004-09-22  Martin Baulig  <martin@ximian.com>
10128
10129         Thanks to Peter Sestoft for this bug report.
10130
10131         * expression.cs (Conditional): If both the `trueExpr' and the
10132         `falseExpr' is a NullLiteral, return a NullLiteral.
10133
10134 2004-09-22  Martin Baulig  <martin@ximian.com>
10135
10136         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
10137         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
10138         for the "get_Current" call.
10139
10140 2004-09-22  Martin Baulig  <martin@ximian.com>
10141
10142         Marek and me just fixed one of our oldest bugs: #28562 :-)
10143
10144         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
10145
10146         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
10147         we're an EnumConstant, just return that.
10148         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
10149         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
10150         to get the value which'll actually be written into the attribute.
10151         However, we have to use GetValue() to access the attribute's value
10152         in the compiler.        
10153
10154 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10155
10156         * constant.cs (Constant.IsNegative): New abstract property
10157         IsNegative.
10158
10159         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
10160         (StackAlloc.DoResolve): Reused IsNegative.
10161
10162 2004-09-21  Martin Baulig  <martin@ximian.com>
10163
10164         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
10165         if we're used in an iterator, we may be called from different
10166         methods.
10167
10168         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
10169         we actually have an exception block.
10170
10171 2004-09-20  John Luke <jluke@cfl.rr.com>
10172
10173         * class.cs, cs-parser.jay: Improve the error report for 1520:
10174         report the actual line where the error happens, not where the
10175         class was declared.
10176
10177         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
10178         Pass location information that was available elsewhere.
10179
10180 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
10181
10182         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
10183         runtime to delay sign assemblies.
10184
10185 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
10186
10187         * cs-parser.jay: Do not report the stack trace, this is barely
10188         used nowadays.
10189
10190 2004-08-22  John Luke  <john.luke@gmail.com>
10191  
10192         * driver.cs : check that a resource id is not already used
10193         before adding it, report CS1508 if it is, bug #63637
10194
10195 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
10196
10197         * ecore.cs: Removed dead code.
10198
10199 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
10200
10201         * class.cs: Do not report warning CS0067 on the interfaces.
10202
10203 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10204
10205         * cs-parser.jay: Add error 504 report.
10206
10207 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10208
10209         * rootcontext.cs: WarningLevel is 4 by default now.
10210
10211         * statement.cs (Fixed.Resolve): Do not null
10212         VariableInfo.
10213
10214 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10215
10216         Fixed bug #55780
10217         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
10218         deep search when property is not virtual.
10219         (PropertyExpr.ResolveAccessors): Make one call for both
10220         accessors.
10221
10222 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10223
10224         Fixed bug #65766
10225         * statement.cs: Error 152 report constains also location.
10226
10227 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10228
10229         Fixed bug #65766
10230         * const.cs: Explicitly set constant as static.
10231
10232 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10233
10234         Fixed bug #64226
10235         * cs-parser.jay: Add error 1017 report.
10236
10237 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10238
10239         Fixed bug #59980, #64224
10240         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
10241
10242         * typemanager.cs (IsSpecialMethod): Simplified
10243
10244 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10245
10246         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
10247         condition with better params.
10248
10249 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10250
10251         Fixed bug #65238
10252         * attribute.cs (Resolve): Property has to have both
10253         accessors.
10254
10255 2004-09-14  Martin Baulig  <martin@ximian.com>
10256
10257         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
10258
10259 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10260
10261         Fixed bug #61902
10262         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
10263         called and is obsolete then this member suppress message
10264         when call is inside next [Obsolete] method or type.
10265
10266         * expression.cs: Use TestObsoleteMethodUsage member.
10267
10268 2004-09-14  Martin Baulig  <martin@ximian.com>
10269
10270         * cs-parser.jay: Sync a bit with the GMCS version.
10271
10272 2004-09-14  Martin Baulig  <martin@ximian.com>
10273
10274         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
10275         (CSharpParser.yacc_verbose_flag): New public field.
10276
10277         * genericparser.cs: Removed.
10278
10279 2004-09-14  Raja R Harinath  <rharinath@novell.com>
10280
10281         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
10282
10283 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
10284
10285         * class.cs (MethodCore.CheckBase): Fix bug #65757.
10286
10287 2004-09-10  Martin Baulig  <martin@ximian.com>
10288
10289         Backported my MemberName changes from GMCS into MCS.
10290
10291         - we are now using a special `MemberName' class instead of using
10292         strings; in GMCS, the `MemberName' also contains the type
10293         arguments.
10294
10295         - changed the grammar rules a bit:
10296           * the old `member_name' is now a `namespace_or_type_name':
10297             The rule is that we use `namespace_or_type_name' everywhere
10298             where we expect either a "member name" (GetEnumerator) or a
10299             "member name" with an explicit interface name
10300             (IEnumerable.GetEnumerator).
10301             In GMCS, the explicit interface name may include type arguments
10302             (IEnumerable<T>.GetEnumerator).
10303           * we use `member_name' instead of just `IDENTIFIER' for
10304             "member names":
10305             The rule is that we use `member_name' wherever a member may
10306             have type parameters in GMCS.       
10307
10308         * decl.cs (MemberName): New public class.
10309         (MemberCore.MemberName): New public readonly field.
10310         (MemberCore.ctor): Take a `MemberName' argument, not a string.
10311         (DeclSpace): Likewise.
10312
10313         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
10314         * enum.cs (Enum.ctor): Likewise.
10315
10316         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
10317         MemberName.     
10318         (AliasEntry.ctor): Take a MemberName, not an Expression.
10319         (AliasEntry.UsingAlias): Likewise.
10320
10321         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
10322         (IMethodData.MemberName): Changed type from string to MemberName.
10323         (MemberBase.ExplicitInterfaceName): Likewise.
10324         (AbstractPropertyEventMethod.SetupName): Make this private.
10325         (AbstractPropertyEventMethod.ctor): Added `string prefix'
10326         argument; compute the member name here.
10327         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
10328         on the `member.MemberName' and the `prefix'.
10329
10330         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
10331         not `type_name'.
10332         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
10333         thus, we get a `MemberName' instead of a `string'.  These
10334         declarations may have type parameters in GMCS.
10335         (interface_method_declaration, delegate_declaration): Likewise.
10336         (class_declaration, interface_declaration): Likewise.
10337         (method_header): Use `namespace_or_type_name' instead of
10338         `member_name'.  We may be an explicit interface implementation.
10339         (property_declaration, event_declaration): Likewise.
10340         (member_name): This is now just an `IDENTIFIER', not a
10341         `namespace_or_type_name'.
10342         (type_name, interface_type): Removed.
10343         (namespace_or_type_name): Return a MemberName, not an Expression.
10344         (primary_expression): Use `member_name' instead of `IDENTIFIER';
10345         call GetTypeExpression() on the MemberName to get an expression.
10346         (IndexerDeclaration.interface_type): Changed type from string to
10347         MemberName.
10348         (MakeName): Operate on MemberName's instead of string's.
10349
10350 2004-09-13  Raja R Harinath  <rharinath@novell.com>
10351
10352         Fix bug #55770.
10353         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
10354         (NamespaceEntry.Lookup): Add new argument to flag if we want the
10355         lookup to avoid symbols introduced by 'using'.
10356         * rootcontext.cs (NamespaceLookup): Update.
10357
10358 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10359
10360         * class.cs (TypeContainer.DoDefineMembers): Do not call
10361         DefineDefaultConstructor for static classes.
10362
10363 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10364
10365         * attribute.cs (Attribute.Resolve): Add error 653 report.
10366
10367         * class.cs (Class.ApplyAttributeBuilder): Add error 641
10368         report.
10369         (Method.ApplyAttributeBuilder): Add error 685 report.
10370         (Operator.Define): Add error 564 report.
10371
10372         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
10373
10374         * expression.cs (Invocation.DoResolve): Add error
10375         245 and 250 report.
10376
10377         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
10378         error 674 report.
10379
10380 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10381
10382         * class.cs (ConstructorInitializer.Resolve):
10383         Wrong error number (515->516).
10384
10385 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10386
10387         * class.cs (Indexer.Define): Add error 631 report.
10388
10389 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10390
10391         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
10392
10393 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10394
10395         * expression.cs (Probe.DoResolve): Add error CS0241 report.
10396
10397 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
10398
10399         * cs-parser.jay: Added error CS0241 report.
10400
10401 2004-09-10  Raja R Harinath  <rharinath@novell.com>
10402
10403         * cs-parser.jay (fixed_statement): Introduce a scope for the
10404         declaration in the 'fixed' statement.
10405
10406 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10407
10408         * cs-parser.jay: Added CS0230 error report.
10409
10410 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10411
10412         * cs-parser.jay: Added errors CS0231 and CS0257 report.
10413
10414 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10415
10416         * expression.cs (Argument.Resolve): Added error CS0192 and
10417         CS0199 report.
10418
10419 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10420
10421         C# 2.0 #pragma warning feature
10422
10423         * cs-tokenizer.cs (PreProcessPragma): New method; 
10424         Handles #pragma directive.
10425
10426         * report.cs (WarningRegions): New class; Support
10427         class for #pragma warning directive. It tests whether
10428         warning is enabled for a given line.
10429
10430 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
10431
10432         * const.cs: Add more descriptive error report, tahnks to
10433         Sebastien. 
10434
10435 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
10436
10437         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
10438
10439 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
10440
10441         * expression.cs: Apply patch from Ben: Remove dead code from
10442         ArrayCreation, and remove the TurnintoConstant call in const.cs,
10443         as that code just threw an exception anwyays.
10444
10445         * const.cs: Remove the call to the turnintoconstant, for details
10446         see bug: #63144
10447         
10448         * literal.cs: The type of the null-literal is the null type;  So
10449         we use a placeholder type (literal.cs:System.Null, defined here)
10450         for it.
10451
10452         * expression.cs (Conditional.DoResolve): Remove some old code that
10453         is no longer needed, conversions have been fixed.
10454
10455         (ArrayCreationExpression.DoResolve): Return false if we fail to
10456         resolve the inner expression.
10457
10458 2004-09-07  Raja R Harinath  <rharinath@novell.com>
10459
10460         Fix test-290.cs.
10461         * cs-parser.jay (delegate_declaration): Record a delegate
10462         declaration as a type declaration.
10463         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
10464
10465 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
10466
10467         * parameter.cs: Do not crash if the type can not be resolved. 
10468
10469         * expression.cs: Report errors with unsafe pointers, fixes #64896
10470
10471 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10472
10473         * expression.cs: Pointer arith always needs to do a conv.i
10474         if the operand is a long. fix 65320
10475
10476 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10477
10478         Fixed cs0619-37.cs, cs0619-38.cs
10479
10480         * enum.cs (GetObsoleteAttribute): Removed.
10481
10482         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
10483         on Enum member is double staged. The first is tested member
10484         and then enum.
10485
10486 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10487
10488         Fixed #56986, #63631, #65231
10489
10490         * class.cs: (TypeContainer.AddToMemberContainer): New method,
10491         adds member to name container.
10492         (TypeContainer.AddToTypeContainer): New method, adds type to
10493         name container.
10494         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
10495         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
10496         AddOperator): Simplified by reusing AddToMemberContainer.
10497         (TypeContainer.UserDefinedStaticConstructor): Changed to property
10498         instead of field.
10499         (Method.CheckForDuplications): Fixed implementation to test all
10500         possibilities.
10501         (MemberBase): Detection whether member is explicit interface
10502         implementation is now in constructor.
10503         (MemberBase.UpdateMemberName): Handles IndexerName.
10504         (Accessor): Changed to keep also location information.
10505         (AbstractPropertyEventMethod): Is derived from MemberCore.
10506         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
10507         will be emited or not.
10508         (PropertyBase.AreAccessorsDuplicateImplementation):
10509         Tests whether accessors are not in collision with some method.
10510         (Operator): Is derived from MethodCore to simplify common
10511         operations.
10512
10513         * decl.cs (Flags.TestMethodDuplication): Test for duplication
10514         must be performed.
10515         (DeclSpace.AddToContainer): Adds the member to defined_names
10516         table. It tests for duplications and enclosing name conflicts.
10517
10518         * enum.cs (EnumMember): Clean up to reuse the base structures
10519
10520 2004-09-03  Martin Baulig  <martin@ximian.com>
10521
10522         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
10523         into TypeContainer, to make partial classes work again.
10524
10525 2004-09-03  Martin Baulig  <martin@ximian.com>
10526
10527         * rootcontext.cs (RootContext.V2): Removed.
10528
10529 2004-03-23  Martin Baulig  <martin@ximian.com>
10530
10531         * expression.cs (Invocation.OverloadResolve): Added `bool
10532         may_fail' argument and use it instead of the Location.IsNull() hack.
10533
10534 2004-09-03  Martin Baulig  <martin@ximian.com>
10535
10536         Merged latest changes into gmcs.  Please keep this comment in
10537         here, it makes it easier for me to see what changed in MCS since
10538         the last time I merged.
10539
10540 2004-09-03  Raja R Harinath  <rharinath@novell.com>
10541
10542         Fix #61128.
10543         * expression.cs (BetterConversion): Don't allow either conversion 
10544         to be null.  Remove redundant implicit conversion test when 'q ==
10545         null' -- when this function is invoked, we already know that the
10546         implicit conversion exists.
10547         (BetterFunction): Assume that 'best' is non-null.  Remove
10548         redundant reimplementation of IsApplicable when 'best' is null.
10549         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
10550         number of arguments.
10551         (IsAncestralType): Extract from OverloadResolve.
10552         (OverloadResolve): Make robust to the MethodGroupExpr being
10553         unsorted.  Implement all the logic of Section 14.5.5.1, and
10554         support overloading of methods from multiple applicable types.
10555         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
10556
10557         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
10558         (RealError, Warning): Append type of report to related symbol.
10559
10560 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
10561
10562         * enum.cs: Fixed CLS-Compliance checks for enum members.
10563         Error tests cs3008-8.cs, cs3014-8.cs
10564
10565 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10566
10567         Fixed bug #62342, #63102
10568         * class.cs: ImplementIndexer uses member.IsExplicitImpl
10569         like ImplementMethod.
10570
10571 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10572
10573         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10574         Fixed bug #65170.
10575
10576 2004-09-02  Martin Baulig  <martin@ximian.com>
10577
10578         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
10579         TypeManager.GetArgumentTypes() rather than calling GetParameters()
10580         on the MethodBase.
10581
10582 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
10583
10584         C# 2.0 Static classes implemented
10585
10586         * class.cs (TypeContainer): instance_constructors,
10587         initialized_fields, initialized_static_fields,
10588         default_constructor, base_inteface_types are protected to be
10589         accessible from StaticClass.
10590         (TypeContainer.DefineDefaultConstructor): New virtual method
10591         for custom default constructor generating
10592         (StaticClass): New class to handle "Static classes" feature.
10593
10594         * cs-parser.jay: Handle static keyword on class like instance
10595         of StaticClass.
10596
10597         * driver.cs: Added "/langversion" command line switch with two
10598         options (iso-1, default).
10599
10600 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
10601
10602         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
10603
10604 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
10605
10606         * delegate.cs: Style.
10607
10608 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10609
10610         * delegate.cs: Add seperate instance expr field for miguel.
10611
10612 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10613
10614         * PointerArithmetic (Resolve): make sure we are not doing
10615         pointer arith on void*. Also, make sure we are resolved
10616         by not setting eclass until resolve.
10617
10618         All callers: Make sure that PointerArithmetic gets resolved.
10619
10620 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10621
10622         * ArrayCreation (LookupType): If the type does not resolve 
10623         to an array, give an error.
10624
10625 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
10626
10627         * statement.cs (Try.Resolve): Fixed bug #64222
10628
10629 2004-08-27  Martin Baulig  <martin@ximian.com>
10630
10631         * class.cs
10632         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10633         crash here.     
10634
10635 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10636
10637         * ecore.cs (Constantify): Get underlying type via
10638         System.Enum.GetUnderlyingType to avoid StackOverflow on the
10639         Windows in special cases.
10640
10641 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10642
10643         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10644         for obtaining also private methods.
10645         (GetRemoveMethod): Used GetRemoveMethod (true)
10646         for obtaining also private methods.
10647
10648 2004-08-24  Martin Baulig  <martin@ximian.com>
10649
10650         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10651         MethodAttributes.HideBySig for operators.
10652
10653 2004-08-23  Martin Baulig  <martin@ximian.com>
10654
10655         Back to the old error reporting system :-)
10656
10657         * report.cs (Message): Removed.
10658         (Report.MessageData, ErrorData, WarningData): Removed.
10659         (Report.Error, Warning): Back to the old system.
10660
10661 2004-08-23  Martin Baulig  <martin@ximian.com>
10662
10663         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10664
10665         * class.cs (TypeContainer.ParentContainer): New public virtual
10666         method; replaces the explicit interface implementation.
10667         (ClassPart.ParentContainer): Override.
10668
10669 2004-08-23  Martin Baulig  <martin@ximian.com>
10670
10671         * statement.cs (Switch): Added support for constant switches; see
10672         #59428 or test-285.cs.
10673
10674 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10675
10676         Fixed bug #62740.
10677         * statement.cs (GetEnumeratorFilter): Removed useless
10678         logic because C# specs is strict. GetEnumerator must be
10679         public.
10680
10681 2004-08-22  Martin Baulig  <martin@ximian.com>
10682
10683         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10684         a switch and may break, reset the barrier.  Fixes #59867.
10685
10686 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10687
10688         CLS-Compliance speed up (~5% for corlib)
10689
10690         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10691         New method. Tests container for CLS-Compliant names
10692
10693         * class.cs (TypeContainer.VerifyClsName): New method.
10694         Checks whether container name is CLS Compliant.
10695         (Constructor): Implements IMethodData.
10696
10697         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10698         low-case table for CLS Compliance test.
10699         (MemberCache.VerifyClsParameterConflict): New method.
10700         Checks method parameters for CS3006 error.
10701
10702         * enum.cs (EnumMember): Is derived from MemberCore.
10703         (Enum.VerifyClsName): Optimized for better performance.
10704
10705 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10706
10707         * report.cs: Renamed Error_T to Error and changed all
10708         references.
10709
10710 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10711
10712         * class.cs (TypeContainer.IndexerArrayList): New inner class
10713         container for indexers.
10714         (TypeContainer.DefaultIndexerName): New constant for default
10715         indexer name. Replaced all "Item" with this constant.
10716         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10717
10718         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10719         DefaultMemberAttribute constructor.
10720
10721 2004-08-05  Martin Baulig  <martin@ximian.com>
10722
10723         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10724         Fix bug #59429.
10725
10726 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10727
10728         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10729         multi platforms problem.
10730
10731         * compiler.csproj: Included shared files.
10732
10733 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10734
10735         Fix bug 60333, 55971 in the more general way
10736         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10737         Added arg_type argument for constant conversion.
10738         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10739
10740 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10741
10742         Fix bug #59760
10743         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10744         OperatorArrayList, MethodCoreArrayList for typecontainer
10745         containers. Changed class member types to these new types.
10746         (MethodArrayList.DefineMembers): Added test for CS0659.
10747
10748 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10749
10750         * cfold.cs: Synchronize the folding with the code in expression.cs
10751         Binary.DoNumericPromotions for uint operands.
10752
10753         * attribute.cs: Revert patch from Raja, it introduced a regression
10754         while building Blam-1.2.1 (hard to isolate a test case).
10755
10756 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10757
10758         Fix for #55382
10759         * class.cs:
10760         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10761         name collision.
10762         (MethodCore.parent_method): New member. The method we're overriding
10763         if this is an override method.
10764         (MethodCore.CheckBase): Moved from Method class and made common.
10765         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10766         private.
10767         (MethodCore.CheckForDuplications): New abstract method. For custom
10768         member duplication search in a container
10769         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10770         method and its return type.
10771         (Event.conflict_symbol): New member. Symbol with same name in the
10772         parent class.
10773
10774         * decl.cs:
10775         (MemberCache.FindMemberWithSameName): New method. The method
10776         is looking for conflict with inherited symbols.
10777
10778 2004-08-04  Martin Baulig  <martin@ximian.com>
10779
10780         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10781
10782         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10783
10784 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10785
10786         * report.cs (Message): New enum for better error, warning reference in
10787         the code.
10788         (MessageData): New inner abstract class. It generally handles printing of
10789         error and warning messages.
10790         Removed unused Error, Warning, Message methods.
10791
10792 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10793
10794         Fix for cs0592-8.cs test
10795         * attribute.cs
10796         (Attributable.ValidAttributeTargets): Made public.
10797         (Attribute.ExplicitTarget): New member for explicit target value.
10798         (Attribute.CheckTargets): Now we translate explicit attribute
10799         target to Target here.
10800
10801 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10802
10803         * ecore.cs (MethodGroupExpr): new IsBase property.
10804
10805         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10806
10807         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10808         rather than an instance expr.
10809
10810         (DelegateCreation.Emit): Use the method group rather than
10811         the instance expression. Also, if you have base.Foo as the
10812         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10813
10814         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10815
10816         (NewDelegate.DoResolve): Only check for the existance of Invoke
10817         if the method is going to be needed. Use MethodGroupExpr.
10818
10819         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10820
10821         * expression.cs: For pointer arith., make sure to use
10822         the size of the type, not the size of the pointer to
10823         the type.
10824
10825 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10826
10827         Fix for #60722
10828         * class.cs (Class): Added error CS0502 test.
10829
10830 2004-08-03  John Luke  <jluke@cfl.rr.com>
10831             Raja R Harinath  <rharinath@novell.com>
10832
10833         Fix for #60997.
10834         * attribute.cs (Attribute.complained_before): New flag.
10835         (Attribute.ResolveType, Attribute.Resolve),
10836         (Attribute.DefinePInvokeMethod): Set it.
10837         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10838         
10839 2004-08-03  Martin Baulig  <martin@ximian.com>
10840
10841         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10842         use a user-defined operator; we still need to do numeric
10843         promotions in case one argument is a builtin type and the other
10844         one has an implicit conversion to that type.  Fixes #62322.
10845
10846 2004-08-02  Martin Baulig  <martin@ximian.com>
10847
10848         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10849         (LocalInfo.IsThis): New public property.
10850         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10851
10852 2004-08-01  Martin Baulig  <martin@ximian.com>
10853
10854         * class.cs (TypeContainer.GetClassBases): Don't set the default
10855         here since we may get called from GetPartialBases().
10856         (TypeContainer.DefineType): If GetClassBases() didn't return a
10857         parent, use the default one.
10858
10859 2004-07-30  Duncan Mak  <duncan@ximian.com>
10860
10861         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10862
10863 2004-07-30  Martin Baulig  <martin@ximian.com>
10864
10865         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10866
10867         * class.cs (SourceMethod): New public class, derive from the
10868         symbol writer's ISourceMethod.
10869         (Method): Use the new symbol writer API.
10870
10871         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10872         as argument and use the new symbol writer.
10873
10874         * location.cs
10875         (SourceFile): Implement the symbol writer's ISourceFile.
10876         (Location.SymbolDocument): Removed.
10877         (Location.SourceFile): New public property.
10878
10879         * symbolwriter.cs: Use the new symbol writer API.
10880
10881 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10882
10883         * Makefile (install-local): Remove.  Functionality moved to
10884         executable.make.
10885
10886 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10887
10888         * Makefile: Install mcs.exe.config file together with mcs.exe.
10889         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10890         correct runtime version.
10891         
10892 2004-07-25  Martin Baulig  <martin@ximian.com>
10893
10894         * class.cs
10895         (TypeContainer.RegisterOrder): Removed, this was unused.
10896         (TypeContainer, interface_order): Removed.
10897         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10898         TypeContainer as argument since we can also be called with a
10899         `PartialContainer' for a partial class/struct/interface.
10900         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10901         of checking whether we're an `Interface' - we could be a
10902         `PartialContainer'.
10903         (PartialContainer.Register): Override; call
10904         AddClass()/AddStruct()/AddInterface() on our parent.
10905
10906         * cs-parser.jay (interface_member_declaration): Add things to the
10907         `current_container', not the `current_class'.
10908
10909         * rootcontext.cs (RegisterOrder): The overloaded version which
10910         takes an `Interface' was unused, removed.
10911
10912         * typemanager.cs (TypeManager.LookupInterface): Return a
10913         `TypeContainer', not an `Interface'.
10914         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10915         contain a `PartialContainer' for an interface, so check it's
10916         `Kind' to figure out what it is.
10917
10918 2004-07-25  Martin Baulig  <martin@ximian.com>
10919
10920         * class.cs (Class.DefaultTypeAttributes): New public constant.
10921         (Struct.DefaultTypeAttributes): Likewise.
10922         (Interface.DefaultTypeAttributes): Likewise.
10923         (PartialContainer.TypeAttr): Override this and add the
10924         DefaultTypeAttributes.
10925
10926 2004-07-25  Martin Baulig  <martin@ximian.com>
10927
10928         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10929         we can just use the `Parent' field instead.
10930
10931 2004-07-25  Martin Baulig  <martin@ximian.com>
10932
10933         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10934
10935 2004-07-25  Martin Baulig  <martin@ximian.com>
10936
10937         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10938         our parts before defining any methods.
10939         (TypeContainer.VerifyImplements): Make this virtual.
10940         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10941         on our PartialContainer.
10942
10943 2004-07-25  Martin Baulig  <martin@ximian.com>
10944
10945         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10946
10947         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10948         argument, we can just use the `Parent' field instead.
10949
10950         * class.cs
10951         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10952         (MemberBase.DoDefine): Likewise.
10953
10954 2004-07-24  Martin Baulig  <martin@ximian.com>
10955
10956         * decl.cs (MemberCore.Parent): New public field.
10957         (DeclSpace.Parent): Moved to MemberCore.
10958
10959         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10960         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10961         parent's .ctor.
10962         (FieldBase, Field, Operator): Likewise.
10963         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10964         (EventField, Event): Likewise.
10965
10966 2004-07-23  Martin Baulig  <martin@ximian.com>
10967
10968         * class.cs (PartialContainer): New public class.
10969         (ClassPart): New public class.
10970         (TypeContainer): Added support for partial classes.
10971         (TypeContainer.GetClassBases): Splitted some of the functionality
10972         out into GetNormalBases() and GetPartialBases().
10973
10974         * cs-tokenizer.cs (Token.PARTIAL): New token.
10975         (Tokenizer.consume_identifier): Added some hacks to recognize
10976         `partial', but only if it's immediately followed by `class',
10977         `struct' or `interface'.
10978
10979         * cs-parser.jay: Added support for partial clases.
10980
10981 2004-07-23  Martin Baulig  <martin@ximian.com>
10982
10983         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10984         a `DeclSpace' and also made it readonly.
10985         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10986         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10987         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10988
10989         * cs-parser.jay: Pass the `current_class', not the
10990         `current_container' (at the moment, this is still the same thing)
10991         to a new Method, Property, Event, Indexer or Constructor.
10992
10993 2004-07-23  Martin Baulig  <martin@ximian.com>
10994
10995         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10996         and removed the `current_interface' one.
10997         (struct_declaration, class_declaration, interface_declaration):
10998         Set `current_class' to the newly created class/struct/interface;
10999         set their `Bases' and call Register() before parsing their body.
11000
11001 2004-07-23  Martin Baulig  <martin@ximian.com>
11002
11003         * class.cs (Kind): New public enum.
11004         (TypeContainer): Made this class abstract.
11005         (TypeContainer.Kind): New public readonly field.
11006         (TypeContainer.CheckDef): New public method; moved here from
11007         cs-parser.jay.
11008         (TypeContainer.Register): New public abstract method.
11009         (TypeContainer.GetPendingImplementations): New public abstract
11010         method.
11011         (TypeContainer.GetClassBases): Removed the `is_class' and
11012         `is_iface' parameters.
11013         (TypeContainer.DefineNestedTypes): Formerly known as
11014         DoDefineType().
11015         (ClassOrStruct): Made this class abstract.
11016
11017         * tree.cs (RootTypes): New public type. 
11018
11019 2004-07-20  Martin Baulig  <martin@ximian.com>
11020
11021         * tree.cs (Tree.RecordNamespace): Removed.
11022         (Tree.Namespaces): Removed.
11023
11024         * rootcontext.cs (RootContext.IsNamespace): Removed.
11025
11026         * cs-parser.jay (namespace_declaration): Just create a new
11027         NamespaceEntry here.
11028
11029 2004-07-20  Martin Baulig  <martin@ximian.com>
11030
11031         * statement.cs (ExceptionStatement): New abstract class.  This is
11032         now used as a base class for everyone who's using `finally'.
11033         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
11034         our local variables before using them.
11035
11036         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
11037         virtual method.  This is used by Yield.Resolve() to "steal" an
11038         outer block's `finally' clauses.
11039         (FlowBranchingException): The .ctor now takes an ExceptionStatement
11040         argument.
11041
11042         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
11043         version which takes an ExceptionStatement.  This version must be
11044         used to create exception branchings.
11045
11046         * iterator.cs
11047         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
11048         (Iterator.EmitMoveNext): Added exception support; protect the
11049         block with a `fault' clause, properly handle 'finally' clauses.
11050         (Iterator.EmitDispose): Run all the `finally' clauses here.
11051
11052 2004-07-20  Martin Baulig  <martin@ximian.com>
11053
11054         * iterator.cs: This is the first of a set of changes in the
11055         iterator code.  Match the spec more closely: if we're an
11056         IEnumerable, then GetEnumerator() must be called.  The first time
11057         GetEnumerator() is called, it returns the current instance; all
11058         subsequent invocations (if any) must create a copy.
11059
11060 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
11061
11062         * expression.cs: Resolve the constant expression before returning
11063         it. 
11064
11065 2004-07-19  Martin Baulig  <martin@ximian.com>
11066
11067         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
11068         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
11069         the return type of the new EmitContext.
11070
11071 2004-07-18  Martin Baulig  <martin@ximian.com>
11072
11073         * class.cs (Property.Define): Fix iterators.
11074
11075         * iterators.cs (Iterator.Define): Moved the
11076         `container.AddInterator (this)' call here from the .ctor; only do
11077         it if we resolved successfully.
11078
11079 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
11080
11081         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
11082         `true' for preprocessing directives that we parse.  The return
11083         value indicates whether we should return to regular tokenizing or
11084         not, not whether it was parsed successfully.
11085
11086         In the past if we were in: #if false ... #line #endif, we would
11087         resume parsing after `#line'.  See bug 61604.
11088
11089         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
11090         building: IsEnumType should return true only for enums, not for
11091         enums or System.Enum itself.  This fixes #61593.
11092
11093         Likely what happened is that corlib was wrong: mcs depended on
11094         this bug in some places.  The bug got fixed, we had to add the
11095         hack, which caused bug 61593.
11096
11097         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
11098         that was a workaround for the older conditions.
11099
11100 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
11101
11102         * assign.cs: IAssignMethod has a new interface, as documented
11103         inline. All assignment code now uses this new api.
11104
11105         * ecore.cs, expression.cs: All classes which implement
11106         IAssignMethod now use the new interface.
11107
11108         * expression.cs (Invocation): add a hack to EmitCall so that
11109         IndexerAccess can be the target of a compound assignment without
11110         evaluating its arguments twice.
11111
11112         * statement.cs: Handle changes in Invocation api.
11113
11114 2004-07-16  Martin Baulig  <martin@ximian.com>
11115
11116         * iterators.cs: Rewrote this.  We're now using one single Proxy
11117         class for both the IEnumerable and the IEnumerator interface and
11118         `Iterator' derives from Class so we can use the high-level API.
11119
11120         * class.cs (TypeContainer.AddIterator): New method.
11121         (TypeContainer.DoDefineType): New protected virtual method, which
11122         is called from DefineType().
11123         (TypeContainer.DoDefineMembers): Call DefineType() and
11124         DefineMembers() on all our iterators.
11125         (TypeContainer.Emit): Call Emit() on all our iterators.
11126         (TypeContainer.CloseType): Call CloseType() on all our iterators.
11127
11128         * codegen.cs (EmitContext.CurrentIterator): New public field.
11129
11130 2004-07-15  Martin Baulig  <martin@ximian.com>
11131
11132         * typemanager.cs
11133         (TypeManager.not_supported_exception_type): New type.   
11134
11135 2004-07-14  Martin Baulig  <martin@ximian.com>
11136
11137         * iterators.cs: Use real error numbers.
11138
11139 2004-07-14  Martin Baulig  <martin@ximian.com>
11140
11141         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
11142         requires this to be a System.Collection.IEnumerable and not a
11143         class implementing that interface.
11144         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
11145
11146 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
11147
11148         * class.cs: Fixed previous fix, it broke some error tests.
11149
11150 2004-07-12  Martin Baulig  <martin@ximian.com>
11151
11152         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
11153         Fixes #61293.
11154
11155 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
11156
11157         * assign.cs (LocalTemporary): Add new argument: is_address,If
11158         `is_address' is true, then the value that we store is the address
11159         to the real value, and not the value itself.
11160         
11161         * ecore.cs (PropertyExpr): use the new local temporary
11162         stuff to allow us to handle X.Y += z (where X is a struct)
11163
11164 2004-07-08  Martin Baulig  <martin@ximian.com>
11165
11166         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
11167         not always return, just like we're doing in Using.Resolve().
11168
11169 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
11170
11171         * cs-parser.jay (fixed_statement): flag this as Pinned.
11172
11173 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
11174
11175         * typemanager.cs (TypeManager): Removed MakePinned method, this
11176         mechanism is replaced with the .NET 2.x compatible mechanism of
11177         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
11178
11179         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
11180         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
11181         `IsFixed' property which has a different meaning.
11182
11183 2004-07-02  Raja R Harinath  <rharinath@novell.com>
11184
11185         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
11186         visible from inside a nested class, not just the names of the
11187         immediately enclosing class.
11188         Fix for bug #60730.
11189
11190 2004-06-24  Raja R Harinath  <rharinath@novell.com>
11191
11192         * expression.cs (BetterConversion): Remove buggy special-case
11193         handling of "implicit constant expression conversions".  At this
11194         point, we already know that the conversion is possible -- we're
11195         only checking to see which is better.
11196
11197 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11198
11199         * cs-parser.jay: Added error CS0210 test.
11200
11201 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11202
11203         * cs-parser.jay: Added error CS0134 test.
11204
11205 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11206
11207         Fix bug #52507
11208         * cs-parser.jay: Added error CS0145 test.
11209
11210 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11211
11212         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
11213
11214 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
11215         
11216         * expression.cs (StackAlloc.Resolve): The argument may not
11217         be a constant; deal with this case.
11218         
11219 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
11220
11221         * attribute.cs (IndexerName_GetIndexerName): Renamed to
11222         GetIndexerAttributeValue.
11223         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
11224
11225         * class.cs (Indexer.Define): Added error tests for CS0415,
11226         CS0609.
11227
11228 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
11229
11230         * attribute.cs (Attribute.Resolve): Keep field code in sync with
11231         property code.
11232
11233 2004-06-23  Martin Baulig  <martin@ximian.com>
11234
11235         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
11236         neither return nor throw, reset the barrier as well.  Fixes #60457.
11237
11238 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
11239
11240         * class.cs : EventAttributes is now set to None by default.
11241           This fixes bug #60459.
11242
11243 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11244
11245         Fix bug #60219
11246         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11247         Don't throw exception but return null (it's sufficient now).
11248
11249 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11250
11251         * typemanager.cs (GetArgumentTypes): Faster implementation.
11252
11253 2004-06-18  Martin Baulig  <martin@ximian.com>
11254
11255         * attribute.cs (Attribute.Resolve): Check whether we're an
11256         EmptyCast which a Constant child.  Fixes #60333.
11257
11258 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
11259
11260         * statement.cs (EmitCollectionForeach): Account for the fact that
11261         not all valuetypes are in areas which we can take the address of.
11262         For these variables, we store to a temporary variable. Also, make
11263         sure that we dont emit a `callvirt' on a valuetype method.
11264
11265 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11266
11267         * expression.cs (StackAlloc.DoReSolve): Added test for
11268         negative parameter (CS0247).
11269
11270 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11271
11272         Fix bug #59792
11273         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
11274
11275 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11276
11277         Fix bug #59781
11278         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
11279         ulong.
11280
11281 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11282
11283         Fix bug #58254 & cs1555.cs, cs1556.cs
11284         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
11285
11286 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11287
11288         * cs-parser.jay: Added error CS1669 test for indexers.
11289
11290 2004-06-11  Martin Baulig  <martin@ximian.com>
11291
11292         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
11293         call this twice: for params and varargs methods.
11294
11295 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11296
11297         * class.cs:
11298         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
11299
11300 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11301
11302         * attribute.cs (Attribute.GetValidTargets): Made public.
11303
11304         * class.cs: 
11305         (AbstractPropertyEventMethod): New class for better code sharing.
11306         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
11307         CS1667 report.
11308         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
11309
11310 2004-06-11  Raja R Harinath  <rharinath@novell.com>
11311
11312         Fix bug #59477.
11313         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
11314         that the call to Resolve is part of a MemberAccess.
11315         (Expression.Resolve): Use it for SimpleName resolution.
11316         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
11317         Add 'intermediate' boolean argument.
11318         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
11319         error message when the SimpleName can be resolved ambiguously
11320         between an expression and a type.
11321         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
11322         public.
11323         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
11324         call on the left-side.
11325
11326 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11327
11328         * class.cs:
11329         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
11330
11331 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11332
11333         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
11334
11335 2004-06-11  Martin Baulig  <martin@ximian.com>
11336
11337         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
11338         varargs methods if applicable.
11339
11340 2004-06-11  Martin Baulig  <martin@ximian.com>
11341
11342         * expression.cs (Invocation.EmitCall): Don't use
11343         `method.CallingConvention == CallingConventions.VarArgs' since the
11344         method could also have `CallingConventions.HasThis'.
11345
11346 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11347
11348         * class.cs (Event.GetSignatureForError): Implemented.
11349         Fixed crash in error test cs3010.cs
11350
11351 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
11352
11353         * cs-tokenizer.cs: Change the way we track __arglist to be
11354         consistent with the other keywords.
11355
11356 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
11357
11358         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
11359         tomorrow.
11360
11361 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
11362
11363         * codegen.cs: Check that all referenced assemblies have a strongname
11364         before strongnaming the compiled assembly. If not report error CS1577.
11365         Fix bug #56563. Patch by Jackson Harper.
11366         * typemanager.cs: Added a method to return all referenced assemblies.
11367         Fix bug #56563. Patch by Jackson Harper.
11368
11369 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11370
11371         * class.cs:
11372         (Method.ApplyAttributeBuilder): Moved and added conditional
11373         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
11374
11375         * delegate.cs:
11376         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
11377
11378 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11379
11380         Fixed #59640
11381         * class.cs: (EventField.attribute_targets): Changed default target.
11382
11383 2004-06-08  Martin Baulig  <martin@ximian.com>
11384
11385         * expression.cs (Invocation.EmitCall): Enable varargs methods.
11386
11387 2004-06-08  Martin Baulig  <martin@ximian.com>
11388
11389         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
11390
11391 2004-06-07  Martin Baulig  <martin@ximian.com>
11392
11393         Added support for varargs methods.
11394
11395         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
11396         keyword.
11397
11398         * cs-parser.jay: Added support for `__arglist'.
11399
11400         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
11401
11402         * expression.cs (Argument.AType): Added `ArgList'.
11403         (Invocation): Added support for varargs methods.
11404         (ArglistAccess): New public class.
11405         (Arglist): New public class.
11406
11407         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
11408
11409         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
11410         a method's top-level block if the method has varargs.
11411
11412         * support.cs (ReflectionParameters, InternalParameters): Added
11413         support for varargs methods.    
11414
11415 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
11416
11417         * class.cs: Provide location in indexer error report.
11418
11419         * driver.cs: Use standard names.
11420
11421         * namespace.cs: Catch the use of using after a namespace has been
11422         declared also on using aliases.
11423
11424 2004-06-03  Raja R Harinath  <rharinath@novell.com>
11425
11426         Bug #50820.
11427         * typemanager.cs (closure_private_ok, closure_invocation_type)
11428         (closure_qualifier_type, closure_invocation_assembly)
11429         (FilterWithClosure): Move to ...
11430         (Closure): New internal nested class.
11431         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
11432         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
11433         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
11434         (MemberLookup, MemberLookupFailed): Use it.
11435         * expression.cs (New.DoResolve): Treat the lookup for the
11436         constructor as being qualified by the 'new'ed type.
11437         (Indexers.GetIndexersForTypeOrInterface): Update.
11438
11439 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
11440
11441         * attribute.cs
11442         (GetConditionalAttributeValue): New method. Returns
11443         condition of ConditionalAttribute.
11444         (SearchMulti): New method.  Returns all attributes of type 't'.
11445         Use it when attribute is AllowMultiple = true.
11446         (IsConditionalMethodExcluded): New method.
11447
11448         * class.cs
11449         (Method.IsExcluded): Implemented. Returns true if method has conditional
11450         attribute and the conditions is not defined (method is excluded).
11451         (IMethodData): Extended interface for ConditionalAttribute support.
11452         (PropertyMethod.IsExcluded): Implemented.
11453
11454         * decl.cs
11455         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
11456
11457         * expression.cs
11458         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
11459         on the method.
11460
11461 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11462
11463         * expression.cs (ArrayCreationExpression): Make this just an
11464         `expression'. It can't be a statement, so the code here was
11465         dead.
11466
11467 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11468
11469         Fixed #59072
11470         * typemanager.cs (GetFullNameSignature): New method for
11471         MethodBase types.
11472
11473 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11474
11475         Fixed #56452
11476         * class.cs (MemberBase.GetSignatureForError): New virtual method.
11477         Use this method when MethodBuilder is null.
11478         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
11479         Added test for error CS0626 (MONO reports error for this situation).
11480         (IMethodData.GetSignatureForError): Extended interface.
11481
11482 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11483
11484         * attribute.cs
11485         (AttributeTester.GetObsoleteAttribute): Returns instance of
11486         ObsoleteAttribute when type is obsolete.
11487
11488         * class.cs
11489         (TypeContainer.VerifyObsoleteAttribute): Override.
11490         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
11491         (MethodCode.VerifyObsoleteAttribute): Override.
11492         (MemberBase.VerifyObsoleteAttribute): Override.
11493
11494         * decl.cs
11495         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
11496         and report proper error.
11497
11498         *delegate.cs
11499         Delegate.VerifyObsoleteAttribute): Override.
11500
11501         * ecore.cs
11502         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
11503         and report proper error.
11504         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
11505
11506         * enum.cs
11507         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
11508         and enum member.
11509
11510         * expression.cs
11511         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
11512         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
11513         Added test for ObsoleteAttribute.
11514
11515         * statement.cs
11516         (Catch): Derived from Statement.
11517
11518 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11519  
11520         Fixed bug #59071 & cs0160.cs
11521  
11522         * statement.cs (Try.Resolve): Check here whether order of catch
11523         clauses matches their dependencies.
11524
11525 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
11526
11527         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
11528         caused a regression: #59343.  Referencing nested classes from an
11529         assembly stopped working.
11530
11531 2004-05-31  Martin Baulig  <martin@ximian.com>
11532
11533         MCS is now frozen for beta 2.
11534
11535 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11536
11537         * convert.cs: add a trivial cache for overload operator resolution.
11538
11539 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11540
11541         * decl.cs: If possible, use lookuptypedirect here. We can only do
11542         this if there is no `.' after the namespace. Avoids using
11543         LookupType, which does lots of slow processing.
11544         (FindNestedType) New method, does what it says :-).
11545         * namespace.cs: use LookupTypeDirect.
11546         * rootcontext.cs: use membercache, if possible.
11547         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
11548
11549 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11550
11551         * expression.cs:
11552         According to the spec, 
11553
11554         In a member access of the form E.I, if E is a single identifier,
11555         and if the meaning of E as a simple-name (§7.5.2) is a constant,
11556         field, property, localvariable, or parameter with the same type as
11557         the meaning of E as a type-name (§3.8), then both possible
11558         meanings of E are permitted.
11559
11560         We did not check that E as a simple-name had the same type as E as
11561         a type name.
11562
11563         This trivial check gives us 5-7% on bootstrap time.
11564
11565 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11566
11567         * expression.cs (Invocation.OverloadResolve): Avoid the
11568         use of hashtables and boxing here by allocating on demand.
11569
11570 2004-05-30  Martin Baulig  <martin@ximian.com>
11571
11572         * rootcontext.cs (RootContext.LookupType): Don't cache things if
11573         we're doing a silent lookup.  Don't try to lookup nested types in
11574         TypeManager.object_type (thanks to Ben Maurer).
11575
11576 2004-05-30  Martin Baulig  <martin@ximian.com>
11577
11578         Committing a patch from Ben Maurer.
11579
11580         * rootcontext.cs (RootContext.LookupType): Cache negative results.
11581
11582 2004-05-29  Martin Baulig  <martin@ximian.com>
11583
11584         * class.cs (IMethodData.ShouldIgnore): New method.
11585
11586         * typemanager.cs (TypeManager.MethodFlags): Don't take a
11587         `Location' argument, we don't need it anywhere.  Use
11588         `IMethodData.ShouldIgnore ()' instead of
11589         `MethodData.GetMethodFlags ()'.
11590         (TypeManager.AddMethod): Removed.
11591         (TypeManager.AddMethod2): Renamed to AddMethod.
11592
11593 2004-05-29  Martin Baulig  <martin@ximian.com>
11594
11595         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
11596
11597         * convert.cs (Convert.ImplicitReferenceConversion): If we're
11598         converting from a class type S to an interface type and we already
11599         have an object on the stack, don't box it again.  Fixes #52578.
11600
11601 2004-05-29  Martin Baulig  <martin@ximian.com>
11602
11603         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11604         Added support for `params' parameters.  Fixes #59267.
11605
11606 2004-05-29  Martin Baulig  <martin@ximian.com>
11607
11608         * literal.cs (NullPointer): Provide a private .ctor which sets
11609         `type' to TypeManager.object_type.  Fixes #59048.
11610
11611 2004-05-29  Martin Baulig  <martin@ximian.com>
11612
11613         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11614         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
11615
11616         * ecore.cs (EventExpr.instance_expr): Make the field private.
11617
11618 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
11619
11620         Fixed bug #50080 & cs0214-2.cs
11621         * expression.cs (Cast.DoResolve): Check unsafe context here.
11622         
11623         * statement.cs (Resolve.DoResolve): Likewise.
11624
11625 2004-05-26  Martin Baulig  <martin@ximian.com>
11626
11627         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11628
11629         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11630         (RootContext.LookupType): Pass down the `silent' flag.
11631
11632 2004-05-25  Martin Baulig  <martin@ximian.com>
11633
11634         * expression.cs
11635         (MethodGroupExpr.IdenticalTypeName): New public property.
11636         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11637         expression actually refers to a type.
11638
11639 2004-05-25  Martin Baulig  <martin@ximian.com>
11640
11641         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11642         for #56176 and made it actually work.
11643
11644 2004-05-25  Martin Baulig  <martin@ximian.com>
11645
11646         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11647         (FieldExpr, PropertyExpr): Override and implement
11648         CacheTemporaries.  Fixes #52279.
11649
11650 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
11651
11652         * location.cs: In the new compiler listing a file twice is a
11653         warning, not an error.
11654
11655 2004-05-24  Martin Baulig  <martin@ximian.com>
11656
11657         * enum.cs (Enum.DefineType): For the `BaseType' to be a
11658         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
11659
11660 2004-05-24  Martin Baulig  <martin@ximian.com>
11661
11662         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11663         walking the `using' list.  Fixes #53921.
11664
11665 2004-05-24  Martin Baulig  <martin@ximian.com>
11666
11667         * const.cs (Const.LookupConstantValue): Added support for
11668         EmptyCast's; fixes #55251.
11669
11670 2004-05-24  Martin Baulig  <martin@ximian.com>
11671
11672         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11673         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11674         which does the CS0135 check.  The reason is that we first need to
11675         check whether the variable actually exists.
11676
11677 2004-05-24  Martin Baulig  <martin@ximian.com>
11678
11679         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11680         than RootContext.LookupType() to find the explicit interface
11681         type.  Fixes #58584.
11682
11683 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11684
11685         * Makefile: Simplify.  Use executable.make.
11686         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11687
11688 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11689
11690         * decl.cs:
11691         * enum.cs:
11692         Use the invariant culture when doing String.Compare for CLS case
11693         sensitivity.
11694         
11695 2004-05-23  Martin Baulig  <martin@ximian.com>
11696
11697         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11698         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11699
11700         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11701         
11702 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11703
11704         * class.cs (MemberBase.Define): Reuse MemberType member for 
11705         resolved type. Other methods can use it too.
11706
11707 2004-05-23  Martin Baulig  <martin@ximian.com>
11708
11709         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11710         the variable also exists in the current block (otherwise, we need
11711         to report a CS0103).  Fixes #58670.
11712
11713 2004-05-23  Martin Baulig  <martin@ximian.com>
11714
11715         * flowanalysis.cs (Reachability.Reachable): Compute this
11716         on-the-fly rather than storing it as a field.
11717
11718 2004-05-23  Martin Baulig  <martin@ximian.com>
11719
11720         * flowanalysis.cs (Reachability.And): Manually compute the
11721         resulting `barrier' from the reachability.      
11722        
11723 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11724
11725         Fix bug #57835
11726         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11727         instance of ObsoleteAttribute when symbol is obsolete.
11728
11729         * class.cs
11730         (IMethodData): Extended interface for ObsoleteAttribute support.
11731
11732 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11733
11734         * attribute.cs: Fix bug #55970
11735
11736 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11737
11738         Fix bug #52705
11739         * attribute.cs
11740         (GetObsoleteAttribute): New method. Creates the instance of
11741         ObsoleteAttribute.
11742         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11743         ObsoleteAttribute when member is obsolete.
11744         (AttributeTester.Report_ObsoleteMessage): Common method for
11745         Obsolete error/warning reporting.
11746
11747         * class.cs
11748         (TypeContainer.base_classs_type): New member for storing parent type.
11749
11750         * decl.cs
11751         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11752         for this MemberCore.
11753
11754 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11755
11756         * attribute.cs, const.cs: Fix bug #58590
11757
11758 2004-05-21  Martin Baulig  <martin@ximian.com>
11759
11760         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11761         out parameters if the end of the method is unreachable.  Fixes
11762         #58098. 
11763
11764 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11765
11766         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11767         Hari was right, why extra method.
11768
11769 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11770
11771         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11772
11773 2004-05-20  Martin Baulig  <martin@ximian.com>
11774
11775         Merged this back from gmcs to keep the differences to a minumum.
11776
11777         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11778         instead of a Declspace.
11779         (Attribute.ResolveType): Likewise.
11780         (Attributes.Search): Likewise.
11781         (Attributes.Contains): Likewise.
11782         (Attributes.GetClsCompliantAttribute): Likewise.
11783
11784         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11785         argument.
11786         (MethodData.ApplyAttributes): Take an EmitContext instead of a
11787         DeclSpace.
11788
11789 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11790
11791         Fix bug #58688 (MCS does not report error when the same attribute
11792         is assigned twice)
11793
11794         * attribute.cs (Attribute.Emit): Distinction between null and default.
11795
11796 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11797
11798         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11799         of a top-level attribute without an attribute target.
11800         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11801         Make non-static.
11802         (Attribute.Conditional_GetConditionName), 
11803         (Attribute.Obsolete_GetObsoleteMessage): Update.
11804         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11805         part of ScanForIndexerName.
11806         (Attribute.CanIgnoreInvalidAttribute): New function.
11807         (Attribute.ScanForIndexerName): Move to ...
11808         (Attributes.ScanForIndexerName): ... here.
11809         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11810         (Attributes.Search): New internal variant that can choose not to
11811         complain if types aren't resolved.  The original signature now
11812         complains.
11813         (Attributes.GetClsCompliantAttribute): Use internal variant, with
11814         complaints suppressed.
11815         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11816         only if it not useful.
11817         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11818         top-level for attributes that are shared between the assembly
11819         and a top-level class.
11820         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11821         * class.cs: Update to reflect changes.
11822         (DefineIndexers): Fuse loops.
11823         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11824         a couple more variants of attribute names.
11825
11826 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11827
11828         Fix bug #52585 (Implemented explicit attribute declaration)
11829
11830         * attribute.cs:
11831         (Attributable.ValidAttributeTargets): New abstract method. It gets
11832         list of valid attribute targets for explicit target declaration.
11833         (Attribute.Target): It holds target itself.
11834         (AttributeSection): Removed.
11835         (Attribute.CheckTargets): New method. It checks whether attribute
11836         target is valid for the current element.
11837
11838         * class.cs:
11839         (EventProperty): New class. For events that are declared like
11840         property (with add and remove accessors).
11841         (EventField): New class. For events that are declared like field.
11842         class.cs
11843
11844         * cs-parser.jay: Implemented explicit attribute target declaration.
11845
11846         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11847         Override ValidAttributeTargets.
11848
11849         * parameter.cs:
11850         (ReturnParameter): Class for applying custom attributes on 
11851         the return type.
11852         (ParameterAtribute): New class. Class for applying custom
11853         attributes on the parameter type.
11854
11855 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11856
11857         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11858         definitions. 
11859
11860         (Method): Allow UNSAFE here.
11861
11862         * modifiers.cs: Support unsafe reporting.
11863
11864 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11865
11866         * decl.cs: Fix bug #58478.
11867
11868 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11869
11870         * statement.cs: When checking for unreachable code on an EmptyStatement,
11871         set the location. Fixes bug #58488.
11872
11873 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11874
11875         * driver.cs: Add -pkg handling.
11876
11877         From Gonzalo: UseShelLExecute=false
11878
11879 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11880
11881         * attribute.cs:
11882         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11883         for attribute.
11884         (Attribute.IsClsCompliaceRequired): Moved to base for better
11885         accesibility.
11886         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11887         when attribute is AttributeUsageAttribute.
11888         (Attribute.GetValidTargets): Simplified.
11889         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11890         attribute for this type.
11891         (Attribute.ApplyAttributes): Method renamed to Emit and make
11892         non-static.
11893         (GlobalAttributeSection): New class for special handling of global
11894         attributes (assembly, module).
11895         (AttributeSection.Emit): New method.
11896
11897         * class.cs: Implemented Attributable abstract methods.
11898         (MethodCore.LabelParameters): Moved to Parameter class.
11899         (Accessor): Is back simple class.
11900         (PropertyMethod): Implemented Attributable abstract class.
11901         (DelegateMethod): Implemented Attributable abstract class.
11902         (Event): New constructor for disctintion between normal Event
11903         and Event with accessors.
11904
11905         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11906
11907         * codegen.cs, const.cs, decl.cs, delegate.cs:
11908         (CommonAssemblyModulClass): Implemented Attributable abstract class
11909         and simplified.
11910
11911         * enum.cs: Implement IAttributeSupport interface.
11912         (EnumMember): New class for emum members. Implemented Attributable
11913         abstract class
11914
11915         * parameter.cs:
11916         (ParameterBase): Is abstract.
11917         (ReturnParameter): New class for easier [return:] attribute handling.
11918
11919         * typemanager.cs: Removed builder_to_attr.
11920
11921 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11922
11923         Fix bug #57151.
11924         * attribute.cs (Attribute.GetPositionalValue): New function.
11925         * class.cs (TypeContainer.VerifyMembers): New function.
11926         (TypeContainer.Emit): Use it.
11927         (ClassOrStruct): New base class for Class and Struct.
11928         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11929         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11930         class.
11931         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11932         then each non-static field should have a FieldOffset attribute.
11933         Otherwise, none of the fields should have a FieldOffset attribute.
11934         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11935         and FieldOffset attributes.
11936         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11937         (TypeManager.field_offset_attribute_type): New core types.
11938         (TypeManager.InitCoreTypes): Initialize them.
11939
11940 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11941
11942         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11943         Return correct type.
11944         From bug #58270.
11945
11946 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11947
11948         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11949         be implicitly converted to ulong.
11950         
11951         * expression.cs: The logic for allowing operator &, | and ^ worked
11952         was wrong, it worked before because we did not report an error in
11953         an else branch.  Fixes 57895.
11954
11955         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11956         allow volatile fields to be reference types.
11957
11958 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11959
11960         * driver.cs: Add support for /debug-
11961
11962 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11963
11964         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11965         Add a 'complain' parameter to silence errors.
11966         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11967         silently overlooked type-resolutions.
11968         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11969         to reflect changes.
11970         (Attributes.Search): New function.
11971         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11972         (Attributes.GetAttributeFullName): Remove hack.
11973         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11974         Update to reflect changes.
11975         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11976         Use Attributes.Search instead of nested loops.
11977
11978 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11979
11980         * decl.cs:
11981         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11982         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11983         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11984
11985         * report.cs: (Report.Warning): Renamed to Warning_T because of
11986         parameter collision.
11987
11988 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11989
11990         * expression.cs (MemberAccess.ResolveMemberAccess):
11991         Exit with non-zero status after Report.Error.
11992         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11993         Likewise.
11994         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11995
11996 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11997
11998         * support.cs: Don't hang when the file is empty.
11999
12000 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
12001
12002         * support.cs: In SeekableStreamReader, compute the preamble size of the
12003           underlying stream. Position changes should take into account that initial
12004           count of bytes.
12005
12006 2004-05-03  Todd Berman  <tberman@sevenl.net>
12007
12008         * driver.cs: remove unused GetSysVersion function.
12009
12010 2004-05-03  Todd Berman  <tberman@sevenl.net>
12011
12012         * driver.cs: Remove the hack from saturday, as well as the hack
12013         from jackson (LoadAssemblyFromGac), also adds the CWD to the
12014         link_paths to get that bit proper.
12015
12016 2004-05-01  Todd Berman  <tberman@sevenl.net>
12017
12018         * driver.cs: Try a LoadFrom before a Load, this checks the current
12019         path. This is currently a bug in mono that is be fixed, however, this
12020         provides a workaround for now. This will be removed when the bug
12021         is fixed.
12022
12023 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
12024
12025         * CryptoConvert.cs: Updated to latest version. Fix issue with 
12026         incomplete key pairs (#57941).
12027
12028 2004-05-01  Todd Berman  <tberman@sevenl.net>
12029
12030         * driver.cs: Remove '.' from path_chars, now System.* loads properly
12031         from the GAC
12032
12033 2004-04-30  Jackson Harper  <jackson@ximian.com>
12034
12035         * codegen.cs: Open keys readonly.
12036         
12037 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12038
12039         * typemanager.cs: don't report cyclic struct layout when a struct
12040         contains 2 or more fields of the same type. Failed for Pango.AttrShape
12041         which has 2 Pango.Rectangle fields.
12042
12043 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12044
12045         * expression.cs: Handle IntPtr comparisons with IL code
12046         rather than a method call.
12047
12048 2004-04-29  Martin Baulig  <martin@ximian.com>
12049
12050         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
12051         the list of PropertyInfo's in class hierarchy and find the
12052         accessor.  Fixes #56013.
12053
12054 2004-04-29  Martin Baulig  <martin@ximian.com>
12055
12056         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
12057
12058 2004-04-29  Martin Baulig  <martin@ximian.com>
12059
12060         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12061
12062         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
12063
12064 2004-04-29  Martin Baulig  <martin@ximian.com>
12065
12066         * class.cs (ConstructorInitializer.Resolve): Check whether the
12067         parent .ctor is accessible.  Fixes #52146.
12068
12069 2004-04-29  Martin Baulig  <martin@ximian.com>
12070
12071         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12072
12073         * statement.cs (Using.EmitLocalVariableDecls): Use
12074         TypeManager.idisposable_type, not typeof (IDisposable).
12075         (Foreach.EmitCollectionForeach): Added support for valuetypes.
12076
12077 2004-04-29  Martin Baulig  <martin@ximian.com>
12078
12079         * class.cs (Event.Define): Don't emit the field and don't set
12080         RTSpecialName and SpecialName for events on interfaces.  Fixes
12081         #57703. 
12082
12083 2004-04-29  Raja R Harinath  <rharinath@novell.com>
12084
12085         Refactor Attribute.ApplyAttributes.
12086         * attribute.cs (Attributable): New base class for objects that can
12087         have Attributes applied on them.
12088         (Attribute): Make AttributeUsage fields public.
12089         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
12090         (Attribute.IsInternalCall): New property.
12091         (Attribute.UsageAttr): Convert to a public read-only property.
12092         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
12093         (Attribute.ResolveType, Attribute.Resolve)
12094         (Attribute.ScanForIndexerName): Update to reflect changes.
12095         (Attribute.CheckAttributeTarget): Re-format.
12096         (Attribute.ApplyAttributes): Refactor, to various
12097         Attributable.ApplyAttributeBuilder methods.
12098         * decl.cs (MemberCore): Make Attributable.
12099         * class.cs (Accessor): Make Attributable.
12100         (MethodData.ApplyAttributes): Use proper attribute types, not
12101         attribute names.
12102         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
12103         (TypeContainer.ApplyAttributeBuilder)
12104         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
12105         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
12106         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
12107         (Operator.ApplyAttributeBuilder): New factored-out methods.
12108         * const.cs (Const.ApplyAttributeBuilder): Likewise.
12109         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
12110         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
12111         * parameter.cs (ParameterBase): New Attributable base class
12112         that can also represent Return types.
12113         (Parameter): Update to the changes.
12114
12115 2004-04-29  Jackson Harper  <jackson@ximian.com>
12116
12117         * driver.cs: Prefer the corlib system version when looking for
12118         assemblies in the GAC. This is still a hack, but its a better hack
12119         now.
12120         
12121 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
12122
12123         * decl.cs, enum.cs: Improved error 3005 reporting.
12124   
12125         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
12126         (related_symbols): New private member for list of symbols
12127         related to reported error/warning.
12128         
12129         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
12130
12131 2004-04-29  Martin Baulig  <martin@ximian.com>
12132
12133         * ecore.cs (Expression.Constantify): If we're an enum and
12134         TypeManager.TypeToCoreType() doesn't give us another type, use
12135         t.UnderlyingSystemType.  Fixes #56178.  
12136
12137 2004-04-29  Martin Baulig  <martin@ximian.com>
12138
12139         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
12140         interfaces and for each interface, only add members directly
12141         declared in that interface.  Fixes #53255.
12142
12143 2004-04-28  Martin Baulig  <martin@ximian.com>
12144
12145         * expression.cs (ConditionalLogicalOperator): Use a temporary
12146         variable for `left' to avoid that we evaluate it more than once;
12147         bug #52588.
12148
12149 2004-04-28  Martin Baulig  <martin@ximian.com>
12150
12151         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
12152         `void[]' (CS1547).
12153
12154 2004-04-28  Martin Baulig  <martin@ximian.com>
12155
12156         * statement.cs (LocalInfo.Resolve): Check whether the type is not
12157         void (CS1547).
12158
12159         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
12160         whether the type is not void (CS1547).
12161
12162 2004-04-28  Martin Baulig  <martin@ximian.com>
12163
12164         * expression.cs (Unary.DoResolveLValue): Override this and report
12165         CS0131 for anything but Operator.Indirection.
12166
12167 2004-04-28  Martin Baulig  <martin@ximian.com>
12168
12169         Committing a patch from Ben Maurer; see bug #50820.
12170
12171         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12172         check for classes.
12173
12174         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12175         classes.        
12176
12177 2004-04-28  Martin Baulig  <martin@ximian.com>
12178
12179         Committing a patch from Ben Maurer; see bug #50820.
12180
12181         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12182         check for classes.
12183
12184         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12185         classes.        
12186
12187 2004-04-28  Martin Baulig  <martin@ximian.com>
12188
12189         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
12190         (Block.AddLabel): Call DoLookupLabel() to only search in the
12191         current block.
12192
12193 2004-04-28  Martin Baulig  <martin@ximian.com>
12194
12195         * cfold.cs (ConstantFold.BinaryFold): Added special support for
12196         comparing StringConstants and NullLiterals in Equality and Inequality.
12197
12198 2004-04-28  Jackson Harper  <jackson@ximian.com>
12199
12200         * driver.cs: Attempt to load referenced assemblies from the
12201         GAC. This is the quick and dirty version of this method that
12202         doesnt take into account versions and just takes the first
12203         canidate found. Will be good enough for now as we will not have more
12204         then one version installed into the GAC until I update this method.
12205
12206 2004-04-28  Martin Baulig  <martin@ximian.com>
12207
12208         * typemanager.cs (TypeManager.CheckStructCycles): New public
12209         static method to check for cycles in the struct layout.
12210
12211         * rootcontext.cs (RootContext.PopulateTypes): Call
12212         TypeManager.CheckStructCycles() for each TypeContainer.
12213         [Note: We only need to visit each type once.]
12214
12215 2004-04-28  Martin Baulig  <martin@ximian.com>
12216
12217         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
12218
12219         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
12220         success and added `out object value'.  Use a `bool resolved' field
12221         to check whether we've already been called rather than
12222         `ConstantValue != null' since this breaks for NullLiterals.
12223
12224 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12225
12226         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
12227         setting of this flag, since the 'set' method may be non-public.
12228
12229 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12230
12231         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
12232         check on current_vector.Block.
12233
12234 2004-04-27  Martin Baulig  <martin@ximian.com>
12235
12236         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
12237         a field initializer.  Fixes #56459.
12238
12239 2004-04-27  Martin Baulig  <martin@ximian.com>
12240
12241         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
12242         we're not attempting to use an indexer.  Fixes #52154.
12243
12244 2004-04-27  Martin Baulig  <martin@ximian.com>
12245
12246         * statement.cs (Return): Don't create a return label if we don't
12247         need it; reverts my change from January 20th.  Thanks to Ben
12248         Maurer for this.
12249
12250 2004-04-27  Martin Baulig  <martin@ximian.com>
12251
12252         According to the spec, `goto' can only leave a nested scope, but
12253         never enter it.
12254
12255         * statement.cs (Block.LookupLabel): Only lookup in the current
12256         block, don't recurse into parent or child blocks.
12257         (Block.AddLabel): Check in parent and child blocks, report
12258         CS0140/CS0158 if we find a duplicate.
12259         (Block): Removed this indexer for label lookups.
12260         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
12261         this already does the error reporting for us.
12262
12263         * flowanalysis.cs
12264         (FlowBranching.UsageVector.Block): New public variable; may be null.
12265         (FlowBranching.CreateSibling): Added `Block' argument.
12266         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
12267         label for the target of a `goto' and check whether we're not
12268         leaving a `finally'.
12269
12270 2004-04-27  Martin Baulig  <martin@ximian.com>
12271
12272         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12273         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
12274         just for returns).
12275
12276 2004-04-27  Martin Baulig  <martin@ximian.com>
12277
12278         * statement.cs (Block.AddLabel): Also check for implicit blocks
12279         and added a CS0158 check.
12280
12281 2004-04-27  Martin Baulig  <martin@ximian.com>
12282
12283         * flowanalysis.cs (FlowBranchingLoop): New class.
12284         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
12285         UsageVector's instead of an ArrayList.
12286         (FlowBranching.Label): Likewise.
12287         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
12288         (FlowBranching.AddBreakVector): New method.
12289
12290 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
12291
12292         * attribute.cs: Small regression fix: only convert the type if we
12293         the type is different, fixes System.Drawing build.
12294
12295 2004-04-27  Martin Baulig  <martin@ximian.com>
12296
12297         * attribute.cs (Attribute.Resolve): If we have a constant value
12298         for a named field or property, implicity convert it to the correct
12299         type.
12300
12301 2004-04-27  Raja R Harinath  <rharinath@novell.com>
12302
12303         * statement.cs (Block.Block): Implicit blocks share
12304         'child_variable_names' fields with parent blocks.
12305         (Block.AddChildVariableNames): Remove.
12306         (Block.AddVariable): Mark variable as "used by a child block" in
12307         every surrounding block.
12308         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
12309         been used in a child block, complain about violation of "Invariant
12310         meaning in blocks" rule.
12311         * cs-parser.jay (declare_local_variables): Don't use
12312         AddChildVariableNames.
12313         (foreach_statement): Don't create an implicit block: 'foreach'
12314         introduces a scope.
12315
12316 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
12317
12318         * convert.cs (ImplicitNumericConversion): 0 is also positive when
12319         converting from 0L to ulong.  Fixes 57522.
12320
12321 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12322
12323         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
12324         derived class hides via 'new' keyword field from base class (test-242.cs).
12325         TODO: Handle this in the more general way.
12326         
12327         * class.cs (CheckBase): Ditto.
12328
12329 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12330
12331         * decl.cs (caching_flags): New member for storing cached values
12332         as bit flags.
12333         (MemberCore.Flags): New enum where bit flags for caching_flags
12334         are defined.
12335         (MemberCore.cls_compliance): Moved to caching_flags.
12336         (DeclSpace.Created): Moved to caching_flags.
12337
12338         * class.cs: Use caching_flags instead of DeclSpace.Created
12339         
12340 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
12341
12342         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
12343         if we are only a derived class, not a nested class.
12344
12345         * typemanager.cs: Same as above, but do this at the MemberLookup
12346         level (used by field and methods, properties are handled in
12347         PropertyExpr).   Allow for the qualified access if we are a nested
12348         method. 
12349
12350 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
12351
12352         * class.cs: Refactoring.
12353         (IMethodData): New inteface; Holds links to parent members
12354         to avoid member duplication (reduced memory allocation).
12355         (Method): Implemented IMethodData interface.
12356         (PropertyBase): New inner classes for get/set methods.
12357         (PropertyBase.PropertyMethod): Implemented IMethodData interface
12358         (Event): New inner classes for add/remove methods.
12359         (Event.DelegateMethod): Implemented IMethodData interface.
12360
12361         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
12362         EmitContext (related to class.cs refactoring).
12363
12364 2004-04-21  Raja R Harinath  <rharinath@novell.com>
12365
12366         * delegate.cs (Delegate.VerifyApplicability): If the number of
12367         arguments are the same as the number of parameters, first try to
12368         verify applicability ignoring  any 'params' modifier on the last
12369         parameter.
12370         Fixes #56442.
12371
12372 2004-04-16  Raja R Harinath  <rharinath@novell.com>
12373
12374         * class.cs (TypeContainer.AddIndexer): Use
12375         'ExplicitInterfaceName' to determine if interface name was
12376         explicitly specified.  'InterfaceType' is not initialized at this time.
12377         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
12378         Indexers array is already in the required order.  Initialize
12379         'IndexerName' only if there are normal indexers.
12380         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
12381         (TypeContainer.Emit): Emit DefaultMember attribute only if
12382         IndexerName is initialized.
12383         Fixes #56300.
12384
12385 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
12386
12387         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
12388         Fixes #57007
12389
12390 2004-04-15  Raja R Harinath  <rharinath@novell.com>
12391
12392         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
12393         attributes.
12394         Fix for #56456.
12395
12396         * attribute.cs (Attribute.Resolve): Check for duplicate named
12397         attributes.
12398         Fix for #56463.
12399
12400 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
12401
12402         * iterators.cs (MarkYield): track whether we are in an exception,
12403         and generate code accordingly.  Use a temporary value to store the
12404         result for our state.
12405
12406         I had ignored a bit the interaction of try/catch with iterators
12407         since their behavior was not entirely obvious, but now it is
12408         possible to verify that our behavior is the same as MS .NET 2.0
12409
12410         Fixes 54814
12411
12412 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
12413
12414         * iterators.cs: Avoid creating temporaries if there is no work to
12415         do. 
12416
12417         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
12418         Enumerations, use TypeManager.EnumToUnderlying and call
12419         recursively. 
12420
12421         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
12422         bug #57013
12423
12424         (This.Emit): Use EmitContext.EmitThis to emit our
12425         instance variable.
12426
12427         (This.EmitAssign): Ditto.
12428
12429         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
12430         codepaths, we will move all the functionality into
12431         Mono.CSharp.This 
12432
12433         (FieldExpr.EmitAssign): Ditto.
12434
12435         This fixes several hidden bugs that I uncovered while doing a code
12436         review of this today.
12437
12438         * codegen.cs (EmitThis): reworked so the semantics are more clear
12439         and also support value types "this" instances.
12440
12441         * iterators.cs: Changed so that for iterators in value types, we
12442         do not pass the value type as a parameter.  
12443
12444         Initialization of the enumerator helpers is now done in the caller
12445         instead of passing the parameters to the constructors and having
12446         the constructor set the fields.
12447
12448         The fields have now `assembly' visibility instead of private.
12449
12450 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
12451
12452         * expression.cs (Argument.Resolve): Check if fields passed as ref
12453         or out are contained in a MarshalByRefObject.
12454
12455         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
12456         another compiler type.
12457
12458 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12459
12460         * class.cs (Indexer.Define): use the new name checking method.
12461         Also, return false on an error.
12462         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
12463         (is_identifier_[start/part]_character): make static.
12464
12465 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
12466
12467         * expression.cs (Binary.ResolveOperator): Do no append strings
12468         twice: since we can be invoked more than once (array evaluation)
12469         on the same concatenation, take care of this here.  Based on a fix
12470         from Ben (bug #56454)
12471
12472 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
12473
12474         * codegen.cs: Fix another case where CS1548 must be reported (when 
12475         delay-sign isn't specified and no private is available #56564). Fix
12476         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
12477         error when MCS is used on the MS runtime and we need to delay-sign 
12478         (which seems unsupported by AssemblyBuilder - see #56621).
12479
12480 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
12481
12482         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
12483         (TypeManager.ComputeNamespaces): Faster implementation for
12484         Microsoft runtime.
12485
12486         * compiler.csproj: Updated AssemblyName to mcs.
12487
12488 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12489
12490         * rootcontext.cs: Add new types to the boot resolution.
12491
12492         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12493         MulticastDelegate is not allowed.
12494
12495         * typemanager.cs: Add new types to lookup: System.TypedReference
12496         and ArgIterator.
12497
12498         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12499         check for TypedReference or ArgIterator, they are not allowed. 
12500
12501         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12502         makes us properly catch 1510 in some conditions (see bug 56016 for
12503         details). 
12504
12505 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12506
12507         * CryptoConvert.cs: update from corlib version
12508         with endian fixes.
12509
12510 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12511
12512         * class.cs (Indexer.Define): Check indexername declaration
12513
12514 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12515
12516         * attribute.cs (IsClsCompliant): Fixed problem with handling
12517         all three states (compliant, not-compliant, undetected).
12518
12519 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12520
12521         * attribute.cs (Attribute): Location is now public.
12522         (Resolve): Store resolved arguments (pos_values) in attribute class.
12523         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12524         (GetClsCompliantAttributeValue): New method that gets
12525         CLSCompliantAttribute value.
12526         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12527         if exists else null.
12528         (AttributeTester): New class for CLS-Compliant verification routines.
12529
12530         * class.cs (Emit): Add CLS-Compliant verification.
12531         (Method.GetSignatureForError): Implemented.
12532         (Constructor.GetSignatureForError): Implemented
12533         (Constructor.HasCompliantArgs): Returns if constructor has
12534         CLS-Compliant arguments.
12535         (Constructor.Emit): Override.
12536         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12537         is needed to test only parameters.
12538         (FieldBase.GetSignatureForError): Implemented.
12539         (TypeContainer): New member for storing base interfaces.
12540         (TypeContainer.FindMembers): Search in base interfaces too.
12541
12542         * codegen.cs (GetClsComplianceAttribute): New method that gets
12543         assembly or module CLSCompliantAttribute value.
12544         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12545         for assembly.
12546         (ModuleClass.Emit): Add error 3012 test.
12547
12548         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12549
12550         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12551         state for all decl types.
12552         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12553         if CLS-Compliant tests are required.
12554         (IsClsCompliaceRequired): New method. Analyze whether code
12555         must be CLS-Compliant.
12556         (IsExposedFromAssembly): New method. Returns true when MemberCore
12557         is exposed from assembly.
12558         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12559         value or gets cached value.
12560         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12561         is explicitly marked with CLSCompliantAttribute.
12562         (IsIdentifierClsCompliant): New abstract method. This method is
12563         used to testing error 3005.
12564         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12565         for identifier and parameters CLS-Compliant testing.
12566         (VerifyClsCompliance): New method. The main virtual method for
12567         CLS-Compliant verifications.
12568         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12569         null. I don't know why is null (too many public members !).
12570         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12571         and get value of first CLSCompliantAttribute that found.
12572
12573         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12574         (VerifyClsCompliance): Override and add extra tests.
12575
12576         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12577         clscheck- disable CLS-Compliant verification event if assembly is has
12578         CLSCompliantAttribute(true).
12579
12580         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12581         ApllyAttribute is now called in emit section as in the other cases.
12582         Possible future Emit integration.
12583         (IsIdentifierClsCompliant): New override.
12584         (VerifyClsCompliance): New override.
12585         (GetEnumeratorName): Returns full enum name.
12586
12587         * parameter.cs (GetSignatureForError): Implemented.
12588
12589         * report.cs (WarningData): New struct for Warning message information.
12590         (LocationOfPreviousError): New method.
12591         (Warning): New method. Reports warning based on the warning table.
12592         (Error_T): New method. Reports error based on the error table.
12593
12594         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12595         verifications are done here.
12596
12597         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12598
12599         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12600         CLSCompliantAttribute.
12601         (all_imported_types): New member holds all imported types from other
12602         assemblies.
12603         (LoadAllImportedTypes): New method fills static table with exported types
12604         from all referenced assemblies.
12605         (Modules): New property returns all assembly modules.
12606
12607 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12608
12609         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12610         throwing a parser error.
12611
12612         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12613         which removes the hardcoded get_/set_ prefixes for properties, as
12614         IL allows for the properties to be named something else.  
12615
12616         Bug #56013
12617
12618         * expression.cs: Do not override operand before we know if it is
12619         non-null.  Fix 56207
12620
12621 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12622
12623         * typemanager.cs: support for pinned variables.
12624
12625 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12626
12627         * decl.cs, typemanager.cs: Avoid using an arraylist
12628         as a buffer if there is only one result set.
12629
12630 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12631
12632         * expression.cs: Make sure you cant call a static method
12633         with an instance expression, bug #56174.
12634
12635 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12636
12637         * class.cs (IsDuplicateImplementation): Improve error reporting to
12638         flag 663 (method only differs in parameter modifier).
12639
12640         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12641         in preprocessor directives.
12642
12643         * location.cs (LookupFile): Allow for the empty path.
12644
12645         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12646         better approach for some of that patch, but its failing with the
12647         CharSet enumeration.  For now try/catch will do.
12648
12649         * typemanager.cs: Do not crash if a struct does not have fields.
12650         Fixes 56150.
12651
12652 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12653
12654         * expression.cs: cs0213, cant fix a fixed expression.
12655         fixes 50231.
12656
12657 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12658
12659         * cs-parser.jay: detect invalid embeded statements gracefully.
12660         bug #51113.
12661
12662 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12663
12664         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12665         As a regex:
12666         s/
12667         the invocation type may not be a subclass of the tye of the item/
12668         The type of the item must be a subclass of the invocation item.
12669         /g
12670
12671         Fixes bug #50820.
12672
12673 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12674
12675         * attribute.cs: Added methods to get a string and a bool from an
12676         attribute. Required to information from AssemblyKeyFileAttribute,
12677         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12678         * codegen.cs: Modified AssemblyName creation to include support for
12679         strongnames. Catch additional exceptions to report them as CS1548.
12680         * compiler.csproj: Updated include CryptoConvert.cs.
12681         * compiler.csproj.user: Removed file - user specific configuration.
12682         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12683         Mono.Security assembly. The original class is maintained and tested in
12684         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12685         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12686         like CSC 8.0 (C# v2) supports.
12687         * Makefile: Added CryptoConvert.cs to mcs sources.
12688         * rootcontext.cs: Added new options for strongnames.
12689
12690 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12691
12692         * driver.cs: For --expect-error, report error code `2'
12693         if the program compiled with no errors, error code `1' if
12694         it compiled with an error other than the one expected.
12695
12696 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12697
12698         * compiler.csproj: Updated for Visual Studio .NET 2003.
12699         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12700         * compiler.sln: Updated for Visual Studio .NET 2003.
12701
12702 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12703
12704         * expression.cs: Fix bug #47234. We basically need to apply the
12705         rule that we prefer the conversion of null to a reference type
12706         when faced with a conversion to 'object' (csc behaviour).
12707
12708 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12709
12710         * statement.cs: Shorter form for foreach, eliminates
12711         a local variable. r=Martin.
12712
12713 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12714
12715         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12716         checks if we can use brtrue/brfalse to test for 0.
12717         * expression.cs: use the above in the test for using brtrue/brfalse.
12718         cleanup code a bit.
12719
12720 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12721
12722         * expression.cs: Rewrite string concat stuff. Benefits:
12723
12724         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12725         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12726         rather than a concat chain.
12727
12728         * typemanager.cs: Add lookups for more concat overloads.
12729
12730 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12731
12732         * expression.cs: Emit shorter il code for array init.
12733
12734         newarr
12735         dup
12736         // set 1
12737
12738         // set 2
12739
12740         newarr
12741         stloc.x
12742
12743         ldloc.x
12744         // set 1
12745
12746         ldloc.x
12747         // set 2
12748
12749 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12750
12751         * statement.cs: Before, two switch blocks would be merged if the
12752         total size of the blocks (end_item - begin_item + 1) was less than
12753         two times the combined sizes of the blocks.
12754
12755         Now, it will only merge if after the merge at least half of the
12756         slots are filled.
12757
12758         fixes 55885.
12759
12760 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12761
12762         * class.cs : csc build fix for GetMethods(). See bug #52503.
12763
12764 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12765
12766         * expression.cs: Make sure fp comparisons work with NaN.
12767         This fixes bug #54303. Mig approved this patch a long
12768         time ago, but we were not able to test b/c the runtime
12769         had a related bug.
12770
12771 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12772
12773         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12774
12775 2004-03-19  Martin Baulig  <martin@ximian.com>
12776
12777         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12778         error here and not in our caller.
12779
12780 2004-03-19  Martin Baulig  <martin@ximian.com>
12781
12782         * interface.cs: Completely killed this file.
12783         (Interface): We're now a TypeContainer and live in class.cs.
12784
12785         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12786         argument; we're now also called for interfaces.
12787         (TypeContainer.DefineMembers): Allow this method being called
12788         multiple times.
12789         (TypeContainer.GetMethods): New public method; formerly known as
12790         Interface.GetMethod().  This is used by PendingImplementation.
12791         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12792         it's now private and non-static.
12793         (Interface): Moved this here; it's now implemented similar to
12794         Class and Struct.
12795         (Method, Property, Event, Indexer): Added `bool is_interface'
12796         argument to their .ctor's.
12797         (MemberBase.IsInterface): New public field.
12798
12799         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12800         instances instead of InterfaceMethod, InterfaceProperty, etc.
12801         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12802         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12803
12804 2004-03-19  Martin Baulig  <martin@ximian.com>
12805
12806         * class.cs (MethodCore.IsDuplicateImplementation): New private
12807         method which does the CS0111 checking.
12808         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12809         Use IsDuplicateImplementation().
12810
12811 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12812
12813         * decl.cs (FindMemberToOverride): New method to find the correct
12814         method or property to override in the base class.
12815         * class.cs
12816             - Make Method/Property use the above method to find the
12817               version in the base class.
12818             - Remove the InheritableMemberSignatureCompare as it is now
12819               dead code.
12820
12821         This patch makes large code bases much faster to compile, as it is
12822         O(n) rather than O(n^2) to do this validation.
12823
12824         Also, it fixes bug 52458 which is that nested classes are not
12825         taken into account when finding the base class member.
12826
12827         Reviewed/Approved by Martin.
12828
12829 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12830
12831         * interface.cs: In all interface classes removed redundant
12832         member initialization.
12833
12834 2004-03-16  Martin Baulig  <martin@ximian.com>
12835
12836         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12837
12838 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12839
12840         * decl.cs (DefineTypeAndParents): New helper method to define a
12841         type's containers before the type itself is defined;  This is a
12842         bug exposed by the recent changes to Windows.Forms when an
12843         implemented interface was defined inside a class that had not been
12844         built yet.   
12845
12846         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12847
12848         (Check): Loop correctly to report errors modifiers
12849         (UNSAFE was not in the loop, since it was the same as TOP).
12850
12851         * interface.cs: Every interface member now takes a ModFlags,
12852         instead of a "is_new" bool, which we set on the base MemberCore. 
12853
12854         Every place where we called "UnsafeOk" in the interface, now we
12855         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12856         the unsafe settings from the member declaration instead of the
12857         container interface. 
12858
12859         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12860
12861         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12862         `set_indexer_name' to the pending bits (one per type).
12863
12864         We fixed a bug today that was picking the wrong method to
12865         override, since for properties the existing InterfaceMethod code
12866         basically ignored the method name.  Now we make sure that the
12867         method name is one of the valid indexer names.
12868
12869 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12870  
12871         * support.cs (SeekableStreamReader): Keep track of stream byte
12872         positions and don't mix them with character offsets to the buffer.
12873
12874         Patch from Gustavo Giráldez
12875
12876 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12877
12878         * interface.cs (InterfaceSetGetBase): Removed double member
12879         initialization, base class does it as well.
12880
12881 2004-03-13  Martin Baulig  <martin@ximian.com>
12882
12883         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12884         when compiling corlib.
12885
12886 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12887
12888         * convert.cs (ExplicitConversion): We were reporting an error on
12889         certain conversions (object_type source to a value type, when the
12890         expression was `null') before we had a chance to pass it through
12891         the user defined conversions.
12892
12893         * driver.cs: Replace / and \ in resource specifications to dots.
12894         Fixes 50752
12895
12896         * class.cs: Add check for duplicate operators.  Fixes 52477
12897
12898 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12899
12900         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12901         that are in the middle of the statements, not only at the end.
12902         Fixes #54987
12903
12904         * class.cs (TypeContainer.AddField): No longer set the
12905         `HaveStaticConstructor' flag, now we call it
12906         `UserDefineStaticConstructor' to diferentiate the slightly
12907         semantic difference.
12908
12909         The situation is that we were not adding BeforeFieldInit (from
12910         Modifiers.TypeAttr) to classes that could have it.
12911         BeforeFieldInit should be set to classes that have no static
12912         constructor. 
12913
12914         See:
12915
12916         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12917
12918         And most importantly Zoltan's comment:
12919
12920         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12921
12922         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12923          before its static fields are used', i.e. initialization does not need
12924          to be triggered by the first access to the type. Setting this flag
12925          helps the JIT to compile better code, since it can run the static
12926          constructor at JIT time, and does not need to generate code to call it
12927          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12928          this flag for lots of classes like String. 
12929          
12930          csc sets this flag if the type does not have an explicit static 
12931          constructor. The reasoning seems to be that if there are only static
12932          initalizers for a type, and no static constructor, then the programmer
12933          does not care when this initialization happens, so beforefieldinit
12934          can be used.
12935          
12936          This bug prevents the AOT compiler from being usable, since it 
12937          generates so many calls to mono_runtime_class_init that the AOT code
12938          is much slower than the JITted code. The JITted code is faster, 
12939          because it does not generate these calls if the vtable is type is
12940          already initialized, which is true in the majority of cases. But the
12941          AOT compiler can't do this."
12942
12943 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12944
12945         * class.cs (MethodData.Emit): Refactor the code so symbolic
12946         information is generated for destructors;  For some reasons we
12947         were taking a code path that did not generate symbolic information
12948         before. 
12949
12950 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12951
12952         * class.cs: Create a Constructor.CheckBase method that
12953         takes care of all validation type code. The method
12954         contains some code that was moved from Define.
12955
12956         It also includes new code that checks for duplicate ctors.
12957         This fixes bug #55148.
12958
12959 2004-03-09  Joshua Tauberer <tauberer@for.net>
12960
12961         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12962         a { ... }-style array creation invokes EmitStaticInitializers
12963         which is not good for reference-type arrays.  String, decimal
12964         and now null constants (NullCast) are not counted toward
12965         static initializers.
12966
12967 2004-03-05  Martin Baulig  <martin@ximian.com>
12968
12969         * location.cs (SourceFile.HasLineDirective): New public field;
12970         specifies whether the file contains or is referenced by a "#line"
12971         directive.
12972         (Location.DefineSymbolDocuments): Ignore source files which
12973         either contain or are referenced by a "#line" directive.        
12974
12975 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12976
12977         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12978         direct access to our parent, so check the method inline there.
12979
12980 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12981
12982         * expression.cs (Invocation.EmitCall): Miguel's last commit
12983         caused a regression. If you had:
12984
12985             T t = null;
12986             t.Foo ();
12987
12988         In Foo the implict this would be null.
12989
12990 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12991
12992         * expression.cs (Invocation.EmitCall): If the method is not
12993         virtual, do not emit a CallVirt to it, use Call.
12994
12995         * typemanager.cs (GetFullNameSignature): Improve the method to
12996         cope with ".ctor" and replace it with the type name.
12997
12998         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12999         as an argument the ConstructorBuilder where it is being defined,
13000         to catch the recursive constructor invocations.
13001
13002 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
13003
13004         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
13005         routines to check if a type is an enumerable/enumerator allow
13006         classes that implement the IEnumerable or IEnumerator interfaces.
13007
13008         * class.cs (Property, Operator): Implement IIteratorContainer, and
13009         implement SetYields.
13010
13011         (Property.Define): Do the block swapping for get_methods in the
13012         context of iterators.   We need to check if Properties also
13013         include indexers or not.
13014
13015         (Operator): Assign the Block before invoking the
13016         OperatorMethod.Define, so we can trigger the Iterator code
13017         replacement. 
13018
13019         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
13020         Property and Operator classes are not created when we parse the
13021         declarator but until we have the block completed, so we use a
13022         singleton SimpleIteratorContainer.Simple to flag whether the
13023         SetYields has been invoked.
13024
13025         We propagate this setting then to the Property or the Operator to
13026         allow the `yield' to function.
13027
13028 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
13029
13030         * codegen.cs: Implemented attribute support for modules.
13031         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
13032         Assembly/Module functionality.
13033
13034         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
13035         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
13036         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
13037
13038 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
13039
13040         * interface.cs (FindMembers): The operation is performed on all base
13041         interfaces and not only on the first. It is required for future CLS Compliance patch.
13042
13043 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13044
13045         * statement.cs, codegen.cs:
13046         This patch deals with patterns such as:
13047
13048         public class List : IEnumerable {
13049
13050                 public MyEnumerator GetEnumerator () {
13051                         return new MyEnumerator(this);
13052                 }
13053
13054                 IEnumerator IEnumerable.GetEnumerator () {
13055                         ...
13056                 }
13057                 
13058                 public struct MyEnumerator : IEnumerator {
13059                         ...
13060                 }
13061         }
13062
13063         Before, there were a few things we did wrong:
13064         1) we would emit callvirt on a struct, which is illegal
13065         2) we emited ldarg when we needed to emit ldarga
13066         3) we would mistakenly call the interface methods on an enumerator
13067         type that derived from IEnumerator and was in another assembly. For example:
13068
13069         public class MyEnumerator : IEnumerator
13070
13071         Would have the interface methods called, even if there were public impls of the
13072         method. In a struct, this lead to invalid IL code.
13073
13074 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
13075
13076         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
13077           renamed to Emit.
13078
13079         * delegate.cs (Define): Fixed crash when delegate type is undefined.
13080
13081 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * cs-parser.jay: Fix small regression: we were not testing V2
13084         compiler features correctly.
13085
13086         * interface.cs: If the emit context is null, then create one
13087
13088 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
13089
13090         * decl.cs (GetSignatureForError): New virtual method to get full name
13091           for error messages.
13092
13093         * attribute.cs (IAttributeSupport): New interface for attribute setting.
13094           Now it is possible to rewrite ApplyAttributes method to be less if/else.
13095
13096         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
13097           Duplicated members and code in these classes has been removed.
13098           Better encapsulation in these classes.
13099
13100 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
13101
13102         * assign.cs (Assign.DoResolve): When dealing with compound
13103         assignments, there is a new rule in ECMA C# 2.4 (might have been
13104         there before, but it is documented here) that states that in:
13105
13106         a op= b;
13107
13108         If b is of type int, and the `op' is a shift-operator, then the
13109         above is evaluated as:
13110
13111         a = (int) a op b 
13112
13113         * expression.cs (Binary.ResolveOperator): Instead of testing for
13114         int/uint/long/ulong, try to implicitly convert to any of those
13115         types and use that in pointer arithmetic.
13116
13117         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
13118         method to print information for from the type, not from the
13119         null-method we were given.
13120
13121 2004-02-01  Duncan Mak  <duncan@ximian.com>
13122
13123         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
13124         parsing for cmd, fixes bug #53694.
13125
13126 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
13127
13128         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
13129         in the member name duplication tests. Property and operator name duplication
13130         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
13131
13132 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
13133
13134         * interface.cs (PopulateMethod): Fixed crash when interface method
13135         returns not existing type (error test cs0246-3.cs).
13136
13137 2004-02-02  Ravi Pratap M <ravi@ximian.com>
13138
13139         * cs-parser.jay (interface_accessors): Re-write actions to also
13140         store attributes attached to get and set methods. Fix spelling
13141         while at it.
13142
13143         (inteface_property_declaration): Modify accordingly.
13144
13145         (InterfaceAccessorInfo): New helper class to store information to pass
13146         around between rules that use interface_accessors.
13147
13148         * interface.cs (Emit): Apply attributes on the get and set
13149         accessors of properties and indexers too.
13150
13151         * attribute.cs (ApplyAttributes): Modify accordingly to use the
13152         right MethodBuilder when applying attributes to the get and set accessors.
13153
13154 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
13155
13156         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
13157
13158 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13161
13162 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
13163
13164         * cs-parser.jay: Remove YIELD token, instead use the new grammar
13165         changes that treat `yield' specially when present before `break'
13166         or `return' tokens.
13167
13168         * cs-tokenizer.cs: yield is no longer a keyword.
13169
13170 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
13171
13172         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13173         setting for default constructors.
13174         For default constructors are almost every time set wrong Modifier. The
13175         generated IL code has been alright. But inside mcs this values was
13176         wrong and this was reason why several of my CLS Compliance tests
13177         failed.
13178
13179 2004-01-22  Martin Baulig  <martin@ximian.com>
13180
13181         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13182         not a QualifiedIdentifier.  This is what `type_name_expression'
13183         was previously doing.
13184         (type_name_expression): Removed; the code is now in
13185         `namespace_or_type_name'.
13186         (qualified_identifier): Removed, use `namespace_or_type_name'
13187         instead.
13188         (QualifiedIdentifier): Removed this class.      
13189
13190 2004-01-22  Martin Baulig  <martin@ximian.com>
13191
13192         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13193         not a string as alias name.
13194
13195 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13196
13197         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13198         #52730 bug, and instead compute correctly the need to use a
13199         temporary variable when requesting an address based on the
13200         static/instace modified of the field and the constructor.
13201  
13202 2004-01-21  Martin Baulig  <martin@ximian.com>
13203
13204         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13205         class and namespace before looking up aliases.  Fixes #52517.
13206
13207 2004-01-21  Martin Baulig  <martin@ximian.com>
13208
13209         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13210         assinged in a 'try'; fixes exception4.cs.
13211
13212 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13213         * class.cs : Implemented parameter-less constructor for TypeContainer
13214
13215         * decl.cs: Attributes are now stored here. New property OptAttributes
13216
13217         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13218
13219         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13220
13221 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13222
13223         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13224           (CSharpSignature): New method for indexer and property signature.
13225
13226 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13227
13228         * pending.cs (IsVirtualFilter): Faster implementation.
13229
13230 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13231
13232         * typemanager.cs: Avoid inclusion of same assembly more than once.
13233
13234 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13235
13236         * cs-parser.jay: Fixed problem where the last assembly attribute
13237           has been applied also to following declaration (class, struct, etc.)
13238           
13239 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13240
13241         * class.cs: Added error CS0538, CS0539 reporting.
13242         Fixed crash on Microsoft runtime when field type is void.
13243
13244         * cs-parser.jay: Added error CS0537 reporting.
13245
13246         * pending.cs: Added error CS0535 reporting.
13247         Improved error report for errors CS0536, CS0534.
13248
13249 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13250
13251         Merge a few bits from the Anonymous Method MCS tree.
13252
13253         * statement.cs (ToplevelBlock): New class for toplevel methods,
13254         will hold anonymous methods, lifted variables.
13255
13256         * cs-parser.jay: Create toplevel blocks for delegates and for
13257         regular blocks of code. 
13258
13259 2004-01-20  Martin Baulig  <martin@ximian.com>
13260
13261         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13262         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13263         and `NeedExplicitReturn'; added `IsLastStatement'.
13264         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13265         have a `ReturnLabel' or we're not unreachable.
13266
13267         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13268         child's reachability; don't just override ours with it.  Fixes
13269         #58058 (lluis's example).
13270         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13271         InFinally(), InLoop(), InSwitch() and
13272         BreakCrossesTryCatchBoundary() methods.
13273
13274         * statement.cs (Return): Do all error checking in Resolve().
13275         Unless we are the last statement in a top-level block, always
13276         create a return label and jump to it.
13277         (Break, Continue): Do all error checking in Resolve(); also make
13278         sure we aren't leaving a `finally'.
13279         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13280         statement in a top-level block.
13281         (Block.Flags): Added `IsDestructor'.
13282         (Block.IsDestructor): New public property.
13283
13284 2004-01-20  Martin Baulig  <martin@ximian.com>
13285
13286         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13287
13288 2004-01-20  Martin Baulig  <martin@ximian.com>
13289
13290         * statement.cs (Statement.ResolveUnreachable): New public method.
13291         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13292         (Block.Resolve): Resolve unreachable statements.
13293
13294 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13295
13296         * expression.cs: We need to fix the case where we do
13297         not have a temp variable here.
13298
13299         * assign.cs: Only expression compound assignments need
13300         temporary variables.
13301
13302 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13303
13304         * flowanalysis.cs: Reduce memory allocation in a few ways:
13305           - A block with no variables should not allocate a bit
13306             vector for itself.
13307           - A method with no out parameters does not need any tracking
13308             for assignment of the parameters, so we need not allocate
13309             any data for it.
13310           - The arrays:
13311                 public readonly Type[] VariableTypes;
13312                 public readonly string[] VariableNames;
13313             Are redundant. The data is already stored in the variable
13314             map, so we need not allocate another array for it.
13315           - We need to add alot of checks for if (params | locals) == null
13316             due to the first two changes.
13317
13318 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13319
13320         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13321         implement IMemoryLocation, we store a copy on a local variable and
13322         take the address of it.  Patch from Benjamin Jemlich
13323
13324         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13325         to use a special "type_name_expression" rule which reduces the
13326         number of "QualifiedIdentifier" classes created, and instead
13327         directly creates MemberAccess expressions.
13328
13329 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13330
13331         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13332         that fixes #52853.  Null literal assignment to ValueType
13333
13334         * class.cs (MethodData.Emit): Instead of checking the name of the
13335         method to determine if its a destructor, create a new derived
13336         class from Method called Destructor, and test for that.  
13337
13338         * cs-parser.jay: Create a Destructor object instead of a Method.  
13339
13340         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13341
13342         Fixes: 52933
13343
13344 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13345
13346         * expression.cs (Binary.ResolveOperator): Perform an implicit
13347         conversion from MethodGroups to their delegate types on the
13348         Addition operation.
13349
13350         * delegate.cs: Introduce a new class DelegateCreation that is the
13351         base class for `NewDelegate' and `ImplicitDelegateCreation',
13352         factor some code in here.
13353
13354         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13355         conversion from MethodGroups to compatible delegate types. 
13356
13357         * ecore.cs (Expression.Resolve): Do not flag error 654
13358         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13359         we allow conversions from MethodGroups to delegate types now.
13360
13361         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13362         assignments in v2 either.
13363
13364 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13365
13366         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13367         static read-only fields in ctors.
13368
13369         Applied patch from Benjamin Jemlich 
13370
13371         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13372
13373 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13374
13375         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13376         here to return true, as they can be used like this:
13377
13378                 (XXX) int.MEMBER ()
13379
13380         Fixed 49836 and all the other dups
13381
13382 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13383
13384         * driver.cs: Implement /win32res and /win32icon.
13385
13386 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13387
13388         * cs-parser.jay: Add a rule to improve error handling for the
13389         common mistake of placing modifiers after the type.
13390
13391 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13392
13393         * cs-parser.jay (interface_event_declaration): Catch
13394         initialization of events on interfaces, and report cs0068
13395
13396         * cs-parser.jay (interface_event_declaration): Catch
13397         initialization of events. 
13398
13399         * ecore.cs: Better report missing constructors.
13400
13401         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13402         the error reporting done in the wrong place.  Fix.
13403
13404         * expression.cs (Binary.ResolveOperator): Catch the 
13405         operator + (E x, E y) error earlier, and later allow for implicit
13406         conversions in operator +/- (E e, U x) from U to the underlying
13407         type of E.
13408
13409         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13410         52596, if the container class is abstract, the default constructor
13411         is protected otherwise its public (before, we were always public).
13412
13413         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13414         fixed statement.
13415
13416         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13417         Jemlich that fixes bug #52597, MCS was generating invalid code for
13418         idisposable structs.   Thanks to Ben for following up with this
13419         bug as well.
13420
13421 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13422
13423         * driver.cs: Allow assemblies without code to be generated, fixes
13424         52230.
13425
13426 2004-01-07  Nick Drochak <ndrochak@gol.com>
13427
13428         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13429
13430 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13431
13432         * cs-parser.jay: Add rules to improve error reporting if fields or
13433         methods are declared at the namespace level (error 116)
13434
13435         * Add rules to catch event add/remove
13436
13437 2004-01-04  David Sheldon <dave-mono@earth.li>
13438
13439   * expression.cs: Added matching ")" to error message for 
13440   CS0077
13441
13442 2004-01-03 Todd Berman <tberman@gentoo.org>
13443
13444         * ecore.cs, attribute.cs:
13445         Applying fix from #52429.
13446
13447 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13448
13449         * ecore.cs, expression.cs, statement.cs:
13450         Total rewrite of how we handle branching. We
13451         now handle complex boolean expressions with fewer
13452         jumps. As well if (x == 0) no longer emits a ceq.
13453
13454         if (x is Foo) is much faster now, because we generate
13455         better code.
13456
13457         Overall, we get a pretty big improvement on our benchmark
13458         tests. The code we generate is smaller and more readable.
13459
13460         I did a full two-stage bootstrap. The patch was reviewed
13461         by Martin and Miguel.
13462
13463 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13464
13465         * cs-parser.jay: Make primary_expression not take a QI.
13466         we dont need this because the member_access rule covers
13467         us here. So we replace the rule with just IDENTIFIER.
13468
13469         This has two good effects. First, we remove a s/r conflict.
13470         Second, we allocate many fewer QualifiedIdentifier objects.
13471
13472 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13473
13474         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13475         set the correct information via SRE. This prevents
13476         hanging on the MS runtime. Fixes #29374.
13477
13478 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13479
13480         * convert.cs: correctly handle conversions to value types
13481         from Enum and ValueType as unboxing conversions.
13482
13483         Fixes bug #52569. Patch by Benjamin Jemlich.
13484
13485 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13486
13487         * expression.cs (BetterConversion): Prefer int -> uint
13488         over int -> ulong (csc's behaviour). This fixed bug #52046.
13489
13490 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13491
13492         * decl.cs (MemberCache.FindMembers): now returns a
13493         MemberInfo [].
13494
13495         * typemanager.cs: In general, go with with ^^.
13496         (CopyNewMethods): take an IList.
13497         (RealMemberLookup): Only allocate an arraylist
13498         if we copy from two sets of methods.
13499
13500         This change basically does two things:
13501         1) Fewer array lists allocated due to CopyNewMethods.
13502         2) the explicit cast in MemberList costed ALOT.
13503
13504 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13505
13506         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13507         a hashtable to avoid needless string allocations when an identifier is
13508         used more than once (the common case).
13509
13510 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13511
13512         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13513         is broken, it will not return anything. So, we
13514         have to use the information we have in mcs to
13515         do the task.
13516
13517         * typemanager.cs: Add a cache for GetInterfaces,
13518         since this will now be used more often (due to ^^)
13519
13520         (GetExplicitInterfaces) New method that gets the
13521         declared, not effective, interfaces on a type
13522         builder (eg, if you have interface IFoo, interface
13523         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13524         { IBar }.
13525
13526         This patch makes MCS able to bootstrap itself on
13527         Windows again.
13528
13529 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13530
13531         * expression.cs: Remove the Nop's that Miguel put
13532         in by mistake.
13533
13534 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13535
13536         * report.cs, codegen.cs: Give the real stack trace to
13537         the error when an exception is thrown.
13538
13539 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13540
13541         * decl.cs: only allocate hashtables for ifaces if 
13542         it is an iface!
13543
13544 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13545
13546         * expression.cs: fix the error from cs0121-2.cs
13547         (a parent interface has two child interfaces that
13548         have a function with the same name and 0 params
13549         and the function is called through the parent).
13550
13551 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13552
13553         * class.cs, rootcontext.cs, typmanager.cs: do not
13554         leak pointers.
13555
13556 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13557
13558         * codegen.cs: remove stack for the ec flow branching.
13559         It is already a linked list, so no need.
13560
13561 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13562
13563         * Makefile: Allow custom profiler here.
13564
13565 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13566
13567         * typemanager.cs (LookupType):
13568           - Use a static char [], because split takes
13569             a param array for args, so it was allocating
13570             every time.
13571           - Do not store true in a hashtable, it boxes.
13572
13573 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13574
13575         * flowanalysis.cs: bytify common enums.
13576
13577 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13578
13579         * modifiers.cs: Add a new set of flags for the
13580         flags allowed on explicit interface impls.
13581         * cs-parser.jay: catch the use of modifiers in
13582         interfaces correctly.
13583         * class.cs: catch private void IFoo.Blah ().
13584
13585         All related to bug #50572.
13586
13587 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13588
13589         * decl.cs: Rewrite the consistant accessability checking.
13590         Accessability is not linear, it must be implemented in
13591         a tableish way. Fixes #49704.
13592
13593 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13594
13595         * expression.cs: Handle negation in a checked context.
13596         We must use subtraction from zero. Fixes #38674.
13597
13598 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13599
13600         * class.cs: Ignore static void main in DLLs.
13601         * rootcontext.cs: Handle the target type here,
13602         since we are have to access it from class.cs
13603         * driver.cs: account for the above.
13604
13605 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13606
13607         * report.cs: Give line numbers and files if available.
13608
13609 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13610
13611         * driver.cs: Implement /addmodule.
13612
13613         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13614         ModuleBuilders.
13615
13616 2003-12-20  Martin Baulig  <martin@ximian.com>
13617
13618         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13619         (FieldBase.IsAssigned): Removed this field.
13620         (FieldBase.SetAssigned): New public method.
13621         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13622
13623 2003-12-20  Martin Baulig  <martin@ximian.com>
13624
13625         * expression.cs (LocalVariableReference.DoResolve): Don't set
13626         `vi.Used' if we're called from DoResolveLValue().
13627
13628         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13629         returns the usage vector it just merged into the current one -
13630         pass this one to UsageWarning().
13631         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13632         of the `EmitContext', don't call this recursively on our children.
13633
13634 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13635
13636         * driver.cs: Implement /target:module.
13637
13638 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13639
13640         * support.cs (CharArrayHashtable): New helper class.
13641
13642         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13643         char arrays, not strings, so we can avoid creating a string in
13644         consume_identifier if the identifier is a keyword.
13645
13646 2003-12-16  Martin Baulig  <martin@ximian.com>
13647
13648         * statement.cs (LocalInfo.Assigned): Removed this property.
13649         (LocalInfo.Flags): Removed `Assigned'.
13650         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13651         and uses flow analysis.
13652         (Block.UsageWarning): Made this method private.
13653         (Block.Resolve): Call UsageWarning() if appropriate.
13654
13655         * expression.cs (LocalVariableReference.DoResolve): Always set
13656         LocalInfo.Used here.
13657
13658 2003-12-13  Martin Baulig  <martin@ximian.com>
13659
13660         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13661         any value here; we're now using flow analysis to figure out
13662         whether a statement/block returns a value.
13663
13664 2003-12-13  Martin Baulig  <martin@ximian.com>
13665
13666         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13667         working again.
13668         (FlowBranching.MergeFinally): Don't call
13669         `branching.CheckOutParameters()' here, this is called in
13670         MergeTopBlock().
13671         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13672         when adding the `finally' vector.       
13673
13674 2003-12-13  Martin Baulig  <martin@ximian.com>
13675
13676         * flowanalysis.cs
13677         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13678         actually work and also fix #48962.
13679
13680 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13681
13682         * decl.cs: Do not check System.Object for nested types,
13683         since we know it does not have any. Big bang for buck:
13684
13685         BEFORE:
13686            Run 1:   8.35 seconds
13687            Run 2:   8.32 seconds
13688            corlib:  17.99 seconds
13689         AFTER:
13690            Run 1:   8.17 seconds
13691            Run 2:   8.17 seconds
13692            corlib:  17.39 seconds
13693
13694 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13695
13696         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13697         time we are returning 0 members, so we save alot here.
13698
13699 2003-12-11  Martin Baulig  <martin@ximian.com>
13700
13701         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13702         `MergeChild()', also just take the `FlowBranching' as argument;
13703         call Merge() on it and return the result.
13704         (FlowBranching.Merge): We don't need to do anything if we just
13705         have one sibling.
13706
13707 2003-12-11  Martin Baulig  <martin@ximian.com>
13708
13709         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13710         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13711         Maurer for this idea.
13712
13713 2003-12-11  Martin Baulig  <martin@ximian.com>
13714
13715         * flowanalysis.cs (MergeResult): This class is now gone; we now
13716         use the `UsageVector' for this.  The reason for this is that if a
13717         branching just has one sibling, we don't need to "merge" them at
13718         all - that's the next step to do.
13719         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13720         `MergeResult'.
13721
13722 2003-12-11  Martin Baulig  <martin@ximian.com>
13723
13724         Reworked flow analyis and made it more precise and bug-free.  The
13725         most important change is that we're now using a special `Reachability'
13726         class instead of having "magic" meanings of `FlowReturns'.  I'll
13727         do some more cleanups and optimizations and also add some more
13728         documentation this week.
13729
13730         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13731         largely reworked this class.
13732         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13733         the new `Reachability' class instead of having "magic" values here.
13734         (FlowBranching): We're now using an instance of `Reachability'
13735         instead of having separate `Returns', `Breaks' etc. fields.
13736
13737         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13738         based on flow analysis; ignore the return value of block.Emit ().
13739
13740 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13741
13742         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13743         if they are private.
13744
13745 2003-12-09  Martin Baulig  <martin@ximian.com>
13746
13747         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13748         call them directly on the UsageVector.
13749
13750 2003-12-09  Martin Baulig  <martin@ximian.com>
13751
13752         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13753         Changed return type from `FlowReturns' to `Reachability'.
13754
13755 2003-12-09  Martin Baulig  <martin@ximian.com>
13756
13757         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13758         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13759         `Reachable' fields with a single `Reachability' one.
13760
13761 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13762
13763         * class.cs (FindMembers): Remove foreach's.
13764
13765         Bootstrap times:
13766
13767         BEFORE
13768                 Run 1:   8.74 seconds
13769                 Run 2:   8.71 seconds
13770
13771         AFTER
13772                 Run 1:   8.64 seconds
13773                 Run 2:   8.58 seconds
13774
13775
13776 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13777
13778         * cs-parser.jay:
13779         * gen-treedump.cs:
13780         * statement.cs:
13781         This patch does a few things:
13782                 1. EmptyStatement is now a singleton, so it is never reallocated.
13783                 2. All blah is EmptyStatement constructs have been changed to
13784                    blah == EmptyStatement.Value, which is much faster and valid
13785                    now that EmptyStatement is a singleton.
13786                 3. When resolving a block, rather than allocating a new array for
13787                    the non-empty statements, empty statements are replaced with
13788                    EmptyStatement.Value
13789                 4. Some recursive functions have been made non-recursive.
13790         Mainly the performance impact is from (3), however (1) and (2) are needed for
13791         this to work. (4) does not make a big difference in normal situations, however
13792         it makes the profile look saner.
13793
13794         Bootstrap times:
13795
13796         BEFORE
13797         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13798         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13799         Total memory allocated: 56397 KB
13800
13801         AFTER
13802         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13803         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13804         Total memory allocated: 55666 KB
13805
13806 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13807
13808         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13809         than the hashtable in a hashtable version
13810
13811         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13812         we always end up concating a string. This results in a huge perf
13813         loss, because many strings have to be tracked by the GC. In this
13814         patch, we first use a hashtable that works with two keys, so that
13815         the strings do not need to be concat'ed.
13816
13817         Bootstrap times:
13818         BEFORE
13819                 Run 1:   8.74 seconds
13820                 Run 2:   8.71 seconds
13821
13822         AFTER
13823                 Run 1:   8.65 seconds
13824                 Run 2:   8.56 seconds
13825
13826 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13827
13828         * Makefile: Add a new target `do-time' that does a quick and simple
13829         profile, leaving easy to parse output.
13830
13831 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13832
13833         * codegen.cs (Init): Create the dynamic assembly with 
13834         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13835
13836 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13837
13838         * support.cs: Make the PtrHashtable use only one
13839         instance of its comparer.
13840
13841 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13842
13843         * typemanager.cs: Fix lookup of GetNamespaces.
13844
13845 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13846
13847         * expression.cs: Removed redundant line.
13848
13849         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13850         ArrayLists, use for loops with bounds.  
13851
13852         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13853         arraylist.
13854
13855         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13856         arraylists, use for loop with bounds.
13857
13858         The above three changes give us a 0.071 second performance
13859         improvement out of 3.294 seconds down to 3.223.  On my machine
13860         the above changes reduced the memory usage by 1,387 KB during
13861         compiler bootstrap.
13862
13863         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13864         QualifiedIdentifiers.  Before we created a new string through
13865         concatenation, and mostly later on, the result would be
13866         manipulated by DecomposeQI through string manipulation.
13867
13868         This reduced the compiler memory usage for bootstrapping from
13869         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13870         compile times in 0.05 seconds.
13871
13872 2003-11-28  Dick Porter  <dick@ximian.com>
13873
13874         * support.cs: Do string compares with the Invariant culture.
13875
13876         * rootcontext.cs: 
13877         * gen-treedump.cs: 
13878         * expression.cs: 
13879         * driver.cs: 
13880         * decl.cs: 
13881         * codegen.cs: 
13882         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13883         the comparison is done with the Invariant culture.
13884
13885 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13886
13887         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13888         GetEnumerator method.
13889
13890         (ProbeCollectionType): Iterate starting at the most specific type
13891         upwards looking for a GetEnumerator
13892
13893         * expression.cs: Shift count can be up to 31 for int/uint and 63
13894         for long/ulong.
13895
13896 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13897
13898         * statement.cs (Block.LookupLabel): Also look for the label on the
13899         children blocks.  Use a hash table to keep track of visited
13900         nodes. 
13901
13902         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13903         we actually did transform the other operand, otherwise fall back
13904         to the common codepath that casts to long.
13905
13906         * cs-tokenizer.cs: Use the same code pattern as the int case.
13907         Maybe I should do the parsing myself, and avoid depending on the
13908         Parse routines to get this done.
13909
13910 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13911
13912         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13913         which fixes bug 51347.  This time test it.
13914
13915         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13916         attributes for example can not tell the difference between these.
13917         The difference was only a syntax feature of the language. 
13918
13919         * attribute.cs: Apply attributes to delegates.
13920
13921         * delegate.cs: Call the apply attributes method.
13922
13923 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13924
13925         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13926         comparing 0 vs Byte.MinValue, not the value
13927
13928         (ImplicitConversionRequired): When reporting a conversion error,
13929         use error 31 to print out the constant error instead of the
13930         simpler 29.
13931
13932         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13933         which fixes bug 51347.
13934
13935 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13936
13937         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13938         which fixes the -warnaserror command line option.
13939
13940 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13941
13942         * cfold.cs (DoNumericPromotions): During constant folding of
13943         additions on UIntConstant, special case intconstants with
13944         IntConstants like we do on the expression binary operator. 
13945
13946 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13947
13948         * convert.cs (ImplicitReferenceConversion): We were missing a case
13949         (System.Enum are not value types or class types, so we need to
13950         classify them separatedly).
13951
13952         * driver.cs: We do not support error 2007.
13953
13954 2003-11-12 Jackson Harper <jackson@ximian.com>
13955
13956         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13957         system directory. Also use the full file name so users can
13958         libraries names mscorlib-o-tron.dll in a non system dir.
13959
13960 2003-11-10  Martin Baulig  <martin@ximian.com>
13961
13962         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13963         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13964         calling `ResolveType()' on them, directly assign their `Type'.
13965
13966 2003-11-08  Martin Baulig  <martin@ximian.com>
13967
13968         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13969         return value and the `out parent' parameter.
13970         (TypeContainer.DefineType): Moved the CS0644 check into
13971         GetClassBases().  Don't pass the interface types to the
13972         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13973         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13974
13975         * ecore.cs (TypeExpr.IsAttribute): New property.
13976         (TypeExpr.GetInterfaces): New method.
13977
13978         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13979         TypeExpr instead of a Type.
13980         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13981         (Interface.DefineType): Don't pass the interface types to the
13982         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13983         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13984
13985         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13986         instead of a `Type[]'.
13987         (TypeManager.RegisterBuilder): Likewise.
13988         (TypeManager.AddUserInterface): Likewise.
13989         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13990         `Type[]' and also return a `TypeExpr[]'.
13991         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13992
13993 2003-11-08  Martin Baulig  <martin@ximian.com>
13994
13995         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13996         Expression.     
13997
13998 2003-11-08  Martin Baulig  <martin@ximian.com>
13999
14000         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14001         TypeManager.ResolveExpressionTypes().
14002
14003         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14004         instead of an Expression.
14005         (TypeExpr): This is now an abstract base class for `TypeExpression'.
14006         (TypeExpression): New public class; formerly known as `TypeExpr'.
14007
14008         * expression.cs (ComposedCast): Derive from TypeExpr.
14009
14010         * typemanager.cs (TypeManager.system_*_expr): These are now
14011         TypExpr's instead of Expression's.
14012         (TypeManager.ResolveExpressionTypes): New public static function;
14013         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14014         of them.        
14015
14016 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
14017
14018         * expression.cs (New.DoResolve): Do not dereference value that
14019         might be a null return.
14020
14021         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14022         sure that the constant value has the right type.  Fixes an
14023         unreported bug, similar to 50425.
14024
14025         * const.cs (Const.LookupConstantValue): Call
14026         ImplicitStandardConversionExists before doing a conversion to
14027         avoid havng the TypeManager.ChangeType do conversions.
14028
14029         Reduced the number of casts used
14030
14031         (Const.ChangeType): New routine to enable reuse of the constant
14032         type changing code from statement.
14033
14034         * typemanager.cs (ChangeType): Move common initialization to
14035         static global variables.
14036
14037         Fixes #50425.
14038
14039         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14040         every value type to go through, even if it was void.  Fix that. 
14041
14042         * cs-tokenizer.cs: Use is_identifier_start_character on the start
14043         character of the define, and the is_identifier_part_character for
14044         the rest of the string.
14045
14046 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
14047
14048         * expression.cs (UnaryMutator.EmitCode): When I updated
14049         LocalVariableReference.DoResolve, I overdid it, and dropped an
14050         optimization done on local variable references.
14051
14052 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
14053
14054         * ecore.cs: Convert the return from Ldlen into an int.
14055
14056 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
14057
14058         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14059         the accessibility, this is a special case for toplevel non-public
14060         classes (internal for instance).
14061
14062 2003-10-20  Nick Drochak <ndrochak@gol.com>
14063
14064         * ecore.cs: Fix typo and build.  Needed another right paren.
14065
14066 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
14067
14068         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
14069         `internal' case regular and protected, but not allowing protected
14070         to be evaluated later.  Bug 49840
14071
14072 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
14073
14074         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14075         to kb.Nlast, and not the kb.nFirst to isolate the switch
14076         statement.
14077
14078         Extract the underlying type, so enumerations of long/ulong are
14079         treated like long/ulong.
14080
14081 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14082
14083         * expression.cs (New): Overload the meaning of RequestedType to
14084         track the possible creation of the NewDelegate type, since
14085         DoResolve is invoked more than once for new constructors on field
14086         initialization.
14087
14088         See bugs: #48800 and #37014
14089
14090         * cs-parser.jay (declare_local_constants): Take an arraylist
14091         instead of a single constant.
14092
14093         (local_constant_declaration): It should take a
14094         constant_declarators, not a constant_declarator.  Fixes 49487
14095
14096         * convert.cs: Fix error report.
14097
14098 2003-10-13 Jackson Harper <jackson@ximian.com>
14099
14100         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14101         bug #49611
14102
14103 2003-10-09  Martin Baulig  <martin@ximian.com>
14104
14105         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14106         to the .ctor.
14107         (MethodCore.DoDefineParameters): Removed the TypeContainer
14108         argument; use the DeclSpace which was passed to the .ctor instead.
14109         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14110         TypeContainer; we only need a DeclSpace here.
14111
14112 2003-10-09  Martin Baulig  <martin@ximian.com>
14113
14114         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14115         to the .ctor.
14116         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14117         EmitContext's .ctor.    
14118
14119 2003-10-09  Martin Baulig  <martin@ximian.com>
14120
14121         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14122         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14123         AsAccessible(), moved them as well.
14124
14125         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14126
14127 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14128
14129         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14130
14131 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14132
14133         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14134         generation for >=, as spotted by Paolo, bug 48679.  
14135         Patch from David Waite.
14136
14137         * cs-tokenizer.cs: Add handling for #pragma.
14138
14139         * cs-parser.jay: Allow for both yield and yield return in the
14140         syntax.  The anti-cobolization of C# fight will go on!
14141
14142         * class.cs (TypeBuilder.DefineType): Catch error condition here
14143         (Parent.DefineType erroring out and returning null).
14144
14145         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14146         coping with enumerations variables, we were mistakenly processing
14147         them as a regular value type instead of built-in types.  Fixes the
14148         bug #48063
14149
14150         * typemanager.cs (IsBuiltinOrEnum): New method.
14151
14152 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14153
14154         * cs-parser.jay: Upgrade: yield now needs the return clause.
14155
14156 2003-09-19  Martin Baulig  <martin@ximian.com>
14157
14158         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14159         `MemberCache parent' argument.  Normally, an interface doesn't
14160         have a parent type except System.Object, but we use this in gmcs
14161         for generic type parameters.
14162
14163 2003-09-18  Martin Baulig  <martin@ximian.com>
14164
14165         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14166         on `type.IsInterface'; don't check whether the type has a parent
14167         to determine whether it's an interface.
14168
14169 2003-09-15  Martin Baulig  <martin@ximian.com>
14170
14171         * class.cs (TypeContainer.DefineType): Added an error flag to
14172         avoid reporting duplicate CS0146's ("class definition is
14173         circular.").
14174
14175         * driver.cs (Driver.MainDriver): Abort if
14176         RootContext.ResolveTree() reported any errors.
14177
14178 2003-09-07  Martin Baulig  <martin@ximian.com>
14179
14180         * report.cs (Error, Warning): Added overloaded versions which take
14181         a `params object[] args' and call String.Format().
14182
14183 2003-09-07  Martin Baulig  <martin@ximian.com>
14184
14185         * decl.cs (DeclSpace..ctor): Don't call
14186         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14187         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14188         (DeclSpace.RecordDecl): New method.
14189
14190         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14191
14192 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14193
14194         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14195         value attributes to be applied to ParameterBuilders.
14196
14197         * class.cs (MethodCore.LabelParameters): Make static and more
14198         generic so that it can be used from other places - like interface
14199         methods, for instance.
14200
14201         * interface.cs (Interface.Emit): Call LabelParameters before
14202         emitting attributes on the InterfaceMethod.
14203
14204 2003-08-26  Martin Baulig  <martin@ximian.com>
14205
14206         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14207         resolving aliases; fixes #47927.
14208
14209 2003-08-26  Martin Baulig  <martin@ximian.com>
14210
14211         * statement.cs (Using.DoResolve): This is internally emitting a
14212         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14213         do not always return.  Fixes #47681.
14214
14215 2003-08-26  Martin Baulig  <martin@ximian.com>
14216
14217         * decl.cs (MemberCore): Moved WarningNotHiding(),
14218         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14219         into MemberBase.
14220         (AdditionResult): Make this nested in DeclSpace.
14221         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14222         argument; call NamespaceEntry.Define() unless we're nested in a
14223         class or struct.
14224
14225         * namespace.cs (Namespace.DefineName): New public function.  This
14226         is called from DeclSpace's .ctor to add 
14227         (Namespace.Lookup): Include DeclSpaces in the lookup.
14228
14229         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14230
14231         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14232
14233 2003-08-25  Martin Baulig  <martin@ximian.com>
14234
14235         * convert.cs (Convert.ExplicitReferenceConversion): When
14236         converting from an interface type to a class, unbox if the target
14237         type is a struct type.  Fixes #47822.
14238
14239 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14240
14241         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14242         #47854.
14243
14244 2003-08-22  Martin Baulig  <martin@ximian.com>
14245
14246         * class.cs (TypeManager.DefineType): When defining a nested type,
14247         call DefineType() on our parent; fixes #47801.
14248
14249 2003-08-22  Martin Baulig  <martin@ximian.com>
14250
14251         * class.cs (MethodData.Define): While checking if a method is an
14252         interface implementation, improve the test a bit more to fix #47654.
14253
14254 2003-08-22  Martin Baulig  <martin@ximian.com>
14255
14256         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14257         correctly; fixes #47722.
14258
14259 2003-08-22  Martin Baulig  <martin@ximian.com>
14260
14261         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14262         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14263
14264         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14265
14266 2003-08-22  Martin Baulig  <martin@ximian.com>
14267
14268         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14269         can only be assigned in static constructors.  Fixes #47161.
14270
14271 2003-08-22  Martin Baulig  <martin@ximian.com>
14272
14273         Rewrote and improved the flow analysis code.
14274
14275         * flowbranching.cs (FlowBranching): Make this class abstract.
14276         (FlowBranching.CreateBranching): New static function to create a
14277         new flow branching.
14278         (FlowBranchingBlock, FlowBranchingException): New classes.
14279         (FlowBranching.UsageVector.Type): New public readonly field.
14280         (FlowBranching.UsageVector.Breaks): Removed the setter.
14281         (FlowBranching.UsageVector.Returns): Removed the setter.
14282         (FlowBranching.UsageVector): Added Break(), Return(),
14283         NeverReachable() and Throw() methods to modify the reachability.
14284         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14285         done by FlowBranching.Merge().
14286         (FlowBranching.UsageVector.MergeChild): New method; merges the
14287         merge result into the current vector.
14288         (FlowBranching.Merge): New abstract method to merge a branching.
14289
14290 2003-08-12  Martin Baulig  <martin@ximian.com>
14291
14292         * expression.cs (Indirection.CacheTemporaries): Create the
14293         LocalTemporary with the pointer type, not its element type.
14294
14295 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14296
14297         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14298         token was a keyword or not.
14299
14300         Add `error' options where an IDENTIFIER was expected;  Provide
14301         CheckToken and CheckIdentifierToken convenience error reporting
14302         functions. 
14303
14304         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14305
14306         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14307         NameSpaceEntry NameSpaceEntry.
14308
14309         (LookupInterfaceOrClass): Avoid creating a full qualified name
14310         from namespace and name: avoid doing lookups when we know the
14311         namespace is non-existant.   Use new Tree.LookupByNamespace which
14312         looks up DeclSpaces based on their namespace, name pair.
14313
14314         * driver.cs: Provide a new `parser verbose' to display the
14315         exception thrown during parsing.  This is turned off by default
14316         now, so the output of a failure from mcs is more graceful.
14317
14318         * namespace.cs: Track all the namespaces defined in a hashtable
14319         for quick lookup.
14320
14321         (IsNamespace): New method
14322
14323 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14326         we know that we need to concatenate (full typename can never be
14327         null). 
14328
14329         * class.cs: ditto.
14330
14331         * statement.cs: Use a bitfield;  Do not initialize to null things
14332         which are done by the constructor by default.
14333
14334         * cs-parser.jay: bug fix, parameter was 4, not 3.
14335
14336         * expression.cs: Just use the property;
14337
14338         * statement.cs: No need for GetVariableInfo method.
14339
14340 2003-08-08  Martin Baulig  <martin@ximian.com>
14341
14342         * flowanalysis.cs (FlowReturns): This is now nested in the
14343         `FlowBranching' class.
14344         (MyBitVector): Moved this here from statement.cs.
14345         (FlowBranching.SiblingType): New enum type.
14346         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14347
14348 2003-08-07  Martin Baulig  <martin@ximian.com>
14349
14350         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14351         `FlowBranching' class and called `BranchingType'.
14352
14353 2003-08-07  Martin Baulig  <martin@ximian.com>
14354
14355         * flowanalysis.cs: Moved all the control flow analysis code into
14356         its own file.
14357
14358 2003-08-07  Martin Baulig  <martin@ximian.com>
14359
14360         * assign.cs (Assign.DoResolve): `target' must either be an
14361         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14362         #37319.
14363
14364 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * expression.cs (BinaryMethod): This kind of expression is created by the
14367         Binary class if it determines that the operator has to be handled
14368         by a method.
14369
14370         (BinaryDelegate): This kind of expression is created if we are
14371         dealing with a + or - operator on delegates.
14372
14373         (Binary): remove method, argumetns, and DelegateOperator: when
14374         dealing with methods, 
14375
14376         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14377
14378         * statement.cs (Block): use bitfields for the three extra booleans
14379         we had in use.   Remove unused topblock parameter.
14380
14381         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14382
14383         * assign.cs: Drop extra unneeded tests.
14384
14385 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14388
14389         * statement.cs (Foreach): Use VariableStorage instead of
14390         LocalBuilders.   
14391
14392         * codegen.cs (VariableStorage): New class used by clients that
14393         require a variable stored: locals or fields for variables that
14394         need to live across yield.
14395
14396         Maybe provide a convenience api for EmitThis+EmitLoad?
14397
14398         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14399         these bad boys.
14400
14401 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14402
14403         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14404         RemapParameterLValue): New methods that are used to turn a
14405         precomputed FieldInfo into an expression like this:
14406
14407                 instance.FieldInfo
14408
14409         The idea is to use this instead of making LocalVariableReference
14410         have more than one meaning.
14411
14412         * cs-parser.jay: Add error production to BASE.
14413
14414         * ecore.cs: Deal with TypeManager.GetField returning null, which
14415         is now a valid return value.
14416
14417         (FieldExprNoAddress): New expression for Fields whose address can
14418         not be taken.
14419
14420         * expression.cs (LocalVariableReference): During the resolve
14421         phases, create new expressions if we are in a remapping context.
14422         Remove code that dealt with remapping here.
14423
14424         (ParameterReference): same.
14425
14426         (ProxyInstance): New expression, like the `This' expression, but
14427         it is born fully resolved.  We know what we are doing, so remove
14428         the errors that are targeted to user-provided uses of `this'.
14429
14430         * statement.cs (Foreach): our variable is now stored as an
14431         Expression;  During resolution, follow the protocol, dont just
14432         assume it will return this.
14433
14434 2003-08-06  Martin Baulig  <martin@ximian.com>
14435
14436         * support.cs (SeekableStreamReader.cs): New public class.
14437
14438         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14439         SeekableStreamReader instead of the normal StreamReader.
14440
14441 2003-08-04  Martin Baulig  <martin@ximian.com>
14442
14443         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14444         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14445         deambiguate casts and delegate invocations.
14446         (parenthesized_expression): Use the new tokens to ensure this is
14447         not a cast of method invocation.
14448
14449         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14450         when reading a `)' and Deambiguate_CloseParens () was previously
14451         called.
14452
14453         * expression.cs (ParenthesizedExpression): New class.  This is
14454         just used for the CS0075 test.
14455         (Binary.DoResolve): Check for CS0075.   
14456
14457 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14458
14459         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14460         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14461         reference comparison.
14462
14463         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14464         examine the ReturnType for equality - this is necessary in the
14465         cases of implicit and explicit operators whose signature also
14466         includes the return type.
14467
14468 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14469
14470         * namespace.cs: Cache the result of the namespace computation,
14471         instead of computing it every time.
14472
14473 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14474
14475         * decl.cs: Use a global arraylist that we reuse over invocations
14476         to avoid excesive memory consumption.  Reduces memory usage on an
14477         mcs compile by one meg (45 average).
14478
14479         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14480         private, work around that.
14481
14482 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14483
14484         * literal.cs (IntLiteral): Define Zero and One static literals. 
14485
14486         * cs-parser.jay (integer_literal): use static literals to reduce
14487         memory usage for the most used literals (0, 1 and -1).  211kb
14488         reduced in memory usage.
14489
14490         Replace all calls to `new ArrayList' with `new
14491         ArrayList(4)' which is a good average number for most allocations,
14492         and also requires only 16 bytes of memory for its buffer by
14493         default. 
14494
14495         This reduced MCS memory usage in seven megabytes for the RSS after
14496         bootstrapping.
14497
14498 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14499
14500         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14501         handle params methods the correct way by forming only one
14502         applicable set with params and normal methods in them. Earlier we
14503         were looking at params methods only if we found no normal methods
14504         which was not the correct thing to do.
14505
14506         (Invocation.BetterFunction): Take separate arguments indicating
14507         when candidate and the best method are params methods in their
14508         expanded form.
14509
14510         This fixes bugs #43367 and #46199.
14511
14512         * attribute.cs: Documentation updates.
14513
14514         (CheckAttribute): Rename to CheckAttributeTarget.
14515         (GetValidPlaces): Rename to GetValidTargets.
14516
14517         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14518         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14519
14520         Fixes bug #44468.
14521
14522 2003-07-28  Martin Baulig  <martin@ximian.com>
14523
14524         * class.cs (TypeContainer.DefineMembers): Use the base type's full
14525         name when looking up the base class of a nested class.  Fixes #46977.
14526
14527 2003-07-26  Martin Baulig  <martin@ximian.com>
14528
14529         * expression.cs (Indexers.Indexer): New nested struct; contains
14530         getter, setter and the indexer's type.
14531         (Indexers.Properties): This is now an ArrayList of
14532         Indexers.Indexer's.
14533         (IndexerAccess.DoResolveLValue): Correctly set the type if the
14534         indexer doesn't have any getters.
14535
14536         * assign.cs (Assign.DoResolve): Also do the implicit conversions
14537         for embedded property and indexer assignments.
14538
14539 2003-07-26  Martin Baulig  <martin@ximian.com>
14540
14541         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
14542         preprocessor directive is not the first non-whitespace character
14543         on a line.
14544
14545 2003-07-26  Martin Baulig  <martin@ximian.com>
14546
14547         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
14548         namespace parsing, follow the spec more closely.
14549
14550         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
14551         NamespaceEntry.Lookup().
14552
14553 2003-07-25  Martin Baulig  <martin@ximian.com>
14554
14555         * MethodCore.cs (OverridesSomething): New public field; it's set
14556         from TypeContainer.DefineMembers if this method overrides
14557         something (which doesn't need to be a method).  Fix #39462.
14558
14559 2003-07-25  Ravi Pratap  <ravi@ximian.com>
14560
14561         * typemanager.cs (GetMembers): Ensure that the list of members is
14562         reversed. This keeps things in sync.
14563
14564         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
14565         find an AttributeUsage attribute.
14566
14567         * expression.cs (Invocation.OverloadResolve): Perform the check
14568         which disallows Invoke to be directly called on a Delegate.
14569
14570         (Error_InvokeOnDelegate): Report error cs1533.
14571
14572 2003-07-25  Martin Baulig  <martin@ximian.com>
14573
14574         * expression.cs (Indexers.GetIndexersForType): Only look in the
14575         interface hierarchy if the requested type is already an
14576         interface.  Fixes #46788 while keeping #46502 fixed.
14577
14578 2003-07-25  Martin Baulig  <martin@ximian.com>
14579
14580         * class.cs (TypeContainer.DefineMembers): Check whether all
14581         readonly fields have been assigned and report warning CS0649 if
14582         not.
14583
14584         * statement.cs (LocalInfo.IsFixed): Always return true if this is
14585         a valuetype.
14586
14587 2003-07-24  Ravi Pratap  <ravi@ximian.com>
14588
14589         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
14590         returned from GetMethods to make things consistent with the
14591         assumptions MCS makes about ordering of methods.
14592
14593         This should comprehensively fix bug #45127 and it does :-)
14594
14595         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
14596         ordering is actually reverse.
14597
14598         * Clean up some debug messages I left lying around.
14599
14600         * interface.cs (Populate*): Get rid of code which emits attributes
14601         since the stage in which we emit attributes is the 'Emit' stage,
14602         not the define stage.
14603
14604         (Emit): Move attribute emission for interface members here.
14605
14606 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14607
14608         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14609         closely: we eliminate methods in base types when we have an
14610         applicable method in a top-level type.
14611
14612         Please see section 14.5.5.1 for an exact description of what goes
14613         on. 
14614
14615         This fixes bug #45127 and a host of other related to corlib compilation.
14616
14617         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14618         array is the method corresponding to the top-level type (this is
14619         because of the changes made to icall.c) so we change this
14620         accordingly.
14621
14622         (MethodGroupExpr.Name): This too.
14623
14624         * typemanager.cs (GetElementType): New method which does the right
14625         thing when compiling corlib. 
14626
14627         * everywhere: Make use of the above in the relevant places.
14628
14629 2003-07-22  Martin Baulig  <martin@ximian.com>
14630
14631         * cs-parser.jay (invocation_expression): Moved
14632         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14633         `cast_expression', but create a InvocationOrCast which later
14634         resolves to either an Invocation or a Cast.
14635
14636         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14637         method; call this before EmitStatement() to make sure that this
14638         expression can be used as a statement.
14639
14640         * expression.cs (InvocationOrCast): New class; resolves to either
14641         an Invocation or a Cast.
14642
14643         * statement.cs (StatementExpression): Call ResolveStatement() on
14644         the ExpressionStatement before emitting it.
14645
14646 2003-07-21  Martin Baulig  <martin@ximian.com>
14647
14648         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14649         `ref' and `out' attributes match; fixes #46220.
14650         (MemberAccess.ResolveMemberAccess): You can't reference a type
14651         through an expression; fixes #33180.
14652         (Indexers.GetIndexersForType): Don't return the indexers from
14653         interfaces the class implements; fixes #46502.
14654
14655 2003-07-21  Martin Baulig  <martin@ximian.com>
14656
14657         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14658         CS0661 checks; fixes bug #30442.
14659
14660 2003-07-21  Martin Baulig  <martin@ximian.com>
14661
14662         * decl.cs (AdditionResult): Added `Error'.
14663
14664         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14665
14666         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14667         makes cs0031.cs actually work.
14668
14669 2003-07-20  Martin Baulig  <martin@ximian.com>
14670
14671         * namespace.cs: Fixed that bug which caused a crash when compiling
14672         the debugger's GUI.
14673
14674 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14675
14676         * typemanager.cs (LookupTypeReflection): Never expose types which
14677         are NotPublic, NestedPrivate, NestedAssembly, or
14678         NestedFamANDAssem.  We used to return these, and later do a check
14679         that would report a meaningful error, but the problem is that we
14680         would not get the real match, if there was a name override.
14681
14682 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14683
14684         * namespace.cs (Namespace, Name): Do not compute the namespace
14685         name dynamically, compute it in the constructor.  This reduced
14686         memory usage by 1697 KB.
14687
14688         * driver.cs: Use --pause to pause at the end.
14689
14690 2003-07-17  Peter Williams  <peter@newton.cx>
14691
14692         * Makefile: Change the name of the test target so that it doesn't
14693         conflict with the recursive test target.
14694
14695 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14696
14697         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14698         AddressOf): Do not use EmitThis, that was wrong, use the actual
14699         this pointer.
14700
14701 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14702
14703         * class.cs (MethodData.Define): While checking if a method is an
14704         interface implementation, improve the test: If we are not public
14705         (use new test here: use the computed MethodAttributes directly,
14706         instead of the parsed modifier flags) check if the `implementing'
14707         method comes from an interface or not.
14708
14709         * pending.cs (VerifyPendingMethods): Slightly better error
14710         message.
14711
14712         * makefile: add test target that does the mcs bootstrap.
14713
14714 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14715
14716         * interface.cs (Define): Do nothing here since there are no
14717         members to populate etc. Move the attribute emission out of here
14718         since this was just totally the wrong place to put it. Attribute
14719         application happens during the 'Emit' phase, not in the 'Define'
14720         phase.
14721
14722         (Emit): Add this method and move the attribute emission here
14723
14724         * rootcontext.cs (EmitCode): Call the Emit method on interface
14725         types too.
14726
14727 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14728
14729         * expression.cs (OverloadResolve): Report error only if Location
14730         is not 'Null' which means that there was a probe going on.
14731
14732 2003-07-14  Martin Baulig  <martin@ximian.com>
14733
14734         * expression.cs (ConditionalLogicalOperator): New public class to
14735         implement user defined conditional logical operators.
14736         This is section 14.11.2 in the spec and bug #40505.
14737
14738 2003-07-14  Martin Baulig  <martin@ximian.com>
14739
14740         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14741
14742 2003-07-14  Martin Baulig  <martin@ximian.com>
14743
14744         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14745
14746         * ecore.cs (IVariable.VerifyFixed): New interface method.
14747
14748         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14749         operator, check whether the variable is actually fixed.  Fixes bug
14750         #36055.  Set a variable definitely assigned when taking its
14751         address as required by the spec.
14752
14753         * statement.cs (LocalInfo.IsFixed): New field.
14754         (LocalInfo.MakePinned): Set `IsFixed' to true.
14755
14756 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14757
14758         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14759         for .ctors, ensure that we only ask for members declared in the
14760         attribute type (BindingFlags.DeclaredOnly).
14761
14762         Fixes bug #43632.
14763
14764         * expression.cs (Error_WrongNumArguments): Report error 1501
14765         correctly the way CSC does.
14766
14767 2003-07-13  Martin Baulig  <martin@ximian.com>
14768
14769         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14770         lookup on the fully qualified name, to make things like "X.X" work
14771         where "X.X" is a fully qualified type name, but we also have a
14772         namespace "X" in the using list.  Fixes #41975.
14773
14774 2003-07-13  Martin Baulig  <martin@ximian.com>
14775
14776         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14777         function. If we're a CompoundAssign, we need to create an embedded
14778         CompoundAssign, not an embedded Assign.
14779         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14780         Fixes #45854.
14781
14782 2003-07-13  Martin Baulig  <martin@ximian.com>
14783
14784         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14785         work to fix bug #46088.
14786
14787 2003-07-13  Ravi Pratap <ravi@ximian.com>
14788
14789         * class.cs (Operator.Emit): Do not emit attributes here - it is
14790         taken care of by the Method class that we delegate too. This takes
14791         care of bug #45876.
14792
14793 2003-07-10  Martin Baulig  <martin@ximian.com>
14794
14795         * expression.cs (TypeOfVoid): New class.
14796         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14797
14798 2003-07-10  Martin Baulig  <martin@ximian.com>
14799
14800         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14801         bug #35957.
14802
14803 2003-07-10  Martin Baulig  <martin@ximian.com>
14804
14805         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14806         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14807
14808         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14809
14810         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14811
14812 2003-07-10  Martin Baulig  <martin@ximian.com>
14813
14814         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14815         of decimal.  Fixes #42850.
14816
14817         NOTE: I also fixed the created byte blob, but this doesn't work on
14818         the MS runtime and csc never produces any byte blobs for decimal
14819         arrays.
14820
14821 2003-07-10  Martin Baulig  <martin@ximian.com>
14822
14823         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14824         structs; fixes #32068.
14825         (Block.AddChildVariableNames): Fixed #44302.
14826
14827 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14828
14829         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14830
14831 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14832
14833         * attribute.cs: And this test is onger needed.
14834
14835 2003-07-08  Martin Baulig  <martin@ximian.com>
14836
14837         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14838         inaccessible types.  Fixes #36313.
14839
14840         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14841
14842         * namespace.cs (NamespaceEntry): Create implicit entries for all
14843         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14844         implicit entries for N1.N2 and N1.
14845
14846 2003-07-08  Martin Baulig  <martin@ximian.com>
14847
14848         Rewrote the handling of namespaces to fix a lot of the issues
14849         wrt. `using' aliases etc.
14850
14851         * namespace.cs (Namespace): Splitted this class into a
14852         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14853
14854         * typemanager.cs (TypeManager.IsNamespace): Removed.
14855         (TypeManager.ComputeNamespaces): Only compute namespaces from
14856         loaded assemblies here, not the namespaces from the assembly we're
14857         currently compiling.
14858
14859 2003-07-08  Martin Baulig  <martin@ximian.com>
14860
14861         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14862
14863 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14864
14865         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14866         already fixed it.  
14867
14868         I thought about the memory savings here, but LookupTypeReflection
14869         is used under already very constrained scenarios.  Compiling
14870         corlib or mcs only exposes one hit, so it would not really reduce
14871         any memory consumption.
14872
14873 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14874
14875         * typemanager.cs: fixes bug #45889 by only adding public types from
14876         other assemblies to the list of known types.
14877
14878 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14879
14880         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14881         on the type we resolved.
14882
14883 2003-07-05  Martin Baulig  <martin@ximian.com>
14884
14885         * pending.cs (PendingImplementation.ParentImplements): Don't
14886         create the proxy if the parent is abstract.
14887
14888         * class.cs (TypeContainer.DefineIndexers): Process explicit
14889         interface implementations first.  Fixes #37714.
14890
14891 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14892
14893         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14894         defined recursively;  but since we modify the input parameters
14895         (left is set to `this' temporarily), we reset this value if the
14896         left_is_explicit is false, which gives the original semantics to
14897         the code.  
14898
14899         * literal.cs (NullPointer): new class used to represent a null
14900         literal in a pointer context.
14901
14902         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14903         type is a pointer, use a NullPointer object instead of a
14904         NullLiteral.   Closes 43687
14905
14906         (ExplicitConversion): Convert pointer values using
14907         the conv opcode to the proper type.
14908
14909         * ecore.cs (New): change ValueTypeVariable property into a method,
14910         that returns whether the valuetype is suitable for being used.
14911
14912         * expression.cs (Binary.DoNumericPromotions): Only return if we
14913         the int constant was a valid uint, and we can return both left and
14914         right as uints.  If not, we continue processing, to trigger the
14915         type conversion.  This fixes 39018.
14916
14917         * statement.cs (Block.EmitMeta): During constant resolution, set
14918         the CurrentBlock property on the emitcontext, so that we resolve
14919         constants propertly.
14920
14921 2003-07-02  Martin Baulig  <martin@ximian.com>
14922
14923         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14924         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14925
14926         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14927         than emitting it here.
14928
14929         * statement.cs: Fixed some more flow analysis bugs.
14930
14931 2003-07-02  Martin Baulig  <martin@ximian.com>
14932
14933         * class.cs (MethodData.Define): When implementing interface
14934         methods, set Final unless we're Virtual.
14935
14936         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14937         check work for interface methods.
14938
14939 2003-07-01  Martin Baulig  <martin@ximian.com>
14940
14941         * ecore.cs (EmitContext.This): Replaced this property with a
14942         GetThis() method which takes a Location argument.  This ensures
14943         that we get the correct error location for a CS0188.
14944
14945 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14946
14947         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14948         ImplicitStandardConversion.
14949
14950         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14951
14952 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14953
14954         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14955         optimization.
14956
14957 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14958
14959         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14960         constructors.
14961
14962         (MethodData.Define): Turn off initlocals for unsafe methods.
14963
14964 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14965
14966         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14967         complete;  Fixes #37521.
14968
14969         * delegate.cs: Use Modifiers.TypeAttr to compute the
14970         TypeAttributes, instead of rolling our own.  This makes the flags
14971         correct for the delegates.
14972
14973 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14974
14975         * class.cs (Constructor.Define): Set the private flag for static
14976         constructors as well.
14977
14978         * cs-parser.jay (statement_expression): Set the return value to
14979         null, to avoid a crash when we catch an error.
14980
14981 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14982
14983         * cs-parser.jay: Applied patch from Jackson that adds support for
14984         extern and unsafe modifiers to destructor declarations.
14985
14986         * expression.cs: Report error 21 if the user is trying to index a
14987         System.Array.
14988
14989         * driver.cs: Add an error message, suggested by the bug report.
14990
14991         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14992         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14993
14994 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14995
14996         * namespace.cs: Add some information to reduce FAQs.
14997
14998 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14999
15000         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15001         underlying enumeration types.  Fixes #43915.
15002
15003         * expression.cs: Treat ushort/short as legal values to be used in
15004         bitwise operations.
15005
15006 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15007
15008         * delegate.cs: transfer custom attributes for paramenters from
15009         the delegate declaration to Invoke and BeginInvoke.
15010
15011 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15012
15013         * attribute.cs: handle custom marshalers and emit marshal info
15014         for fields, too.
15015
15016 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15017
15018         * makefile.gnu: Added anonymous.cs to the compiler sources.
15019
15020 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15021
15022         * iterators.cs: Change the name of the proxy class to include two
15023         underscores.
15024
15025         * cs-parser.jay: Update grammar to include anonymous methods.
15026
15027         * anonymous.cs: new file.
15028
15029 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15030
15031         * class.cs (Field.Define): Add missing test for pointers and
15032         safety. 
15033
15034 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15035
15036         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15037         we use the stobj opcode.
15038
15039         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15040         since it wasn't the correct fix. 
15041
15042         It still is puzzling that we are required to use stobj for IntPtr
15043         which seems to be a ValueType.
15044
15045 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15046
15047         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15048         during regular simple name resolution.   Now, the trick is that
15049         instead of returning for processing the simplename, we do a
15050         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15051         contextual lookup type).   If a match is found, return that, if
15052         not, return for further composition.
15053
15054         This fixes long-standing 30485.
15055
15056         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15057         using the address to initialize an object, do an Stobj instead of
15058         using the regular Stelem.
15059
15060         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15061         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15062         Because if we are a BaseIndexerAccess that value will be true.
15063         Fixes 43643.
15064
15065         * statement.cs (GotoCase.Resolve): Return after reporting an
15066         error, do not attempt to continue. 
15067
15068         * expression.cs (PointerArithmetic.Emit): If our operand is a
15069         long, convert our constants to match the operand before
15070         multiplying.  Convert to I type before adding.   Fixes 43670.
15071
15072 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15073
15074         * enum.cs (ImplicitConversionExists) : Rename to
15075         ImplicitEnumConversionExists to remove ambiguity. 
15076
15077         * ecore.cs (NullCast): New type of cast expression class which
15078         basically is very similar to EmptyCast with the difference being
15079         it still is a constant since it is used only to cast a null to
15080         something else
15081         (eg. (string) null)
15082
15083         * convert.cs (ImplicitReferenceConversion): When casting a null
15084         literal, we return a NullCast.
15085
15086         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15087         should be around anymore.
15088
15089         The renaming (reported was slightly wrong). Corrections:
15090
15091         ConvertImplicitStandard -> ImplicitConversionStandard
15092         ConvertExplicitStandard -> ExplicitConversionStandard
15093
15094         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15095         before passing them in !
15096
15097         * convert.cs (ImplicitConversionStandard): When comparing for
15098         equal expr and target types, ensure that expr is not a
15099         NullLiteral.
15100
15101         In general, we must not be checking (expr_type ==
15102         target_type) in the top level conversion methods
15103         (ImplicitConversion, ExplicitConversion etc). This checking is
15104         done in the methods that they delegate to.
15105
15106 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15107
15108         * convert.cs: Move Error_CannotConvertType,
15109         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15110         ImplicitNumericConversion, ImplicitConversionExists,
15111         ImplicitUserConversionExists, StandardConversionExists,
15112         FindMostEncompassedType, FindMostSpecificSource,
15113         FindMostSpecificTarget, ImplicitUserConversion,
15114         ExplicitUserConversion, GetConversionOperators,
15115         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15116         TryImplicitIntConversion, Error_CannotConvertImplicit,
15117         ConvertImplicitRequired, ConvertNumericExplicit,
15118         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15119         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15120         its own file.
15121
15122         Perform the following renames:
15123
15124         StandardConversionExists -> ImplicitStandardConversionExists
15125         ConvertImplicit -> ImplicitConversion
15126         ConvertImplicitStandard -> ImplicitStandardConversion
15127         TryImplicitIntConversion -> ImplicitIntConversion
15128         ConvertImplicitRequired -> ImplicitConversionRequired
15129         ConvertNumericExplicit -> ExplicitNumericConversion
15130         ConvertReferenceExplicit -> ExplicitReferenceConversion
15131         ConvertExplicit -> ExplicitConversion
15132         ConvertExplicitStandard -> ExplicitStandardConversion
15133
15134 2003-05-19  Martin Baulig  <martin@ximian.com>
15135
15136         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15137         (TypeInfo): Added support for structs having structs as fields.
15138
15139         * ecore.cs (FieldExpr): Implement IVariable.
15140         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15141         VariableInfo for the field.
15142
15143 2003-05-18  Martin Baulig  <martin@ximian.com>
15144
15145         * expression.cs (This.DoResolve): Report a CS0027 if we're
15146         emitting a field initializer.
15147
15148 2003-05-18  Martin Baulig  <martin@ximian.com>
15149
15150         * expression.cs (This.ResolveBase): New public function.
15151         (This.DoResolve): Check for CS0188.
15152
15153         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15154         This.Resolve().
15155
15156         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15157         `instance_expression' to null if we don't have any non-static
15158         methods.
15159
15160 2003-05-18  Martin Baulig  <martin@ximian.com>
15161
15162         Reworked the way how local variables and parameters are handled by
15163         the flow analysis code.
15164
15165         * statement.cs (TypeInfo, VariableMap): New public classes.
15166         (VariableInfo): New public class.  This is now responsible for
15167         checking whether a variable has been assigned.  It is used for
15168         parameters and local variables.
15169         (Block.EmitMeta): Take the InternalParameters as argument; compute
15170         the layout of the flow vectors here.
15171         (Block.LocalMap, Block.ParameterMap): New public properties.
15172         (FlowBranching): The .ctor doesn't get the InternalParameters
15173         anymore since Block.EmitMeta() now computes the layout of the flow
15174         vector.
15175         (MyStructInfo): This class is now known as `StructInfo' and nested
15176         in `TypeInfo'; we don't access this directly anymore.
15177
15178         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15179         property and removed IsAssigned(), IsFieldAssigned(),
15180         SetAssigned() and SetFieldAssigned(); we now call them on the
15181         VariableInfo so we don't need to duplicate this code everywhere.
15182
15183         * expression.cs (ParameterReference): Added `Block block' argument
15184         to the .ctor.
15185         (LocalVariableReference, ParameterReference, This): The new
15186         VariableInfo class is now responsible for all the definite
15187         assignment stuff.
15188
15189         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15190         IsParameterAssigned, SetParameterAssigned): Removed.
15191
15192 2003-05-18  Martin Baulig  <martin@ximian.com>
15193
15194         * typemanager.cs (InitCoreTypes): Try calling
15195         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15196         the 3-args-version.  Corlib now also needs our `void_type'.
15197         (GetMethod): Added overloaded version which takes an optional
15198         `bool report_errors' to allow lookups of optional methods.
15199
15200 2003-05-12  Martin Baulig  <martin@ximian.com>
15201
15202         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15203         only used for locals and not for parameters.
15204
15205 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15206
15207         * support.cs (InternalParameters.ParameterType): Return the
15208         ExternalType of the parameter.
15209
15210         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15211         they were unused.
15212
15213 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * class.cs (MethodData.Define): Do not set the `newslot' on
15216         interface members, if they are also flagged as "override".
15217
15218         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15219         better code for ++i and i++.  This only works for static fields
15220         and local variables.
15221
15222         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15223         want to pull the DeclSpace out of the builder_to_declspace instead
15224         of the TypeBuilder (like in TypeContainer.FindMembers).
15225
15226         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15227         instead of LookupTypeContainer.  Fixes the crash on .NET for
15228         looking up interface members.
15229
15230         * const.cs: Create our own emit context during the Definition
15231         stage, so that constants are evaluated in the proper context, when
15232         a recursive definition happens.
15233
15234 2003-05-11  Martin Baulig  <martin@ximian.com>
15235
15236         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15237         new block for a switch section.
15238         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15239         the adding/lookup in the switch block.  Fixes #39828.
15240
15241 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15242
15243         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15244         functionality: I needed to convert the data after I had performed
15245         the add/sub operation into the operands type size.
15246
15247         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15248         pass the type for the box operation, otherwise the resulting
15249         object would have been of type object.
15250
15251         (BoxedCast): Add constructor to specify the type to box as.
15252
15253 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15254
15255         * iterators.cs: I was reusing the `count' variable inadvertently,
15256         take steps to not allow this to happen.
15257
15258 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15259
15260         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15261         by creating an array at the point where the params starts and
15262         putting all those arguments there, then adjusting the size of the
15263         array.
15264
15265 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15266
15267         * expression.cs (New.AddressOf): Implement interface
15268         IMemoryLocation.  This is used when the `new' operator is used in
15269         the context of an invocation to a method on a value type.
15270
15271         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15272         example. 
15273
15274         * namespace.cs: Also check the using aliases here.
15275
15276         * driver.cs: Move the test for using validity after the types have
15277         been entered, so we do a single pass that also includes the using
15278         aliases. 
15279
15280         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15281         in the regular case.   CreateSiblingForFinally is doing extra
15282         error checking.
15283
15284         * attribute.cs (GetAttributeArgumentExpression): Store the result
15285         on an out value, and use the return value to indicate failure
15286         instead of using null (which is a valid return for Constant.GetValue).
15287
15288         * statement.cs: Perform the analysis flow for the increment
15289         portion after the statement, because this will be the real flow of
15290         execution.  Fixes #42385
15291
15292         * codegen.cs (EmitContext.EmitArgument,
15293         EmitContext.EmitStoreArgument): New helper functions when the
15294         RemapToProxy flag is set.
15295
15296         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15297         function.
15298
15299         Add support for remapping parameters. 
15300
15301         * iterators.cs: Propagate parameter values;  Store parameter
15302         values in the proxy classes.
15303
15304 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15305
15306         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15307         need a proxy reference;  I do not know what I was thinking
15308
15309         * cs-parser.jay (constructor_initializer): catch another error,
15310         and display nice message.
15311
15312         (field_declaration): catch void field declaration
15313         to flag a better error. 
15314
15315         * class.cs (MemberBase.CheckBase): Report an error instead of a
15316         warning if a new protected member is declared in a struct. 
15317         (Field.Define): catch the error of readonly/volatile.
15318
15319         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15320
15321         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15322         volatile variable is taken
15323
15324 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15325
15326         * statement.cs (Fixed.Resolve): Report an error if we are not in
15327         an unsafe context.
15328
15329 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15330
15331         * typemanager.cs: reuse the code that handles type clashes for
15332         delegates and enumerations.
15333
15334         * class.cs (Report28): Always report.
15335
15336         * expression.cs (EncodeAsAttribute): Allow nulls here.
15337
15338 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15339
15340         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15341         the functionality for testing whether an expression is valid for
15342         an attribute here.  Also handle the case of arrays of elements
15343         being stored. 
15344
15345         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15346         encoding a linear array into an array of objects that are suitable
15347         to be passed to an CustomAttributeBuilder.
15348
15349         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15350
15351         * ecore.cs: (FieldExpr): Handle field remapping here.
15352
15353         * iteratators.cs: Pass the instance variable (if the method is an
15354         instance method) to the constructors, so we can access the field
15355         variables on the class.
15356
15357         TODO: Test this with structs.  I think the THIS variable on
15358         structs might have to be a pointer, and not a refenrece
15359
15360 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15361
15362         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15363         local variables to fields in a proxy class.
15364
15365         * iterators.cs (PopulateProxy): Rename our internal fields to
15366         <XXX>.  
15367         Create a <THIS> field if we are an instance method, so we can
15368         reference our parent container variables.
15369         (MapVariable): Called back from the EmitContext code to enter a
15370         new variable to field mapping into the proxy class (we just create
15371         a FieldBuilder).
15372
15373         * expression.cs
15374         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15375         for using the remapped locals to fields.
15376
15377         I placed the code here, because that gives the same semantics to
15378         local variables, and only changes the Emit code.
15379
15380         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15381         statements inside iterators.
15382         (VariableInfo): Add a FieldBuilder for the cases when we are
15383         remapping local variables to fields in a proxy class
15384
15385         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15386         current_block != null.
15387
15388         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15389         not cope with strings, as it has been moved to the
15390         TableSwitchEmit.  Fixed bug in switch generation.
15391
15392         * expression.cs (New.DoResolve): Provide more context for the user
15393         when reporting an error.
15394
15395         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15396         pointers. 
15397
15398         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15399         check the permissions for it.  Note than in a type-resolution
15400         context the check was already present in DeclSpace.ResolveType,
15401         but was missing from the MemberAccess.
15402
15403         (ArrayCreation.CheckIndices): warn if the user has
15404         more nested levels of expressions, but there are no more
15405         dimensions specified.  Avoids crash on bug 41906.
15406
15407 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15408
15409         * statement.cs (Block): replace Implicit bool, for a generic
15410         flags.   
15411         New flag: `Unchecked'.  This is used during the EmitMeta phase
15412         (which is out-of-line with the regular Resolve/Emit process for a
15413         statement, as this is done ahead of time, but still gets a chance
15414         to call constant resolve).
15415
15416         (Block.Flags): new enum for adding a new flag.
15417
15418         (Block.EmitMeta): track the state of unchecked.
15419
15420         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15421         to enable constant resolution to work there as well.
15422
15423 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15424
15425         * typemanager.cs (ienumerable_type): Also look up
15426         System.Collections.IEnumerable. 
15427
15428 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15429
15430         TODO: Test more than one conditional per method.
15431
15432         * class.cs (Indexer.Define): Report the location where the user is
15433         referencing the unsupported feature.
15434
15435         (MethodData): Overload the use of `conditionals' to
15436         minimize the creation of needless ArrayLists.   This saves roughly
15437         212kb on my machine.
15438
15439         (Method): Implement the new IIteratorContainer interface.
15440         (Method.SetYields): Implement the method by setting the ModFlags
15441         to contain METHOD_YIELDS.
15442
15443         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15444         which just got set to null.
15445
15446         * iterators.cs: New file.
15447
15448         (Yield, YieldBreak): New statements.
15449
15450         * statement.cs (Return.Resolve): Flag an error if we are used in
15451         an iterator method.
15452
15453         * codegen.cs (InIterator): New flag set if the code is being
15454         compiled in an iterator method.
15455
15456         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15457         internal modifier, and we just use it to avoid adding extra
15458         fields, as this is seldom used.  
15459
15460         * cs-parser.jay: Add yield_statement (yield and yield break).
15461
15462         * driver.cs: New flag -v2 to turn on version 2 features. 
15463
15464         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15465         hashtable when v2 is enabled.
15466
15467 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15468
15469         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15470         there is already a namespace defined with this name.
15471
15472         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15473         people upgraded their corlibs.
15474
15475         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15476         always use fully qualified types, no need to use the compiler
15477         front end.
15478
15479         (TypeManager.IsNamespace): Use binarysearch.
15480
15481         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15482         AddDelegate): I did not quite use the new IsValid API properly: I
15483         have to pass the short-name and the fullname.  I was passing only
15484         the basename instead of the fullname sometimes. 
15485
15486         (TypeContainer.DefineType): call NamespaceClash.
15487
15488         * interface.cs (Interface.DefineType): use NamespaceClash before
15489         defining the type.
15490
15491         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15492         defining the type.
15493
15494         * enum.cs: (Enum.DefineType): use NamespaceClash before
15495         defining the type.
15496
15497         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15498         speed increase.  First, use the negative_hits cache when we get a
15499         negative.  Second, add the type with its full original name
15500         instead of the new . and + encoded name (reflection uses + to
15501         separate type from a nested type).  Use LookupTypeReflection
15502         directly which bypasses the type->name hashtable (that we already
15503         know does not contain the type.
15504
15505         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15506         location/container type. 
15507
15508         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15509
15510 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15511
15512         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15513
15514         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15515         method is being referenced in the method group from a static
15516         context, and report error 120 if so.
15517
15518         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15519         Error118. 
15520
15521         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15522         is created, we create the A namespace).
15523
15524         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15525         Fixes #41591
15526
15527 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15528
15529         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15530         invocation to ModuleBuilder.GetType with the same values will
15531         return a new type instance, so we need to cache its return
15532         values. 
15533
15534         * expression.cs (Binary.ResolveOperator): Only allow the compare
15535         operators on enums if they are of the same type.
15536
15537         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15538         types of ValueType on their own case.  Before we were giving them
15539         the same treatment as objects.
15540
15541         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15542         fullname.  Short name is used to compare against container name.
15543         Fullname is used to check against defined namespace names.
15544
15545         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15546         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15547
15548         (Method.CheckBase): Call parent.
15549         (MemberBase.CheckBase): Check for protected members on sealed
15550         classes.
15551         (PropertyBase.CheckBase): Call parent.
15552         (Field.Define): Call parent.
15553
15554         * report.cs: Negative error codes are now mapped to 8000 - code,
15555         so that the display is render more nicely.
15556
15557         * typemanager.cs: Do not use try/catch, instead report a regular
15558         error. 
15559
15560         (GetPointerType, GetReferenceType): These methods provide
15561         mechanisms to obtain the T* and T& from a T.  We had the code
15562         previously scattered around the code base, and it also used
15563         TypeManager.LookupType that would go through plenty of caches.
15564         This one goes directly to the type source.
15565
15566         In some places we did the Type.GetType followed by
15567         ModuleBuilder.GetType, but not in others, so this unifies the
15568         processing as well.
15569
15570         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15571         statements now that we have namespace information.
15572
15573         * typemanager.cs (IsNamespace): New method, returns whether the
15574         string presented is a namespace or not.
15575
15576         (ComputeNamespaces): New public entry point, computes the list of
15577         available namespaces, using the GetNamespaces API call in Mono, or
15578         the slower version in MS.NET.   
15579
15580         Now before we start the semantic analysis phase, we have a
15581         complete list of namespaces including everything that the user has
15582         provided.
15583
15584         Deleted old code to cache namespaces in .nsc files.
15585
15586 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15587
15588         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15589         class/struct location definition Location for the implicit
15590         constructor location.
15591
15592         (Operator.Define): Use the location of the operator for the
15593         implicit Method definition.
15594
15595         (Constructor.Emit): use the constructor location for the implicit
15596         base initializer constructor.
15597
15598         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15599         and the Expression class now contains two new methods:
15600
15601         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15602         isolate type lookup from the rest of the resolution process.
15603
15604         Since we use Expressions to hold type definitions due to the way
15605         we parse the input we have historically overloaded Resolve to
15606         perform the Type lookups if a special flag is passed.  Now this is
15607         eliminated and two methods take their place. 
15608
15609         The differences in the two methods between xStep and xTerminal is
15610         that xStep is involved in our current lookup system that uses
15611         SimpleNames to compose a name, while xTerminal is used just to
15612         catch the case where the simplename lookup failed.
15613
15614 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * expression.cs (ResolveMemberAccess): Remove redundant code.
15617         TypeExpr expressions are always born fully resolved.
15618
15619         * interface.cs (PopulateMethod): Do not lookup the types twice.
15620         We were doing it once during SemanticAnalysis and once during
15621         PopulateMethod.
15622
15623         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15624         in local variable type definitions, were being returned as a
15625         SimpleName (we decomposed everything into a string), that is
15626         because primary_expression was being used instead of a type in the
15627         grammar (reduce/reduce conflicts).
15628
15629         The part that was wrong is that we converted the expression into a
15630         string (an oversimplification in one hand, compounded with primary
15631         expressions doing string concatenation).
15632
15633         So things like:
15634
15635         A.B.C [] x;
15636
15637         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15638         using clauses from working on this particular context.  And a type
15639         was being matched directly against "A.B.C[]".
15640
15641         We now use the correct approach, and allow for ComposedCast to be
15642         part of the unary expression.  So the "A.B.C []" become a composed
15643         cast of "A.B.C" (as a nested group of MemberAccess with a
15644         SimpleName at the end) plus the rank composition "[]". 
15645
15646         Also fixes 35567
15647
15648 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15649
15650         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15651         for the access level checking.
15652
15653         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15654         `TypeContainer container', because I kept getting confused when I
15655         was debugging this code.
15656
15657         * expression.cs (Indexers): Instead of tracking getters/setters,
15658         we now track them in parallel.  We create one arraylist less, but
15659         most importantly it is possible now for the LValue code to find a
15660         matching get for a set.
15661
15662         (IndexerAccess.DoResolveLValue): Update the code.
15663         GetIndexersForType has been modified already to extract all the
15664         indexers from a type.  The code assumed it did not.
15665
15666         Also make the code set the correct return type for the indexer.
15667         This was fixed a long time ago for properties, but was missing for
15668         indexers.  It used to be void_type.
15669
15670         (Binary.Emit): Test first for doubles instead of
15671         floats, as they are more common.
15672
15673         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15674         when dealing with floats and the <=, >= operators.  This fixes bug
15675         #39314 
15676
15677         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15678         to load the array value by emitting a load on the foreach variable
15679         type.  This was incorrect.  
15680
15681         We now emit the code to load an element using the the array
15682         variable type, and then we emit the conversion operator.
15683
15684         Fixed #40176
15685
15686 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15687
15688         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15689
15690 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15691
15692         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15693         test for protection before we test for signatures. 
15694
15695         (MethodSignature.ToString): implement.
15696
15697         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15698         to the case where we reduced into a LongConstant.
15699
15700         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15701         depend on whether the information is acurrate, because the
15702         Microsoft runtime will always claim that the array type is public,
15703         regardless of the real state.
15704
15705         If the type is a pointer, another problem happens: the type is
15706         reported as non-public in Microsoft.  
15707
15708         In both cases we have to call CheckAccessLevel recursively with
15709         the underlying type as the argument to be tested.
15710
15711 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15712
15713         * assign.cs (Assign.Emit): If we are dealing with a compound
15714         assignment expression, we should use the code path that stores the
15715         intermediate result in a temporary value.  This fixes #40903.
15716
15717         *expression.cs (Indirection.ToString): Provide ToString method for
15718         debugging. 
15719
15720 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15721
15722         * class.cs: Null out fields holding references to Block objects so
15723         they can be garbage collected.
15724
15725         * expression.cs (OverloadResolve): Remove unused local.
15726
15727 2003-04-07  Martin Baulig  <martin@ximian.com>
15728
15729         * codegen.cs (EmitContext.CurrentFile): New public field.
15730         (EmitContext.Mark): Use the CurrentFile to check whether the
15731         location is in the correct file.
15732         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15733
15734 2003-04-07  Martin Baulig  <martin@ximian.com>
15735
15736         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15737
15738         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15739         location.  [FIXME: The location argument which gets passed to this
15740         method is sometimes wrong!]
15741
15742 2003-04-07  Nick Drochak <ndrochak@gol.com>
15743
15744         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15745
15746 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15747
15748         * expression.cs (Indirection.EmitAssign): We were using the
15749         temporary, but returning immediately instead of continuing the
15750         EmitAssing flow.
15751
15752 2003-04-06  Martin Baulig  <martin@ximian.com>
15753
15754         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15755         if it's a nested child, but also deriving from the outer class.
15756         See test 190.cs.
15757
15758         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15759         nested child, but also deriving from the outer class.  See
15760         test-190.cs.
15761         (FilterWithClosure): We may access private members of the outer
15762         class if we're a nested child and deriving from the outer class.
15763         (RealMemberLookup): Only set `closure_private_ok' if the
15764         `original_bf' contained BindingFlags.NonPublic.
15765
15766 2003-04-05  Martin Baulig  <martin@ximian.com>
15767
15768         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15769
15770 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15771
15772         * class.cs (Event.Define): Do not allow abstract events to have
15773         initializers. 
15774
15775 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15776
15777         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15778         block in event declarations.
15779
15780         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15781         value type, get its address.
15782
15783         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15784         leaving a class on the stack instead of a boolean value (int
15785         0/1).  Change the code so we compare against null, and then the
15786         result against zero.
15787
15788         * class.cs (TypeContainer.GetClassBases): We were checking for the
15789         parent class being sealed too late.
15790
15791         * expression.cs (Binary.Emit): For <= and >= when dealing with
15792         floating point values, use cgt.un and clt.un instead of cgt and
15793         clt alone.
15794
15795 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15796
15797         * statement.cs: Apply the same optimization as MS: skip the 
15798         GetEnumerator returning an IEnumerator, and use the one returning a 
15799         CharEnumerator instead. This allows us to avoid the try-finally block 
15800         and the boxing.
15801
15802 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15803
15804         * cs-parser.jay: Attributes cannot be applied to
15805                          namespaces. Fixes #40473
15806
15807 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15808
15809         * class.cs:
15810         (Add*): check if the name is valid using the full name for constants,
15811         fields, properties and events.
15812
15813 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15814
15815         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15816         char constants to be part of the enumeration.
15817
15818         * expression.cs (Conditional.DoResolve): Add support for operator
15819         true. Implements the missing functionality from 14.12
15820
15821         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15822         operator true/false as required by the spec.
15823
15824         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15825         implicit conversion to boolean.
15826
15827         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15828         also one where the type implements `operator true'. 
15829
15830         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15831         get an expression that will invoke operator true based on an
15832         expression.  
15833
15834         (GetConversionOperators): Removed the hack that called op_True
15835         here.  
15836
15837         (Expression.ResolveBoolean): Move this from Statement.
15838
15839 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15840
15841         * ecore.cs (FieldExpr): do not allow initialization of initonly
15842         fields on derived classes
15843
15844 2003-03-13  Martin Baulig  <martin@ximian.com>
15845
15846         * statement.cs (Block.Emit): Call ig.BeginScope() and
15847         ig.EndScope() when compiling with debugging info; call
15848         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15849
15850 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15851
15852         * expression.cs (Indexers): Do not construct immediately, allow
15853         for new members to be appended as we go.  Fixes 38143
15854
15855 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15856
15857         * expression.cs: save/restore context when resolving an unchecked
15858         expression.
15859
15860 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * cfold.cs: Catch division by zero in modulus operator during
15863         constant folding.
15864
15865 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15866
15867         * interface.cs (Interface.DefineMembers): Avoid defining members
15868         twice. 
15869
15870 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15871
15872         * driver.cs: handle the +/- options for -noconfig
15873
15874         * statement.cs (Unckeched.Resolve): Also track the state of
15875         unchecked in the Resolve phase.
15876
15877 2003-02-27  Martin Baulig  <martin@ximian.com>
15878
15879         * ecore.cs (Expression.MemberLookup): Don't create a
15880         MethodGroupExpr for something which is not a method.  Fixes #38291.
15881
15882 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15883
15884         * class.cs (MemberBase.CheckParameters): Also check that the type
15885         is unmanaged if it is a pointer.
15886
15887         * expression.cs (SizeOf.Resolve): Add location information.
15888
15889         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15890         a managed type is declared.
15891
15892         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15893         parameter modifiers as well.  Fixes bug 38606
15894
15895         * class.cs: Very sad.  Am backing out the speed up changes
15896         introduced by the ArrayList -> Array in the TypeContainer, as they
15897         were not actually that much faster, and introduced a bug (no error
15898         reports on duplicated methods).
15899
15900         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15901         source first, this will guarantee that we have a valid expression
15902         before calling in lower levels functions that will require a
15903         resolved object.  Then use this original_source in the
15904         target.ResolveLValue instead of the original source that was
15905         passed to us.
15906
15907         Another change.  Use target.Resolve instead of LValueResolve.
15908         Although we are resolving for LValues, we will let the Assign code
15909         take care of that (it will be called again from Resolve).  This
15910         basically allows code like this:
15911
15912         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15913         class Y { void A (X x) { x [0] += o; }
15914
15915         The problem was that the indexer was trying to resolve for
15916         set_Item (idx, object o) and never finding one.  The real set_Item
15917         was set_Item (idx, X).  By delaying the process we get the right
15918         semantics. 
15919
15920         Fixes bug 36505
15921
15922 2003-02-23  Martin Baulig  <martin@ximian.com>
15923
15924         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15925         while calling DoEmit ().
15926
15927         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15928         source files; if you use the #line directive inside a method, the
15929         compiler stops emitting line numbers for the debugger until it
15930         reaches the end of the method or another #line directive which
15931         restores the original file.
15932
15933 2003-02-23  Martin Baulig  <martin@ximian.com>
15934
15935         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15936
15937 2003-02-23  Martin Baulig  <martin@ximian.com>
15938
15939         * statement.cs (Block.AddChildVariableNames): We need to call this
15940         recursively, not just for our immediate children.
15941
15942 2003-02-23  Martin Baulig  <martin@ximian.com>
15943
15944         * class.cs (Event.Define): Always make the field private, like csc does.
15945
15946         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15947         actually work, fixes bug #37521.
15948
15949 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15950
15951         * delegate.cs: When creating the various temporary "Parameters"
15952         classes, make sure that we call the ComputeAndDefineParameterTypes
15953         on those new parameters (just like we do with the formal ones), to
15954         allow them to be resolved in the context of the DeclSpace.
15955
15956         This fixes the bug that Dick observed in Bugzilla #38530.
15957
15958 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * expression.cs (ResolveMemberAccess): When resolving a constant,
15961         do not attempt to pull a constant if the value was not able to
15962         generate a valid constant.
15963
15964         * const.cs (LookupConstantValue): Do not report more errors than required.
15965
15966 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15967
15968         * expression.cs: fixes bug #38328.
15969
15970 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15971
15972         * class.cs: Changed all the various members that can be part of a
15973         class from being an ArrayList to be an Array of the right type.
15974         During the DefineType type_list, interface_list, delegate_list and
15975         enum_list are turned into types, interfaces, delegates and enums
15976         arrays.  
15977
15978         And during the member population, indexer_list, event_list,
15979         constant_list, field_list, instance_constructor_list, method_list,
15980         operator_list and property_list are turned into their real arrays.
15981
15982         Although we could probably perform this operation earlier, for
15983         good error reporting we need to keep the lists and remove the
15984         lists for longer than required.
15985
15986         This optimization was triggered by Paolo profiling the compiler
15987         speed on the output of `gen-sample-program.pl' perl script. 
15988
15989         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15990         not crash in methods like MemberLookupFailed that use this field.  
15991
15992         This problem arises when the compiler fails to resolve a type
15993         during interface type definition for example.
15994
15995 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15996
15997         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15998         inherit from System.Object, so we have to stop at null, not only
15999         when reaching System.Object.
16000
16001 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16002
16003         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16004         DeclaredOnly because the parent indexer might have had a different
16005         name, but did not loop until the top of the hierarchy was reached.
16006
16007         The problem this one fixes is 35492: when a class implemented an
16008         indexer from an interface, we were getting the interface method
16009         (which was abstract) and we were flagging an error (can not invoke
16010         abstract method).
16011
16012         This also keeps bug 33089 functioning, and test-148 functioning.
16013
16014         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16015         out if a method is special is to see if it is declared in a
16016         property or event, or whether it is one of the predefined operator
16017         names.   This should fix correctly #36804.
16018
16019 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16020
16021         The goal here is to remove the dependency on EmptyCast.Peel ().
16022         Killing it completely.
16023
16024         The problem is that currently in a number of places where
16025         constants are expected, we have to "probe" for an EmptyCast, and
16026         Peel, which is not the correct thing to do, as this will be
16027         repetitive and will likely lead to errors. 
16028
16029         The idea is to remove any EmptyCasts that are used in casts that
16030         can be reduced to constants, so we only have to cope with
16031         constants. 
16032
16033         This bug hunt was triggered by Bug 37363 and the desire to remove
16034         the duplicate pattern where we were "peeling" emptycasts to check
16035         whether they were constants.  Now constants will always be
16036         constants.
16037
16038         * ecore.cs: Use an enumconstant here instead of wrapping with
16039         EmptyCast.  
16040
16041         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16042         throwing me off.  By handling this we can get rid of a few hacks.
16043
16044         * statement.cs (Switch): Removed Peel() code.
16045
16046 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16047
16048         * class.cs: Location information for error 508
16049
16050         * expression.cs (New.DoResolve): Add a guard against double
16051         resolution of an expression.  
16052
16053         The New DoResolve might be called twice when initializing field
16054         expressions (see EmitFieldInitializers, the call to
16055         GetInitializerExpression will perform a resolve on the expression,
16056         and later the assign will trigger another resolution
16057
16058         This leads to bugs (#37014)
16059
16060         * delegate.cs: The signature for EndInvoke should contain any ref
16061         or out parameters as well.  We were not doing this in the past. 
16062
16063         * class.cs (Field.Define): Do not overwrite the type definition
16064         inside the `volatile' group.  Turns out that volatile enumerations
16065         were changing the type here to perform a validity test, which
16066         broke conversions. 
16067
16068 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16071         and structs, we do not want to load the instance variable
16072
16073         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16074         enum_type has to be handled like an object reference (implicit
16075         conversions exists from this to object), but the regular IsClass
16076         and IsValueType tests will never return true for this one.
16077
16078         Also we use TypeManager.IsValueType instead of type.IsValueType,
16079         just for consistency with the rest of the code (this is only
16080         needed if we ever use the construct exposed by test-180.cs inside
16081         corlib, which we dont today).
16082
16083 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16084
16085         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16086         just InternalCall.
16087
16088 2003-02-09  Martin Baulig  <martin@ximian.com>
16089
16090         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16091         (Namespace.DefineNamespaces): New static public method; this is
16092         called when we're compiling with debugging to add all namespaces
16093         to the symbol file.
16094
16095         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16096         pass it to the Namespace's .ctor.
16097
16098         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16099         and MethodBase arguments; pass the namespace ID to the symwriter;
16100         pass the MethodBase instead of the token to the symwriter.
16101         (SymbolWriter.DefineNamespace): New method to add a namespace to
16102         the symbol file.
16103
16104 2003-02-09  Martin Baulig  <martin@ximian.com>
16105
16106         * symbolwriter.cs: New file.  This is a wrapper around
16107         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16108         methods here in near future.
16109
16110 2003-02-09  Martin Baulig  <martin@ximian.com>
16111
16112         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16113         ILGenerator.MarkSequencePoint() which are actually used by the
16114         symbol writer.
16115
16116 2003-02-09  Martin Baulig  <martin@ximian.com>
16117
16118         * location.cs (SourceFile): New public sealed class.  This
16119         contains the name and an index which is used in the location's token.
16120         (Location): Reserve an appropriate number of bits in the token for
16121         the source file instead of walking over that list, this gives us a
16122         really huge performance improvement when compiling with debugging.
16123
16124         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16125         `SourceFile' argument instead of a string.
16126         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16127         but don't parse/tokenize here, we need to generate the list of all
16128         source files before we do that.
16129         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16130         the files.
16131
16132         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16133         instead of a string.
16134
16135         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16136         of a string.
16137
16138 2003-02-09  Martin Baulig  <martin@ximian.com>
16139
16140         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16141         filename on `#line default'.
16142
16143 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16144
16145         * statement.cs: don't clear the pinned var when the fixed statement
16146         returns from the method (fixes bug#37752).
16147
16148 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16149
16150         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16151         to IsValueType.
16152
16153 2003-02-07  Martin Baulig  <martin@ximian.com>
16154
16155         * driver.cs: Removed the `--debug-args' command line argument.
16156
16157         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16158         automatically by the AsssemblyBuilder.
16159         (CodeGen.InitializeSymbolWriter): We don't need to call any
16160         initialization function on the symbol writer anymore.  This method
16161         doesn't take any arguments.
16162
16163 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16164
16165         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16166         from referenced assemblies as well.
16167
16168 2003-02-02  Martin Baulig  <martin@ximian.com>
16169
16170         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16171
16172 2003-02-02  Martin Baulig  <martin@ximian.com>
16173
16174         * class.cs (Constructor.Emit): Open the symbol writer before
16175         emitting the constructor initializer.
16176         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16177         single-stepping through constructor initializers.
16178
16179 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16180
16181         * class.cs: Handle error 549: do not allow virtual methods in
16182         sealed classes. 
16183
16184 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16185
16186         * decl.cs: Check access levels when resolving types
16187
16188 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16189
16190         * statement.cs: Add parameters and locals set in catch blocks that might 
16191         return to set vector
16192
16193 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * class.cs (Operator): Set the SpecialName flags for operators.
16196
16197         * expression.cs (Invocation.DoResolve): Only block calls to
16198         accessors and operators on SpecialName methods.
16199
16200         (Cast.TryReduce): Handle conversions from char constants.
16201
16202
16203 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16204
16205         * statement.cs: small memory and time optimization in FlowBranching.
16206
16207 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16208
16209         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16210         problem that the last fix but in the other sid (Set).
16211
16212         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16213         access when there is no indexer in the hierarchy.
16214
16215 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16216
16217         * class.cs: Combine some if statements.
16218
16219 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16220
16221         * driver.cs: fixed bug #37187.
16222
16223 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16224
16225         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16226         any indexer, it's needed to build a list with all the indexers in the
16227         hierarchy (AllGetters), else we have problems. Fixes #35653.
16228
16229 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16230
16231         * class.cs (MethodData.Define): It is wrong for an interface
16232         implementation to be static in both cases: explicit and implicit.
16233         We were only handling this in one case.
16234
16235         Improve the if situation there to not have negations.
16236
16237         * class.cs (Field.Define): Turns out that we do not need to check
16238         the unsafe bit on field definition, only on usage.  Remove the test.
16239
16240 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16241
16242         * driver.cs: use assembly.Location instead of Codebase (the latest
16243         patch made mcs fail when using MS assemblies).
16244
16245 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16246
16247         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16248         get the path to *corlib.dll.
16249
16250 2003-01-21  Nick Drochak <ndrochak@gol.com>
16251
16252         * cs-tokenizer.cs:
16253         * pending.cs:
16254         * typemanager.cs: Remove compiler warnings
16255
16256 2003-01-20  Duncan Mak  <duncan@ximian.com>
16257
16258         * AssemblyInfo.cs: Bump the version number to 0.19.
16259
16260 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16261
16262         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16263
16264 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16265
16266         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16267
16268 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16269
16270         * cs-parser.jay: Small fix: we were not comparing the constructor
16271         name correctly.   Thanks to Zoltan for the initial pointer.
16272
16273 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16274
16275         * cs-tokenizer.cs: Set file name when specified with #line
16276
16277 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16278
16279         * cs-parser.jay: Only perform the constructor checks here if we
16280         are named like the class;  This will help provider a better
16281         error.  The constructor path is taken when a type definition is
16282         not found, but most likely the user forgot to add the type, so
16283         report that rather than the constructor error.
16284
16285 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16286
16287         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16288         allocations.
16289
16290 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16291
16292         * cs-parser.jay: Add cleanup call.
16293
16294 2003-01-13  Duncan Mak  <duncan@ximian.com>
16295
16296         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16297         consistent with other methods.
16298
16299 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16300
16301         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16302
16303 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16304
16305         * attribute.cs: only set GuidAttr to true when we have a
16306         GuidAttribute.
16307
16308 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16309
16310         * ecore.cs:
16311         * expression.cs:
16312         * typemanager.cs: fixes to allow mcs compile corlib with the new
16313         Type.IsSubclassOf fix.
16314
16315 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16316
16317         * expression.cs (LocalVariableReference.DoResolve): Classify a
16318         constant as a value, not as a variable.   Also, set the type for
16319         the variable.
16320
16321         * cs-parser.jay (fixed_statement): take a type instead of a
16322         pointer_type, so we can produce a better error message later.
16323
16324         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16325         as an error.  
16326
16327         (For.DoEmit): Make inifinite loops have a
16328         non-conditional branch back.
16329
16330         (Fixed.DoEmit): First populate the pinned variables, then emit the
16331         statement, then clear the variables.  Before I was emitting the
16332         code once for each fixed piece.
16333
16334
16335 2003-01-08  Martin Baulig  <martin@ximian.com>
16336
16337         * statement.cs (FlowBranching.MergeChild): A break in a
16338         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16339
16340 2003-01-08  Martin Baulig  <martin@ximian.com>
16341
16342         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16343         lives in the same number space than `param_map'.  Fixes #36154.
16344
16345 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16346
16347         * cs-parser.jay (constructor_declaration): Set the
16348         Constructor.ModFlags before probing for it.  This makes the
16349         compiler report 514, 515 and 132 (the code was there, but got
16350         broken). 
16351
16352         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16353         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16354         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16355
16356 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16357
16358         * enum.cs: create the enum static fields using the enum type.
16359
16360 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16361
16362         * class.cs: don't try to create the ParamBuilder for the return
16363         type if it's not needed (and handle it breaking for the ms runtime
16364         anyway).
16365
16366 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16367
16368         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16369
16370 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16371
16372         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16373         the command.   This showed up while compiling the JANET source
16374         code, which used \r as its only newline separator.
16375
16376 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16377
16378         * class.cs (Method.Define): If we are an operator (because it
16379         reuses our code), then set the SpecialName and HideBySig.  #36128
16380
16381 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16382
16383         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16384         exception, report error 120 `object reference required'.
16385
16386         * driver.cs: Add --pause option, used during to measure the size
16387         of the process as it goes with --timestamp.
16388
16389         * expression.cs (Invocation.DoResolve): Do not allow methods with
16390         SpecialName to be invoked.
16391
16392 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16393
16394         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16395         number before adding it.
16396
16397 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16398
16399         * ecore.cs (StandardImplicitConversion): When in an unsafe
16400         context, we allow conversion between void * to any other pointer
16401         type. This fixes bug #35973.
16402
16403 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16404
16405         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16406         is not thrown when extensionless outputs are used 
16407
16408 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16409
16410         * rootcontext.cs: fixed compilation of corlib.
16411
16412 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16413
16414         * attribute.cs (Attributes.Contains): Add new method.
16415
16416         * class.cs (MethodCore.LabelParameters): if the parameter is an
16417         `out' parameter, check that no attribute `[In]' has been passed.
16418
16419         * enum.cs: Handle the `value__' name in an enumeration.
16420
16421 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16422
16423         * decl.cs: Added special case to allow overrides on "protected
16424         internal" methods
16425
16426 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16427
16428         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16429         since it makes much more sense.
16430
16431         (Attributes.ctor): Don't require a Location parameter.
16432
16433         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16434
16435         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16436         since we already have that information per attribute.
16437
16438         * everywhere : make appropriate changes.
16439
16440         * class.cs (LabelParameters): Write the code which actually
16441         applies attributes to the return type. We can't do this on the MS
16442         .NET runtime so we flag a warning in the case an exception is
16443         thrown.
16444
16445 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16446
16447         * const.cs: Handle implicit null conversions here too.
16448
16449 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16450
16451         * class.cs (MethodCore.LabelParameters): Remove the extra
16452         Type [] parameter since it is completely unnecessary. Instead
16453         pass in the method's attributes so that we can extract
16454         the "return" attribute.
16455
16456 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16457
16458         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16459         of ignoring it and letting the compile continue.
16460
16461         * typemanager.cs (ChangeType): use an extra argument to return an
16462         error condition instead of throwing an exception.
16463
16464 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16465
16466         * expression.cs (Unary.TryReduce): mimic the code for the regular
16467         code path.  Perform an implicit cast in the cases where we can
16468         implicitly convert to one of the integral types, and then reduce
16469         based on that constant.   This fixes bug #35483.
16470
16471 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16472
16473         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16474
16475 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16476
16477         * namespace.cs: fixed bug #35489.
16478
16479 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16480
16481         * class.cs: Remove some dead code.
16482
16483         * cs-parser.jay: Estimate the number of methods needed
16484         (RootContext.MethodCount);
16485
16486         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16487         numbers instead of StringBuilders.
16488
16489         * support.cs (PtrHashtable): Add constructor with initial size;
16490         We can now reduce reallocations of the method table.
16491
16492 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16493
16494         * attribute.cs (ApplyAttributes): Keep track of the emitted
16495         attributes on a per-target basis. This fixes bug #35413.
16496
16497 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16498
16499         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16500         default to the Windows 1252 encoding.
16501
16502         (UnixParseOption): Support version, thanks to Alp for the missing
16503         pointer. 
16504
16505         * AssemblyInfo.cs: Add nice assembly information.
16506
16507         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16508         (bug 35169).
16509
16510         * cs-parser.jay: Allow a trailing comma before the close bracked
16511         in the attribute_section production.
16512
16513         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16514         address of the instance was being taken, I will take this out,
16515         because we take the address of the object immediately here.
16516
16517 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16518
16519         * typemanager.cs (AreMultipleAllowed): Take care of the most
16520         obvious case where attribute type is not in the current assembly -
16521         stupid me ;-)
16522
16523 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16524
16525         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16526         definitions, instead of doing that afterwards.  
16527
16528         Also we use a nice little hack, depending on the constructor, we
16529         know if we are a "composed" name or a simple name.  Hence, we
16530         avoid the IndexOf test, and we avoid 
16531
16532         * codegen.cs: Add code to assist in a bug reporter to track down
16533         the source of a compiler crash. 
16534
16535 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16536
16537         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16538         types have been emitted for a given element and flag an error
16539         if something which does not have AllowMultiple set is used more
16540         than once.
16541
16542         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16543         attribute types and their corresponding AllowMultiple properties
16544
16545         (AreMultipleAllowed): Check the property for a given type.
16546
16547         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16548         property in the case we have a TypeContainer.
16549
16550         (Attributes.AddAttribute): Detect duplicates and just skip on
16551         adding them. This trivial fix catches a pretty gross error in our
16552         attribute emission - global attributes were being emitted twice!
16553
16554         Bugzilla bug #33187 is now fixed.
16555
16556 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16557
16558         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16559         instead of pp_and).
16560
16561         * expression.cs (Binary.ResolveOperator): I can only use the
16562         Concat (string, string, string) and Concat (string, string,
16563         string, string) if the child is actually a concatenation of
16564         strings. 
16565
16566 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16569         context where we need a 2-character lookahead.
16570
16571         * pending.cs (PendingImplementation): Rework so we can keep track
16572         of interface types all the time, and flag those which were
16573         implemented by parents as optional.
16574
16575 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16576
16577         * expression.cs (Binary.ResolveOperator): Use
16578         String.Concat(string,string,string) or
16579         String.Concat(string,string,string,string) when possible. 
16580
16581         * typemanager: More helper methods.
16582
16583
16584 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16585
16586         * pending.cs: remove the bogus return from GetMissingInterfaces()
16587         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16588
16589 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16590
16591         * namespace.cs: avoid duplicated 'using xxx' being added to
16592         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16593         when we get more than one 'using' statement for the same namespace.
16594         Report a CS0105 warning for it.
16595
16596 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16597
16598         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16599         of calling getChar/putback, uses internal knowledge of it.    
16600
16601         (xtoken): Reorder tokenizer so most common patterns are checked
16602         first.  This reduces the compilation time in another 5% (from 8.11s
16603         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16604
16605         The parsing time is 22% of the compilation in mcs, and from that
16606         64% is spent on the tokenization process.  
16607
16608         I tried using a binary search for keywords, but this is slower
16609         than the hashtable.  Another option would be to do a couple of
16610         things:
16611
16612                 * Not use a StringBuilder, instead use an array of chars,
16613                   with a set value.  Notice that this way we could catch
16614                   the 645 error without having to do it *afterwards*.
16615
16616                 * We could write a hand-parser to avoid the hashtable
16617                   compares altogether.
16618
16619         The identifier consumption process takes 37% of the tokenization
16620         time.  Another 15% is spent on is_number.  56% of the time spent
16621         on is_number is spent on Int64.Parse:
16622
16623                 * We could probably choose based on the string length to
16624                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16625                   computations. 
16626
16627         Another 3% is spend on wrapping `xtoken' in the `token' function.
16628
16629         Handle 0xa0 as whitespace (#34752)
16630
16631 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16632
16633         * typemanager.cs (IsCLRType): New routine to tell whether a type
16634         is one of the builtin types.  
16635
16636         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16637         typecode in more places instead of doing pointer comparissions.
16638         We could leverage some knowledge about the way the typecodes are
16639         laid out.
16640
16641         New code to cache namespaces in assemblies, it is currently not
16642         invoked, to be used soon.
16643
16644         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16645
16646         * expression.cs (Binary.ResolveOperator): specially handle
16647         strings, and do not perform user-defined operator overloading for
16648         built-in types.
16649
16650 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16651
16652         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16653         internalcall as it is a pretty simple operation;  Avoid whenever
16654         possible to call Char.IsLetter.
16655
16656         (consume_identifier): Cut by half the number of
16657         hashtable calls by merging the is_keyword and GetKeyword behavior.
16658
16659         Do not short-circuit, because if we do, we
16660         report errors (ie, #if false && true would produce an invalid
16661         directive error);
16662
16663
16664 2002-11-24  Martin Baulig  <martin@ximian.com>
16665
16666         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16667         check constant ranges and report a CS0221.  Fixes #33186.
16668
16669 2002-11-24  Martin Baulig  <martin@ximian.com>
16670
16671         * cs-parser.jay: Make this work for uninitialized variable
16672         declarations in the `for' initializer.  Fixes #32416.
16673
16674 2002-11-24  Martin Baulig  <martin@ximian.com>
16675
16676         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16677         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16678
16679 2002-11-24  Martin Baulig  <martin@ximian.com>
16680
16681         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16682         argument; if true, we also check for user-defined conversions.
16683         This is only needed if both arguments are of a user-defined type.
16684         Fixes #30443, added test-175.cs.
16685         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16686
16687         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16688
16689 2002-11-24  Martin Baulig  <martin@ximian.com>
16690
16691         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16692         function to get the store opcode.
16693         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16694         only emit the Ldelema if the store opcode is Stobj.  You must run
16695         both test-34 and test-167 to test this.  Fixes #34529.
16696
16697 2002-11-23  Martin Baulig  <martin@ximian.com>
16698
16699         * ecore.cs (Expression.MemberLookup): Added additional
16700         `qualifier_type' argument which is used when we're being called
16701         from MemberAccess.DoResolve() and null if we're called from a
16702         SimpleName lookup.
16703         (Expression.MemberLookupFailed): New method to report errors; this
16704         does the CS1540 check and reports the correct error message.
16705
16706         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16707         argument for the CS1540 check and redone the way how we're dealing
16708         with private members.  See the comment in the source code for details.
16709         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16710         `closure_start_type' to `closure_qualifier_type' and check whether
16711         it's not null.  It was not this filter being broken, it was just
16712         being called with the wrong arguments.
16713
16714         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16715         and pass it the correct `qualifier_type'; this also does the error
16716         handling for us.
16717
16718 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16719
16720         * expression.cs (Invocation.EmitParams): If the we are dealing
16721         with a non-built-in value type, load its address as well.
16722
16723         (ArrayCreation): Use a a pretty constant instead
16724         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16725         static initializers.  
16726
16727         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16728         because they are not really value types, just glorified integers. 
16729
16730         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16731
16732         * ecore.cs: Remove redundant code for enumerations, make them use
16733         the same code path as everything else, fixes the casting issue
16734         with enumerations in Windows.Forms.
16735
16736         * attribute.cs: Do only cast to string if it is a string, the
16737         validation happens later.
16738
16739         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16740         people upgrade their corlibs.
16741
16742         * ecore.cs: Oops, enumerations were not following the entire code path
16743
16744 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16745
16746         * typemanager.cs (FilterWithClosure): Commented out the test for
16747         1540 in typemanager.cs, as it has problems when accessing
16748         protected methods from a parent class (see test-174.cs). 
16749
16750         * attribute.cs (Attribute.ValidateGuid): new method.
16751         (Attribute.Resolve): Use above.
16752
16753 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16754
16755         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16756
16757         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16758         handling for enumerations, as we only needed the TypeContainer
16759         functionality to begin with (this is required for the fix below to
16760         work for enums that reference constants in a container class for
16761         example). 
16762
16763         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16764
16765         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16766         a valid TypeBuilder to perform lookups on.o
16767
16768         * class.cs (InheritableMemberSignatureCompare): Use true in the
16769         call to GetGetMethod and GetSetMethod, because we are comparing
16770         the signature, and we need to get the methods *even* if they are
16771         private. 
16772
16773         (PropertyBase.CheckBase): ditto.
16774
16775         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16776         GotoCase.Resolve): Use Peel on EmpytCasts.
16777
16778         * ecore.cs (EmptyCast): drop child, add Peel method.
16779
16780 2002-11-17  Martin Baulig  <martin@ximian.com>
16781
16782         * ecore.cs (EmptyCast.Child): New public property.
16783
16784         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16785         label resolved to an EmptyCast.  Fixes #34162.
16786         (GotoCase.Resolve): Likewise.
16787         (Block.EmitMeta): Likewise.
16788
16789 2002-11-17  Martin Baulig  <martin@ximian.com>
16790
16791         * expression.cs (Invocation.BetterConversion): Prefer int over
16792         uint; short over ushort; long over ulong for integer literals.
16793         Use ImplicitConversionExists instead of StandardConversionExists
16794         since we also need to check for user-defined implicit conversions.
16795         Fixes #34165.  Added test-173.cs.
16796
16797 2002-11-16  Martin Baulig  <martin@ximian.com>
16798
16799         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16800         with the `true' and `false' literals.  Fixes #33151.
16801
16802 2002-11-16  Martin Baulig  <martin@ximian.com>
16803
16804         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16805         October 22nd; don't do the cs1540 check for static members.
16806
16807         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16808         now using our own filter here and doing the cs1540 check again.
16809
16810 2002-11-16  Martin Baulig  <martin@ximian.com>
16811
16812         * support.cs (InternalParameters): Don't crash if we don't have
16813         any fixed parameters.  Fixes #33532.
16814
16815 2002-11-16  Martin Baulig  <martin@ximian.com>
16816
16817         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16818         when looking up static methods to make this work on Windows.
16819         Fixes #33773.
16820
16821 2002-11-16  Martin Baulig  <martin@ximian.com>
16822
16823         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16824         a setter rather than using PropertyInfo.CanWrite.
16825
16826 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16827
16828         * class.cs: Allow acces to block member by subclasses. Fixes build
16829         breaker.
16830
16831 2002-11-14  Martin Baulig  <martin@ximian.com>
16832
16833         * class.cs (Constructor.Emit): Added the extern/block check.
16834         Fixes bug #33678.
16835
16836 2002-11-14  Martin Baulig  <martin@ximian.com>
16837
16838         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16839         iteration while looking for indexers, this is needed because the
16840         indexer may have a different name in our base classes.  Fixed the
16841         error reporting (no indexers at all, not get accessor, no
16842         overloaded match).  Fixes bug #33089.
16843         (IndexerAccess.DoResolveLValue): Likewise.
16844
16845 2002-11-14  Martin Baulig  <martin@ximian.com>
16846
16847         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16848         indexers.  Fixes the first part of bug #33089.
16849         (MethodSignature.InheritableMemberSignatureCompare): Added support
16850         for properties.
16851
16852 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16853
16854         * attribute.cs (Attribute.Resolve): Catch the
16855         NullReferenceException and report it since it isn't supposed to
16856         happen. 
16857
16858 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16859
16860         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16861         LogicalOr and LogicalAnd that can benefit from recursively
16862         handling EmitBranchable.  The code now should be nice for Paolo.
16863
16864 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16865
16866         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16867         the Type lookups, as we perform quite a number of lookups on
16868         non-Types.  This can be removed once we can deterministically tell
16869         whether we have a type or a namespace in advance.
16870
16871         But this might require special hacks from our corlib.
16872
16873         * TODO: updated.
16874
16875         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16876         and double which avoids a conversion from an integer to a double.
16877
16878         * expression.cs: tiny optimization, avoid calling IsConstant,
16879         because it effectively performs the lookup twice.
16880
16881 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16882
16883         But a bogus return here to keep the semantics of the old code
16884         until the Mono runtime is fixed.
16885
16886         * pending.cs (GetMissingInterfaces): New method used to remove all
16887         the interfaces that are already implemented by our parent
16888         classes from the list of pending methods. 
16889
16890         * interface.cs: Add checks for calls after ResolveTypeExpr.
16891
16892 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16893
16894         * class.cs (Class.Emit): Report warning 67: event not used if the
16895         warning level is beyond 3.
16896
16897         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16898         being a NullLiteral.
16899
16900         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16901         specifiers. 
16902
16903         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16904         path that might fail if a type can not be resolved.
16905
16906         * expression.cs (Binary.Emit): Emit unsigned versions of the
16907         operators. 
16908
16909         * driver.cs: use error 5.
16910
16911 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16912
16913         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16914
16915 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16916
16917         * cs-parser.jay (switch_section): A beautiful patch from Martin
16918         Baulig that fixed 33094.
16919
16920 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16921
16922         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16923         Check whether the base is abstract and report an error if so.
16924
16925         * expression.cs (IndexerAccess.DoResolveLValue,
16926         IndexerAccess.DoResolve): ditto. 
16927
16928         (Invocation.DoResolve): ditto.
16929
16930         (Invocation.FullMethodDesc): Improve the report string.
16931
16932         * statement.cs (Block): Eliminate IsVariableDefined as it is
16933         basically just a wrapper for GetVariableInfo.
16934
16935         * ecore.cs (SimpleName): Use new 
16936
16937         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16938         type, as we return the actual parameter ref/unref state on a
16939         different call.
16940
16941 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16942
16943         * support.cs: Return proper flags REF/OUT fixing the previous
16944         commit.  
16945
16946         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16947         not used to mean `ref' but `ref or out' in ParameterReference
16948
16949         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16950         full type signature instead of calling TypeManger.CSharpName
16951         ourselves. 
16952
16953         * support.cs (InternalParameters.ParameterDesc): Do not compare
16954         directly to the modflags, because REF/OUT will actually be bitsets
16955         if set. 
16956
16957         * delegate.cs (VerifyMethod): Check also the modifiers.
16958
16959         * cs-tokenizer.cs: Fix bug where floating point values with an
16960         exponent where a sign was missing was ignored.
16961
16962         * driver.cs: Allow multiple assemblies to be specified in a single
16963         /r: argument
16964
16965 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16966
16967         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16968         because identifiers after a parenthesis would end up in this kind
16969         of production, and we needed to desamiguate it for having casts
16970         like:
16971
16972                 (UserDefinedType *) xxx
16973
16974 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16975
16976         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16977         we should set on the Bindingflags.NonPublic, but not turn on
16978         private_ok.  private_ok controls whether a Private member is
16979         returned (this is chekced on the filter routine), while the
16980         BindingFlags.NonPublic just controls whether private/protected
16981         will be allowed.   This fixes the problem part of the problem of
16982         private properties being allowed to be used in derived classes.
16983
16984         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16985         so we can call the children DoResolveLValue method (this will
16986         properly signal errors on lvalue assignments to base properties)
16987
16988         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16989         getter are null, and we have a property info, we know that this
16990         happened because the lookup failed, so we report an error 122 for
16991         protection level violation.
16992
16993         We also silently return if setter and getter are null in the
16994         resolve functions, this condition only happens if we have flagged
16995         the error before.  This is the other half of the problem. 
16996
16997         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16998         not have accessibility information, that is why we were returning
16999         true in the filter function in typemanager.cs.
17000
17001         To properly report 122 (property is inaccessible because of its
17002         protection level) correctly, we report this error in ResolveAccess
17003         by failing if both the setter and the getter are lacking (ie, the
17004         lookup failed). 
17005
17006         DoResolve and DoLResolve have been modified to check for both
17007         setter/getter being null and returning silently, the reason being
17008         that I did not want to put the knowledge about this error in upper
17009         layers, like:
17010
17011         int old = Report.Errors;
17012         x = new PropertyExpr (...);
17013         if (old != Report.Errors)
17014                 return null;
17015         else
17016                 return x;
17017
17018         So the property expr is returned, but it is invalid, so the error
17019         will be flagged during the resolve process. 
17020
17021         * class.cs: Remove InheritablePropertySignatureCompare from the
17022         class, as we no longer depend on the property signature to compute
17023         whether it is possible to implement a method or not.
17024
17025         The reason is that calling PropertyInfo.GetGetMethod will return
17026         null (in .NET, in Mono it works, and we should change this), in
17027         cases where the Get Method does not exist in that particular
17028         class.
17029
17030         So this code:
17031
17032         class X { public virtual int A { get { return 1; } } }
17033         class Y : X { }
17034         class Z : Y { public override int A { get { return 2; } } }
17035
17036         Would fail in Z because the parent (Y) would not have the property
17037         defined.  So we avoid this completely now (because the alternative
17038         fix was ugly and slow), and we now depend exclusively on the
17039         method names.
17040
17041         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17042         reference method, instead of using the property.
17043
17044         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17045         routines are gone now.
17046
17047         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17048         names, they were incorrectly named.
17049
17050         * cs-tokenizer.cs: Return are more gentle token on failure. 
17051
17052         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17053         had an out-of-sync index variable, which caused it to remove from
17054         the list of pending methods the wrong method sometimes.
17055
17056 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17057
17058         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17059         CanWrite, because those refer to this particular instance of the
17060         property, and do not take into account the fact that we can
17061         override single members of a property.
17062
17063         Constructor requires an EmitContext.  The resolution process does
17064         not happen here, but we need to compute the accessors before,
17065         because the resolution does not always happen for properties.
17066
17067         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17068         subclass, before we did not update this flag, but we did update
17069         bindingflags. 
17070
17071         (GetAccessors): Drop this routine, as it did not work in the
17072         presence of partially overwritten set/get methods. 
17073
17074         Notice that this broke the cs1540 detection, but that will require
17075         more thinking. 
17076
17077 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17078
17079         * class.cs:
17080         * codegen.cs:
17081         * driver.cs: issue a warning instead of an error if we don't support
17082         debugging for the platform. Also ignore a couple of errors that may
17083         arise when trying to write the symbols. Undo my previous patch.
17084
17085 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17086
17087         * driver.cs: ignore /debug switch except for Unix platforms.
17088
17089 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17090
17091         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17092
17093 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17094
17095         * driver.cs: Do not make mcs-debug conditional, so we do not break
17096         builds that use it.
17097
17098         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17099         review this patch.  But basically after all the children variables
17100         have been merged, the value of "Breaks" was not being set to
17101         new_breaks for Switch blocks.  I think that it should be set after
17102         it has executed.  Currently I set this to the value of new_breaks,
17103         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17104         conservative, but I do not understand this code very well.
17105
17106         I did not break anything in the build, so that is good ;-)
17107
17108         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17109
17110 2002-10-20  Mark Crichton  <crichton@gimp.org>
17111
17112         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17113
17114 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17115
17116         * cfold.cs: Fixed compile blocker.
17117
17118 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17119
17120         * driver.cs: I was chekcing the key, not the file.
17121
17122 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17123
17124         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17125         message that we were generating - we just need to silently return
17126         a null.
17127
17128 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17129
17130         * class.cs (Event.Define): Change my previous commit, as this
17131         breaks the debugger.  This is a temporary hack, as it seems like
17132         the compiler is generating events incorrectly to begin with.
17133
17134         * expression.cs (Binary.ResolveOperator): Added support for 
17135         "U operator - (E x, E y)"
17136
17137         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17138         y)".
17139
17140         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17141         init-only variables, but this path did not take into account that
17142         there might be also instance readonly variables.  Correct this
17143         problem. 
17144
17145         This fixes bug 32253
17146
17147         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17148         delegates as well.
17149
17150         * driver.cs: Change the extension for modules to `netmodule'
17151
17152         * cs-parser.jay: Improved slightly the location tracking for
17153         the debugger symbols.
17154
17155         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17156         modifiers that were specified instead of the hardcoded value
17157         (FamAndAssem).  This was basically ignoring the static modifier,
17158         and others.  Fixes 32429.
17159
17160         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17161         fixed a bug in the process (32476)
17162
17163         * expression.cs (ArrayAccess.EmitAssign): Patch from
17164         hwang_rob@yahoo.ca that fixes bug 31834.3
17165
17166 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17167
17168         * driver.cs: Make the module extension .netmodule.
17169
17170 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17171
17172         * driver.cs: Report an error if the resource file is not found
17173         instead of crashing.
17174
17175         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17176         false, like Emit does.
17177
17178 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17179
17180         * typemanager.cs: Remove unused private member.  Also reported mcs
17181         bug to report this as a warning like csc.
17182
17183 2002-10-15  Martin Baulig  <martin@gnome.org>
17184
17185         * statement.cs (Statement.Emit): Made this a virtual method; emits
17186         the line number info and calls DoEmit().
17187         (Statement.DoEmit): New protected abstract method, formerly knows
17188         as Statement.Emit().
17189
17190         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17191
17192 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17193
17194         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17195         have fixed a remaining problem: not every AddXXXX was adding a
17196         fully qualified name.  
17197
17198         Now everyone registers a fully qualified name in the DeclSpace as
17199         being defined instead of the partial name.  
17200
17201         Downsides: we are slower than we need to be due to the excess
17202         copies and the names being registered this way.  
17203
17204         The reason for this is that we currently depend (on the corlib
17205         bootstrap for instance) that types are fully qualified, because
17206         we dump all the types in the namespace, and we should really have
17207         types inserted into the proper namespace, so we can only store the
17208         basenames in the defined_names array.
17209
17210 2002-10-10  Martin Baulig  <martin@gnome.org>
17211
17212         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17213         from bug #31834, see the bug report for a testcase which is
17214         miscompiled.
17215
17216 2002-10-10  Martin Baulig  <martin@gnome.org>
17217
17218         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17219         flow analysis code for this.
17220
17221         * statement.cs (Do, While, For): Tell the flow analysis code about
17222         infinite loops.
17223         (FlowBranching.UsageVector): Added support for infinite loops.
17224         (Block.Resolve): Moved the dead code elimination here and use flow
17225         analysis to do it.
17226
17227 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17228
17229         * class.cs (Field.Define): Catch cycles on struct type
17230         definitions. 
17231
17232         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17233         fields if the fields are static.  We only need to check instance
17234         fields. 
17235
17236         * expression.cs (As.DoResolve): Test for reference type.
17237
17238         * statement.cs (Using.ResolveExpression): Use
17239         ConvertImplicitRequired, not ConvertImplicit which reports an
17240         error on failture
17241         (Using.ResolveLocalVariableDecls): ditto.
17242
17243         * expression.cs (Binary.ResolveOperator): Report errors in a few
17244         places where we had to.
17245
17246         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17247
17248 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17249
17250         * expression.cs: Use StoreFromPtr instead of extracting the type
17251         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17252
17253         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17254         an enumeration value to a System.Enum, but System.Enum is not a
17255         value type, but an class type, so we need to box.
17256
17257         (Expression.ConvertExplicit): One codepath could return
17258         errors but not flag them.  Fix this.  Fixes #31853
17259
17260         * parameter.cs (Resolve): Do not allow void as a parameter type.
17261
17262 2002-10-06  Martin Baulig  <martin@gnome.org>
17263
17264         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17265         if it's a class type and not a struct.  Fixes #31815.
17266
17267 2002-10-06  Martin Baulig  <martin@gnome.org>
17268
17269         * statement.cs: Reworked the flow analysis code a bit to make it
17270         usable for dead code elimination.
17271
17272 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17273
17274         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17275
17276 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17277
17278         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17279         to fix the test 165, will investigate deeper.
17280
17281 2002-10-04  Martin Baulig  <martin@gnome.org>
17282
17283         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17284         finally blocks actually work.
17285         (Try.Resolve): We don't need to create a sibling for `finally' if
17286         there is no finally block.
17287
17288 2002-10-04  Martin Baulig  <martin@gnome.org>
17289
17290         * class.cs (Constructor.Define): The default accessibility for a
17291         non-default constructor is private, not public.
17292
17293 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17294
17295         * class.cs (Constructor): Make AllowedModifiers public, add
17296         EXTERN.
17297
17298         * cs-parser.jay: Perform the modifiers test here, as the
17299         constructor for the Constructor class usually receives a zero
17300         because of the way we create it (first we create, later we
17301         customize, and we were never checking the modifiers).
17302
17303         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17304         is a version of LookupTypeReflection that includes the type-name
17305         cache.  This can be used as a fast path for functions that know
17306         the fully qualified name and are only calling into *.GetType() to
17307         obtain a composed type.
17308
17309         This is also used by TypeManager.LookupType during its type
17310         composition.
17311
17312         (LookupType): We now also track the real type name, as sometimes
17313         we can get a quey for the real type name from things like
17314         ComposedCast.  This fixes bug 31422.
17315
17316         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17317         complete type fullname, it does not have to go through the type
17318         resolution system to obtain the composed version of the type (for
17319         obtaining arrays or pointers).
17320
17321         (Conditional.Emit): Use the EmitBoolExpression to
17322         generate nicer code, as requested by Paolo.
17323
17324         (ArrayCreation.CheckIndices): Use the patch from
17325         hwang_rob@yahoo.ca to validate the array initializers. 
17326
17327 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17328
17329         * class.cs (ConstructorInitializer.Emit): simplify code by using
17330         Invocation.EmitCall, and at the same time, fix the bugs in calling
17331         parent constructors that took variable arguments. 
17332
17333         * ecore.cs (Expression.ConvertNumericExplicit,
17334         Expression.ImplicitNumericConversion): Remove the code that
17335         manually wrapped decimal (InternalTypeConstructor call is now gone
17336         as well).
17337
17338         * expression.cs (Cast.TryReduce): Also handle decimal types when
17339         trying to perform a constant fold on the type.
17340
17341         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17342
17343         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17344         that only turned off an error report, and did nothing else. 
17345
17346 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17347
17348         * driver.cs: Handle and ignore /fullpaths
17349
17350 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17351
17352         * expression.cs (Binary.ResolveOperator): Catch the case where
17353         DoNumericPromotions returns true, 
17354
17355         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17356
17357 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17358
17359         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17360         report error 70.
17361
17362 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17363
17364         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17365         conversion exists, but it is also required that the conversion be
17366         performed.  This manifested in "(Type64Enum) 2".  
17367
17368         * class.cs (TypeManager.AddMethod): The fix is not to change
17369         AddEnum, because that one was using a fully qualified name (every
17370         DeclSpace derivative does), but to change the AddMethod routine
17371         that was using an un-namespaced name.  This now correctly reports
17372         the duplicated name.
17373
17374         Revert patch until I can properly fix it.  The issue
17375         is that we have a shared Type space across all namespaces
17376         currently, which is wrong.
17377
17378         Options include making the Namespace a DeclSpace, and merge
17379         current_namespace/current_container in the parser.
17380
17381 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17382
17383         * cs-parser.jay: Improve error reporting when we get a different
17384         kind of expression in local_variable_type and
17385         local_variable_pointer_type. 
17386
17387         Propagate this to avoid missleading errors being reported.
17388
17389         * ecore.cs (ImplicitReferenceConversion): treat
17390         TypeManager.value_type as a target just like object_type.   As
17391         code like this:
17392
17393         ValueType v = 1;
17394
17395         Is valid, and needs to result in the int 1 being boxed before it
17396         is assigned to the value type v.
17397
17398         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17399         to validate the enumeration name.
17400
17401         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17402         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17403         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17404
17405         * ecore.cs (TryImplicitIntConversion): When doing an
17406         implicit-enumeration-conversion, check if the type is 64-bits and
17407         perform a conversion before passing to EnumConstant.
17408
17409 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17410
17411         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17412         report ambiguous type references.  Unlike the MS version, we
17413         report what the ambiguity is.   Innovation at work ;-)
17414
17415         (DeclSpace.FindType): Require a location argument to
17416         display when we display an ambiguous error.
17417
17418         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17419
17420         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17421
17422         * expression.cs (EmitDynamicInitializers): Apply patch from
17423         hwang_rob@yahoo.ca that fixes the order in which we emit our
17424         initializers. 
17425
17426 2002-09-21  Martin Baulig  <martin@gnome.org>
17427
17428         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17429         delegate takes no arguments.
17430
17431 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17432
17433         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17434         from integers.
17435
17436         * expression.cs: Extract the underlying type.
17437
17438         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17439
17440         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17441
17442 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17443
17444         * class.cs (TypeContainer.DefineType): We can not use the nice
17445         PackingSize with the size set to 1 DefineType method, because it
17446         will not allow us to define the interfaces that the struct
17447         implements.
17448
17449         This completes the fixing of bug 27287
17450
17451         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17452         means also structs.  This fixes part of the problem. 
17453         (Expresion.ImplicitReferenceConversionExists): ditto.
17454
17455         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17456         error if there were no errors reported during the type lookup
17457         process, to avoid duplicates or redundant errors.  Without this
17458         you would get an ambiguous errors plus a type not found.  We have
17459         beaten the user enough with the first error.  
17460
17461         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17462         reference. 
17463
17464         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17465         during the resolution process, stop the lookup, this avoids
17466         repeated error reports (same error twice).
17467
17468         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17469
17470         * typemanager.cs (LookupType): Redo the type lookup code to match
17471         the needs of System.Reflection.  
17472
17473         The issue is that System.Reflection requires references to nested
17474         types to begin with a "+" sign instead of a dot.  So toplevel
17475         types look like: "NameSpace.TopLevelClass", and nested ones look
17476         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17477         levels. 
17478
17479 2002-09-19  Martin Baulig  <martin@gnome.org>
17480
17481         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17482         says that a method always returns or always throws an exception,
17483         don't report the CS0161.
17484
17485         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17486         set `Returns = new_returns'.
17487
17488 2002-09-19  Martin Baulig  <martin@gnome.org>
17489
17490         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17491         to an enum constant, check for a CS0176.
17492
17493 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17494
17495         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17496         for operators that must be in pairs and report errors.
17497
17498         * ecore.cs (SimpleName.DoResolveType): During the initial type
17499         resolution process, when we define types recursively, we must
17500         check first for types in our current scope before we perform
17501         lookups in the enclosing scopes.
17502
17503         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17504
17505         (Invocation.VerifyArgumentsCompat): Call
17506         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17507         I thought we were supposed to always call this, but there are a
17508         few places in the code where we dont do it.
17509
17510 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17511
17512         * driver.cs: Add support in -linkres and -resource to specify the
17513         name of the identifier.
17514
17515 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17516
17517         * ecore.cs (StandardConversionExists): Sync with the conversion
17518         code: allow anything-* to void* conversions.
17519
17520         (FindMostSpecificSource): Use an Expression argument
17521         instead of a Type, because we might be handed over a Literal which
17522         gets a few more implicit conversions that plain types do not.  So
17523         this information was being lost.
17524
17525         Also, we drop the temporary type-holder expression when not
17526         required.
17527
17528 2002-09-17  Martin Baulig  <martin@gnome.org>
17529
17530         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17531         this is an explicit interface implementation.
17532
17533 2002-09-17  Martin Baulig  <martin@gnome.org>
17534
17535         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17536         different `IndexerName' attributes.
17537
17538         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17539         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17540         virtual CommonResolve().
17541
17542 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17543
17544         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17545         and convert that to the UnderlyingType.
17546
17547         * statement.cs (Foreach.Resolve): Indexers are just like variables
17548         or PropertyAccesses.
17549
17550         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17551         inside quoted strings, we were not doing this before.
17552
17553 2002-09-16  Martin Baulig  <martin@gnome.org>
17554
17555         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17556         resolve it.  This is needed for the definite assignment check of the
17557         instance expression, fixes bug #29846.
17558         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17559
17560 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17561
17562         * parameter.cs: Fix compile error.  Cannot reference static member
17563         from an instance object.  Is this an mcs bug?
17564
17565 2002-09-14  Martin Baulig  <martin@gnome.org>
17566
17567         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17568         multiple times.  Fixes bug #30295, added test-166.cs.
17569
17570 2002-09-14  Martin Baulig  <martin@gnome.org>
17571
17572         * statement.cs (Block.Emit): Don't emit unreachable code.
17573         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17574         `break' statements.
17575         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17576
17577 2002-09-14  Martin Baulig  <martin@gnome.org>
17578
17579         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17580         is set.
17581
17582 2002-09-14  Martin Baulig  <martin@gnome.org>
17583
17584         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17585         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17586         be false on the ms runtime.
17587
17588 2002-09-13  Martin Baulig  <martin@gnome.org>
17589
17590         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17591         the CS0038 error message.
17592
17593 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17594
17595         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17596         constant inside, return it.
17597
17598 2002-09-12  Martin Baulig  <martin@gnome.org>
17599
17600         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17601         implicit conversion can be done between enum types.
17602
17603         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17604         check whether an implicit conversion to the current enum's UnderlyingType
17605         exists and report an error if not.
17606
17607         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17608         without debugging support.
17609
17610         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17611         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17612
17613 2002-09-12  Martin Baulig  <martin@gnome.org>
17614
17615         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17616
17617         * ecore.cs (IMemberExpr.DeclaringType): New property.
17618         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17619         nonstatic member of an outer type (CS0038).
17620
17621 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17622
17623         * driver.cs: Activate the using-error detector at warning level
17624         4 (at least for MS-compatible APIs).
17625
17626         * namespace.cs (VerifyUsing): Small buglett fix.
17627
17628         * pending.cs (PendingImplementation): pass the container pointer. 
17629
17630         * interface.cs (GetMethods): Allow for recursive definition.  Long
17631         term, I would like to move every type to support recursive
17632         definitions, not the current ordering mechanism that we have right
17633         now.
17634
17635         The situation is this: Attributes are handled before interfaces,
17636         so we can apply attributes to interfaces.  But some attributes
17637         implement interfaces, we will now handle the simple cases
17638         (recursive definitions will just get an error).  
17639
17640         * parameter.cs: Only invalidate types at the end if we fail to
17641         lookup all types.  
17642
17643 2002-09-09  Martin Baulig  <martin@gnome.org>
17644
17645         * ecore.cs (PropertyExpr.Emit): Also check for
17646         TypeManager.system_int_array_get_length so this'll also work when
17647         compiling corlib.  Fixes #30003.
17648
17649 2002-09-09  Martin Baulig  <martin@gnome.org>
17650
17651         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17652         and throw an exception if we can't get the type's size.  Fixed #30040,
17653         added test-165.cs.
17654
17655 2002-09-09  Martin Baulig  <martin@gnome.org>
17656
17657         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17658
17659         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17660         context.  Fixes bug #30027.
17661
17662         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17663         virtual functions.  Fixes bug #30043, added test-164.cs.
17664
17665 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17666
17667         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17668
17669 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17670
17671         * driver.cs: Use an object to get the windows codepage since it's not a
17672         static property.
17673
17674 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17675
17676         * statement.cs (For.Emit): for infinite loops (test == null)
17677         return whether there is a break inside, not always "true".
17678
17679         * namespace.cs (UsingEntry): New struct to hold the name of the
17680         using definition, the location where it is defined, and whether it
17681         has been used in a successful type lookup.
17682
17683         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17684         strings.
17685
17686         * decl.cs: ditto.
17687
17688 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17689
17690         * attribute.cs : Fix incorrect code which relied on catching
17691         a NullReferenceException to detect a null being passed in
17692         where an object was expected.
17693
17694 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17695
17696         * statement.cs (Try): flag the catch variable as assigned
17697
17698         * expression.cs (Cast): Simplified by using ResolveType instead of
17699         manually resolving.
17700
17701         * statement.cs (Catch): Fix bug by using ResolveType.
17702
17703 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17704
17705         * expression.cs (BetterConversion): Special case for when we have
17706         a NullLiteral as the argument and we have to choose between string
17707         and object types - we choose string the way csc does.
17708
17709         * attribute.cs (Attribute.Resolve): Catch the
17710         NullReferenceException and report error #182 since the Mono
17711         runtime no more has the bug and having this exception raised means
17712         we tried to select a constructor which takes an object and is
17713         passed a null.
17714
17715 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17716
17717         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17718         message (1502, 1503) when we can't locate a method after overload
17719         resolution. This is much more informative and closes the bug
17720         Miguel reported.
17721
17722         * interface.cs (PopulateMethod): Return if there are no argument
17723         types. Fixes a NullReferenceException bug.
17724
17725         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17726         expressions too. Previously we were checking only in one place for
17727         positional arguments leaving out named arguments.
17728
17729         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17730         type to the enum type is not allowed. Remove code corresponding to
17731         that.
17732
17733         (ConvertNumericExplicit): Allow explicit conversions from
17734         the underlying type to enum type. This precisely follows the spec
17735         and closes a bug filed by Gonzalo.
17736
17737 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17738
17739         * compiler.csproj:
17740         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17741
17742 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17743
17744         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17745         it was important that we stored the right value after the
17746         reduction in `converted'.
17747
17748 2002-09-04  Martin Baulig  <martin@gnome.org>
17749
17750         * location.cs (Location.SymbolDocument): Use full pathnames for the
17751         source files.
17752
17753 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17754
17755         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17756         of the expression resolve mechanism, because that will catch the
17757         SimpleName error failures.
17758
17759         (Conditional): If we can not resolve the
17760         expression, return, do not crash.
17761
17762 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17763
17764         * cs-tokenizer.cs:
17765         (location): display token name instead of its number.
17766
17767 2002-08-28  Martin Baulig  <martin@gnome.org>
17768
17769         * expression.cs (Binary.ResolveOperator): Don't silently return
17770         but return an error if an operator cannot be applied between two
17771         enum types.
17772
17773 2002-08-28  Martin Baulig  <martin@gnome.org>
17774
17775         * class.cs (Constructor.Define): Set the permission attributes
17776         correctly instead of making all constructors public.
17777
17778 2002-08-28  Martin Baulig  <martin@gnome.org>
17779
17780         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17781         for private members before reporting a CS0103; if we find anything,
17782         it's a CS0122.
17783
17784 2002-08-28  Martin Baulig  <martin@gnome.org>
17785
17786         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17787         to check whether `closure_start_type == closure_invocation_type',
17788         we also need to check whether `m.DeclaringType == closure_invocation_type'
17789         before bypassing the permission checks.  We might be accessing
17790         protected/private members from the base class.
17791         (TypeManager.RealMemberLookup): Only set private_ok if private
17792         members were requested via BindingFlags.NonPublic.
17793
17794         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17795
17796         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17797         MethodGroupExpr.IsExplicitImpl if appropriate.
17798         (Invocation.DoResolve): Don't report the CS0120 for explicit
17799         interface implementations.
17800
17801 2002-08-27  Martin Baulig  <martin@gnome.org>
17802
17803         * expression.cs (Invocation.DoResolve): If this is a static
17804         method and we don't have an InstanceExpression, we must report
17805         a CS0120.
17806
17807 2002-08-25  Martin Baulig  <martin@gnome.org>
17808
17809         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17810         `==' between a valuetype and an object.
17811
17812 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17813
17814         * ecore.cs (TypeExpr): Provide a ToString method.
17815
17816 2002-08-24  Martin Baulig  <martin@gnome.org>
17817
17818         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17819         now called proggie.dbg and it's a binary file.
17820
17821 2002-08-23  Martin Baulig  <martin@gnome.org>
17822
17823         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17824
17825 2002-08-23  Martin Baulig  <martin@gnome.org>
17826
17827         * struct.cs (MyStructInfo.ctor): Make this work with empty
17828         structs; it's not allowed to use foreach() on null.
17829
17830 2002-08-23  Martin Baulig  <martin@gnome.org>
17831
17832         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17833         writer the full pathname of the generated assembly.
17834
17835 2002-08-23  Martin Baulig  <martin@gnome.org>
17836
17837         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17838         A `finally' block never returns or breaks; improved handling of
17839         unreachable code.
17840
17841 2002-08-23  Martin Baulig  <martin@gnome.org>
17842
17843         * statement.cs (Throw.Resolve): Allow `throw null'.
17844
17845 2002-08-23  Martin Baulig  <martin@gnome.org>
17846
17847         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17848         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17849         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17850         MemberLookup would return a wrong event if this is an explicit
17851         interface implementation and the class has an event with the same
17852         name.
17853
17854 2002-08-23  Martin Baulig  <martin@gnome.org>
17855
17856         * statement.cs (Block.AddChildVariableNames): New public method.
17857         (Block.AddChildVariableName): Likewise.
17858         (Block.IsVariableNameUsedInChildBlock): Likewise.
17859         (Block.AddVariable): Check whether a variable name has already
17860         been used in a child block.
17861
17862         * cs-parser.jay (declare_local_variables): Mark all variable names
17863         from the current block as being used in a child block in the
17864         implicit block.
17865
17866 2002-08-23  Martin Baulig  <martin@gnome.org>
17867
17868         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17869         find the symbol writer.
17870
17871         * driver.cs: csc also allows the arguments to /define being
17872         separated by commas, not only by semicolons.
17873
17874 2002-08-23  Martin Baulig  <martin@gnome.org>
17875
17876         * interface.cs (Interface.GetMembers): Added static check for events.
17877
17878 2002-08-15  Martin Baulig  <martin@gnome.org>
17879
17880         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17881         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17882
17883         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17884         why the MethodData.EmitDestructor() change was necessary.
17885
17886 2002-08-20  Martin Baulig  <martin@gnome.org>
17887
17888         * class.cs (TypeContainer.FindMembers): Added static check for events.
17889
17890         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17891
17892         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17893         use Type.GetEvents(), not Type.FindMembers().
17894
17895 2002-08-20  Martin Baulig  <martin@gnome.org>
17896
17897         * decl.cs (MemberCache): Added a special method cache which will
17898         be used for method-only searched.  This ensures that a method
17899         search will return a MethodInfo with the correct ReflectedType for
17900         inherited methods.      
17901
17902 2002-08-20  Martin Baulig  <martin@gnome.org>
17903
17904         * decl.cs (DeclSpace.FindMembers): Made this public.
17905
17906 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17907
17908         * delegate.cs: fixed build on windows.
17909         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17910
17911 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17912
17913         * ecore.cs (StandardConversionExists): Return a false
17914         if we are trying to convert the void type to anything else
17915         since that is not allowed.
17916
17917         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17918         we flag error 70 in the event an event is trying to be accessed
17919         directly from outside the declaring type.
17920
17921 2002-08-20  Martin Baulig  <martin@gnome.org>
17922
17923         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17924         MemberCache from typemanager.cs to decl.cs.
17925
17926 2002-08-19  Martin Baulig  <martin@gnome.org>
17927
17928         * class.cs (TypeContainer): Implement IMemberContainer.
17929         (TypeContainer.DefineMembers): Create the MemberCache.
17930         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17931         return public members if BindingFlags.Public was given, check
17932         whether members are static.
17933
17934 2002-08-16  Martin Baulig  <martin@gnome.org>
17935
17936         * decl.cs (DeclSpace.Define): Splitted this in Define and
17937         DefineMembers.  DefineMembers is called first and initializes the
17938         MemberCache.
17939
17940         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17941         DefineMembers() on all our DeclSpaces.
17942
17943         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17944         but call DefineMembers() on all nested interfaces.  We call their
17945         Define() in our new Define() function.
17946
17947         * interface.cs (Interface): Implement IMemberContainer.
17948         (Interface.Define): Moved all code except the attribute stuf to
17949         DefineMembers().
17950         (Interface.DefineMembers): Initialize the member cache.
17951
17952         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17953         need this anymore since we can use MemberCache.FindMembers directly.
17954
17955 2002-08-19  Martin Baulig  <martin@gnome.org>
17956
17957         * typemanager.cs (MemberCache): When creating the cache for an
17958         interface type, add all inherited members.
17959         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17960         to `out bool used_cache' and documented it.
17961         (TypeManager.MemberLookup): If we already used the cache in the first
17962         iteration, we don't need to do the interfaces check.
17963
17964 2002-08-19  Martin Baulig  <martin@gnome.org>
17965
17966         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17967         here from IMemberFinder and don't implement this interface anymore.
17968         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17969
17970         * typemanager.cs (IMemberFinder): This interface is now only used by
17971         classes which actually support the member cache.
17972         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17973         since we only put DeclSpaces into this Hashtable.
17974         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17975         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17976
17977 2002-08-16  Martin Baulig  <martin@gnome.org>
17978
17979         * typemanager.cs (ICachingMemberFinder): Removed.
17980         (IMemberFinder.MemberCache): New property.
17981         (TypeManager.FindMembers): Merged this with RealFindMembers().
17982         This function will never be called from TypeManager.MemberLookup()
17983         so we can't use the cache here, just the IMemberFinder.
17984         (TypeManager.MemberLookup_FindMembers): Check whether the
17985         IMemberFinder has a MemberCache and call the cache's FindMembers
17986         function.
17987         (MemberCache): Rewrote larger parts of this yet another time and
17988         cleaned it up a bit.
17989
17990 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17991
17992         * driver.cs (LoadArgs): Support quoting.
17993
17994         (Usage): Show the CSC-like command line arguments.
17995
17996         Improved a few error messages.
17997
17998 2002-08-15  Martin Baulig  <martin@gnome.org>
17999
18000         * typemanager.cs (IMemberContainer.Type): New property.
18001         (IMemberContainer.IsInterface): New property.
18002
18003         The following changes are conditional to BROKEN_RUNTIME, which is
18004         defined at the top of the file.
18005
18006         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18007         class'es members, but add all members from TypeHandle.ObjectType
18008         if we're an interface.
18009         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18010         is the current type.
18011         (MemberCache.CacheEntry.Container): Removed this field.
18012         (TypeHandle.GetMembers): Include inherited members.
18013
18014 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18015
18016         * typemanager.cs: fixed compilation and added a comment on a field that
18017         is never used.
18018
18019 2002-08-15  Martin Baulig  <martin@gnome.org>
18020
18021         * class.cs (ConstructorInitializer.Resolve): In the
18022         Expression.MemberLookup call, use the queried_type as
18023         invocation_type.
18024
18025         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18026         declared' attribute, it's always true.
18027         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18028         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18029         temporary wrapper for FindMembers which tells MemberLookup whether
18030         members from the base classes are included in the return value.
18031         This will go away soon.
18032         (TypeManager.MemberLookup): Use this temporary hack here; once the
18033         new MemberCache is completed, we don't need to do the DeclaredOnly
18034         looping here anymore since the MemberCache will take care of this.
18035         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18036         (MemberCache): When creating the MemberCache for a class, get
18037         members from the current class and all its base classes.
18038         (MemberCache.CacheEntry.Container): New field.  This is a
18039         temporary hack until the Mono runtime is fixed to distinguish
18040         between ReflectedType and DeclaringType.  It allows us to use MCS
18041         with both the MS runtime and the unfixed Mono runtime without
18042         problems and without accecting performance.
18043         (MemberCache.SearchMembers): The DeclaredOnly looping from
18044         TypeManager.MemberLookup is now done here.      
18045
18046 2002-08-14  Martin Baulig  <martin@gnome.org>
18047
18048         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18049         Type.GetFields on dynamic types but get the fields from the
18050         corresponding TypeContainer.
18051         (MyStructInfo.GetStructInfo): Added check for enum types.
18052
18053         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18054         (MemberList.SyncRoot): Implemented.
18055         (TypeManager.FilterWithClosure): No need to check permissions if
18056         closure_start_type == closure_invocation_type, don't crash if
18057         closure_invocation_type is null.
18058
18059 2002-08-13  Martin Baulig  <martin@gnome.org>
18060
18061         Rewrote TypeContainer.FindMembers to use a member cache.  This
18062         gives us a speed increase of about 35% for the self-hosting MCS
18063         build and of about 15-20% for the class libs (both on GNU/Linux).
18064
18065         * report.cs (Timer): New class to get enhanced profiling.  This
18066         whole class is "TIMER" conditional since it remarkably slows down
18067         compilation speed.
18068
18069         * class.cs (MemberList): New class.  This is an IList wrapper
18070         which we're now using instead of passing MemberInfo[]'s around to
18071         avoid copying this array unnecessarily.
18072         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18073         (ICachingMemberFinder, IMemberContainer): New interface.
18074         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18075         has already been checked, otherwise use it for the name comparision.
18076         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18077         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18078         if possible.  Returns a MemberList, not a MemberInfo [].
18079         (TypeHandle): New class, implements IMemberContainer.  We create
18080         one instance of this class per type, it contains a MemberCache
18081         which is used to do the member lookups.
18082         (MemberCache): New class.  Each instance of this class contains
18083         all members of a type and a name-based hash table.
18084         (MemberCache.FindMembers): This is our new member lookup
18085         function.  First, it looks up all members of the requested name in
18086         the hash table.  Then, it walks this list and sorts out all
18087         applicable members and returns them.
18088
18089 2002-08-13  Martin Baulig  <martin@gnome.org>
18090
18091         In addition to a nice code cleanup, this gives us a performance
18092         increase of about 1.4% on GNU/Linux - not much, but it's already
18093         half a second for the self-hosting MCS compilation.
18094
18095         * typemanager.cs (IMemberFinder): New interface.  It is used by
18096         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18097         Enum, Delegate or Interface.
18098         (TypeManager.finder_to_member_finder): New PtrHashtable.
18099         (TypeManager.finder_to_container): Removed.
18100         (TypeManager.finder_to_delegate): Removed.
18101         (TypeManager.finder_to_interface): Removed.
18102         (TypeManager.finder_to_enum): Removed.
18103
18104         * interface.cs (Interface): Implement IMemberFinder.
18105
18106         * delegate.cs (Delegate): Implement IMemberFinder.
18107
18108         * enum.cs (Enum): Implement IMemberFinder.
18109
18110         * class.cs (TypeContainer): Implement IMemberFinder.
18111
18112 2002-08-12  Martin Baulig  <martin@gnome.org>
18113
18114         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18115
18116 2002-08-12  Martin Baulig  <martin@gnome.org>
18117
18118         * ecore.cs (ITypeExpression): New interface for expressions which
18119         resolve to a type.
18120         (TypeExpression): Renamed to TypeLookupExpression.
18121         (Expression.DoResolve): If we're doing a types-only lookup, the
18122         expression must implement the ITypeExpression interface and we
18123         call DoResolveType() on it.
18124         (SimpleName): Implement the new ITypeExpression interface.
18125         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18126         hack, the situation that we're only looking up types can't happen
18127         anymore when this method is called.  Moved the type lookup code to
18128         DoResolveType() and call it.
18129         (SimpleName.DoResolveType): This ITypeExpression interface method
18130         is now doing the types-only lookup.
18131         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18132         (ResolveFlags): Added MaskExprClass.
18133
18134         * expression.cs (MemberAccess): Implement the ITypeExpression
18135         interface.
18136         (MemberAccess.DoResolve): Added support for a types-only lookup
18137         when we're called via ITypeExpression.DoResolveType().
18138         (ComposedCast): Implement the ITypeExpression interface.
18139
18140         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18141         Expression.Resolve() with ResolveFlags.Type instead.
18142
18143 2002-08-12  Martin Baulig  <martin@gnome.org>
18144
18145         * interface.cs (Interface.Define): Apply attributes.
18146
18147         * attribute.cs (Attribute.ApplyAttributes): Added support for
18148         interface attributes.
18149
18150 2002-08-11  Martin Baulig  <martin@gnome.org>
18151
18152         * statement.cs (Block.Emit): Only check the "this" variable if we
18153         do not always throw an exception.
18154
18155         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18156         whether the property has a set accessor.
18157
18158 2002-08-11  Martin Baulig  <martin@gnome.org>
18159
18160         Added control flow analysis support for structs.
18161
18162         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18163         with control flow analysis turned off.
18164         (IVariable): New interface.
18165         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18166         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18167         (FieldExpr.DoResolve): Resolve the instance expression with flow
18168         analysis turned off and do the definite assignment check after the
18169         resolving when we know what the expression will resolve to.
18170
18171         * expression.cs (LocalVariableReference, ParameterReference):
18172         Implement the new IVariable interface, only call the flow analysis
18173         code if ec.DoFlowAnalysis is true.
18174         (This): Added constructor which takes a Block argument.  Implement
18175         the new IVariable interface.
18176         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18177         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18178         This does the definite assignment checks for struct members.
18179
18180         * class.cs (Constructor.Emit): If this is a non-static `struct'
18181         constructor which doesn't have any initializer, call
18182         Block.AddThisVariable() to tell the flow analysis code that all
18183         struct elements must be initialized before control returns from
18184         the constructor.
18185
18186         * statement.cs (MyStructInfo): New public class.
18187         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18188         argument to this indexer.  If non-zero, check an individual struct
18189         member, not the whole struct.
18190         (FlowBranching.CheckOutParameters): Check struct members.
18191         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18192         overloaded versions of these methods which take an additional
18193         `int field_idx' argument to check struct members.
18194         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18195         overloaded versions of these methods which take an additional
18196         `string field_name' argument to check struct member.s
18197         (VariableInfo): Implement the IVariable interface.
18198         (VariableInfo.StructInfo): New public property.  Returns the
18199         MyStructInfo instance of the variable if it's a struct or null.
18200         (Block.AddThisVariable): New public method.  This is called from
18201         Constructor.Emit() for non-static `struct' constructor which do
18202         not have any initializer.  It creates a special variable for the
18203         "this" instance variable which will be checked by the flow
18204         analysis code to ensure that all of the struct's fields are
18205         initialized before control returns from the constructor.
18206         (UsageVector): Added support for struct members.  If a
18207         variable/parameter is a struct with N members, we reserve a slot
18208         in the usage vector for each member.  A struct is considered fully
18209         initialized if either the struct itself (slot 0) or all its
18210         members are initialized.
18211
18212 2002-08-08  Martin Baulig  <martin@gnome.org>
18213
18214         * driver.cs (Driver.MainDriver): Only report an error CS5001
18215         if there were no compilation errors.
18216
18217         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18218         `UnsafeContext' property to determine whether the parent is in
18219         unsafe context rather than checking the parent's ModFlags:
18220         classes nested in an unsafe class are unsafe as well.
18221
18222 2002-08-08  Martin Baulig  <martin@gnome.org>
18223
18224         * statement.cs (UsageVector.MergeChildren): Distinguish between
18225         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18226         we return.  Added test17() and test18() to test-154.cs.
18227
18228 2002-08-08  Martin Baulig  <martin@gnome.org>
18229
18230         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18231         Family access, make sure the invoking type isn't a subclass of the
18232         queried type (that'd be a CS1540).
18233
18234         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18235         this method which takes an additional `Type invocation_type'.
18236
18237         * expression.cs (BaseAccess.DoResolve): Use the base type as
18238         invocation and query type.
18239         (MemberAccess.DoResolve): If the lookup failed and we're about to
18240         report a CS0122, try a lookup with the ec.ContainerType - if this
18241         succeeds, we must report a CS1540.
18242
18243 2002-08-08  Martin Baulig  <martin@gnome.org>
18244
18245         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18246         (MethodGroupExpr): Implement the IMemberExpr interface.
18247
18248         * expression (MemberAccess.ResolveMemberAccess): No need to have
18249         any special code for MethodGroupExprs anymore, they're now
18250         IMemberExprs.   
18251
18252 2002-08-08  Martin Baulig  <martin@gnome.org>
18253
18254         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18255         Family, FamANDAssem and FamORAssem permissions.
18256         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18257
18258 2002-08-08  Martin Baulig  <martin@gnome.org>
18259
18260         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18261         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18262         or loop block.
18263
18264 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18265
18266         * driver.cs: implemented /resource option to embed managed resources.
18267
18268 2002-08-07  Martin Baulig  <martin@gnome.org>
18269
18270         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18271         (FieldBase.HasFieldInitializer): New public property.
18272         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18273         returns the field initializer and makes sure it is only resolved once.
18274         (TypeContainer.EmitFieldInitializers): Call
18275         FieldBase.GetInitializerExpression to get the initializer, this ensures
18276         that it isn't resolved multiple times.
18277
18278         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18279         the resolving process (SimpleName/MemberLookup) that we're currently
18280         emitting a field initializer (which must not access any instance members,
18281         this is an error CS0236).
18282
18283         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18284         argument, if the `IsFieldInitializer' flag is set, we must report and
18285         error CS0236 and not an error CS0120.   
18286
18287 2002-08-07  Martin Baulig  <martin@gnome.org>
18288
18289         * ecore.cs (IMemberExpr): New public interface.
18290         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18291         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18292         if the expression is an IMemberExpr.
18293
18294         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18295         to be null, implicitly default to `this' if we're non-static in
18296         this case.  Simplified the code a lot by using the new IMemberExpr
18297         interface.  Also fixed bug #28176 here.
18298
18299 2002-08-06  Martin Baulig  <martin@gnome.org>
18300
18301         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18302         ParameterReferences during semantic analysis so that we can do a
18303         type-only search when resolving Cast, TypeOf and SizeOf.
18304         (block): Pass the `current_local_parameters' to the Block's
18305         constructor.
18306
18307         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18308         argument to the constructor.
18309         (ConstructorInitializer.Resolve): Create a temporary implicit
18310         block with the parameters.
18311
18312         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18313         references here if we aren't doing a type-only search.
18314
18315         * statement.cs (Block): Added constructor which takes a
18316         `Parameters parameters' argument.
18317         (Block.Parameters): New public property.
18318
18319         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18320         to `Parameters' and made it public readonly.
18321
18322 2002-08-06  Martin Baulig  <martin@gnome.org>
18323
18324         * ecore.cs (Expression.Warning): Made this public as well.
18325
18326         * report.cs (Report.Debug): Print the contents of collections.
18327
18328 2002-08-06  Martin Baulig  <martin@gnome.org>
18329
18330         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18331         used to tell Resolve() which kinds of expressions it may return.
18332         (Expression.Resolve): Added overloaded version of this method which
18333         takes a `ResolveFlags flags' argument.  This can be used to tell
18334         Resolve() which kinds of expressions it may return.  Reports a
18335         CS0118 on error.
18336         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18337         ResolveFlags.SimpleName.
18338         (Expression.Error118): Added overloaded version of this method which
18339         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18340         which kinds of expressions are allowed.
18341
18342         * expression.cs (Argument.ResolveMethodGroup): New public method.
18343         Resolves an argument, but allows a MethodGroup to be returned.
18344         This is used when invoking a delegate.
18345
18346         * TODO: Updated a bit.
18347
18348 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18349
18350         Fixed compilation with csc.
18351
18352         * ecore.cs: Expression.Error made public. Is this correct? Should
18353         Warning be made public too?
18354
18355         * expression.cs: use ea.Location instead of ea.loc.
18356         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18357
18358 2002-08-06  Martin Baulig  <martin@gnome.org>
18359
18360         * ecore.cs (Expression.loc): Moved the location here instead of
18361         duplicating it in all derived classes.
18362         (Expression.Location): New public property.
18363         (Expression.Error, Expression.Warning): Made them non-static and
18364         removed the location argument.
18365         (Expression.Warning): Added overloaded version which takes an
18366         `int level' argument.
18367         (Expression.Error118): Make this non-static and removed the
18368         expression and location arguments.
18369         (TypeExpr): Added location argument to the constructor.
18370
18371         * expression.cs (StaticCallExpr): Added location argument to
18372         the constructor.
18373         (Indirection, PointerArithmetic): Likewise.
18374         (CheckedExpr, UnCheckedExpr): Likewise.
18375         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18376         (StringPtr): Likewise.
18377
18378
18379 2002-08-05  Martin Baulig  <martin@gnome.org>
18380
18381         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18382
18383         * assign.cs (Assign.DoResolve): Check whether the source
18384         expression is a value or variable.
18385
18386         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18387         while resolving the corresponding blocks.
18388
18389         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18390         an error, don't silently return null.
18391
18392         * statement.cs (Block.AddVariable): Do the error reporting here
18393         and distinguish between CS0128 and CS0136.
18394         (Block.DoResolve): Report all unused labels (warning CS0164).
18395         (LabeledStatement): Pass the location to the constructor.
18396         (LabeledStatement.HasBeenReferenced): New property.
18397         (LabeledStatement.Resolve): Set it to true here.
18398
18399         * statement.cs (Return.Emit): Return success even after reporting
18400         a type mismatch error (CS0126 or CS0127), this is what csc does and
18401         it avoids confusing the users with any consecutive errors.
18402
18403 2002-08-05  Martin Baulig  <martin@gnome.org>
18404
18405         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18406
18407         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18408
18409         * expression.cs (MemberAccess.DoResolve): Silently return if an
18410         error has already been reported.
18411
18412         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18413         error has already been reported.
18414
18415 2002-08-05  Martin Baulig  <martin@gnome.org>
18416
18417         * statement.cs (UsageVector): Only initialize the `parameters'
18418         vector if we actually have any "out" parameters.
18419
18420 2002-08-05  Martin Baulig  <martin@gnome.org>
18421
18422         * expression.cs (Binary.ResolveOperator): When combining delegates,
18423         they must have the same type.
18424
18425 2002-08-05  Martin Baulig  <martin@gnome.org>
18426
18427         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18428         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18429         work with the ms runtime and we also don't need it: if we're a
18430         PropertyBuilder and not in the `indexer_arguments' hash, then we
18431         are a property and not an indexer.
18432
18433         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18434         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18435         since the latter one doesn't work with the ms runtime.
18436
18437 2002-08-03  Martin Baulig  <martin@gnome.org>
18438
18439         Fixed bugs #27998 and #22735.
18440
18441         * class.cs (Method.IsOperator): New public field.
18442         (Method.CheckBase): Report CS0111 if there's already a method
18443         with the same parameters in the current class.  Report CS0508 when
18444         attempting to change the return type of an inherited method.
18445         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18446         and it's not marked abstract or extern.
18447         (PropertyBase): New abstract base class for Property and Indexer.
18448         (PropertyBase.CheckBase): Moved here from Property and made it work
18449         for indexers.
18450         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18451         the same so we can reuse it there.
18452         (Property, Indexer): Derive from PropertyBase.
18453         (MethodSignature.inheritable_property_signature_filter): New delegate
18454         to find properties and indexers.
18455
18456         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18457         argument and improved error reporting.
18458
18459         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18460         EmptyReadOnlyParameters and made it a property.
18461
18462         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18463         version of this method which takes a `PropertyInfo indexer'.
18464         (TypeManager.RegisterIndexer): New method.
18465
18466         * class.cs: Added myself as author of this file :-)
18467
18468 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18469
18470         * class.cs: fixed compilation on windoze.
18471
18472 2002-08-03  Martin Baulig  <martin@gnome.org>
18473
18474         * interface.cs (Interface.GetInterfaceBases): Check whether all
18475         base interfaces are at least as accessible than the current one.
18476
18477         * class.cs (TypeContainer.GetClassBases): Check whether base types
18478         are at least as accessible than the current type.
18479         (TypeContainer.AsAccessible): Implemented and made non-static.
18480         (MemberBase.CheckParameters): Report errors if the accessibility
18481         checks fail.
18482
18483         * delegate.cs (Delegate.Delegate): The default visibility is
18484         internal for top-level types and private for nested types.
18485         (Delegate.Define): Report errors if the accessibility checks fail.
18486
18487         * enum.cs (Enum.Enum): The default visibility is internal for
18488         top-level types and private for nested types.
18489         (Enum.DefineType): Compute the correct visibility.
18490
18491         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18492         function which takes a `bool is_toplevel' instead of a TypeContainer.
18493
18494         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18495         builtin type.
18496
18497 2002-08-02  Martin Baulig  <martin@gnome.org>
18498
18499         * expression.cs (LocalVariableReferenc): Added constructor which
18500         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18501         (LocalVariableReference.IsReadOnly): New property.
18502         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18503         variable is readonly, use our own readonly flag to do this; you can
18504         use the new constructor to get a writable reference to a read-only
18505         variable.
18506
18507         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18508         reference to the local variable.
18509
18510 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18511
18512         * rootcontext.cs (ResolveCore): Also include System.Exception
18513
18514         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18515         we reach an EmptyStatement.
18516
18517         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18518         is also fine.
18519
18520         * expression.cs (Binary.ResolveOperator): Check error result in
18521         two places.
18522
18523         use brtrue/brfalse directly and avoid compares to null.
18524
18525 2002-08-02  Martin Baulig  <martin@gnome.org>
18526
18527         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18528         Fixes bug #28407, added test-155.cs.
18529
18530 2002-08-01  Martin Baulig  <martin@gnome.org>
18531
18532         * class.cs (Event.EmitDefaultMethod): Make this work with static
18533         events.  Fixes #28311, added verify-3.cs.
18534
18535 2002-08-01  Martin Baulig  <martin@gnome.org>
18536
18537         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18538         `is_disposable' fields.
18539         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18540         `hm.is_disposable' if we're using the collection pattern.
18541         (Foreach.EmitCollectionForeach): Use the correct type for the
18542         enumerator's local variable, only emit the try/finally block if
18543         necessary (fixes #27713).
18544
18545 2002-08-01  Martin Baulig  <martin@gnome.org>
18546
18547         * ecore.cs (Expression.report118): Renamed to Error118 and made
18548         it public static.
18549
18550         * statement.cs (Throw.Resolve): Check whether the expression is of
18551         the correct type (CS0118) and whether the type derives from
18552         System.Exception (CS0155).
18553         (Catch.Resolve): New method.  Do the type lookup here and check
18554         whether it derives from System.Exception (CS0155).
18555         (Catch.CatchType, Catch.IsGeneral): New public properties.
18556
18557         * typemanager.cs (TypeManager.exception_type): Added.
18558
18559 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18560
18561         * driver.cs: Updated About function.
18562
18563 2002-07-31  Martin Baulig  <martin@gnome.org>
18564
18565         Implemented Control Flow Analysis.
18566
18567         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18568         (EmitContext.CurrentBranching): Added.
18569         (EmitContext.StartFlowBranching): Added.
18570         (EmitContext.EndFlowBranching): Added.
18571         (EmitContext.KillFlowBranching): Added.
18572         (EmitContext.IsVariableAssigned): Added.
18573         (EmitContext.SetVariableAssigned): Added.
18574         (EmitContext.IsParameterAssigned): Added.
18575         (EmitContext.SetParameterAssigned): Added.
18576         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18577         Added control flow analysis stuff here.
18578
18579         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18580         resolve the expression as lvalue.
18581         (LocalVariableReference.DoResolve): Check whether the variable has
18582         already been assigned.
18583         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18584         the parameter as assigned here.
18585         (ParameterReference.DoResolve): Check whether the parameter has already
18586         been assigned.
18587         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18588         expression as lvalue.
18589
18590         * statement.cs (FlowBranching): New class for the flow analysis code.
18591         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18592         (LabeledStatement.IsDefined): New public property.
18593         (LabeledStatement.AddUsageVector): New public method to tell flow
18594         analyis that the label may be reached via a forward jump.
18595         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18596         flow analysis.
18597         (VariableInfo.Number): New public field.  This is used by flow analysis
18598         to number all locals of a block.
18599         (Block.CountVariables): New public property.  This is the number of
18600         local variables in this block (including the locals from all parent
18601         blocks).
18602         (Block.EmitMeta): Number all the variables.
18603
18604         * statement.cs: Added flow analysis support to all classes.
18605
18606 2002-07-31  Martin Baulig  <martin@gnome.org>
18607
18608         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18609         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18610         then use this argument.
18611
18612         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18613
18614         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18615         use this to specify /define options.
18616
18617 2002-07-29  Martin Baulig  <martin@gnome.org>
18618
18619         * statement.cs (Fixed): Moved all code that does variable lookups
18620         and resolvings from Emit to Resolve.
18621
18622         * statement.cs (For): Moved all code that does variable lookups
18623         and resolvings from Emit to Resolve.
18624
18625         * statement.cs (Using): Moved all code that does variable lookups
18626         and resolvings from Emit to Resolve.
18627
18628 2002-07-29  Martin Baulig  <martin@gnome.org>
18629
18630         * attribute.cs (Attribute.Resolve): Explicitly catch a
18631         System.NullReferenceException when creating the
18632         CustromAttributeBuilder and report a different warning message.
18633
18634 2002-07-29  Martin Baulig  <martin@gnome.org>
18635
18636         * support.cs (ParameterData.ParameterName): Added method to
18637         get the name of a parameter.
18638
18639         * typemanager.cs (TypeManager.IsValueType): New public method.
18640
18641 2002-07-29  Martin Baulig  <martin@gnome.org>
18642
18643         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18644         is a flag which specifies that it's either ref or out.
18645         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18646         the out parameter to `out Parameter.Modifier mod', also set the
18647         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18648
18649         * support.cs (InternalParameters.ParameterModifier): Distinguish
18650         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18651         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18652
18653         * expression.cs (Argument.GetParameterModifier): Distinguish
18654         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18655         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18656
18657 2002-07-29  Martin Baulig  <martin@gnome.org>
18658
18659         * expression.cs (ParameterReference.ParameterReference): Added
18660         `Location loc' argument to the constructor.
18661
18662         * cs-parser.jay: Pass location to ParameterReference.
18663
18664 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18665
18666         * statement.cs (Try): Initialize the location.
18667
18668         * cs-parser.jay: pass location to Try.
18669
18670         * expression.cs (Unary.Reduce): Change the prototype to return
18671         whether a constant fold could be performed or not.  The result is
18672         returned in an out parameters.  In the case of Indirection and
18673         AddressOf, we want to perform the full tests.
18674
18675 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18676
18677         * statement.cs (Statement.Emit): Flag dead code.
18678
18679 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18680
18681         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18682
18683 2002-07-27  Martin Baulig  <martin@gnome.org>
18684
18685         * class.cs (MethodData.Define): Put back call to
18686         TypeManager.AddMethod(), accidentally commented this out.
18687
18688         * report.cs (Debug): New public method to print debugging information,
18689         this is `[Conditional ("DEBUG")]'.
18690
18691 2002-07-26  Martin Baulig  <martin@gnome.org>
18692
18693         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18694         (switch_statement): Push the current_block to the switch_stack and
18695         pop it again when we're done with the switch.
18696         (switch_section): The new block is a child of the current_block.
18697         Fixes bug #24007, added test-152.cs.
18698
18699 2002-07-27  Martin Baulig  <martin@gnome.org>
18700
18701         * expression.cs (Invocation.EmitArguments): When calling a varargs
18702         function with only its fixed arguments, we need to pass an empty
18703         array.
18704
18705 2002-07-27  Martin Baulig  <martin@gnome.org>
18706
18707         Mono 0.13 has been released.
18708
18709 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18710
18711         * driver.cs: Rename --resource to --linkres, because that is what
18712         we do currently, we dont support --resource yet.
18713
18714         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18715
18716 2002-07-25  Martin Baulig  <martin@gnome.org>
18717
18718         * class.cs (MethodData): New public class.  This is a `method builder'
18719         class for a method or one accessor of a Property/Indexer/Event.
18720         (MethodData.GetMethodFlags): Moved here from MemberBase.
18721         (MethodData.ApplyAttributes): Likewise.
18722         (MethodData.ApplyObsoleteAttribute): Likewise.
18723         (MethodData.ApplyConditionalAttribute): Likewise.
18724         (MethodData.ApplyDllImportAttribute): Likewise.
18725         (MethodData.CheckAbstractAndExternal): Likewise.
18726         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18727         (MethodData.Emit): Formerly known as Method.Emit().
18728         (MemberBase): Moved everything which was specific to a single
18729         accessor/method to MethodData.
18730         (Method): Create a new MethodData and call Define() and Emit() on it.
18731         (Property, Indexer, Event): Create a new MethodData objects for each
18732         accessor and call Define() and Emit() on them.
18733
18734 2002-07-25  Martin Baulig  <martin@gnome.org>
18735
18736         Made MethodCore derive from MemberBase to reuse the code from there.
18737         MemberBase now also checks for attributes.
18738
18739         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18740         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18741         as virtual.
18742         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18743         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18744         (MemberBase.ApplyAttributes): New virtual method; applies the
18745         attributes to a method or accessor.
18746         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18747         (MemberBase.ApplyConditionalAttribute): Likewise.
18748         (MemberBase.ApplyDllImportAttribute): Likewise.
18749         (MemberBase.CheckAbstractAndExternal): Likewise.
18750         (MethodCore.ParameterTypes): This is now a property instead of a
18751         method, it's initialized from DoDefineParameters().
18752         (MethodCore.ParameterInfo): Removed the set accessor.
18753         (MethodCore.DoDefineParameters): New protected virtual method to
18754         initialize ParameterTypes and ParameterInfo.
18755         (Method.GetReturnType): We can now simply return the MemberType.
18756         (Method.GetMethodFlags): Override the MemberBase version and add
18757         the conditional flags.
18758         (Method.CheckBase): Moved some code from Define() here, call
18759         DoDefineParameters() here.
18760         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18761         here to avoid some larger code duplication.
18762         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18763         ensure that abstract and external accessors don't declare a body.
18764
18765         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18766         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18767         lookup in the attribute's parent classes, so we need to abort as soon
18768         as we found the first match.
18769         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18770         the attribute has no arguments.
18771
18772         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18773         of a Method.
18774
18775 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18776
18777         * cs-parser.jay: reverted previous patch.
18778
18779 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18780
18781         * cs-parser.jay: fixed bug #22119.
18782
18783 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18784
18785         * attribute.cs: fixed compilation. The error was:
18786         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18787         be assigned to before control leaves the current method."
18788         [FIXME:  Filed as bug #28186: MCS must report this error.]
18789
18790 2002-07-25  Martin Baulig  <martin@gnome.org>
18791
18792         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18793         method to pull the condition name ouf of a Conditional attribute.
18794         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18795         the obsolete message and error flag out of an Obsolete attribute.
18796
18797         * class.cs (Method.GetMethodFlags): New public method to get the
18798         TypeManager.MethodFlags for this method.
18799         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18800         private methods.
18801         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18802         if we're overriding a virtual function, set the new private variable
18803         `parent_method'; call the new TypeManager.AddMethod().
18804
18805         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18806         the MethodBuilder and the Method in a PtrHashtable.
18807         (TypeManager.builder_to_method): Added for this purpose.
18808         (TypeManager.MethodFlags): Added IsObsoleteError.
18809         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18810         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18811         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18812         the message from the attribute.
18813
18814 2002-07-24  Martin Baulig  <martin@gnome.org>
18815
18816         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18817         preprocessor directives, ensure that the argument to #define/#undef is
18818         exactly one identifier and that it's actually an identifier.
18819
18820         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18821         did not work ....
18822
18823 2002-07-24  Martin Baulig  <martin@gnome.org>
18824
18825         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18826         initialize it to TypeManager.object_type in the constructor.
18827         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18828         of the `hm.get_current' method if we're using the collection pattern.
18829         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18830         for the explicit conversion to make it work when we're using the collection
18831         pattern and the `Current' property has a different return type than `object'.
18832         Fixes #27713.
18833
18834 2002-07-24  Martin Baulig  <martin@gnome.org>
18835
18836         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18837         does not match, but don't report any errors.  This method is called in
18838         order for all methods in a MethodGroupExpr until a matching method is
18839         found, so we don't want to bail out if the first method doesn't match.
18840         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18841         matches, report the 123.  Fixes #28070.
18842
18843 2002-07-24  Martin Baulig  <martin@gnome.org>
18844
18845         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18846         TypeManager.TypeToCoreType() to the top of the method so the
18847         following equality checks will work.  Fixes #28107.
18848
18849 2002-07-24  Martin Baulig  <martin@gnome.org>
18850
18851         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18852         operand is of type uint, and the other operand is of type sbyte,
18853         short or int, the operands are converted to type long." -
18854         Actually do what this comment already told us.  Fixes bug #28106,
18855         added test-150.cs.
18856
18857 2002-07-24  Martin Baulig  <martin@gnome.org>
18858
18859         * class.cs (MethodBase): New abstract class.  This is now a base
18860         class for Property, Indexer and Event to avoid some code duplication
18861         in their Define() and DefineMethods() methods.
18862         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18863         generic methods for Define() and DefineMethods().
18864         (FieldBase): Derive from MemberBase, not MemberCore.
18865         (Property): Derive from MemberBase, not MemberCore.
18866         (Property.DefineMethod): Moved all the code from this method to the
18867         new MethodBase.DefineAccessor(), just call it with appropriate
18868         argumetnts.
18869         (Property.Define): Call the new Property.DoDefine(), this does some
18870         sanity checks and we don't need to duplicate the code everywhere.
18871         (Event): Derive from MemberBase, not MemberCore.
18872         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18873         accessors, this will also make them work with interface events.
18874         (Indexer): Derive from MemberBase, not MemberCore.
18875         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18876         (Indexer.Define): Use the new MethodBase functions.
18877
18878         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18879         argument to the constructor.
18880         (Interface.FindMembers): Added support for interface events.
18881         (Interface.PopluateEvent): Implemented.
18882
18883         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18884
18885 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18886
18887         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18888         but this is required to check for a method name being the same as
18889         the containing class.  
18890
18891         Handle this now.
18892
18893 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18894
18895         * interface.cs: initialize variable.
18896
18897 2002-07-23  Martin Baulig  <martin@gnome.org>
18898
18899         Implemented the IndexerName attribute in interfaces.
18900
18901         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18902         name if this is an explicit interface implementation.
18903         (Indexer.InterfaceIndexerName): New public variable.  If we're
18904         implementing an interface indexer, this is the IndexerName in that
18905         interface.  Otherwise, it's the IndexerName.
18906         (Indexer.DefineMethod): If we're implementing interface indexer,
18907         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18908         and Pending.ImplementIndexer methods.
18909         (Indexer.Define): Also define the PropertyBuilder if we're
18910         implementing an interface indexer and this is neither an explicit
18911         interface implementation nor do the IndexerName match the one in
18912         the interface.
18913
18914         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18915         If a method is defined here, then we always need to create a proxy
18916         for it.  This is used when implementing interface indexers.
18917         (Pending.IsInterfaceIndexer): New public method.
18918         (Pending.ImplementIndexer): New public method.
18919         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18920         This is used when implementing interface indexers to define a proxy
18921         if necessary.
18922         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18923         define a proxy if necessary.
18924
18925         * interface.cs (Interface.IndexerName): New public variable.
18926         (Interface.PopulateIndexer): Set the IndexerName.
18927         (Interface.DefineIndexers): New private method.  Populate all the
18928         indexers and make sure their IndexerNames match.
18929
18930         * typemanager.cs (IndexerPropertyName): Added support for interface
18931         indexers.
18932
18933 2002-07-22  Martin Baulig  <martin@gnome.org>
18934
18935         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18936         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18937         ret if HasReturnLabel.
18938         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18939         variables.
18940
18941         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18942         and set the ec.LoopBeginTryCatchLevel.
18943         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18944         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18945         the current ec.TryCatchLevel, the branch goes out of an exception
18946         block.  In this case, we need to use Leave and not Br.
18947
18948 2002-07-22  Martin Baulig  <martin@gnome.org>
18949
18950         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18951         block unless the block does not always return or it is contained in
18952         another try { ... } catch { ... } block.  Fixes bug #26506.
18953         Added verify-1.cs to the test suite.
18954
18955 2002-07-22  Martin Baulig  <martin@gnome.org>
18956
18957         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18958         then we do not always return.  Fixes bug #24985.
18959
18960 2002-07-22  Martin Baulig  <martin@gnome.org>
18961
18962         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18963         lookup on a per-class level; ie. walk up the class hierarchy until we
18964         found at least one applicable method, then choose the best among them.
18965         Fixes bug #24463 and test-29.cs.
18966
18967 2002-07-22  Martin Baulig  <martin@gnome.org>
18968
18969         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18970         return types of the methods.  The return type is not part of the
18971         signature and we must not check it to make the `new' modifier work.
18972         Fixes bug #27999, also added test-147.cs.
18973         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18974
18975         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18976         on the method's return type.
18977
18978 2002-07-21  Martin Baulig  <martin@gnome.org>
18979
18980         * assign.cs: Make this work if the rightmost source is a constant and
18981         we need to do an implicit type conversion.  Also adding a few more tests
18982         to test-38.cs which should have caught this.
18983
18984         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18985         target in the makefile for this.  The makefile.gnu is primarily intended
18986         for end-users who don't want to debug the compiler.
18987
18988 2002-07-21  Martin Baulig  <martin@gnome.org>
18989
18990         * assign.cs: Improved the Assign class so it can now handle embedded
18991         assignments (X = Y = Z = something).  As a side-effect this'll now also
18992         consume less local variables.  test-38.cs now passes with MCS, added
18993         a few new test cases to that test.
18994
18995 2002-07-20  Martin Baulig  <martin@gnome.org>
18996
18997         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18998         instructions.  Fixes bug #27977, also added test-146.cs.
18999
19000 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19001
19002         * cs-tokenizer.cs: fixed getHex ().
19003
19004 2002-07-19  Martin Baulig  <martin@gnome.org>
19005
19006         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19007         not Type.GetType() to lookup the array type.  This is needed when
19008         we're constructing an array of a user-defined type.
19009         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19010         single-dimensional arrays, but also for single-dimensial arrays of
19011         type decimal.
19012
19013 2002-07-19  Martin Baulig  <martin@gnome.org>
19014
19015         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19016         this function is called, it's not allowed to share LocalBuilders
19017         among ILGenerators.
19018
19019 2002-07-19  Martin Baulig  <martin@gnome.org>
19020
19021         * expression.cs (Argument.Resolve): Report an error 118 when trying
19022         to pass a type as argument.
19023
19024 2002-07-18  Martin Baulig  <martin@gnome.org>
19025
19026         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19027         Conv_R_Un for the signed `long' type.
19028
19029 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19030
19031         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19032         `expr' for the temporary result, as that will fail if we do
19033         multiple resolves on the same expression.
19034
19035 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19036
19037         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19038         ec.TypeContainer for looking up aliases. 
19039
19040         * class.cs (TypeContainer): Remove LookupAlias from here.
19041
19042         * decl.cs (DeclSpace); Move here.
19043
19044 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19045
19046         * class.cs (FindMembers): Only call filter if the constructor
19047         bulider is not null.
19048
19049         Also handle delegates in `NestedTypes' now.  Now we will perform
19050         type lookups using the standard resolution process.  This also
19051         fixes a bug.
19052
19053         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19054         This uses Expressions (the limited kind that can be parsed by the
19055         tree) instead of strings.
19056
19057         * expression.cs (ComposedCast.ToString): Implement, used to flag
19058         errors since now we have to render expressions.
19059
19060         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19061         FormArrayType. 
19062
19063         * ecore.cs (SimpleName.ToString): ditto.
19064
19065         * cs-parser.jay: Instead of using strings to assemble types, use
19066         Expressions to assemble the type (using SimpleName, ComposedCast,
19067         MemberAccess).  This should fix the type lookups in declarations,
19068         because we were using a different code path for this.
19069
19070         * statement.cs (Block.Resolve): Continue processing statements
19071         even when there is an error.
19072
19073 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19074
19075         * class.cs (Event.Define): Also remove the `remove' method from
19076         the list of pending items.
19077
19078         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19079         generate more compact code. 
19080
19081 2002-07-17  Martin Baulig  <martin@gnome.org>
19082
19083         * const.cs (Const.LookupConstantValue): Add support for constant
19084         `unchecked' and `checked' expressions.
19085         Also adding test case test-140.cs for this.
19086
19087 2002-07-17  Martin Baulig  <martin@gnome.org>
19088
19089         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19090         check whether mi.ReturnType implements the IEnumerator interface; the
19091         `==' and the IsAssignableFrom() will fail in this situation.
19092
19093 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19094
19095         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19096         here too.
19097
19098 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19099
19100         * expression.cs: fixed bug #27811.
19101
19102 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19103
19104         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19105         Molaro: when we are a ref, the value already contains a pointer
19106         value, do not take the address of it.
19107
19108 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19109         * removed mb-parser.jay and mb-tokenizer.cs
19110
19111 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19112
19113         * expression.cs: check against the building corlib void type.
19114
19115 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19116
19117         * ecore.cs: fix for valuetype static readonly fields: when 
19118         initializing them, we need their address, not the address of a copy.
19119
19120 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19121
19122         * typemanager.cs: register also enum_type in corlib.
19123
19124 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19125
19126         * class.cs: allow calling this (but not base) initializers in structs.
19127
19128 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19129
19130         * ecore.cs: make sure we compare against the building base types
19131         in GetTypeSize ().
19132
19133 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19134
19135         * typemanager.cs: fix TypeToCoreType() to handle void and object
19136         (corlib gets no more typerefs after this change).
19137
19138 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19139
19140         * expression.cs (ArrayCreation.EmitArrayArguments): use
19141         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19142
19143         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19144         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19145         array indexes, the runtime actually forbids them.
19146
19147         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19148         for array arguments here.
19149
19150         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19151         instead of the default for ValueTypes.
19152
19153         (New.DoEmit): Use IsValueType instead of
19154         IsSubclassOf (value_type)
19155         (New.DoResolve): ditto.
19156         (Invocation.EmitCall): ditto.
19157
19158         * assign.cs (Assign): ditto.
19159
19160         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19161         Statements *are* currently doing part of their resolution during
19162         Emit.  
19163
19164         Expressions do always resolve during resolve, but statements are
19165         only required to propagate resolution to their children.
19166
19167 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19168
19169         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19170
19171         (LoadAssembly): Do not add the dll if it is already specified
19172
19173         (MainDriver): Add the System directory to the link path at the end,
19174         after all the other -L arguments. 
19175
19176         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19177         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19178         ldelem.u1) and using the opposite for sbytes.
19179
19180         This fixes Digger, and we can finally run it.
19181
19182         * driver.cs (UnixParseOption): Move the option parsing here.  
19183         (CSCParseOption): Implement CSC-like parsing of options.
19184
19185         We now support both modes of operation, the old Unix way, and the
19186         new CSC-like way.  This should help those who wanted to make cross
19187         platform makefiles.
19188
19189         The only thing broken is that /r:, /reference: and /lib: are not
19190         implemented, because I want to make those have the same semantics
19191         as the CSC compiler has, and kill once and for all the confussion
19192         around this.   Will be doing this tomorrow.
19193
19194         * statement.cs (Unsafe.Resolve): The state is checked during
19195         resolve, not emit, so we have to set the flags for IsUnsfe here.
19196
19197 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19198
19199         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19200         not catch the Error_ObjectRefRequired in SimpleName (as it is
19201         possible to have a class/instance variable name that later gets
19202         deambiguated), we have to check this here.      
19203
19204 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19205
19206         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19207         make static and put into Expression.
19208
19209         (Event.Define): Register the private field of the event with the 
19210         TypeManager so that GetFieldFromEvent can get at it.
19211
19212         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19213         keep track of the private field associated with an event which
19214         has no accessors.
19215
19216         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19217         private field.
19218
19219         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19220
19221 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19222
19223         * expression.cs (Binary.EmitBranchable): this routine emits the
19224         Binary expression in a branchable context.  This basically means:
19225         we need to branch somewhere, not just get the value on the stack.
19226
19227         This works together with Statement.EmitBoolExpression.
19228
19229         * statement.cs (Statement.EmitBoolExpression): Use
19230         EmitBranchable. 
19231
19232 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19233
19234         * statement.cs (For): Reduce the number of jumps in loops.
19235
19236         (For): Implement loop inversion for the For statement.
19237
19238         (Break): We can be breaking out of a Try/Catch controlled section
19239         (foreach might have an implicit try/catch clause), so we need to
19240         use Leave instead of Br.
19241
19242         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19243         now).  If the instace expression supports IMemoryLocation, we use
19244         the AddressOf method from the IMemoryLocation to extract the
19245         address instead of emitting the instance.
19246
19247         This showed up with `This', as we were emitting the instance
19248         always (Emit) instead of the Address of This.  Particularly
19249         interesting when This is a value type, as we dont want the Emit
19250         effect (which was to load the object).
19251
19252 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19253
19254         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19255
19256         * statement.cs (Checked): Set the CheckedState during the resolve
19257         process too, as the ConvCast operations track the checked state on
19258         the resolve process, and not emit.
19259
19260         * cs-parser.jay (namespace_member_declaration): Flag that we have
19261         found a declaration when we do.  This is used to flag error 1529
19262
19263         * driver.cs: Report ok when we display the help only.
19264
19265 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19266
19267         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19268
19269 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19270
19271         * cs-tokenizer.cs (define): We also have to track locally the
19272         defines.  AllDefines is just used for the Conditional Attribute,
19273         but we also need the local defines for the current source code. 
19274
19275 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19276
19277         * statement.cs (While, For, Do): These loops can exit through a
19278         Break statement, use this information to tell whether the
19279         statement is the last piece of code.
19280
19281         (Break): Flag that we break.
19282
19283         * codegen.cs (EmitContexts): New `Breaks' state variable.
19284
19285 2002-07-03  Martin Baulig  <martin@gnome.org>
19286
19287         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19288         modifiers in method declarations in structs.  Otherwise, you won't
19289         be able to override things like Object.Equals().
19290
19291 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19292
19293         * class.cs (Method, Property, Indexer): Do not allow the public
19294         modifier to be used in explicit interface implementations.
19295
19296         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19297         override modifiers in method declarations in structs
19298
19299 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19300
19301         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19302         integer or real overflow, report an error
19303
19304 2002-07-02  Martin Baulig  <martin@gnome.org>
19305
19306         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19307         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19308         to tell the runtime about our newly created System.Object and
19309         System.ValueType types.
19310
19311 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19312
19313         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19314         struct instead of Ldarg/Starg.
19315
19316 2002-07-02  Martin Baulig  <martin@gnome.org>
19317
19318         * expression.cs (Indirection.Indirection): Call
19319         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19320
19321 2002-07-02  Martin Baulig  <martin@gnome.org>
19322
19323         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19324         ValueType, call TypeManager.TypeToCoreType() on it.
19325         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19326         the OpCodes.Newarr argument.
19327
19328 2002-07-02  Martin Baulig  <martin@gnome.org>
19329
19330         * expression.cs (Invocation.EmitCall): When compiling corlib,
19331         replace all calls to the system's System.Array type to calls to
19332         the newly created one.
19333
19334         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19335         System.Array methods.
19336         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19337         from the system's System.Array type which must be replaced.
19338
19339 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19340
19341         * typemanager.cs: load unverifiable_code_ctor so we can build
19342         corlib using the correct type. Avoid using GetTypeCode() with
19343         TypeBuilders.
19344         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19345         TypeManager.object_type to allow building corlib.
19346
19347 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19348
19349         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19350
19351 2002-07-01  Martin Baulig  <martin@gnome.org>
19352
19353         * class.cs: Make the last change actually work, we need to check
19354         whether `ifaces != null' to avoid a crash.
19355
19356 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19357
19358         * class.cs: when we build structs without fields that implement
19359         interfaces, we need to add the interfaces separately, since there is
19360         no API to both set the size and add the interfaces at type creation
19361         time.
19362
19363 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19364
19365         * expression.cs: the dimension arguments to the array constructors
19366         need to be converted if they are a long.
19367
19368 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19369
19370         * class.cs: don't emit ldarg.0 if there is no parent constructor
19371         (fixes showstopper for corlib).
19372
19373 2002-06-29  Martin Baulig  <martin@gnome.org>
19374
19375         MCS now compiles corlib on GNU/Linux :-)
19376
19377         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19378         ie. check for MethodImplOptions.InternalCall.
19379
19380         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19381         and TypeManager.attribute_type are null, so we must explicitly check
19382         whether parent is not null to find out whether it's an attribute type.
19383         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19384         and SetBuilder, not only if the property is neither abstract nor external.
19385         This is necessary to set the MethodImplOptions on the accessor methods.
19386         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19387         SetBuilder, see Property.Emit().
19388
19389         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19390         populate "System.Object", "System.ValueType" and "System.Attribute" since
19391         they've already been populated from BootCorlib_PopulateCoreTypes().
19392
19393 2002-06-29  Martin Baulig  <martin@gnome.org>
19394
19395         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19396         is the NullLiteral, we also need to make sure that target_type is not
19397         an enum type.   
19398
19399 2002-06-29  Martin Baulig  <martin@gnome.org>
19400
19401         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19402         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19403         before calling BootstrapCorlib_ResolveDelegate ().
19404
19405 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19406
19407         * statement.cs: fixed build-breaker. All tests passed ok.
19408
19409 2002-06-27  Martin Baulig  <martin@gnome.org>
19410
19411         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19412         for System.Decimal when compiling corlib.
19413
19414 2002-06-27  Martin Baulig  <martin@gnome.org>
19415
19416         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19417         switch blocks which contain nothing but a default clause.
19418
19419 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19420
19421        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19422
19423 2002-06-27  Martin Baulig  <martin@gnome.org>
19424
19425         * ecore.cs (PropertyExpr.PropertyExpr): Call
19426         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19427
19428         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19429         is already a TypeBuilder.
19430
19431 2002-06-27  Martin Baulig  <martin@gnome.org>
19432
19433         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19434         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19435         the "from an array-type to System.Array" case.  This makes it work
19436         when compiling corlib.
19437
19438 2002-06-27  Martin Baulig  <martin@gnome.org>
19439
19440         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19441         non-static PropertyExpr, set its InstanceExpression.  This makes
19442         the `ICollection.Count' property work in System/Array.cs.
19443
19444 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19445
19446         * driver.cs: Made error handling more consistent.  Errors now
19447         tracked by Report class, so many methods which used to return int
19448         now return void.  Main() now prints success/failure and 
19449         errors/warnings message.
19450
19451         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19452         the magic number return values (123 and 124).  Now, if the
19453         expected error occurs, the compiler exits with success (exit value
19454         0).  If the compilation completes without seeing that particular
19455         error, the compiler exits with failure (exit value 1).  The
19456         makefile in mcs/errors has been changed to handle the new behaviour.
19457
19458         * report.cs: Made 'expected error' number a property and renamed
19459         it from 'Probe' to 'ExpectedError'.
19460
19461         * genericparser.cs: Removed error handling support, since it is
19462         now all done by Report class.
19463
19464         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19465         class, so parse() no longer returns an int.
19466
19467         * namespace.cs: Use Report.Error instead of GenericParser.error
19468
19469 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19470
19471         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19472         TypeContainer.AddOperator): At the front of the list put the
19473         explicit implementations, so they get resolved/defined first. 
19474
19475 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19476
19477         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19478         interface type is implemented by this TypeContainer.  Used during
19479         explicit interface implementation.
19480
19481         (Property.Define, Indexer.Define, Method.Define): Validate that
19482         the given interface in the explicit implementation is one of the
19483         base classes for the containing type.
19484
19485         Also if we are explicitly implementing an interface, but there is
19486         no match in the pending implementation table, report an error.
19487
19488         (Property.Define): Only define the property if we are
19489         not explicitly implementing a property from an interface.  Use the
19490         correct name also for those properties (the same CSC uses,
19491         although that is really not needed).
19492
19493         (Property.Emit): Do not emit attributes for explicitly implemented
19494         properties, as there is no TypeBuilder.
19495
19496         (Indexer.Emit): ditto.
19497
19498         Hiding then means that we do not really *implement* a pending
19499         implementation, which makes code fail.
19500
19501 2002-06-22  Martin Baulig  <martin@gnome.org>
19502
19503         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19504         the return value of Object.GetType().  [FIXME: we need to do this whenever
19505         we get a type back from the reflection library].
19506
19507 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19508
19509         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19510
19511 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19512
19513         * attribute.cs: Return null if we can not look up the type.
19514
19515         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19516         the interface types found.
19517
19518         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19519         interface types found.
19520
19521         * typemanager.cs (GetInterfaces): Make this routine returns alll
19522         the interfaces and work around the lame differences between
19523         System.Type and System.Reflection.Emit.TypeBuilder in the results
19524         result for GetInterfaces.
19525
19526         (ExpandInterfaces): Given an array of interface types, expand and
19527         eliminate repeated ocurrences of an interface.  This expands in
19528         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19529         be IA, IB, IC.
19530
19531 2002-06-21  Martin Baulig  <martin@gnome.org>
19532
19533         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19534         on System.Enum.
19535
19536 2002-06-21  Martin Baulig  <martin@gnome.org>
19537
19538         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19539         and called with one of the core types, return the corresponding typebuilder for
19540         that type.
19541
19542         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19543         element type.
19544
19545 2002-06-21  Martin Baulig  <martin@gnome.org>
19546
19547         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19548         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19549         (Expression.ConvertReferenceExplicit): Likewise.
19550
19551         * expression.cs (ElementAccess.DoResolve): Likewise.
19552         (ElementAccess.DoResolveLValue): Likewise.
19553
19554 2002-06-10  Martin Baulig  <martin@gnome.org>
19555
19556         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19557         add the "value" parameter to the parameter list.
19558
19559         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19560         to our caller.
19561
19562 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19563
19564         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19565         the argument to an int, uint, long or ulong, per the spec.  Also
19566         catch negative constants in array creation.
19567
19568 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19569
19570         * class.cs: do not allow the same interface to appear twice in
19571         the definition list.
19572
19573 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19574
19575         * ecore.cs: don't use ldlen with System.Array.
19576
19577 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19578
19579         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19580
19581 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19582
19583         * modifiers.cs: produce correct field attributes for protected
19584         internal. Easy fix so miguel can work on ther harder stuff:-)
19585
19586 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19587
19588         * pending.cs: New file.  Move the code from class.cs here.
19589         Support clearning the pending flag for all methods (when not doing
19590         explicit interface implementation).
19591
19592 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19593
19594         * rootcontext.cs: added a couple more types needed to bootstrap.
19595
19596 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19597
19598         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19599         constructor in the type, instead of any constructor in the type
19600         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19601         a bug in the Mono runtime when applying the params attribute). 
19602
19603 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19604         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19605
19606 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19607
19608         * expression.cs (Unary.ResolveOperator): Use TypeManager
19609         to resolve the type.
19610
19611 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19612
19613         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19614         attached.
19615
19616         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19617         with each member too.
19618
19619         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19620         field builders too - this takes care of the enum member case.
19621
19622 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19623
19624         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19625         address-of operator on both value types and pointers.
19626
19627 2002-06-10  Martin Baulig  <martin@gnome.org>
19628
19629         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19630         PropertyBuilder to the `property_builders' list.
19631
19632         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19633         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19634         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19635         find any indexers which are inherited from an interface.
19636
19637 2002-06-09  Martin Baulig  <martin@gnome.org>
19638
19639         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19640         the same type as the constant if necessary.  There's also a test-130.cs
19641         for this.
19642
19643         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19644
19645         * typemanager.cs (TypeManager.ChangeType): Previously known as
19646         Enum.ChangeEnumType().
19647
19648 2002-06-09  Martin Baulig  <martin@gnome.org>
19649
19650         * expression.cs (Cast.TryReduce): Added support for consts.
19651
19652 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19653
19654         * class.cs (Accessor): Hold attributes information so we can pass
19655         it along.
19656
19657         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19658         Modify to pass in attributes attached to the methods.
19659
19660         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19661
19662         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19663         to handle the Accessor kind :-)
19664
19665         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19666
19667 2002-06-08  Martin Baulig  <martin@gnome.org>
19668
19669         * expression.cs (Unary.TryReduceNegative): Added support for
19670         ULongConstants.
19671
19672 2002-06-08  Martin Baulig  <martin@gnome.org>
19673
19674         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19675         name can't be found in the `defined_names' - the caller will do a
19676         MemberLookup in this case and thus find methods in System.Enum
19677         such as Enum.IsDefined().
19678
19679 2002-06-08  Martin Baulig  <martin@gnome.org>
19680
19681         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19682         Convert.ChangeType() which works with TypeBuilder created types.
19683         (Enum.LookupEnumValue, Enum.Define): Use it here.
19684
19685         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19686         `TypeBuilder.BaseType != null' check.
19687         (TypeContainer.FindMembers): Only lookup parent members if we
19688         actually have a parent.
19689         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19690         (ConstructorInitializer.Resolve): Likewise.
19691
19692         * interface.cs (Interface.FindMembers): Added
19693         `TypeBuilder.BaseType != null' check.
19694
19695         * rootcontext.cs (RootContext.ResolveCore): Added
19696         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19697         classes_second_stage.
19698
19699         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19700         debug_type and trace_type when compiling with --nostdlib.       
19701
19702 2002-06-07  Martin Baulig  <martin@gnome.org>
19703
19704         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19705         (AddField): Set it to true when adding a non-static field.
19706         (DefineType): Use `have_nonstatic_fields' to find out whether we
19707         have non-static fields, not `Fields != null'.
19708
19709 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19710
19711         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19712         dereferencing a null on the static-field code path)
19713
19714 2002-05-30  Martin Baulig  <martin@gnome.org>
19715
19716         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19717         to take command line arguments.  Use reflection to call the new
19718         custom `Initialize' function on the symbol writer and pass it the
19719         command line arguments.
19720
19721         * driver.cs (--debug-args): New command line argument to pass command
19722         line arguments to the symbol writer.
19723
19724 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19725
19726         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19727         the target type for indexers and properties.  Thanks to Joe for
19728         catching this.
19729
19730 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19731
19732         * typemanager.cs (MethodFlags): returns the method flags
19733         (Obsolete/ShouldIgnore) that control warning emission and whether
19734         the invocation should be made, or ignored. 
19735
19736         * expression.cs (Invocation.Emit): Remove previous hack, we should
19737         not do this on matching a base type, we should do this based on an attribute
19738
19739         Only emit calls to System.Diagnostics.Debug and
19740         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19741         on the command line.
19742
19743         * rootcontext.cs: Global settings for tracing and debugging.
19744
19745         * cs-tokenizer.cs (define): New utility function to track
19746         defines.   Set the global settings for TRACE and DEBUG if found.
19747
19748 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19749
19750         * interface.cs (Populate*): Pass in the TypeContainer as well as
19751         the DeclSpace as parameters so that we can create EmitContexts and
19752         then use that to apply attributes etc.
19753
19754         (PopulateMethod, PopulateEvent, PopulateProperty)
19755         (PopulateIndexer): Apply attributes everywhere.
19756
19757         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19758         etc.
19759
19760         (ApplyAttributes): Update accordingly.
19761
19762         We now apply interface attributes for all members too.
19763
19764 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19765
19766         * class.cs (Indexer.Define); Correctly check if we are explicit
19767         implementation (instead of checking the Name for a ".", we
19768         directly look up if the InterfaceType was specified).
19769
19770         Delay the creation of the PropertyBuilder.
19771
19772         Only create the PropertyBuilder if we are not an explicit
19773         interface implementation.   This means that explicit interface
19774         implementation members do not participate in regular function
19775         lookups, and hence fixes another major ambiguity problem in
19776         overload resolution (that was the visible effect).
19777
19778         (DefineMethod): Return whether we are doing an interface
19779         implementation. 
19780
19781         * typemanager.cs: Temporary hack until we get attributes in
19782         interfaces (Ravi is working on that) and we get IndexerName
19783         support in interfaces.
19784
19785         * interface.cs: Register the indexers as properties.
19786
19787         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19788         warning, I have verified that this is a bug in the .NET runtime
19789         (JavaScript suffers of the same problem).
19790
19791         * typemanager.cs (MemberLookup): When looking up members for
19792         interfaces, the parent of an interface is the implicit
19793         System.Object (so we succeed in searches of Object methods in an
19794         interface method invocation.  Example:  IEnumerable x;  x.ToString
19795         ()) 
19796
19797 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * class.cs (Event): Events should also register if they do
19800         implement the methods that an interface requires.
19801
19802         * typemanager.cs (MemberLookup); use the new GetInterfaces
19803         method. 
19804
19805         (GetInterfaces): The code used to lookup interfaces for a type is
19806         used in more than one place, factor it here. 
19807
19808         * driver.cs: Track the errors at the bottom of the file, we kept
19809         on going.
19810
19811         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19812         instance if the method we are calling is static!
19813
19814 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19815
19816         * attribute.cs (ApplyAttributes): Make this function filter out
19817         the IndexerName attribute (as that attribute in reality is never
19818         applied) and return the string constant for the IndexerName
19819         attribute. 
19820
19821         * class.cs (TypeContainer.Emit): Validate that all the indexers
19822         have the same IndexerName attribute, and if so, set the
19823         DefaultName attribute on the class. 
19824
19825         * typemanager.cs: The return value might contain other stuff (not
19826         only methods).  For instance, consider a method with an "Item"
19827         property and an Item method.
19828
19829         * class.cs: If there is a problem with the parameter types,
19830         return. 
19831
19832 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19833
19834         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19835         looks at user defined conversion after making a call to 
19836         StandardConversionExists - we need this for overload resolution.
19837
19838         * expression.cs : Update accordingly the various method calls.
19839
19840         This fixes 2 bugs filed against implicit user defined conversions 
19841
19842 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19843
19844         * statement.cs: Track the result of the assignment.
19845
19846 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19847
19848         * expression.cs (MemberAccess): Improved error reporting for
19849         inaccessible members.
19850
19851 2002-05-22  Martin Baulig  <martin@gnome.org>
19852
19853         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19854         itself with debugging support.
19855
19856 2002-05-22  Martin Baulig  <martin@gnome.org>
19857
19858         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19859         Removed, this isn't needed anymore.
19860
19861 2002-05-20  Martin Baulig  <martin@gnome.org>
19862
19863         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19864         be underlying type for an enum.
19865
19866 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19867
19868         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19869         that splits out the loading of just the core types.
19870
19871         * rootcontext.cs (ResolveCore): Split the struct resolution in
19872         two, so we can load the enumeration underlying types before any
19873         enums are used.
19874
19875         * expression.cs (Is): Bandaid until we fix properly Switch (see
19876         bug #24985 for details).
19877
19878         * typemanager.cs (ImplementsInterface): The hashtable will contain
19879         a null if there are no interfaces implemented.
19880
19881 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * cs-parser.jay (indexer_declarator): It is fine to have array
19884         parameters
19885
19886 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19887
19888         * typemanager.cs: (RegisterBuilder): New function used to register
19889         TypeBuilders that implement interfaces.  Since
19890         TypeBuilder.GetInterfaces (as usual) does not work with lame
19891         Reflection.Emit. 
19892         (AddUserType): register interfaces.
19893
19894         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19895         dealing with TypeBuilder.  Also, arrays are showing up as
19896         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19897         methods can not be invoked on them!
19898
19899         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19900         (ImplicitReferenceConversionExists): Split out from
19901         StandardConversionExists. 
19902
19903         * expression.cs (As): We were only implementing one of the three
19904         cases for the as operator.  We now implement them all.
19905         (Is): Implement the various other cases for Is as well.
19906
19907         * typemanager.cs (CACHE): New define used to control if we want or
19908         not the FindMembers cache.  Seems to have a negative impact on
19909         performance currently
19910
19911         (MemberLookup): Nested types have full acess to
19912         enclosing type members
19913
19914         Remove code that coped with instance/static returns for events, we
19915         now catch this in RealFindMembers.
19916
19917         (RealFindMembers): only perform static lookup if the instance
19918         lookup did not return a type or an event.  
19919
19920 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19921
19922         * assign.cs (CompoundAssign): We pass more semantic information
19923         now to Compound Assignments than we did before: now we have all
19924         the information at hand, and now we resolve the target *before* we
19925         do the expression expansion, which allows the "CacheValue" method
19926         to have the effect we intended (before, a [x] += 1 would generate
19927         two differen ArrayAccess expressions from the ElementAccess,
19928         during the resolution process).
19929
19930         (CompoundAssign.DoResolve): Resolve target and original_source here.
19931
19932 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19933
19934         * expression.cs (ArrayAccess): dropped debugging information. 
19935
19936         * typemanager.cs: Small bug fix: I was always returning i_members,
19937         instead of one of i_members or s_members (depending on which had
19938         the content).
19939
19940         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19941         method is invoked before any code generation takes place, and it
19942         is a mechanism to inform that the expression will be invoked more
19943         than once, and that the method should use temporary values to
19944         avoid having side effects
19945
19946         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19947
19948         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19949         implementation.
19950
19951         * expression.cs (Indirection, ArrayAccess): Add support for
19952         CacheTemporaries in these two bad boys. 
19953
19954         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19955         ldobj or ldind_ref.  
19956         (StoreFromPtr): Handle stobj as well.
19957
19958         * expression.cs (UnaryMutator): Share more code.
19959
19960         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19961         down: I was not tracking the Filter function as well, which
19962         was affecting the results of the cache.
19963
19964 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19965
19966         * attribute.cs: Remove the hack to handle the CharSet property on
19967         StructLayouts. 
19968
19969 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19970
19971         * attribute.cs (DoResolve): More uglyness, we now only try to
19972         resolve the attribute partially, to extract the CharSet
19973         information (only if we are a StructLayout attribute).  Otherwise 
19974
19975         (GetExtraTypeInfo): Add some code to conditionally kill in the
19976         future this.   I am more and more convinced that the .NET
19977         framework has special code to handle the attribute setting on
19978         certain elements.
19979
19980         * expression.cs (IsParamsMethodApplicable): Revert my previous
19981         foreach change here, it was wrong.
19982
19983 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19984
19985         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19986         (pp_expr): do not abort on unknown input, just return.
19987         (eval): abort if there are pending chars.
19988
19989         * attribute.cs (Attribute.Resolve): Positional parameters are
19990         optional.  Deal with that case.
19991
19992         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19993         the Ansi/Unicode/Auto information for the type.
19994
19995         (TypeContainer.DefineType): instantiate the EmitContext here, as
19996         we will be using it during the type definition (to resolve
19997         attributes) and during the emit phase.
19998
19999         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20000         to pull type information out of the attributes
20001
20002         (Attribute.Resolve): track the constructor builder, and allow for
20003         multiple invocations (structs and classes will use this).
20004
20005         * ecore.cs (MemberLookupFinal): new version with all the
20006         parameters customizable.
20007
20008         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20009         constructors.  Return if the result value is null (as the error
20010         would have been flagged already by MemberLookupFinal)
20011
20012         Do not allow instances of abstract classes or interfaces to be
20013         created.
20014
20015         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20016         We have to compare the assembly property here when dealing with
20017         FamANDAssem and Assembly access modifiers, because we might be
20018         creating an assembly from *modules* (that means that we are not
20019         getting TypeBuilders for types defined in other modules that are
20020         part of this assembly).
20021
20022         (Method.Emit): If the method is marked abstract and has a body,
20023         emit an error. 
20024
20025         (TypeContainer.DefineMembers): If both the defined member and the
20026         parent name match are methods, then do not emit any warnings: let
20027         the Method.Define routine take care of flagging warnings.  But if
20028         there is a mismatch (method overrides something else, or method is
20029         overriwritten by something, then emit warning).
20030
20031         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20032         set to null, this means `do not check for the return type on the
20033         signature'. 
20034
20035         (Method.Define): set the return type for the method signature to
20036         null, so that we get methods with the same name and parameters and
20037         different return types.  This is used to flag warning 114 (you are
20038         hiding a method, and you probably want to use the new/override
20039         keywords instead).
20040
20041         * typemanager.cs (MemberLookup): Implemented proper access
20042         control, closing a long standing set of bug reports.  The problem
20043         was that the Framework only has two bits: Public and NonPublic,
20044         and NonPublic includes private and protected methods, but we need
20045         to enforce the FamANDAssem, FamOrAssem and Family. 
20046
20047 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20048
20049         * statement.cs (GotoCase): Return true: Ammounts to giving up
20050         knowledge on whether we return or not, and letting the other case
20051         be responsible for it.
20052
20053 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20054
20055         * driver.cs: Do not load directories for each file processed, only
20056         do it if there is a pattern.
20057
20058         * ecore.cs: Report readonly assigns here as well, as we might have
20059         been resolved only by MemberAccess.
20060
20061         (SimpleName.SimpleNameResolve): Also be useful for LValue
20062         resolution.   We need this to propagate assign to local readonly variables
20063
20064         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20065         do not want to reuse potential criteria memory.
20066
20067         * class.cs (MyEventBuilder): Set reflected_type;
20068
20069         * ecore.cs (Constantify): Added support for constifying bools.
20070
20071         (RootContext.LookupType): Added a cache for values looked up in
20072         the declaration space.
20073
20074         * typemanager.cs (FindMembers): Now is a front-end to
20075         RealFindMembers, and provides a two-level hashtable-based cache to
20076         the request.  
20077
20078         15% performance improvement: from 22.5 to 19.2 seconds.
20079
20080         * expression.cs (IsParamsMethodApplicable): use foreach.
20081         (Invocation.DoResolve): ditto.
20082         (New.DoResolve): ditto.
20083         (ArrayCreation.DoResolve): ditto.
20084
20085         * ecore.cs (FindMostEncompassingType): use foreach.
20086
20087         * delegate.cs (NewDelegate.DoResolve): Use foreach
20088
20089         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20090         (RemoveMethods): use foreach.
20091
20092         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20093         nested foreach statements instead of for, and also break out of
20094         the inner loop once a match is found.
20095
20096         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20097
20098 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20099
20100         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20101         we actually unwrap the expression to allow for extra information
20102         to be extracted. 
20103
20104         * expression.cs: Use Shr_Un on unsigned operations. 
20105
20106 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20107
20108         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20109         applicable operators was not being considered correctly. This closes
20110         the bug Miguel reported.
20111
20112 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20113
20114         * attribute.cs: check that the type derives from System.Attribute
20115         and report the correct error in that case (moved the duplicate code to
20116         its own method, too).
20117
20118 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20119
20120         * attribute.cs: lookup attribute type name as the spec says: first the
20121         bare attribute name and then name + "Attribute" (nant compiles with
20122         mcs after this fix).
20123
20124 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20127         Because of the way we parse things, we should try to see if a
20128         UIntConstant can fit in an integer.
20129
20130 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20131
20132         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20133         when we are in an explicit context.
20134
20135         (ConvertReferenceExplicit): When converting from Iface type S to Class
20136         T make sure the rules are implemented as an OR.
20137
20138         * parameter.cs (ParameterType): Make it a property for now although the
20139         purpose really isn't anything immediate.
20140
20141         * expression.cs (Is*Applicable): Do better checking on the parameter type
20142         of a ref/out parameter. The ones from the system assemblies are already 
20143         marked with the correct type so we don't need to do any correction.
20144
20145         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20146         the object type is standard too so include that.
20147
20148 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20149
20150         * ecore.cs (StandardConversionExists): Augment with missing code:
20151         deal with IntConstant, LongConstants and Enumerations.
20152
20153         * assign.cs: Report the error, instead of failing silently
20154
20155         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20156         typecontainer that they are declared, because the
20157         typecontainer/namespace will have the list of using clauses that
20158         need to be applied.
20159
20160         Assembly Attributes were escaping the normal registration
20161         mechanism. 
20162
20163         (EmitCode): Apply attributes within an EmitContext that represents
20164         the container they were declared on.
20165
20166         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20167
20168 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20169
20170         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20171         Revamp completely - make much cleaner as we now operate only
20172         on a set of Types.
20173
20174         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20175         to implement the logic detailed in the spec more correctly.
20176
20177         (UserDefinedConversion): Update accordingly.
20178
20179 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20180
20181         * statement.cs: Return flow analysis information up.
20182
20183         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20184         and the default.
20185
20186         (token): Do not consume an extra character before calling
20187         decimal_digits.
20188
20189 2002-05-06  Piers Haken <piersh@friskit.com>
20190
20191         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20192
20193 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20194
20195         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20196         EmitContext during the instance constructor initializer
20197         resolution, to stop access to instance variables.
20198
20199         This is mandated by the spec, last paragraph of the `constructor
20200         initializers' section. 
20201
20202 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20203
20204         * cs-parser.jay, class.cs (Accessor): new class used to represent
20205         an accessor (get or set).  In the past we used `null' to represent
20206         a missing accessor.  But this is ambiguous because there was no
20207         way to tell in abstract indexers/properties if one of them was
20208         specified.
20209
20210         Now there is a way of addressing that.
20211
20212         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20213         instead of FindMembers.
20214
20215         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20216         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20217
20218         * attribute.cs: Treat indexers and properties as the same in terms
20219         of applying attributes
20220
20221         * ecore.cs (FindMostEncompassedType): Use statically initialized
20222         EmptyExpressions()s like we do elsewhere to avoid creating useless
20223         objects (and we take this out of the tight loop).
20224
20225         (GetConversionOperators): Move the code to extract the actual
20226         operators to a separate routine to clean things up.
20227
20228 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20229
20230         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20231         events are always registered FieldBuilders.
20232
20233         * class.cs (FieldBase): New class shared by Fields 
20234
20235         * delegate.cs: If we are a toplevel delegate, use our full name.
20236         If we are a nested delegate, then only use our tail name.
20237
20238 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20239
20240         * expression.cs (IsApplicable): Ensure that we add the "&" to
20241         ref/out types before comparing it with the type of the argument.
20242
20243         (IsParamsMethodApplicable): Ditto.
20244
20245         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20246         silly me ;-)
20247
20248         * delegate.cs : Handle the case when we have more than one applicable
20249         method. Flag an error only when we finish checking all.
20250
20251 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20252
20253         * expression.cs: Add support for boolean static initializers.
20254
20255 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20256
20257         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20258
20259         * parameter.cs (ComputeParameterTypes,
20260         ComputeAndDefineParameterTypes): Better error handling: now we
20261         clear the `types' cache if we fail during any of the type lookups.
20262         We also return the status code correctly to our caller
20263
20264         * delegate.cs: If we fail to define a delegate, abort the extra
20265         steps. 
20266
20267         * expression.cs (Binary.ResolveOperator): for
20268         operator==(object,object) and operator !=(object, object) we also
20269         have to verify that there is an implicit conversion from one to
20270         the other.
20271
20272         (ArrayAccess.DoResolve): Array Access can operate on
20273         non-variables. 
20274
20275 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20276
20277         * assign.cs (CompoundAssign): A new class used as a "flag" that
20278         the assignment actually is happening as part of a compound
20279         assignment operator.
20280
20281         During compound assignment, a few new rules exist to enable things
20282         like:
20283
20284         byte b |= 1 + 2
20285
20286         From the spec:
20287
20288         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20289         to the type of x) if y is implicitly convertible to the type of x,
20290         and the operator is a builtin operator and the return type of the
20291         operator is explicitly convertible to the type of x. 
20292
20293         * rootcontext.cs: Reset warning level to 2.  4 catches various
20294         "interesting" features in mcs, we must clean this up at some
20295         point, but currently am trying to kill other bugs ;-)
20296
20297         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20298         in container classes as well.  
20299
20300         * expression.cs (Binary.ResolveOperator): Handle string case
20301         before anything else (as operator overloading does emit an error
20302         before doing anything else).
20303
20304         This code could go away when we move to a table driven model, but
20305         i could not come up with a good plan last night.
20306
20307 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20308
20309         * typemanager.cs (CSharpName): reimplementation using regex.
20310         * class.cs: added null check for fields in Emit
20311         * rootcontext.cs: set warninglevel to 4
20312
20313 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20314
20315         * typemanager.cs (CSharpName): reimplemented with Lupus
20316         suggestion.
20317
20318 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * statement.cs (If): correclty implement Resolve, because we were
20321         not catching sem errors in there.  The same process is needed
20322         everywhere else. 
20323         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20324
20325
20326         (Statement.Warning_DeadCodeFound): Factorize code.
20327         (While): Report dead code here too.
20328
20329         (Statement): Added Resolve virtual method to allow
20330         for resolution split from the emit code.
20331
20332 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20333
20334         * statement.cs (EmitBoolExpression): No longer try to resolve the
20335         expression here.    
20336         (MakeBoolean): New utility function that resolve, implicitly
20337         converts to boolean and tags the expression. 
20338
20339
20340         (If, Do): Implement dead code elimination.
20341         (While): Implement loop inversion
20342
20343         (Do, While, For, If): Resolve the expression prior to calling our
20344         code generation.
20345
20346 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20347
20348         * class.cs:
20349           - added method Report28 (warning: program has more than one entry point)
20350           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20351           - modified method Method.Define, the part at the end of the method
20352
20353         * rootcontext.cs: added static public Location EntryPointLocation;
20354           
20355         * ../errors/cs0028.cs : Add test case for the above warning.              
20356
20357         * typemanager.cs:
20358           - modified method CSharpName to allow arrays of primitive type to
20359             be printed nicely (e.g. instead of System.Int32[][] it now prints
20360             int[][])
20361           - added method CSharpSignature: returns the signature of a method
20362             in string format to be used in reporting errors, warnings, etc.
20363
20364         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20365         with String.Empty.
20366
20367 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20368
20369         * delegate.cs (Define): Fix extremely silly bug where I was
20370         setting the type of the 'object' parameter of the BeginInvoke
20371         method to System.IAsyncResult instead of System.Object ;-)
20372
20373 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20374
20375         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20376         here. 
20377
20378         (Constructor.Emit): return if we fail to initialize the
20379         constructor.  Another door closed!  
20380
20381         * expression.cs (New.DoResolve): Improve error message (from -6 to
20382         1501).  Use DeclaredOnly lookup to find the exact constructor.
20383
20384         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20385         loop.  This is useful.
20386
20387         * cs-parser.jay: Adjust the default parameters so that destructors
20388         have the proper signature.
20389
20390 2002-04-26  Martin Baulig  <martin@gnome.org>
20391
20392         * driver.cs (LoadAssembly): If `assembly' contains any characters
20393         which are only valid in path names and not in assembly names
20394         (currently slash, backslash and point), use Assembly.LoadFrom ()
20395         instead of Assembly.Load () on the `assembly' (before iteration
20396         over the link_paths).
20397
20398 2002-04-26  Martin Baulig  <martin@gnome.org>
20399
20400         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20401
20402 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20403
20404         * class.cs (Property): use the new typemanager.MemberLookup
20405
20406         (TypeContainer.MemberLookup): Implement using the
20407         TypeManager.MemberLookup now. 
20408
20409         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20410         and return MemberInfos, so that these can be used without an
20411         EmitContext (what we had before).
20412
20413 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20414
20415         * expression.cs: Fix the case where the argument to params if the
20416         type of the params.  I omitted handling this before.   Fixed
20417
20418 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20419
20420         * driver.cs: Call BootCorlib_PopulateCoreType
20421
20422         * class.cs (Property.CheckBase): Check for properties only, not
20423         for all members. 
20424
20425         * interface.cs: Temporary hack: try/catch around the
20426         CustomAttributeBuilder, because I am getting an exception that I
20427         do not understand.
20428
20429         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20430         types whose definitions are required to be there (attributes are
20431         defined before standard types).
20432
20433         Compute definitions as we boot the various types, as they are used
20434         immediately (value_type class will need object_type, but if we do
20435         not initialize object_type, we will pass a null, which will let
20436         the runtime pick the System.Object from the existing corlib, which
20437         is not what we want).
20438
20439 2002-04-22  Patrik Torstensson <totte@labs2.com>
20440
20441         * cs-tokenizer.cs: fixed a number of trim() issues.
20442
20443 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20444
20445         * expression.cs (Argument.Type): Ensure that we return the correct
20446         type when we have out or ref parameters [in which case we 
20447         append a "&"].
20448
20449 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20450
20451         * class.cs (Property, Indexer): Allow extern modifier in there. 
20452
20453         * typemanager.cs (InitBaseTypes): Initializes object_type and
20454         value_type, since those will be used early on during the bootstrap
20455         process to compile corlib.
20456
20457         (InitCoreTypes): Move code from here to InitBaseTypes.
20458
20459 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20460
20461         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20462         single-dimension arrays as using the ldlen opcode.  
20463
20464         Daniel Lewis discovered this optimization.  
20465
20466         * typemanager.cs: Add signature for System.Array::get_Length
20467
20468 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20469
20470         * statement.cs: report the error when the foreach does not apply to an
20471         array nor a collection.
20472
20473 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20474
20475         * expression.cs: Add implicit conversions to the operator ~.
20476
20477         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20478
20479         * typemanager.cs: Locate the decimal constructor.
20480
20481 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20482
20483         * attribute.cs: use the new property of TypeOf.
20484         * expression.cs: added 'get' property around typearg.
20485
20486         These changes fix a build breaker reported by NickD. Is this the
20487         correct way to fix?  If not, please, revert my changes and make it
20488         work :-).
20489
20490 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20491
20492         * attribute.cs: Add support for typeof in attribute invocations.
20493         I am not sure that this is right though.
20494
20495 2002-04-14  Duncan Mak  <duncan@ximian.com>
20496
20497         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20498         Binary.Operator.Division case.
20499
20500 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20501
20502         * class.cs (DefineType): Ensure that we do a proper check on
20503         attribute types and also register it with the TypeManager.
20504
20505         (TypeContainer.Targets): The default for attribute types is
20506         AttributeTargets.All.
20507
20508         * attribute.cs (ApplyAttributes): Registering the attribute type
20509         is done elsewhere, not when we discover we have a Usage attribute.
20510
20511 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20512
20513         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20514         and get rid of is_delegate parameter.
20515
20516         * everywhere : update.
20517
20518 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20519
20520         * cs-parser.jay (compilation_unit): Revamp completely to use
20521         some new ideas that I got from Rhys' grammar to solve the problems
20522         with assembly level attributes.
20523
20524         (outer_declaration): New grammar production.
20525
20526         (attribute_sections): Add.
20527
20528         (opt_attributes): Base on attribute_sections
20529
20530         (namespace_declaration): Allow opt_attributes to tackle the case
20531         when we have assembly level attributes - we are clever in this
20532         regard now ;-)
20533
20534         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20535         attributes in the non-global context.
20536
20537         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20538         instead of SetGlobalAttributes.
20539
20540         * class.cs, rootcontext.cs : Ensure we define and generate 
20541         attribute types before anything else.
20542
20543         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20544         and flag the new error -20 for the case when the attribute type
20545         does not have valid targets specified. csc does not catch this.
20546
20547         * ../errors/errors.txt : update for error # -20
20548
20549 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20550
20551         * support.cs (InternalParameters.ParameterModifier): Do some null
20552         checking and return sane values.
20553
20554         * class.cs (Method.Define): If we are a PInvoke method, ensure
20555         that we are static and extern. Report error # 601
20556
20557         * ../errors/cs0601.cs : Add test case for the above error.
20558
20559 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20560
20561         * rootcontext.cs (attribute_types): We need to keep type of
20562         all attribute types separately and emit code for them first.
20563
20564         (RegisterAttribute) : Implement.
20565
20566         * class.cs (DefineType): Check if the current Type is a custom
20567         attribute type and register it accordingly.
20568
20569         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20570         adding the first attribute twice and rename to
20571
20572         (SetGlobalAttributes): this.
20573
20574         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20575         lookups.
20576
20577         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20578         if we are processing global arguments. Hmm, I am unsure of this.
20579
20580 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20581
20582         * expression.cs: added static array of strings to avoid calling
20583         Enum.ToString () for Operator in Binary. Significant recover of
20584         performance.
20585
20586 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * class.cs (FindMembers): Allow the Builders of the various
20589         members to be null.  If they are skip them.  This only happens
20590         during the PInvoke declaration.
20591
20592 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20593
20594         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20595         failure, so we do not keep going afterwards.
20596
20597         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20598         wanted to pass `false' as the `is_delegate' argument.  If this is
20599         the case, why not use delegate_type == null to mean `is_delegate =
20600         false' and anything else as is_delegate = true.
20601
20602 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20603
20604         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20605         code for the section, not the beginning of the tests.
20606
20607 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20608
20609         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20610
20611         * expression.cs (Binary): same.  Warn about errors where we have
20612         Enum/Enum in operator + as well.
20613
20614 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20615
20616         * statement.cs:
20617                 - added support for switch(bool)
20618                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20619                 - add TableSwitchEmit() to handle table-based switch statements
20620
20621 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20622
20623         * expression.cs (Invocation.OverloadResolve): Factor out code which
20624         does parameter compatibility checking with arguments so that we can 
20625         re-use the code even from Delegate.VerifyApplicability
20626
20627         (VerifyArgumentsCompat): Move above code here.
20628
20629         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20630         and instead make a call to the above method.
20631
20632 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20633
20634         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20635         We use it to keep track of classes which are attribute types.
20636
20637 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20638
20639         * delegate.cs (Delegate.Define): Correctly define the types in the
20640         presence of fixed and array parameters.
20641
20642         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20643         doing FindMembers.
20644
20645         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20646         include NonPublic after the first iteration.
20647
20648         * class.cs (Indexer.CheckBase): Only check if both parents are
20649         non-null. 
20650
20651         * cs-parser.jay (accessor_body): If empty, set to null.
20652
20653         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20654         same code path here to resolve constants names that we did have in
20655         MemberAccess.DoResolve.  There is too much code duplicated here.
20656
20657 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20658
20659         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20660
20661         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20662         to MakeUnionSet.
20663
20664         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20665         tokens, numbers and strings.
20666
20667         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20668         parenthesis.
20669
20670         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20671         asyncronous parameters and the regular parameters.  
20672
20673         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20674         specify the target directory.
20675
20676         * expression.cs: (This.DoResolve): Simplify
20677         (As.Emit): Optimize, do not generate IsInst if the expression is
20678         always of the given type.
20679
20680         (Is.DoResolve): Bug fix, we were reporting both always/never for
20681         the is expression.
20682
20683         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20684         creating too many unnecessary arrays.
20685
20686 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20687
20688         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20689         fields instead of rolling our own initializer.   Takes care of all
20690         implicit conversions, and drops unnecessary static checks/argument.
20691
20692 2002-03-31  Dick Porter  <dick@ximian.com>
20693
20694         * driver.cs: use the GetDirectories() return values properly, and
20695         use "/" as path separator.
20696
20697 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20698
20699         * expression.cs (Unary): Optimize - - expr into expr.
20700         (Binary): Optimize a + (-b) into a -b.
20701
20702         * codegen.cs (CodeGen): Made all methods static.
20703
20704 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20705
20706         * rootcontext.cs: 
20707
20708         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20709         TypeBuilder property.
20710
20711         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20712         instead. 
20713
20714         * tree.cs: Removed the various RecordXXXX, and replaced with a
20715         single RecordDecl.  Removed all the accessor methods, and just
20716         left a single access point Type 
20717
20718         * enum.cs: Rename DefineEnum to DefineType.
20719
20720         * decl.cs: New abstract method `DefineType' used to unify the
20721         Defines for Enumerations, Interfaces, TypeContainers and
20722         Delegates.
20723
20724         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20725         LookupBaseClasses method that used to live in class.cs and
20726         interface.cs here, and renamed to FindType.
20727
20728         * delegate.cs: Implement DefineType.  Take advantage of the
20729         refactored pattern for locating the parent builder without taking
20730         the parent_builder argument (which we know does not work if we are
20731         nested, and triggering a toplevel definition).
20732
20733 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20734
20735         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20736         accessibility of a member has changed during override and report
20737         an error if so.
20738
20739         * class.cs (Method.Define, Property.Define): Only complain on
20740         overrides if the method is private, any other accessibility is
20741         fine (and since we just checked the permission is the same, we are
20742         good to go).
20743
20744         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20745         and elif are processed always.  The other pre-processing
20746         directives are only processed if we are "taking" the path
20747
20748 2002-03-29  Martin Baulig  <martin@gnome.org>
20749
20750         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20751         current location is not Null.
20752
20753         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20754         a separate method so we can profile it.
20755
20756         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20757         `span.Seconds' are just seconds, but no minutes or hours.
20758         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20759
20760 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20761
20762         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20763         Remove the gratuitous set of Final:
20764
20765                                 // If an interface implementation, then we can set Final.
20766                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20767                                     implementing.DeclaringType.IsInterface)
20768                                         flags |= MethodAttributes.Final;
20769
20770         I do not know what I was smoking when I used that.
20771
20772
20773         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20774         step into fixing the name resolution issues for delegates and
20775         unifying the toplevel name resolution.
20776
20777 2002-03-28  Martin Baulig  <martin@gnome.org>
20778
20779         * class.cs (Method.Emit): If we have a symbol writer, call its
20780         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20781         tell it about the current method.
20782
20783         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20784         writer that we're going to emit the first byte of IL code for a new
20785         statement (a new source line).
20786         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20787         EmitContext.Mark() before emitting any code.
20788
20789         * location.cs (SymbolDocument): Return null when we're Null.
20790
20791         * statement.cs (Statement): Moved the `Location loc' variable here.
20792         (Statement.EmitBoolExpression): If we have a symbol writer, call
20793         ec.Mark() before emitting any code to tell it that we're at the
20794         beginning of a new statement.
20795         (StatementExpression): Added `Location' argument to the constructor.
20796         (Block): Added public readonly variable `StartLocation' and public
20797         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20798         (Block): Added constructor which takes a start and end location.
20799         (Block.SetEndLocation): New method. This sets the end location.
20800         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20801         local variables we create.
20802         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20803         each statement and do also mark the begin and end of the block.
20804
20805         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20806         tell it the current lexer.Location, use Location.Null for the end of the
20807         block.
20808         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20809         current block, set its end location using SetEndLocation().
20810         (statement_expression): StatementExpression constructor now takes the
20811         lexer.Location as additional argument.
20812         (for_statement, declare_local_variables): Likewise.
20813         (declare_local_variables): When creating a new implicit block, use the
20814         new Block constructor and pass it the lexer.Location.
20815
20816 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20817
20818         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20819         members also on the parent interfaces recursively.
20820
20821 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20822
20823         * report.cs: Use new formats, since Gonzalo finished the missing
20824         bits. 
20825
20826         * expression.cs (Binary.ResolveOperator): added missing operator|
20827         operator& and operator^ for bool/bool.
20828
20829         * cs-parser.jay: CheckDef now takes a Location argument that is
20830         used to report errors more precisly (instead of reporting the end
20831         of a definition, we try to track something which is a lot closer
20832         to the source of the problem).
20833
20834         * cs-tokenizer.cs: Track global token use, so we can properly flag
20835         the use of #define/#undef after the first token has been seen.
20836
20837         Also, rename the reportXXXX to Error_DescriptiveName
20838
20839         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20840         TypeContainer, so that Enum and Interface can use this too.
20841
20842         * class.cs (TypeContainer.LookupInterfaceOrClass,
20843         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20844         `builder' argument.  Typically this was used to pass the parent
20845         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20846         the definition).  
20847
20848         The problem is that a nested class could trigger the definition of
20849         a toplevel class, and the builder would be obviously wrong in that
20850         case. 
20851
20852         So we drop this argument, and we compute dynamically the
20853         TypeBuilder/ModuleBuilder (the correct information was available
20854         to us anyways from DeclSpace.Parent)
20855
20856         * interface.cs (Interface.DefineInterface): Drop builder
20857         parameter cleanup like class.cs
20858
20859         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20860         like class.cs
20861
20862         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20863         values. 
20864
20865         (Try.Emit): Propagate the returns value from the statement.
20866
20867         (Return.Emit): Even if we are leavning 
20868
20869         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20870
20871         * modifiers.cs: Fix the computation of MethodAttributes flags.
20872
20873 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20874
20875         * driver.cs: allow compilation of files that start with '/'.
20876         Add a default case when checking the argument of --target.
20877
20878 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20879
20880         * interface.cs: Implement the same search algorithm for types in
20881         the interface code.
20882
20883         * delegate.cs: Do not allow multiple definition.
20884
20885         * Recovered ChangeLog that got accidentally amputated
20886
20887         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20888
20889         * rootcontext.cs: Load manually enum to allow core classes to
20890         contain enumerations.
20891
20892         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20893         Update to new static methods in TypeManager.
20894
20895         * typemanager.cs (GetMethod, GetConstructor): Use our
20896         implementation of FindMembers to find the members, since during
20897         corlib compilation, the types are TypeBuilders and GetMethod and
20898         GetConstructor do not work.
20899
20900         Make all methods in TypeManager static.
20901
20902         (InitCodeHelpers): Split the functionality from
20903         the InitCodeTypes function.
20904
20905         * driver.cs: Call InitCodeHelpers after we have populated the
20906         types. 
20907
20908         * cs-parser.jay (delegate_declaration): we did not used to compute
20909         the delegate name correctly for void delegates.
20910
20911 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20912
20913         * rootcontext.cs (RootContext): Init the interface_resolve_order
20914         and type_container_resolve_order always.
20915
20916         (ResolveCore, BootstrapCorlib_ResolveClass,
20917         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20918         compiler when compiling with --nostdlib
20919
20920         * class.cs (TypeContainer.DefineType): Check that our parent is
20921         not null.  This test is most important when we are bootstraping
20922         the core types.
20923
20924         * codegen.cs: Split out the symbol writing code.
20925
20926 2002-03-25  Martin Baulig  <martin@gnome.org>
20927
20928         * driver.cs (-g): Made -g an alias for --debug.
20929
20930 2002-03-24  Martin Baulig  <martin@gnome.org>
20931
20932         * codegen.cs (SymbolWriter): New public variable. Returns the
20933         current symbol writer.
20934         (CodeGen): Added `bool want_debugging_support' argument to the
20935          constructor. If true, tell the ModuleBuild that we want debugging
20936         support and ask it for the ISymbolWriter.
20937         (Save): If we have a symbol writer, call it's Close() method after
20938         saving the assembly.
20939
20940         * driver.c (--debug): New command line argument to create a
20941         debugger information file.
20942
20943         * location.cs (SymbolDocument): New public property. Returns an
20944         ISymbolDocumentWriter object for the current source file or null
20945         if we don't have a symbol writer.
20946
20947 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20948
20949         * driver.cs (LoadAssembly): Correctly return when all the paths
20950         have been tried and not before.
20951
20952         * statement.cs (Switch.Emit): return the actual coverage for this
20953         statement (returns/not-returns)
20954
20955         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20956         switch of the statement if we are the last switch section.  That
20957         kills two problems: try/catch problems (we used to emit an empty
20958         nop at the end) and switch statements where all branches would
20959         return. 
20960
20961 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20962
20963         * driver.cs: Add default assemblies (the equivalent to the
20964         Microsoft CSC.RSP file)
20965
20966         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20967         also update tokens_seen and set it to false.
20968
20969         * driver.cs: Implement --recurse for Mike.
20970
20971         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20972         correctly splitting out the paths.
20973
20974 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20975
20976         * interface.cs (Interface.PopulateProperty): Instead of using
20977         `parent' as the declaration space for the set parameters, use
20978         `this' 
20979
20980         * support.cs (InternalParameters): InternalParameters constructor
20981         takes a DeclSpace instead of a TypeContainer.
20982
20983         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20984         types are being initialized, load the address of it before calling
20985         the function.  
20986
20987         (New): Provide a mechanism to disable the generation of local
20988         value type temporaries when the caller will be providing us with
20989         an address to store it.
20990
20991         (ArrayCreation.EmitDynamicInitializers): Use it.
20992
20993 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20994
20995         * expression.cs (Invocation.EmitArguments): Only probe for array
20996         property if there is more than one argument.  Sorry about that.
20997
20998         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20999         empty param arrays.
21000
21001         * class.cs (Method.LabelParameters): Fix incorrect code path that
21002         prevented the `ParamArrayAttribute' from being applied to the
21003         params attribute.
21004
21005 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21006
21007         * support.cs (ReflectionParameters): Correctly compute whether the
21008         last argument is a params array.  Fixes the problem with
21009         string.Split ('a')
21010
21011         * typemanager.cs: Make the assemblies array always be non-null
21012         (empty, but non-null)
21013
21014         * tree.cs (RecordDecl): New function that abstracts the recording
21015         of names.  This reports error 101, and provides a pointer to the
21016         previous declaration.  Fixes a crash in the compiler.
21017
21018         * cs-parser.jay (constructor_declaration): Update to new grammar,
21019         and provide a constructor_body that can be empty.
21020
21021 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21022
21023         * driver.cs: Add support for --resources.
21024
21025         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21026         Make all types for the various array helper methods be integer.
21027
21028         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21029         CheckState to ConvCast.
21030
21031         (ConvCast): Now it takes a `checked' state argument, to avoid
21032         depending on the emit context for the conversion, and just using
21033         the resolve time setting.
21034
21035         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21036         instead of Invocation.EmitArguments.  We do not emit the original
21037         arguments, instead we emit those which have been converted to
21038         unsigned int expressions.
21039
21040         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21041
21042         * codegen.cs: ditto.
21043
21044         * expression.cs (LocalVariableReference): Drop the use of the
21045         Store function that depended on the variable index.
21046
21047         * statement.cs (VariableInfo): Drop the `Idx' property from this
21048         class, as this is not taking into account the indexes for
21049         temporaries tat we generate during the execution, getting the
21050         indexes wrong.
21051
21052         * class.cs: First emit class initializers, then call the parent
21053         constructor. 
21054
21055         * expression.cs (Binary): Fix opcode emision.
21056         (UnaryMutator.EmitCode): Support checked code generation
21057
21058         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21059         matches for events for both the Static and Instance scans,
21060         pointing to the same element.   Fix that.
21061
21062 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21063
21064         * rootcontext.cs (ResolveTree): Always set the
21065         interface_resolve_order, because nested interfaces will be calling
21066         into us.
21067
21068         * class.cs (GetInterfaceOrClass): Track the same resolution
21069         process used by TypeManager.LookupType.  This fixes the nested
21070         type lookups in class declarations (separate path from
21071         LookupType). 
21072
21073         (TypeContainer.DefineType): Also define nested interfaces.
21074         (TypeContainer.RegisterOrder): New public function used to
21075         register the order in which child interfaces need to be closed.
21076
21077         Nested interfaces need to be closed after their parents have been
21078         created. 
21079
21080         * interface.cs (InterfaceAttr): Put all the logic for computing
21081         the interface attribute here. 
21082
21083         (DefineInterface): Register our interface order with the
21084         RootContext or with the TypeContainer depending on the case.
21085
21086 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21087
21088         * cs-parser.jay: rework foreach statement to work with the new
21089         changes to the policy on SimpleNames.
21090
21091         * report.cs: support Stacktrace on warnings as well.
21092
21093         * makefile: drop --unsafe and /unsafe from the compile.
21094
21095 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21096
21097         * ecore.cs (StandardConversionExists): Modify to take an Expression
21098         as the first parameter. Ensure we do null -> reference type conversion
21099         checking.
21100
21101         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21102         temporary Expression objects.
21103
21104 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21105
21106         * interface.cs: workaround bug in method overloading resolution
21107         (there is already a bugzilla bug for it).
21108
21109 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21110
21111         We could also solve this problem by having a separate path for
21112         performing type lookups, instead of DoResolve, we could have a
21113         ResolveType entry point, and only participating pieces of the
21114         production (simplename, deref, array) would implement this. 
21115
21116         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21117         signal SimpleName to only resolve type names and not attempt to
21118         resolve anything else.
21119
21120         * expression.cs (Cast): Set the flag.
21121
21122         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21123
21124         * class.cs: Only report 108 if there is no `new' modifier.
21125
21126         * cs-parser.jay: rework foreach statement to work with the new
21127         changes to the policy on SimpleNames.
21128
21129         * report.cs: support Stacktrace on warnings as well.
21130
21131         * makefile: drop --unsafe and /unsafe from the compile.
21132
21133 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21134
21135         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21136         lookups here, instead of doing that at parse time.  This means
21137         that our grammar will not introduce `LocalVariableReferences' as
21138         expressions at this point.  That solves the problem of code like
21139         this:
21140
21141         class X {
21142            static void Main ()
21143            { int X = 1;
21144             { X x = null }}}
21145
21146         This is only half the fix.  The full fix requires parameters to
21147         also be handled in this way.
21148
21149         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21150         makes the use more obvious of the DeclSpace.  The
21151         ec.TypeContainer.TypeBuilder is now only used to pull the
21152         TypeBuilder for it.
21153
21154         My theory is that I can get rid of the TypeBuilder completely from
21155         the EmitContext, and have typecasts where it is used (from
21156         DeclSpace to where it matters).  
21157
21158         The only pending problem is that the code that implements Aliases
21159         is on TypeContainer, and probably should go in DeclSpace.
21160
21161         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21162         lookups here, instead of doing that at parse time.  This means
21163         that our grammar will not introduce `LocalVariableReferences' as
21164         expressions at this point.  That solves the problem of code like
21165         this:
21166
21167         class X {
21168            static void Main ()
21169            { int X = 1;
21170             { X x = null }}}
21171
21172         This is only half the fix.  The full fix requires parameters to
21173         also be handled in this way.
21174
21175         * class.cs (Property.DefineMethod): When implementing an interface
21176         method, set newslot, when implementing an abstract method, do not
21177         set the flag (before we tried never setting it, or always setting
21178         it, which is the difference).
21179         (Indexer.DefineMethod): same.
21180         (Method.DefineMethod): same.
21181
21182         * ecore.cs: Only set the status used flag if we get back a Field.
21183
21184         * attribute.cs: Temporary hack, so Paolo can keep working.
21185
21186 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21187
21188         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21189         the unmanaged type in the case we have a MarshalAs attribute.
21190
21191         (Resolve): Handle the case when we are parsing the special MarshalAs
21192         attribute [we need to store the unmanaged type to use later]
21193
21194         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21195         MarshalAs Attribute.
21196
21197         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21198         on parameters and accordingly set the marshalling info.
21199
21200 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21201
21202         * class.cs: Optimizing slightly by removing redundant code after
21203         we switched to the `NoTypes' return value.
21204         (Property.DefineMethod): use NoTypes here too.
21205
21206         This fixes the bug I introduced in my last batch of changes.
21207
21208 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21209
21210         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21211
21212         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21213         Enums since those are types too. 
21214
21215         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21216
21217         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21218         thanks to a call during the lookup process.
21219
21220 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21221
21222         * statement.cs (Foreach): Lots of work to accomodate a particular
21223         kind of foreach statement that I had not kept in mind.  It is
21224         possible to have foreachs on classes that provide a GetEnumerator
21225         method that return objects that implement the "pattern" for using
21226         a foreach, there is no need to support GetEnumerator
21227         specifically. 
21228
21229         This is needed to compile nant.
21230
21231         * decl.cs: Only report 114 if the member is not `Finalize' and if
21232         the warning level is at least 2.
21233
21234         * class.cs: Moved the compare function from Method to
21235         MethodSignature. 
21236
21237         (MethodSignature.InheritableMemberSignatureCompare): Add new
21238         filter function that is used to extract inheritable methods from a
21239         class. 
21240
21241         (Method.Define): Use the new `inheritable_method_signature_filter'
21242         delegate
21243
21244         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21245         command. 
21246
21247 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21248
21249         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21250
21251         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21252
21253         * expression.cs: Pass location information to
21254         ConvertImplicitStandard. 
21255
21256         * class.cs: Added debugging code to track return values from
21257         interfaces. 
21258
21259 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21260
21261         * expression.cs (Is.DoResolve): If either side of the `is' is an
21262         interface, do not flag the warning.
21263
21264         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21265         for interfaces
21266
21267         * report.cs: Allow for --fatal to be used with --probe.
21268
21269         * typemanager.cs (NoTypes): Move the definition for the empty Type
21270         array here. 
21271
21272         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21273         properties. 
21274         (TypeContainer.DefineProxy): New function used to proxy to parent
21275         implementations when implementing interfaces.
21276         (TypeContainer.ParentImplements): used to lookup if our parent
21277         implements a public function that is required by an interface.
21278         (TypeContainer.VerifyPendingMethods): Hook this up.
21279
21280         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21281         `modules' and `assemblies' arraylists into arrays.  We only grow
21282         these are the very early start up of the program, so this improves
21283         the speedof LookupType (nicely measured).
21284
21285         * expression.cs (MakeByteBlob): Replaced unsafe code with
21286         BitConverter, as suggested by Paolo.
21287
21288         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21289         folding of string concatenation, but if either side is a string,
21290         and the other is not, then return null, and let the runtime use
21291         the concatenation on the string plus the object (using
21292         `Object.ToString'). 
21293
21294 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21295
21296         Constant Folding has been implemented now.
21297
21298         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21299         the error instead on types that are not supported in one's
21300         complement. 
21301
21302         * constant.cs (Constant and all children): New set of functions to
21303         perform implict and explicit conversions.
21304
21305         * ecore.cs (EnumConstant): Implement the new functions to perform
21306         conversion by proxying to the child expression.
21307
21308         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21309         own separate setting that can not be turned off from the command
21310         line using --unchecked or --checked and is only controlled using
21311         the checked/unchecked statements and expressions.  This setting is
21312         used by the constant folder to flag errors.
21313
21314         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21315         ConstantCheckState as well.   
21316
21317         During Resolve, they also have to flag the state, because the
21318         constant folder runs completely in the Resolve phase.
21319
21320         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21321         well.
21322
21323 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21324
21325         * cfold.cs: New file, this file contains the constant folder.
21326
21327         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21328         argument to track whether we are using the resulting address to
21329         load or store a value and provide better error messages. 
21330
21331         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21332         new AddressOf arguments.
21333
21334         * statement.cs (Foreach.EmitCollectionForeach): Update
21335
21336         * expression.cs (Argument.Emit): Call AddressOf with proper
21337         arguments to track usage.
21338
21339         (New.DoEmit): Call AddressOf with new arguments.
21340
21341         (Unary.Emit): Adjust AddressOf call.
21342
21343 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21344
21345         * cs-parser.jay (member_access): Change the case for pre-defined types
21346         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21347         this suggestion.
21348
21349         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21350         a method body.
21351
21352         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21353         essentially like methods and apply attributes like MethodImplOptions to them too.
21354
21355         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21356         not being null.
21357
21358         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21359         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21360         is the DeclSpace.
21361
21362         * Update code everywhere accordingly.
21363
21364         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21365
21366         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21367
21368 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21369
21370         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21371         try performing lookups against those instead of jumping straight into using
21372         the 'using' clauses.
21373
21374         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21375
21376         (LookupType): Perform lookups in implicit parents too.
21377
21378         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21379         sequence as RootContext.LookupType. 
21380
21381         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21382         the various cases of namespace lookups into this method.
21383
21384 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21385
21386         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21387         in positional arguments)
21388
21389         * class.cs (Operator): Update the AllowedModifiers to contain
21390         extern. 
21391
21392         * cs-parser.jay: Update operator declaration to allow for the
21393         operator body to be empty.
21394
21395         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21396         values. 
21397
21398 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21399
21400         * class.cs (Method.Emit): Label parameters.
21401
21402         * driver.cs: Return 1 or 0 as the program exit code.
21403
21404 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21405
21406         * expression.cs: Special case the `null' object when trying to
21407         auto-compute the type, as anything can be explicitly converted to
21408         that. 
21409
21410         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21411         spotting this Paolo.
21412
21413         (Expression.ImplicitNumericConversion): Perform comparissions of
21414         the type using the underlying type in the case of an enumeration
21415         rather than using the enumeration type for the compare.
21416
21417         Cope with the underlying == type case, which is not possible to
21418         catch before. 
21419
21420         (Expression.ConvertNumericExplicit): Perform comparissions of
21421         the type using the underlying type in the case of an enumeration
21422         rather than using the enumeration type for the compare.
21423
21424         * driver.cs: If the user does not supply an extension, assume .exe
21425
21426         * cs-parser.jay (if_statement): Rewrote so that we can track the
21427         location for the if statement.
21428
21429         * expression.cs (Binary.ConstantFold): Only concat strings when
21430         the operation is "+", not everything ;-)
21431
21432         * statement.cs (Statement.EmitBoolExpression): Take a location
21433         argument. 
21434         (If, While, Do): Track location.
21435
21436         * expression.cs (Binary.ResolveOperator): In the object + string
21437         case, I was missing a call to ConvertImplicit
21438
21439 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21440
21441         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21442         Location arguments. Ensure we use RootContext.LookupType to do our work
21443         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21444
21445         * interface.cs (PopulateMethod): Handle the type of the parameter being
21446         null gracefully.
21447
21448         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21449         have a params method with no fixed arguments and a call is made with no
21450         arguments.
21451
21452 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21453
21454         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21455         the verbatim-string-literal
21456
21457         * support.cs (InternalParameters.ParameterModifier): handle null
21458         fixed parameters.
21459         (InternalParameters.ParameterType): ditto.
21460
21461         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21462         duplicating the name of the variable parameter.
21463         (GetParameterByName): Fix bug where we were not looking up array
21464         paramters if they were the only present (thanks Paolo!).
21465         (GetParameterInfo): We only have an empty set of types if both
21466         fixed and array are set to null.
21467         (GetParameterInfo-idx): Handle FixedParameter == null
21468
21469         * cs-parser.jay: Handle the case where there is no catch
21470         statements (missing null test).
21471
21472 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * driver.cs (MainDriver): Be conservative on our command line
21475         handling.
21476
21477         Catch DirectoryNotFoundException when calling GetFiles.
21478
21479         (SplitPathAndPattern): Used to split the input specification into
21480         a path and a pattern that we can feed to Directory.GetFiles.
21481
21482 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21483
21484         * statement.cs (Fixed): Implement the last case of the Fixed
21485         statement (string handling).
21486
21487         * expression.cs (StringPtr): New class used to return a char * to
21488         a string;  Used by the Fixed statement.
21489
21490         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21491
21492         * expression.cs (Binary.ResolveOperator): Remove redundant
21493         MemberLookup pn parent type.
21494         Optimize union call, we do not need a union if the types are the same.
21495         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21496         type.
21497
21498         Specialize the use of MemberLookup everywhere, instead of using
21499         the default settings. 
21500
21501         (StackAlloc): Implement stackalloc keyword.
21502
21503         * cs-parser.jay: Add rule to parse stackalloc.
21504
21505         * driver.cs: Handle /h, /help, /?
21506
21507         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21508         before we supported unsafe code.
21509
21510         * makefile: add --unsafe to the self compilation of mcs.
21511
21512 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21513
21514         * expression.cs (PointerArithmetic): New class that is used to
21515         perform pointer arithmetic.
21516         (Binary.Resolve): Handle pointer arithmetic
21517         Handle pointer comparission.
21518         (ArrayPtr): Utility expression class that is used to take the
21519         address of an array.
21520
21521         (ElementAccess): Implement array access for pointers
21522
21523         * statement.cs (Fixed): Implement fixed statement for arrays, we
21524         are missing one more case before we are done.
21525
21526         * expression.cs (Indirection): Implement EmitAssign and set the
21527         ExprClass to Variable.  This allows pointer dereferences to be
21528         treated as variables, and to have values assigned to them.
21529
21530         * ecore.cs (Expression.StoreFromPtr): New utility function to
21531         store values dereferencing.
21532
21533 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21534
21535         * expression.cs (Binary.ResolveOperator): Ensure that we are
21536         not trying to operate on a void type - this fixes the reported
21537         bug.
21538
21539         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21540         the parent implementation is sealed.
21541
21542         * ../errors/cs0239.cs : Add.
21543
21544         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21545
21546         * typemanager.cs (unverifiable_code_type): Corresponds to 
21547         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21548         which have unsafe code in them.
21549
21550         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21551         unsafe context.
21552
21553 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21554
21555         * cs-tokenizer.cs: Add support for @"litreal strings"
21556
21557         Make tokenizer accept pre-processor directives
21558         on any column (remove the old C-like limitation). 
21559
21560         * rootcontext.cs (EmitCode): Emit any global attributes.
21561         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21562
21563         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21564
21565         * cs-parser.jay: Add support for global attributes.  
21566
21567 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21568
21569         * expression.cs (Indirection): New helper class.  Unary will
21570         create Indirection classes to be able to implement the
21571         IMemoryLocation interface on it.
21572
21573 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21574
21575         * cs-parser.jay (fixed_statement): reference the right statement.
21576
21577         * statement.cs (Fixed.Emit): Finish implementing the fixed
21578         statement for the &x case.
21579
21580 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21581
21582         * class.cs (Property.Define, Method.Define): Remove newslot when
21583         `implementing'.  
21584
21585         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21586         wrong.  NewSlot should only be used if the `new' keyword is present.
21587
21588         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21589         locating our system dir.  Sorry about this.
21590
21591 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21592
21593         * driver.cs (GetSystemDir): Compute correctly the location of our
21594         system assemblies.  I was using the compiler directory instead of
21595         the library directory.
21596
21597 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21598
21599         * expression.cs (BetterFunction): Put back in what Miguel commented out
21600         since it is the correct fix. The problem is elsewhere ;-)
21601
21602         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21603         parameters of the parms method are themselves compatible or not !
21604
21605         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21606         to check that a class implements an interface before saying that an implicit
21607         conversion was allowed. Use ImplementsInterface to do the checking.
21608
21609 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21610
21611         * class.cs (Method.Define): Track whether we are an explicit
21612         implementation or not.  And only call DefineMethodOverride if we
21613         are an explicit implementation.
21614
21615         (Property.DefineMethod): Ditto.
21616
21617 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21618
21619         * expression.cs (BetterFunction): Catch hideous bug which was
21620          preventing us from detecting ambiguous calls due to implicit casts i.e
21621         cs0121.
21622
21623 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21624
21625         * support.cs (Pair): Remove un-needed method.  I figured why I was
21626         getting the error in cs-parser.jay, the variable in a foreach loop
21627         is readonly, and the compiler does not really treat this as a variable.
21628
21629         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21630         instead of EQUALS in grammar.  
21631
21632         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21633
21634         * expression.cs (Unary.DoResolve): Check whether the argument is
21635         managed or not.
21636
21637 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21638
21639         * support.cs: Api for Pair to set a value.  Despite the fact that
21640         the variables are public the MS C# compiler refuses to compile
21641         code that accesses the field if the variable is part of a foreach
21642         statement. 
21643
21644         * statement.cs (Fixed): Begin implementation of the fixed
21645         statement.
21646
21647         (Block.AddVariable): Return the VariableInfo on success and null
21648         on failure instead of true/false. 
21649
21650         * cs-parser.jay (foreach): Catch errors on variables already
21651         defined (we were ignoring this value before) and properly unwind
21652         the block hierarchy
21653
21654         (fixed_statement): grammar for the fixed statement.
21655
21656 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21657
21658         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21659         pointer types to be incretemented.
21660
21661         (SizeOf): Implement.
21662
21663         * cs-parser.jay (pointer_member_access): Implement
21664         expr->IDENTIFIER production.
21665
21666         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21667         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21668         on safe contexts.
21669
21670         (Unary): Implement indirection.
21671
21672         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21673         use in non-unsafe context).
21674
21675         (SimpleName.DoResolve): Check for pointers in field access on safe
21676         contexts. 
21677
21678         (Expression.LoadFromPtr): Factor the load-indirect code in this
21679         function.  This was duplicated in UnboxCast and ParameterReference
21680
21681 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21682
21683         * expression.cs (ComposedCast): report an error if a pointer cast
21684         is used in a safe region.
21685
21686         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21687         pointer type casts in unsafe context.
21688
21689         * codegen.cs (EmitContext): Set up IsUnsafe.
21690
21691         * cs-parser.jay (non_expression_type): Add productions for pointer
21692         casts. 
21693
21694         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21695         code.  We should not use force into static mode if the method is
21696         not virtual.  Fixes bug in MIS
21697
21698         * statement.cs (Do.Emit, While.Emit, For.Emit,
21699         Statement.EmitBoolExpression): Add support to Do and While to
21700         propagate infinite loop as `I do return' semantics.
21701
21702         Improve the For case to also test for boolean constants.
21703
21704         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21705         to the list of attributes we can add.
21706
21707         Remove `EmitContext' argument.
21708
21709         * class.cs (Method.Define): Apply parameter attributes.
21710         (Constructor.Define): Apply parameter attributes.
21711         (MethodCore.LabelParameters): Move here the core of labeling
21712         parameters. 
21713
21714         * support.cs (ReflectionParameters.ParameterModifier,
21715         InternalParameters.ParameterModifier): Use IsByRef on the type and
21716         only return the OUT bit for these parameters instead of in/out/ref
21717         flags.
21718
21719         This is because I miss-understood things.  The ParameterInfo.IsIn
21720         and IsOut represent whether the parameter has the [In] and [Out]
21721         attributes set.  
21722
21723 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21724
21725         * ecore.cs (FieldExpr.Emit): Release temporaries.
21726
21727         * assign.cs (LocalTemporary.Release): new function.
21728
21729         * codegen.cs (EmitContext.GetTemporaryStorage,
21730         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21731         temporary storage.  Now we can "put back" localbuilders when we
21732         are done with them
21733
21734 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21735
21736         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21737         need to make a copy of the variable to generate verifiable code.
21738
21739 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21740
21741         * driver.cs: Compute dynamically the system directory.
21742
21743         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21744         Slower, but more generally useful.  Used by the abstract
21745         registering implementation. 
21746
21747         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21748         the rules for the special rule on Type/instances.  First check if
21749         we have the same name, and if so, try that special static path
21750         rather than the instance path.
21751
21752 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21753
21754         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21755         for, while and if.
21756
21757         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21758         Enum, ValueType, Delegate or Array for non-corlib compiles.
21759
21760         * cs-tokenizer.cs: Catch long identifiers (645)
21761
21762         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21763         piece of code.
21764
21765         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21766         fix, we were returning too early, so we were not registering
21767         pending methods from abstract classes.
21768
21769         Do not register pending methods if the class is abstract.
21770
21771         * expression.cs (Conditional.DoResolve): Report circular implicit
21772         conversions when we neecd to compute it for conditional
21773         expressions. 
21774
21775         (Is.DoResolve): If the expression is always of the provided type,
21776         flag warning 183.  If the expression can not ever be of the
21777         provided type flag warning 184.
21778
21779         * class.cs: Catch 169 as well.
21780
21781         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21782         read. 
21783
21784 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21785
21786         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21787
21788 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21789
21790         * interface.cs: (PopulateMethod): Check for pointers being defined
21791         only if the unsafe context is active.
21792         (PopulateProperty): ditto.
21793         (PopulateIndexer): ditto.
21794
21795         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21796         specified.  If pointers are present, make sure that they are
21797         present in an unsafe context.
21798         (Constructor, Constructor.Define): ditto.
21799         (Field, Field.Define): ditto.
21800         (Property, Property.Define): ditto.
21801         (Event, Event.Define): ditto.
21802
21803         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21804         hashtable if there are classes or structs defined.
21805
21806         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21807         code, as the constant resolution moved.
21808
21809         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21810         the metadata, so we can flag error 133. 
21811
21812         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21813         pointer is being declared in an unsafe context.
21814
21815 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21816
21817         * modifiers.cs (Modifiers.Check): Require a Location argument.
21818         Report error 227 for Unsafe use.
21819
21820         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21821
21822         * statement.cs (For.Emit): If the test is null, then report that
21823         we do `return', as we wont reach anything afterwards.
21824
21825         (Switch.SwitchGoverningType): Track the expression that matched
21826         the conversion.
21827
21828         * driver.cs: Allow negative numbers as an error code to flag.
21829
21830         * cs-parser.jay: Handle 1551.
21831
21832         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21833
21834 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21835
21836         * cs-parser.jay: Report 1518 (type declaration can only contain
21837         class, struct, interface, enum or delegate)
21838
21839         (switch_label): Report 1523 (keywords `case' or `default' must
21840         preced code)
21841
21842         (opt_switch_sections): Report 1522 (empty switch)
21843
21844         * driver.cs: Report 1515 (response file specified multiple times)
21845         Report 1516 (Source file specified multiple times).
21846
21847         * expression.cs (Argument.Resolve): Signal 1510
21848
21849         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21850         access not allowed in static code)
21851
21852 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21853
21854         * typemanager.cs (IsPointerType): Utility method which we are going
21855         to need a lot.
21856
21857         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21858         the object type, so we take care of that.
21859
21860         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21861
21862         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21863         added to non-params parameters :-)
21864
21865         * typemanager.cs (CSharpName): Include 'void' type too. 
21866
21867         (void_ptr_type): Include in the set of core types.
21868
21869         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21870         duplicating code.
21871
21872         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21873         an unsafe context.
21874
21875         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21876         completely forgotten about it.
21877
21878 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21879
21880         * cs-parser.jay (pointer_type): Add. This begins our implementation
21881         of parsing rules for unsafe code.
21882
21883         (unsafe_statement): Implement.
21884
21885         (embedded_statement): Modify to include the above.
21886
21887         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21888
21889         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21890         if the current context is an unsafe one.
21891
21892         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21893         are handled differently, we need separate rules for them.
21894
21895         (local_variable_declaration): Update to use local_variable_pointer_type
21896         to allow variable declarations of unmanaged pointer types.
21897
21898         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21899         in unsafe contexts.
21900
21901         * ../errors/cs0214.cs : Add.
21902
21903 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21904
21905         * makefile: remove 'response' file when cleaning.
21906
21907 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21908
21909         * cs-parser.jay: Report 1524.
21910
21911 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21912
21913         * typemanager.cs (RegisterMethod): drop checking if we have
21914         registered this from here
21915
21916 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21917
21918         * class.cs (Method.EmitDestructor): Implement calling our base
21919         destructor. 
21920
21921         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21922         value of InFinally.
21923
21924         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21925         this routine and will wrap the call in a try/catch block.  Deal
21926         with the case.
21927
21928 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21929
21930         * ecore.cs (Expression.MemberLookup): instead of taking a
21931         parameter `same_type' that was used to tell whether we could
21932         access private members we compute our containing type from the
21933         EmitContext.
21934
21935         (FieldExpr): Added partial support for volatile fields.  This does
21936         not work for volatile fields exposed from assemblies, as I can not
21937         figure out how to extract the modreq from it.
21938
21939         Updated all the source files to use this.
21940
21941         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21942         because it is referenced by MemberLookup very often. 
21943
21944 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21945
21946         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21947         TypeBuilder.GetCustomAttributes to retrieve what we need.
21948
21949         Get rid of redundant default_member_attr_type as this is the same as
21950         default_member_type which already exists.
21951
21952         * interface.cs, attribute.cs : Update accordingly.
21953
21954 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21955
21956         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21957         work for TYpeBuilders though.  Ravi, can you please fix this?
21958
21959         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21960
21961         * expression.cs (Argument.Emit): Handle the case of ref objects
21962         being passed to ref functions;  
21963
21964         (ParameterReference.EmitLoad): Loads the content of the pointer
21965         without dereferencing.
21966
21967 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21968
21969         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21970
21971 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21972
21973         * class.cs (Indexer.DefineMethod): Incorporate the interface
21974         type in the name of the method if we are doing explicit interface
21975         implementation.
21976
21977         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21978
21979         (BetterConversion): Fix extremely trivial bug where we were referring to
21980         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21981         again !
21982
21983         * ../errors/bug16.cs : Add although we have fixed it.
21984
21985 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21986
21987         * expression.cs (BaseIndexer): Begin implementation.
21988
21989         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21990
21991         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21992         production directly to remove a shift/reduce, and implement
21993         explicit interface implementation.
21994
21995         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21996         after a floating point suffix.
21997
21998         * expression.cs (DoNumericPromotions): Improved the conversion for
21999         uint/uint.  If we have a constant, we avoid doing a typecast to a
22000         larger type.
22001
22002         * class.cs (Indexer): Implement explicit interface implementation
22003         for indexers.
22004
22005 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22006
22007         * class.cs: make the default instance constructor public and hidebysig.
22008
22009 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22010
22011         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22012         so we can call it from elsewhere.
22013
22014         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22015         we emit it internally if the class has a defined indexer; otherwise the user
22016         emits it by decorating the class definition with the DefaultMemberAttribute.
22017
22018         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22019         attribute is not used on a type which defines an indexer.
22020
22021         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22022         character when we skip whitespace.
22023
22024         * ../errors/cs0646.cs : Add.
22025
22026 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22027
22028         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22029         again. 
22030
22031         * makefile: Add practical target `mcs3.exe' which builds the third
22032         generation compiler. 
22033
22034         * expression.cs (New): Fix structures constructor calling.
22035
22036         * class.cs (Property, Method, Indexer): Emit Final flag on the
22037         method if we are an interface implementation and we are not
22038         abstract. 
22039
22040         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22041         whether this property is referencing a `base' method.
22042
22043         * expression.cs (Invocation.EmitCall): take an extra argument:
22044         is_base, this is used to determine whether the `call' or
22045         `callvirt' opcode should be used.
22046
22047
22048         * delegate.cs: update EmitCall.
22049
22050         * class.cs (Method.Define): Set NewSlot for the cases where we are
22051         not implementing an interface method.
22052
22053         (Property.Define): ditto.
22054
22055 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22056
22057         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22058         'r'.  Allows mcs to parse itself fully.
22059
22060 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22061
22062         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22063         of the number of initializers that require the InitializeArray method.
22064
22065         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22066         update the above field where necessary.
22067
22068         (MakeByteBlob): Update accordingly.
22069
22070         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22071         greater than 2.
22072
22073         (EmitDynamicInitializers): Update in accordance with the new optimization.
22074
22075         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22076         same OpCode applies.
22077
22078         * cs-parser.jay : Fix some glaring errors I introduced.
22079
22080 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22081
22082         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22083         so that we can check for name clashes there too.
22084
22085         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22086         for interface indexers.
22087
22088         * interfaces.cs (Define): Emit the default member attribute.
22089
22090         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22091         variable was being referred to while setting the value ;-)
22092
22093 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22094
22095         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22096         byte-by-byte information when we know the data is zero.
22097
22098         Make the block always a multiple of 4, because
22099         DefineInitializedData has a bug.
22100
22101         * assign.cs: Fix, we should assign from the temporary, not from
22102         the source. 
22103
22104         * expression.cs (MakeByteBlob): Fix my incorrect code.
22105
22106 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22107
22108         * typemanager.cs (EnumToUnderlying): This function is used to get
22109         the underlying type from an enumeration, because it does not
22110         always work. 
22111
22112         * constant.cs: Use the I4_S form for values between -128 and 127.
22113
22114         * statement.cs (Block.LookupLabel): Looks up a label.
22115         (Block): Drop support for labeled blocks.
22116
22117         (LabeledStatement): New kind of statement that represents a label
22118         only.
22119
22120         (Goto): Finally implement this bad boy.
22121
22122         * cs-parser.jay: Update to reflect new mechanism to implement
22123         labels.
22124
22125 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22126
22127         * codegen.cs (EmitContext.This): a codegen property that keeps the
22128         a single instance of this instead of creating many different this
22129         instances. 
22130
22131         * delegate.cs (Delegate.DoResolve): Update to use the property;
22132
22133         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22134
22135         * expression.cs (BaseAccess.DoResolve): Ditto.
22136
22137 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22138
22139         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22140         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22141
22142         (InitCoreTypes): Update accordingly.
22143
22144         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22145         so we can quickly store the state.
22146
22147         (ApplyAttributes): Set the correct implementation flags
22148         for InternalCall methods.
22149
22150 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22151
22152         * expression.cs (EmitCall): if a method is not virtual, then do
22153         not use callvirt on it.
22154
22155         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22156         user defined stuff) requires the use of stobj, which takes an
22157         address on the stack instead of an array and an index.  So emit
22158         the Ldelema operation for it.
22159
22160         (EmitStoreOpcode): Use stobj for valuetypes.
22161
22162         (UnaryMutator.EmitCode): Use the right 1 value depending on
22163         whether we are dealing with int64/uint64, float or doubles.
22164
22165         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22166         constructors that I implemented last night.
22167
22168         (Constructor.IsDefault): Fix to work properly for static
22169         constructors.
22170
22171         * cs-parser.jay (CheckDef): report method signature errors.
22172         Update error number 103 to be 132.
22173
22174         * decl.cs: New AdditionResult enumeration value: MethodExists.
22175         Although we do this check for methods later on in the semantic
22176         analysis, catching repeated default constructors is so easy that
22177         we catch these here. 
22178
22179         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22180         promotions code.
22181
22182         (ParameterReference.EmitAssign, Emit): handle
22183         bools as bytes.
22184
22185         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22186         (ArrayAccess.EmitStoreOpcode): ditto.
22187
22188         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22189
22190         * expression.cs (MakeByteBlob): Complete all the missing types
22191         (uint, short, ushort, byte, sbyte)
22192
22193         * class.cs: Only init instance field initializers on instance
22194         constructors. 
22195
22196         Rename `constructors' to instance_constructors. 
22197
22198         (TypeContainer.AddConstructor): Only add constructors to the list
22199         if it is not static.
22200
22201         Make sure that we handle default_static_constructor independently
22202         everywhere where we handle instance_constructors
22203
22204 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22205
22206         * class.cs: Do not lookup or create a base initializer for a
22207         static constructor.
22208
22209         (ConstructorInitializer.Resolve): use the proper type to lookup
22210         for constructors.
22211
22212         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22213
22214         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22215         in DeclSpace. 
22216
22217         * decl.cs: CloseType is now an virtual method, the default
22218         implementation just closes this type.
22219
22220 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22221
22222         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22223         to PreserveSig by default. Also emit HideBySig on such methods.
22224
22225         Basically, set the defaults to standard values.
22226
22227         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22228         argument, if candidate is better, it can't be worse than the best !
22229
22230         (Invocation): Re-write bits to differentiate between methods being
22231         applicable in their expanded form and their normal form - for params
22232         methods of course.
22233
22234         Get rid of use_standard everywhere as only standard conversions are allowed
22235         in overload resolution. 
22236
22237         More spec conformance.
22238
22239 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22240
22241         * driver.cs: Add --timestamp, to see where the compiler spends
22242         most of its time.
22243
22244         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22245         `this' in static code.
22246
22247         (SimpleName.DoResolve): Implement in terms of a helper function
22248         that allows static-references to be passed upstream to
22249         MemberAccess.
22250
22251         (Expression.ResolveWithSimpleName): Resolve specially simple
22252         names when called by MemberAccess to implement the special
22253         semantics. 
22254
22255         (Expression.ImplicitReferenceConversion): Handle conversions from
22256         Null to reference types before others, as Null's type is
22257         System.Object. 
22258
22259         * expression.cs (Invocation.EmitCall): Handle the special case of
22260         calling methods declared on a reference type from a ValueType
22261         (Base classes System.Object and System.Enum)
22262
22263         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22264         the left hand side is a TypeExpr, not on every enumeration. 
22265
22266         (Binary.Resolve): If types are reference types, then do a cast to
22267         object on operators != and == of both arguments.
22268
22269         * typemanager.cs (FindMembers): Extract instance and static
22270         members if requested.
22271
22272         * interface.cs (PopulateProperty): Use void_type instead of null
22273         as the return type for the setter method.
22274
22275         (PopulateIndexer): ditto.
22276
22277 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22278
22279         * support.cs (ReflectionParameters): Fix minor bug where we
22280         were examining the wrong parameter for the ParamArray attribute.
22281
22282         Cope with requests for the type of the parameter at position
22283         greater than the params parameter's. We now return the element
22284         type of the params array as that makes more sense.
22285
22286         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22287         accordingly as we no longer have to extract the element type
22288         ourselves.
22289
22290         (Invocation.OverloadResolve): Update.
22291
22292 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22293
22294         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22295         against IEnumerator, test whether the return value is a descendant
22296         of the IEnumerator interface.
22297
22298         * class.cs (Indexer.Define): Use an auxiliary method to implement
22299         the other bits of the method definition.  Begin support for
22300         explicit interface implementation.
22301
22302         (Property.DefineMethod): Use TypeManager.void_type instead of null
22303         for an empty return value.
22304
22305 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22306
22307         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22308         dealing with a FieldExpr which is composed of a FieldBuilder, in
22309         the code path we did extract the constant, but we should have
22310         obtained the underlying value to be able to cast it (otherwise we
22311         end up in an infinite loop, this is what Ravi was running into).
22312
22313         (ArrayCreation.UpdateIndices): Arrays might be empty.
22314
22315         (MemberAccess.ResolveMemberAccess): Add support for section
22316         14.5.4.1 that deals with the special case of E.I when E is a type
22317         and something else, that I can be a reference to a static member.
22318
22319         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22320         handle a particular array type to create byte blobs, it is just
22321         something we dont generate byteblobs for.
22322
22323         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22324         arguments. 
22325
22326         * location.cs (Push): remove the key from the hashtable that we
22327         are about to add.   This happens for empty files.
22328
22329         * driver.cs: Dispose files after we have parsed them.
22330
22331         (tokenize): new function that only runs the tokenizer on its
22332         input, for speed testing.
22333
22334 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22335
22336         * class.cs (Event.Define): Define the private field only if there
22337         are no accessors defined.
22338
22339         * expression.cs (ResolveMemberAccess): If there is no associated
22340         field with the event, that means we have an event defined with its
22341         own accessors and we should flag error cs0070 since transforming
22342         ourselves into a field is not valid in that case.
22343
22344         * ecore.cs (SimpleName.DoResolve): Same as above.
22345
22346         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22347         and charset to sane values.
22348
22349 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22350
22351         * assign.cs (DoResolve): Perform check on events only if they 
22352         are being accessed outside the declaring type.
22353
22354         * cs-parser.jay (event_declarations): Update rules to correctly
22355         set the type of the implicit parameter etc.
22356
22357         (add_accessor, remove_accessor): Set current local parameters.
22358
22359         * expression.cs (Binary): For delegate addition and subtraction,
22360         cast the return value from the method into the appropriate delegate
22361         type.
22362
22363 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22364
22365         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22366         of these as the workaround is unnecessary.
22367
22368         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22369         delegate data - none of that is needed at all.
22370
22371         Re-write bits to extract the instance expression and the delegate method
22372         correctly.
22373
22374         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22375         on delegates too.
22376
22377         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22378         of attaching attributes instead of duplicating code everywhere.
22379
22380         * everywhere : Update code to do attribute emission using the above method.
22381
22382 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22383
22384         * expression.cs (IsParamsMethodApplicable): if there are not
22385         parameters, return immediately.
22386
22387         * ecore.cs: The 0 literal can be implicity converted to an enum
22388         type. 
22389
22390         (SimpleName.DoResolve): First lookup the type, then lookup the
22391         members. 
22392
22393         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22394         want to get its address.  If the InstanceExpression is not
22395         addressable, store the result in a temporary variable, then get
22396         the address of it.
22397
22398         * codegen.cs: Only display 219 errors on warning level or above. 
22399
22400         * expression.cs (ArrayAccess): Make it implement the
22401         IMemoryLocation interface.
22402
22403         (Binary.DoResolve): handle the operator == (object a, object b)
22404         and operator != (object a, object b) without incurring into a
22405         BoxedCast (because 5 != o should never be performed).
22406
22407         Handle binary enumerator operators.
22408
22409         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22410         value type, otherwise use Ldelem_ref.
22411
22412         Use precomputed names;
22413
22414         (AddressOf): Implement address of
22415
22416         * cs-parser.jay (labeled_statement): Fix recursive block
22417         addition by reworking the production.
22418
22419         * expression.cs (New.DoEmit): New has a special case:
22420                 
22421                  If we are dealing with a ValueType, we have a few
22422                  situations to deal with:
22423                 
22424                     * The target of New is a ValueType variable, that is
22425                       easy, we just pass this as the variable reference
22426                 
22427                     * The target of New is being passed as an argument,
22428                       to a boxing operation or a function that takes a
22429                       ValueType.
22430                 
22431                       In this case, we need to create a temporary variable
22432                       that is the argument of New.
22433
22434
22435 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22436
22437         * rootcontext.cs (LookupType): Check that current_type is not null before
22438         going about looking at nested types.
22439
22440         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22441         not implement the IAssignMethod interface any more.
22442
22443         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22444         where we tranform them into FieldExprs if they are being resolved from within
22445         the declaring type.
22446
22447         * ecore.cs (SimpleName.DoResolve): Do the same here.
22448
22449         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22450
22451         * ../errors/bug10.cs : Add.
22452
22453         * ../errors/cs0070.cs : Add.
22454
22455         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22456
22457         * assign.cs : Get rid of EventIsLocal everywhere.
22458
22459 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22460
22461         * ecore.cs (ConvertIntLiteral): finished the implementation.
22462
22463         * statement.cs (SwitchLabel): Convert the value we are using as a
22464         key before looking up the table.
22465
22466 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22467
22468         * codegen.cs (EmitTopBlock): Require a Location argument now.
22469
22470         * cs-parser.jay (constructor_declarator): We need to setup
22471         current_local_parameters before we parse the
22472         opt_constructor_initializer, to allow the variables to be bound
22473         to the constructor arguments.
22474
22475         * rootcontext.cs (LookupType): First lookup nested classes in our
22476         class and our parents before we go looking outside our class.
22477
22478         * expression.cs (ConstantFold): Extract/debox the values at the
22479         beginnning. 
22480
22481         * rootcontext.cs (EmitCode): Resolve the constants first before we
22482         resolve the types.  This is not really needed, but it helps debugging.
22483
22484         * statement.cs: report location.
22485
22486         * cs-parser.jay: pass location to throw statement.
22487
22488         * driver.cs: Small bug fix.
22489
22490         * report.cs: Updated format to be 4-zero filled digits.
22491
22492 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22493
22494         * expression.cs (CheckIndices): Fix minor bug where the wrong
22495         variable was being referred to ;-)
22496
22497         (DoEmit): Do not call EmitStaticInitializers when the 
22498         underlying type is System.Object.
22499
22500 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22501
22502         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22503         and do the usual workaround for SRE.
22504
22505         * class.cs (MyEventBuilder.EventType): New member to get at the type
22506         of the event, quickly.
22507
22508         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22509
22510         * assign.cs (Assign.DoResolve): Handle the case when the target
22511         is an EventExpr and perform the necessary checks.
22512
22513         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22514         interface.
22515
22516         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22517
22518         (EventExpr): Set the type in the constructor itself since we 
22519         are meant to be born fully resolved.
22520
22521         (EventExpr.Define): Revert code I wrote earlier.
22522                 
22523         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22524         instance expression is null. The instance expression is a This in that case
22525         or a null, depending on whether it is a static method or not.
22526
22527         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22528         refers to more than one method.
22529
22530         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22531         and accordingly flag errors.
22532
22533 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22534
22535         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22536
22537 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22538
22539         * location.cs (ToString): Provide useful rutine.
22540
22541 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22542
22543         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22544         objects, return the actual integral boxed.
22545
22546         * statement.cs (SwitchLabel): define an ILLabel for each
22547         SwitchLabel. 
22548
22549         (Switch.CheckSwitch): If the value is a Literal, extract
22550         the underlying literal.
22551
22552         Also in the unused hashtable we had, add the SwitchLabel so we can
22553         quickly look this value up.
22554
22555         * constant.cs: Implement a bunch of new constants.  Rewrite
22556         Literal based on this.  Made changes everywhere to adapt to this.
22557
22558         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22559         dereferencing array only once, and also copes with enumrations.
22560
22561         bytes are two bytes wide, not one.
22562
22563         (Cast): Perform constant conversions.
22564
22565         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22566         wrappers to the literals here.
22567
22568         * expression.cs (DoNumericPromotions): long literals can converted
22569         to ulong implicity (this is taken care of elsewhere, but I was
22570         missing this spot).
22571
22572         * ecore.cs (Expression.Literalize): Make the return type Literal,
22573         to improve type checking.
22574
22575         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22576
22577 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22578
22579         * literal.cs: Revert code from ravi that checked the bounds.  The
22580         bounds are sane by the definition of the type itself. 
22581
22582         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22583         need to actually look up in our parent hierarchy for interfaces
22584         implemented. 
22585
22586         * const.cs: Use the underlying type for enumerations
22587
22588         * delegate.cs: Compute the basename for the delegate creation,
22589         that should fix the delegate test case, and restore the correct
22590         Type Lookup semantics in rootcontext
22591
22592         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22593         referencing a nested type with the Reflection API is using the "+"
22594         sign. 
22595
22596         * cs-parser.jay: Do not require EOF token at the end.
22597
22598 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22599
22600         * rootcontext.cs (LookupType): Concatenate type names with
22601         a '.' instead of a '+' The test suite passes again.
22602
22603         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22604         field of the enumeration.
22605
22606         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22607         the case when the member is an EventExpr.
22608
22609         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22610         static has an associated instance expression.
22611
22612         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22613
22614         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22615
22616         * class.cs (Event.Define): Register event and perform appropriate checks
22617         for error #111.
22618
22619         We define the Add and Remove methods even if the use provides none because
22620         in that case, we provide default implementations ourselves.
22621
22622         Define a private field of the type of the event. This is done by the CSC compiler
22623         and we should be doing it too ;-)
22624
22625         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22626         More methods we use in code we generate.
22627
22628         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22629         is important.
22630
22631         (InitCoreTypes): Update accordingly for the above.
22632
22633         * class.cs (Event.Emit): Generate code for default accessors that we provide
22634
22635         (EmitDefaultMethod): Do the job in the above.
22636
22637         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22638         appropriate place.
22639
22640 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22641
22642         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22643         builders even if we were missing one.
22644
22645         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22646         pass the Basename as our class name instead of the Name.  The
22647         basename will be correctly composed for us.
22648
22649         * parameter.cs (Paramters): Now takes a Location argument.
22650
22651         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22652         make all the code call directly LookupType in RootContext and take
22653         this chance to pass the Location information everywhere.
22654
22655         * Everywhere: pass Location information.
22656
22657 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22658
22659         * class.cs (Constructor.Define): Updated way of detecting the
22660         length of the parameters.
22661
22662         (TypeContainer.DefineType): Use basename as the type name for
22663         nested types.
22664
22665         (TypeContainer.Define): Do not recursively define types here, as
22666         definition is taken care in order by the RootContext.
22667
22668         * tree.cs: Keep track of namespaces in a per-file basis.
22669
22670         * parameter.cs (Parameter.ComputeSignature): Update to use
22671         DeclSpace. 
22672
22673         (Parameters.GetSignature): ditto.
22674
22675         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22676         instead of a TypeContainer.
22677
22678         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22679         resolve names.  Because we need to be resolve in our context, not
22680         our parents.
22681
22682         * driver.cs: Implement response files.
22683
22684         * class.cs (TypeContainer.DefineType): If we are defined, do not
22685         redefine ourselves.
22686
22687         (Event.Emit): Emit the code for add/remove handlers.
22688         (Event.Define): Save the MethodBuilders for add/remove.
22689
22690         * typemanager.cs: Use pair here too.
22691
22692         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22693         DictionaryEntry requires the first argument to be non-null.  
22694
22695         (enum_declaration): Compute full name for registering the
22696         enumeration.
22697
22698         (delegate_declaration): Instead of using
22699         formal_parameter_list, use opt_formal_parameter_list as the list
22700         can be empty.
22701
22702         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22703         (EventParsing): New property that controls whether `add' and
22704         `remove' are returned as tokens or identifiers (for events);
22705
22706 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22707
22708         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22709         use MyEventBuilder only and let it wrap the real builder for us.
22710
22711         (MyEventBuilder): Revamp constructor etc.
22712
22713         Implement all operations that we perform on EventBuilder in precisely the same
22714         way here too.
22715
22716         (FindMembers): Update to use the EventBuilder member.
22717
22718         (Event.Emit): Update accordingly.
22719
22720 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22721
22722         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22723         by calling the appropriate methods.
22724
22725         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22726         useful.
22727
22728         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22729
22730 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22731
22732         * delegate.cs (Delegate.Populate): Check that the return type
22733         and various parameters types are indeed accessible.
22734
22735         * class.cs (Constructor.Define): Same here.
22736
22737         (Field.Define): Ditto.
22738
22739         (Event.Define): Ditto.
22740
22741         (Operator.Define): Check that the underlying Method defined itself
22742         correctly - so it's MethodBuilder should not be null.
22743
22744         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22745         expression happens to be null.
22746
22747         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22748         members but as of now we don't seem to be able to do anything really useful with it.
22749
22750         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22751         not the EventBuilder.
22752
22753 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22754
22755         * cs-tokenizer.cs: Add support for defines.
22756         Add support for #if, #elif, #else, #endif
22757
22758         (eval_var): evaluates a variable.
22759         (eval): stubbed for evaluating functions.
22760
22761         * cs-parser.jay: Pass the defines information
22762
22763         * driver.cs: Add --define command line option.
22764
22765         * decl.cs: Move MemberCore here.
22766
22767         Make it the base class for DeclSpace.  This allows us to catch and
22768         report 108 and 109 for everything now.
22769
22770         * class.cs (TypeContainer.Define): Extract all the members
22771         before populating and emit the warning 108 (new keyword required
22772         to override) instead of having each member implement this.
22773
22774         (MemberCore.Define): New abstract method, we will be using this in
22775         the warning reporting engine in Populate.
22776
22777         (Operator.Define): Adjust to new MemberCore protocol. 
22778
22779         * const.cs (Const): This does not derive from Expression, it is a
22780         temporary object we use to create fields, it is a MemberCore. 
22781
22782         * class.cs (Method.Define): Allow the entry point to be in a
22783         specific class.
22784
22785         * driver.cs: Rewrite the argument handler to clean it up a bit.
22786
22787         * rootcontext.cs: Made it just an auxiliary namespace feature by
22788         making everything static.
22789
22790         * driver.cs: Adapt code to use RootContext type name instead of
22791         instance variable.
22792
22793         * delegate.cs: Remove RootContext argument.
22794
22795         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22796         argument. 
22797
22798         * class.cs (Event.Define): The lookup can fail.
22799
22800         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22801
22802         * expression.cs: Resolve the this instance before invoking the code.
22803
22804 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22805
22806         * cs-parser.jay: Add a production in element_access that allows
22807         the thing to become a "type" reference.  This way we can parse
22808         things like "(string [])" as a type.
22809
22810         Note that this still does not handle the more complex rules of
22811         casts. 
22812
22813
22814         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22815
22816         * ecore.cs: (CopyNewMethods): new utility function used to
22817         assemble the list of methods from running FindMembers.
22818
22819         (MemberLookup): Rework FindMembers so that 
22820
22821 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22822
22823         * class.cs (TypeContainer): Remove Delegates who fail to be
22824         defined.
22825
22826         * delegate.cs (Populate): Verify that we dont get null return
22827         values.   TODO: Check for AsAccessible.
22828
22829         * cs-parser.jay: Use basename to emit error 574 (destructor should
22830         have the same name as container class), not the full name.
22831
22832         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22833         possible representation.  
22834
22835         Also implements integer type suffixes U and L.
22836
22837 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22838
22839         * expression.cs (ArrayCreation.DoResolve): We need to do the
22840         argument resolution *always*.
22841
22842         * decl.cs: Make this hold the namespace.  Hold the root context as
22843         well.
22844         (LookupType): Move here.
22845
22846         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22847
22848         * location.cs (Row, Name): Fixed the code, it was always returning
22849         references to the first file.
22850
22851         * interface.cs: Register properties defined through interfaces.
22852
22853         * driver.cs: Add support for globbing on the command line
22854
22855         * class.cs (Field): Make it derive from MemberCore as well.
22856         (Event): ditto.
22857
22858 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22859
22860         * class.cs (Event::Define): Check that the type of the event is a delegate
22861         type else flag error #66.
22862
22863         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22864         same.
22865
22866         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22867         values of EntryPoint, CharSet etc etc.
22868
22869         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22870
22871         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22872         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22873         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22874         which needs this to do its work.
22875
22876         * ../errors/cs0066.cs : Add.
22877
22878 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22879
22880         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22881         helper functions.
22882
22883         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22884         clears out the parameters field.
22885         (MemberSignatureCompare): Cleanup
22886
22887         (MemberCore): New base class used to share code between MethodCore
22888         and Property.
22889
22890         (RegisterRequiredImplementations) BindingFlags.Public requires
22891         either BindingFlags.Instace or Static.  Use instance here.
22892
22893         (Property): Refactored code to cope better with the full spec.
22894
22895         * parameter.cs (GetParameterInfo): Return an empty array instead
22896         of null on error.
22897
22898         * class.cs (Property): Abstract or extern properties have no bodies.
22899
22900         * parameter.cs (GetParameterInfo): return a zero-sized array.
22901
22902         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22903         method modifier validation to the typecontainer so we can reuse
22904         this on properties.
22905
22906         (MethodCore.ParameterTypes): return an empty sized array of types.
22907
22908         (Property.Define): Test property modifier validity.
22909
22910         Add tests for sealed/override too.
22911
22912         (Method.Emit): abstract or extern methods have no bodies.
22913
22914 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22915
22916         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22917         thing.
22918
22919         (Method::Define, ::Emit): Modify accordingly.
22920
22921         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22922
22923         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22924
22925         * makefile: Pass in /unsafe.
22926
22927 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22928
22929         * class.cs (MakeKey): Kill routine.
22930
22931         * class.cs (TypeContainer.Define): Correctly define explicit
22932         method implementations (they require the full interface name plus
22933         the method name).
22934
22935         * typemanager.cs: Deply the PtrHashtable here and stop using the
22936         lame keys.  Things work so much better.
22937
22938         This of course broke everyone who depended on `RegisterMethod' to
22939         do the `test for existance' test.  This has to be done elsewhere.
22940
22941         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22942         the object stupid Equals method (because, that like fails all over
22943         the place).  We still do not use it.
22944
22945         * class.cs (TypeContainer.SetRequiredInterface,
22946         TypeContainer.RequireMethods): Killed these two routines and moved
22947         all the functionality to RegisterRequiredImplementations.
22948
22949         (TypeContainer.RegisterRequiredImplementations): This routine now
22950         registers all the implementations required in an array for the
22951         interfaces and abstract methods.  We use an array of structures
22952         which can be computed ahead of time to reduce memory usage and we
22953         also assume that lookups are cheap as most classes will not
22954         implement too many interfaces.
22955
22956         We also avoid creating too many MethodSignatures.
22957
22958         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22959         clear the "pending" bit if we find that there are problems with
22960         the declaration.
22961
22962         (TypeContainer.VerifyPendingMethods): Update to report errors of
22963         methods that look like implementations but are not.
22964
22965         (TypeContainer.Define): Add support for explicit interface method
22966         implementation. 
22967
22968 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22969
22970         * typemanager.cs: Keep track of the parameters here instead of
22971         being a feature of the TypeContainer.
22972
22973         * class.cs: Drop the registration of parameters here, as
22974         InterfaceMethods are also interface declarations.
22975
22976         * delegate.cs: Register methods with the TypeManager not only with
22977         the TypeContainer.  This code was buggy.
22978
22979         * interface.cs: Full registation here.
22980
22981 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22982
22983         * expression.cs: Remove reducer for binary expressions, it can not
22984         be done this way.
22985
22986         * const.cs: Put here the code that used to go into constant.cs
22987
22988         * constant.cs: Put here the code for constants, this is a new base
22989         class for Literals.
22990
22991         * literal.cs: Make Literal derive from Constant.
22992
22993 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22994
22995         * statement.cs (Return.Emit): Report error 157 if the user
22996         attempts to return from a finally block.
22997
22998         (Return.Emit): Instead of emitting a return, jump to the end of
22999         the function.
23000
23001         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23002         LocalBuilder to store the result of the function.  ReturnLabel is
23003         the target where we jump.
23004
23005
23006 2001-12-09  Radek Doulik  <rodo@ximian.com>
23007
23008         * cs-parser.jay: remember alias in current namespace
23009
23010         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23011         namespaces
23012
23013         * class.cs (LookupAlias): lookup alias in my_namespace
23014
23015         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23016         aliases hashtable
23017         (LookupAlias): lookup alias in this and if needed in parent
23018         namespaces
23019
23020 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23021
23022         * support.cs: 
23023
23024         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23025         making things static.  I need this to avoid passing the
23026         TypeContainer when calling ParameterType.
23027
23028         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23029         that did string manipulation to compute the type and then call
23030         GetType.  Use Parameter.ParameterType instead.
23031
23032         * cs-tokenizer.cs: Consume the suffix for floating values.
23033
23034         * expression.cs (ParameterReference): figure out whether this is a
23035         reference parameter or not.  Kill an extra variable by computing
23036         the arg_idx during emission.
23037
23038         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23039         function that returns whether a parameter is an out/ref value or not.
23040
23041         (Parameter.ParameterType): The type of the parameter (base,
23042         without ref/out applied).
23043
23044         (Parameter.Resolve): Perform resolution here.
23045         (Parameter.ExternalType): The full type (with ref/out applied).
23046
23047         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23048         support for expressions on the using statement.
23049
23050 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23051
23052         * statement.cs (Using.EmitLocalVariableDecls): Split the
23053         localvariable handling of the using statement.
23054
23055         (Block.EmitMeta): Keep track of variable count across blocks.  We
23056         were reusing slots on separate branches of blocks.
23057
23058         (Try.Emit): Emit the general code block, we were not emitting it. 
23059
23060         Check the type of the declaration to be an IDisposable or
23061         something that can be implicity converted to it. 
23062
23063         Emit conversions if required.
23064
23065         * ecore.cs (EmptyExpression): New utility class.
23066         (Expression.ImplicitConversionExists): New utility function.
23067
23068 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23069
23070         * statement.cs (Using): Implement.
23071
23072         * expression.cs (LocalVariableReference): Support read only variables.
23073
23074         * statement.cs: Remove the explicit emit for the Leave opcode.
23075         (VariableInfo): Add a readonly field.
23076
23077 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23078
23079         * ecore.cs (ConvCast): new class used to encapsulate the various
23080         explicit integer conversions that works in both checked and
23081         unchecked contexts.
23082
23083         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23084         properly generate the overflow opcodes.
23085
23086 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23087
23088         * statement.cs: The correct type for the EmptyExpression is the
23089         element_type, not the variable type.  Ravi pointed this out.
23090
23091 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23092
23093         * class.cs (Method::Define): Handle PInvoke methods specially
23094         by using DefinePInvokeMethod instead of the usual one.
23095
23096         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23097         above to do the task of extracting information and defining the method.
23098
23099 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23100
23101         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23102         of the condition for string type.
23103
23104         (Emit): Move that here. 
23105
23106         (ArrayCreation::CheckIndices): Keep string literals in their expression
23107         form.
23108
23109         (EmitDynamicInitializers): Handle strings appropriately.
23110
23111 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * codegen.cs (EmitContext): Replace multiple variables with a
23114         single pointer to the current Switch statement.
23115
23116         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23117         EmitContext.
23118
23119 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23120
23121         * statement.cs 
23122
23123         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23124         default'.
23125
23126         (Foreach.Emit): Foreach on arrays was not setting
23127         up the loop variables (for break/continue).
23128
23129         (GotoCase): Semi-implented.
23130
23131 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23132
23133         * attribute.cs (CheckAttribute): Handle system attributes by using
23134         Attribute.GetAttributes to examine information we need.
23135
23136         (GetValidPlaces): Same here.
23137
23138         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23139
23140         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23141
23142         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23143
23144         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23145
23146         (Method::Emit): Handle the case when we are a PInvoke method.
23147
23148 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * expression.cs: Use ResolveWithSimpleName on compound names.
23151
23152 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23153
23154         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23155         before trying to reduce it.
23156
23157         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23158
23159         * constant.cs (LookupConstantValue): Implement.
23160
23161         (EmitConstant): Use the above in emitting the constant.
23162
23163         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23164         that are user-defined by doing a LookupConstantValue on them.
23165
23166         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23167         too, like above.
23168
23169 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23170
23171         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23172
23173         (BaseAccess.DoResolve): Implement.
23174
23175         (MemberAccess.DoResolve): Split this routine into a
23176         ResolveMemberAccess routine that can be used independently
23177
23178 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23179
23180         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23181         As that share bits of the implementation.  Is returns a boolean,
23182         while As returns the Type that is being probed.
23183
23184 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23185
23186         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23187         instead of a Literal - much easier.
23188
23189         (EnumInTransit): Remove - utterly useless :-)
23190
23191         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23192
23193         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23194
23195         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23196         chain when we have no associated expression.
23197
23198 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23199
23200         * constant.cs (Define): Use Location while reporting the errror.
23201
23202         Also emit a warning when 'new' is used and there is no inherited
23203         member to hide.
23204
23205         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23206         populated.
23207
23208         (LookupEnumValue): Implement to lookup an enum member's value and define it
23209         if necessary.
23210
23211         (Populate): Re-write accordingly to use the above routine.
23212
23213 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23214
23215         * expression.cs (This): Fix prototype for DoResolveLValue to
23216         override the base class DoResolveLValue.
23217
23218         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23219         declarations) 
23220
23221         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23222         (we need to load the address of the field here).  This fixes
23223         test-22. 
23224
23225         (FieldExpr.DoResolveLValue): Call the DoResolve
23226         function to initialize the Instance expression.
23227
23228         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23229         correctly the GetEnumerator operation on a value type.
23230
23231         * cs-parser.jay: Add more simple parsing error catches.
23232
23233         * statement.cs (Switch): Add support for string switches.
23234         Handle null specially.
23235
23236         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23237
23238 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23239
23240         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23241
23242         (declare_local_constant): New helper function.
23243
23244         * statement.cs (AddConstant): Keep a separate record of constants
23245
23246         (IsConstant): Implement to determine if a variable is a constant.
23247
23248         (GetConstantExpression): Implement.
23249
23250         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23251
23252         * statement.cs (IsVariableDefined): Re-write.
23253
23254 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23255
23256         * class.cs (TypeContainer::FindMembers): Look for constants
23257         in the case when we are looking for MemberTypes.Field
23258
23259         * expression.cs (MemberAccess::DoResolve): Check that in the
23260         case we are a FieldExpr and a Literal, we are not being accessed
23261         by an instance reference.
23262
23263         * cs-parser.jay (local_constant_declaration): Implement.
23264
23265         (declaration_statement): Implement for constant declarations.
23266
23267 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23268
23269         * statement.cs (Switch): Catch double defaults.
23270
23271         (Switch): More work on the switch() statement
23272         implementation.  It works for integral values now, need to finish
23273         string support.
23274
23275
23276 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23277
23278         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23279         integer literals into other integer literals.  To be used by
23280         switch. 
23281
23282 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23283
23284         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23285         some memory.
23286
23287         (EmitDynamicInitializers): Cope with the above since we extract data
23288         directly from ArrayData now.
23289
23290         (ExpectInitializers): Keep track of whether initializers are mandatory
23291         or not.
23292
23293         (Bounds): Make it a hashtable to prevent the same dimension being 
23294         recorded for every element in that dimension.
23295
23296         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23297         from being found.
23298
23299         Also fix bug which was causing the indices to be emitted in the reverse
23300         order.
23301
23302 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23303
23304         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23305         unfinished.  They do not work, because the underlying code is
23306         sloppy.
23307
23308 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23309
23310         * cs-parser.jay: Remove bogus fixme.
23311
23312         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23313         on Switch statement.
23314
23315 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23316
23317         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23318         the same. 
23319
23320         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23321         parameter. Apparently, any expression is allowed. 
23322
23323         (ValidateInitializers): Update accordingly.
23324
23325         (CheckIndices): Fix some tricky bugs thanks to recursion.
23326
23327         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23328         I was being completely brain-dead.
23329
23330         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23331         and re-write acordingly.
23332
23333         (DelegateInvocation): Re-write accordingly.
23334
23335         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23336
23337         (MakeByteBlob): Handle types more correctly.
23338
23339         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23340         initialization from expressions but it is incomplete because I am a complete
23341         Dodo :-|
23342
23343 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23344
23345         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23346         on If.  Basically, we have to return `true' (ie, we do return to
23347         our caller) only if both branches of the if return.
23348
23349         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23350         short-circuit operators, handle them as short circuit operators. 
23351
23352         (Cast.DoResolve): Resolve type.
23353         (Cast.Cast): Take an expression as the target type.
23354
23355         * cs-parser.jay (cast_expression): Remove old hack that only
23356         allowed a limited set of types to be handled.  Now we take a
23357         unary_expression and we resolve to a type during semantic
23358         analysis.
23359
23360         Use the grammar productions from Rhys to handle casts (this is
23361         not complete like Rhys syntax yet, we fail to handle that corner
23362         case that C# has regarding (-x), but we will get there.
23363
23364 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23365
23366         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23367         field which is an array type.
23368
23369         * cs-parser.jay (declare_local_variables): Support array initialization too.
23370
23371         * typemanager.cs (MakeKey): Implement.
23372
23373         (everywhere): Use the above appropriately.
23374
23375         * cs-parser.jay (for_statement): Update for array initialization while
23376         declaring variables.
23377
23378         * ecore.cs : The error message was correct, it's the variable's names that
23379         were misleading ;-) Make the code more readable.
23380
23381         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23382         the correct type etc.
23383
23384         (ConvertExplicit): Handle Enum types by examining the underlying type.
23385
23386 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23387
23388         * parameter.cs (GetCallingConvention): Always return
23389         CallingConventions.Standard for now.
23390
23391 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23392
23393         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23394         and `r' after calling DoNumericPromotions.
23395
23396         * ecore.cs: Fix error message (the types were in the wrong order).
23397
23398         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23399         BindingFlags.Instance as well 
23400
23401         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23402         implicit int literal conversion in an empty cast so that we
23403         propagate the right type upstream.
23404
23405         (UnboxCast): new class used to unbox value types.
23406         (Expression.ConvertExplicit): Add explicit type conversions done
23407         by unboxing.
23408
23409         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23410         the target type before applying the implicit LongLiterals to ULong
23411         literal cast.
23412
23413 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23414
23415         * cs-parser.jay (for_statement): Reworked the way For works: now
23416         we declare manually any variables that are introduced in
23417         for_initializer to solve the problem of having out-of-band code
23418         emition (that is what got for broken).
23419
23420         (declaration_statement): Perform the actual variable declaration
23421         that used to be done in local_variable_declaration here.
23422
23423         (local_variable_declaration): Do not declare anything, just pass
23424         the information on a DictionaryEntry
23425
23426 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23427
23428         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23429         re-write of the logic to now make it recursive.
23430
23431         (UpdateIndices): Re-write accordingly.
23432
23433         Store element data in a separate ArrayData list in the above methods.
23434
23435         (MakeByteBlob): Implement to dump the array data into a byte array.
23436
23437 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23438
23439         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23440         into CheckIndices.
23441
23442         * constant.cs (Define): Implement.
23443
23444         (EmitConstant): Re-write fully.
23445
23446         Pass in location info.
23447
23448         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23449         respectively.
23450
23451         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23452         DictionaryEntry since we need location info too.
23453
23454         (constant_declaration): Update accordingly.
23455
23456         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23457         code into another method : UpdateIndices.
23458
23459 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23460
23461         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23462         some type checking etc.
23463
23464 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23465
23466         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23467         bits to provide dimension info if the user skips doing that.
23468
23469         Update second constructor to store the rank correctly.
23470
23471 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23472
23473         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23474         and try to implement.
23475
23476         * ../errors/cs0150.cs : Add.
23477
23478         * ../errors/cs0178.cs : Add.
23479
23480 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23481
23482         * statement.cs: Implement foreach on multi-dimensional arrays. 
23483
23484         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23485         name of the params argument.
23486
23487         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23488         initializing the array.
23489
23490         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23491         we can use this elsewhere.
23492
23493         * statement.cs: Finish implementation of foreach for single
23494         dimension arrays.
23495
23496         * cs-parser.jay: Use an out-of-band stack to pass information
23497         around, I wonder why I need this.
23498
23499         foreach_block: Make the new foreach_block the current_block.
23500
23501         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23502         function used to return a static Parameters structure.  Used for
23503         empty parameters, as those are created very frequently.
23504
23505         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23506
23507 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23508
23509         * interface.cs : Default modifier is private, not public. The
23510         make verify test passes again.
23511
23512 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23513
23514         * support.cs (ReflectionParameters): Fix logic to determine
23515         whether the last parameter is a params one. Test 9 passes again.
23516
23517         * delegate.cs (Populate): Register the builders we define with
23518         RegisterParameterForBuilder. Test 19 passes again.
23519
23520         * cs-parser.jay (property_declaration): Reference $6 instead
23521         of $$ to get at the location.
23522
23523         (indexer_declaration): Similar stuff.
23524
23525         (attribute): Ditto.
23526
23527         * class.cs (Property): Register parameters for the Get and Set methods
23528         if they exist. Test 23 passes again.
23529
23530         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23531         call to EmitArguments as we are sure there aren't any params arguments. 
23532         Test 32 passes again.
23533
23534         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23535         IndexOutOfRangeException. 
23536
23537         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23538         Test 33 now passes again.
23539
23540 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23541
23542         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23543         broke a bunch of things.  Will have to come up with a better way
23544         of tracking locations.
23545
23546         * statement.cs: Implemented foreach for single dimension arrays.
23547
23548 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23549
23550         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23551         an error.  This removes the lookup from the critical path.
23552
23553         * cs-parser.jay: Removed use of temporary_loc, which is completely
23554         broken. 
23555
23556 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23557
23558         * support.cs (ReflectionParameters.ParameterModifier): Report
23559         whether the argument is a PARAMS argument or not.
23560
23561         * class.cs: Set the attribute `ParamArrayAttribute' on the
23562         parameter argument.
23563
23564         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23565         and cons_param_array_attribute (ConstructorInfo for
23566         ParamArrayAttribute)., 
23567
23568         * codegen.cs: Emit the return using the `Return' statement, that
23569         way we can report the error correctly for missing return values. 
23570
23571         * class.cs (Method.Emit): Clean up.
23572
23573         * expression.cs (Argument.Resolve): Take another argument: the
23574         location where this argument is used.  Notice that this is not
23575         part of the "Argument" class as to reduce the size of the
23576         structure (we know the approximate location anyways).
23577
23578         Test if the argument is a variable-reference, if not, then
23579         complain with a 206.
23580
23581         (Argument.Emit): Emit addresses of variables.
23582
23583         (Argument.FullDesc): Simplify.
23584
23585         (Invocation.DoResolve): Update for Argument.Resolve.
23586
23587         (ElementAccess.DoResolve): ditto.
23588
23589         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23590         method should be virtual, as this method is always virtual.
23591
23592         (NewDelegate.DoResolve): Update for Argument.Resolve.
23593
23594         * class.cs (ConstructorInitializer.DoResolve): ditto.
23595
23596         * attribute.cs (Attribute.Resolve): ditto.
23597
23598 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23599
23600         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23601
23602         * expression.cs (ParameterReference): Drop IStackStorage and implement
23603         IAssignMethod instead. 
23604
23605         (LocalVariableReference): ditto.
23606
23607         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23608         IAssignMethod instead. 
23609
23610 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23611
23612         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23613         enumerations that are used in heavily used structures derive from
23614         byte in a laughable and pathetic attempt to reduce memory usage.
23615         This is the kind of pre-optimzations that you should not do at
23616         home without adult supervision.
23617
23618         * expression.cs (UnaryMutator): New class, used to handle ++ and
23619         -- separatedly from the other unary operators.  Cleans up the
23620         code, and kills the ExpressionStatement dependency in Unary.
23621
23622         (Unary): Removed `method' and `Arguments' from this class, making
23623         it smaller, and moving it all to SimpleCall, so I can reuse this
23624         code in other locations and avoid creating a lot of transient data
23625         strucutres when not required.
23626
23627         * cs-parser.jay: Adjust for new changes.
23628
23629 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23630
23631         * enum.cs (Enum.Populate): If there is a failure during
23632         definition, return
23633
23634         * cs-parser.jay (opt_enum_base): we used to catch type errors
23635         here, but this is really incorrect.  The type error should be
23636         catched during semantic analysis.
23637
23638 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23639
23640         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23641         current_local_parameters as expected since I, in my stupidity, had forgotten
23642         to do this :-)
23643
23644         * attribute.cs (GetValidPlaces): Fix stupid bug.
23645
23646         * class.cs (Method::Emit): Perform check on applicability of attributes.
23647
23648         (Constructor::Emit): Ditto.
23649
23650         (Field::Emit): Ditto.
23651
23652         (Field.Location): Store location information.
23653
23654         (Property, Event, Indexer, Operator): Ditto.
23655
23656         * cs-parser.jay (field_declaration): Pass in location for each field.
23657
23658         * ../errors/cs0592.cs : Add.
23659
23660 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23661
23662         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23663
23664         (InitCoreTypes): Update accordingly.
23665
23666         (RegisterAttrType, LookupAttr): Implement.
23667
23668         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23669         info about the same.
23670
23671         (Resolve): Update to populate the above as necessary.
23672
23673         (Error592): Helper.
23674
23675         (GetValidPlaces): Helper to the above.
23676
23677         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23678
23679         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23680
23681 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23682
23683         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23684
23685         * ../errors/cs0617.cs : Add.
23686
23687 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23688
23689         * enum.cs (Emit): Rename to Populate to be more consistent with what
23690         we expect it to do and when exactly it is called.
23691
23692         * class.cs, rootcontext.cs : Update accordingly.
23693
23694         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23695         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23696
23697         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23698
23699         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23700         of a fieldinfo using the above, when dealing with a FieldBuilder.
23701
23702 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23703
23704         * ../errors/cs0031.cs : Add.
23705
23706         * ../errors/cs1008.cs : Add.
23707
23708         * ../errrors/cs0543.cs : Add.
23709
23710         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23711         enum type.
23712
23713         (FindMembers): Implement.
23714
23715         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23716         enums and delegates too.
23717
23718         (enum_types): Rename to builder_to_enum.
23719
23720         (delegate_types): Rename to builder_to_delegate.
23721
23722         * delegate.cs (FindMembers): Implement.
23723
23724 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23725
23726         * typemanager.cs (IsEnumType): Implement.
23727
23728         * enum.cs (Emit): Re-write parts to account for the underlying type
23729         better and perform checking etc.
23730
23731         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23732         of the underlying type.
23733
23734         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23735         value
23736
23737         * enum.cs (error31): Helper to report error #31.
23738
23739         * cs-parser.jay (enum_declaration): Store location of each member too.
23740
23741         * enum.cs (member_to_location): New hashtable. 
23742
23743         (AddEnumMember): Update location hashtable.
23744
23745         (Emit): Use the location of each member while reporting errors.
23746
23747 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23748
23749         * cs-parser.jay: A for_initializer if is a
23750         local_variable_declaration really ammount to have an implicit
23751         block with the variable declaration and no initializer for for.
23752
23753         * statement.cs (For.Emit): Cope with null initializers.
23754
23755         This fixes the infinite loop on for initializers.
23756
23757 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23758
23759         * enum.cs: More cleanup.
23760
23761         * ecore.cs: Remove dead code.
23762
23763         * class.cs (Property.Emit): More simplification.
23764         (Event.Emit): ditto.
23765
23766         Reworked to have less levels of indentation.
23767
23768 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23769
23770         * class.cs (Property): Emit attributes.
23771
23772         (Field): Ditto.
23773
23774         (Event): Ditto.
23775
23776         (Indexer): Ditto.
23777
23778         (Operator): Ditto.
23779
23780         * enum.cs (Emit): Ditto.
23781
23782         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23783         Enums too.
23784
23785         * class.cs (Field, Event, etc.): Move attribute generation into the
23786         Emit method everywhere.
23787
23788         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23789         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23790         as we had no way of defining nested enums !
23791
23792         * rootcontext.cs : Adjust code accordingly.
23793
23794         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23795
23796 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23797
23798         * expression.cs (EvalConstantExpression): Move into ecore.cs
23799
23800         * enum.cs (Enum): Rename some members and make them public and readonly
23801         according to our convention.
23802
23803         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23804         nothing else.
23805
23806         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23807
23808         (Enum::Emit): Write a simple version for now which doesn't try to compute
23809         expressions. I shall modify this to be more robust in just a while.
23810
23811         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23812
23813         (TypeContainer::CloseType): Create the Enum types too.
23814
23815         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23816
23817         * expression.cs (EvalConstantExpression): Get rid of completely.
23818
23819         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23820         user-defined values and other cases.
23821
23822         (IsValidEnumLiteral): Helper function.
23823
23824         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23825         out there in the case we had a literal FieldExpr.
23826
23827         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23828
23829         (Literalize): Revamp a bit to take two arguments.
23830
23831         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23832
23833 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23834
23835         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23836
23837         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23838
23839         (Resolve): Use the above to ensure we have proper initializers.
23840
23841 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23842
23843         * expression.cs (Expression::EvalConstantExpression): New method to 
23844         evaluate constant expressions.
23845
23846         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23847
23848 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23849
23850         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23851         in an array.
23852
23853         (Binary.ResolveOperator): Handle operator != (object a, object b)
23854         and operator == (object a, object b);
23855
23856         (Binary.DoNumericPromotions): Indicate whether the numeric
23857         promotion was possible.
23858
23859         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23860         Implement.  
23861
23862         Made the ArrayAccess implement interface IAssignMethod instead of
23863         IStackStore as the order in which arguments are passed reflects
23864         this.
23865
23866         * assign.cs: Instead of using expr.ExprClass to select the way of
23867         assinging, probe for the IStackStore/IAssignMethod interfaces.
23868
23869         * typemanager.cs: Load InitializeArray definition.
23870
23871         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23872         static data that can be used to initialize arrays. 
23873
23874 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23875
23876         * expression.cs: Handle operator== and operator!= for booleans.
23877
23878         (Conditioal.Reduce): Implement reducer for the ?: operator.
23879
23880         (Conditional.Resolve): Implement dead code elimination.
23881
23882         (Binary.Resolve): Catch string literals and return a new
23883         concatenated string.
23884
23885         (Unary.Reduce): Implement reduction of unary expressions.
23886
23887         * ecore.cs: Split out the expression core handling here.
23888
23889         (Expression.Reduce): New method used to perform constant folding
23890         and CSE.  This is needed to support constant-expressions. 
23891
23892         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23893         targets, and optimize for !x.
23894
23895 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23896
23897         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23898         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23899         set custom atttributes.
23900
23901         * literal.cs (Literal::GetValue): New abstract method to return the actual
23902         value of the literal, cast as an object.
23903
23904         (*Literal): Implement GetValue method.
23905
23906         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23907         expressions to the arraylist but objects of type Argument.
23908
23909         * class.cs (TypeContainer::Emit): Emit our attributes too.
23910
23911         (Method::Emit, Constructor::Emit): Ditto.
23912
23913         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23914         to be ignoring earlier.
23915
23916 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23917
23918         * attribute.cs (AttributeSection::Define): Implement to do the business
23919         of constructing a CustomAttributeBuilder.
23920
23921         (Attribute): New trivial class. Increases readability of code.  
23922
23923         * cs-parser.jay : Update accordingly.
23924
23925         (positional_argument_list, named_argument_list, named_argument): New rules
23926
23927         (attribute_arguments): Use the above so that we are more correct.
23928
23929 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23930
23931         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23932         to perform all checks for a method with a params parameter.
23933
23934         (Invocation::OverloadResolve): Update to use the above method and therefore
23935         cope correctly with params method invocations.
23936
23937         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23938         params too.
23939
23940         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23941         constructors in our parent too because we can't afford to miss out on 
23942         protected ones ;-)
23943
23944         * attribute.cs (AttributeSection): New name for the class Attribute
23945
23946         Other trivial changes to improve readability.
23947
23948         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23949         use the new class names.
23950
23951 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23952
23953         * class.cs (Method::Define): Complete definition for params types too
23954
23955         (Indexer::Define): Ditto.
23956
23957         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23958         Cope everywhere with a request for info about the array parameter.
23959
23960 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23961
23962         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23963
23964         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23965         local_variable_type to extract the string corresponding to the type.
23966
23967         (local_variable_type): Fixup the action to use the new helper method.
23968
23969         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23970         go.
23971
23972         * expression.cs : Clean out code which uses the above.
23973
23974 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23975
23976         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23977         and bale out if necessary by returning a false.
23978
23979         (RegisterProperty): Ditto.
23980
23981         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23982         and print out appropriate error messages.
23983
23984         * interface.cs (everywhere): Ditto.
23985
23986         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23987         location to constructor.
23988
23989         * class.cs (Property, Event, Indexer): Update accordingly.
23990
23991         * ../errors/cs111.cs : Added.
23992
23993         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23994         of a method, as laid down by the spec.
23995
23996         (Invocation::OverloadResolve): Use the above method.
23997
23998 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23999
24000         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24001         now take a TypeContainer and a Parameters object.
24002
24003         (ParameterData): Modify return type of ParameterModifier method to be 
24004         Parameter.Modifier and not a string.
24005
24006         (ReflectionParameters, InternalParameters): Update accordingly.
24007
24008         * expression.cs (Argument::GetParameterModifier): Same here.
24009
24010         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24011         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24012         symbol in it at all so maybe this is only for now.
24013
24014 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24015
24016         * support.cs (InternalParameters): Constructor now takes an extra argument 
24017         which is the actual Parameters class.
24018
24019         (ParameterDesc): Update to provide info on ref/out modifiers.
24020
24021         * class.cs (everywhere): Update call to InternalParameters to pass in
24022         the second argument too.
24023
24024         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24025         to return the modifier info [ref/out etc]
24026
24027         (InternalParameters, ReflectionParameters): Implement the above.
24028
24029         * expression.cs (Argument::ParameterModifier): Similar function to return
24030         info about the argument's modifiers.
24031
24032         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24033         too.
24034
24035         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24036         a new SetFormalParameters object which we pass to InternalParameters.
24037
24038 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24039
24040         * expression.cs (NewArray): Merge into the ArrayCreation class.
24041
24042 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24043
24044         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24045         NewUserdefinedArray into one as there wasn't much of a use in having
24046         two separate ones.
24047
24048         * expression.cs (Argument): Change field's name to ArgType from Type.
24049
24050         (Type): New readonly property which returns the proper type, taking into 
24051         account ref/out modifiers.
24052
24053         (everywhere): Adjust code accordingly for the above.
24054
24055         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24056         whether we are emitting for a ref or out parameter.
24057
24058         * expression.cs (Argument::Emit): Use the above field to set the state.
24059
24060         (LocalVariableReference::Emit): Update to honour the flag and emit the
24061         right stuff.
24062
24063         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24064
24065         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24066
24067         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24068
24069         (ReflectionParameters, InternalParameters): Implement the above method.
24070
24071         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24072         reporting errors.
24073
24074         (Invocation::FullMethodDesc): Ditto. 
24075
24076 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24077
24078         * cs-parser.jay: Add extra production for the second form of array
24079         creation. 
24080
24081         * expression.cs (ArrayCreation): Update to reflect the above
24082         change. 
24083
24084         * Small changes to prepare for Array initialization.
24085
24086 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24087
24088         * typemanager.cs (ImplementsInterface): interface might be null;
24089         Deal with this problem;
24090
24091         Also, we do store negative hits on the cache (null values), so use
24092         this instead of calling t.GetInterfaces on the type everytime.
24093
24094 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24095
24096         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24097
24098         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24099         split functionality out into different classes.
24100
24101         (New::FormArrayType): Move into NewBuiltinArray.
24102
24103         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24104         quite useless.
24105
24106         (NewBuiltinArray): New class to handle creation of built-in arrays.
24107
24108         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24109         account creation of one-dimensional arrays.
24110
24111         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24112
24113         (NewUserdefinedArray::DoResolve): Implement.
24114
24115         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24116
24117         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24118         we maintain inside the TypeManager. This is necessary to perform lookups on the
24119         module builder.
24120
24121         (LookupType): Update to perform GetType on the module builders too.     
24122
24123         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24124
24125         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24126
24127 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24128
24129         * expression.cs (New::DoResolve): Implement guts of array creation.
24130
24131         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24132
24133 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24134
24135         * expression.cs: Fix bug I introduced lsat night that broke
24136         Delegates. 
24137
24138         (Expression.Resolve): Report a 246 error (can not resolve name)
24139         if we find a SimpleName in the stream.
24140
24141         (Expression.ResolveLValue): Ditto.
24142
24143         (Expression.ResolveWithSimpleName): This function is a variant of
24144         ResolveName, this one allows SimpleNames to be returned without a
24145         warning.  The only consumer of SimpleNames is MemberAccess
24146
24147 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24148
24149         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24150         might arrive here.  I have my doubts that this is correct.
24151
24152         * statement.cs (Lock): Implement lock statement.
24153
24154         * cs-parser.jay: Small fixes to support `lock' and `using'
24155
24156         * cs-tokenizer.cs: Remove extra space
24157
24158         * driver.cs: New flag --checked, allows to turn on integer math
24159         checking. 
24160
24161         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24162         Threading.Monitor.Exit 
24163
24164 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24165
24166         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24167         Expression Class to be IndexerAccess.
24168
24169         Notice that Indexer::DoResolve sets the eclass to Value.
24170
24171 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24172
24173         * class.cs (TypeContainer::Emit): Emit code for indexers.
24174
24175         * assign.cs (IAssignMethod): New interface implemented by Indexers
24176         and Properties for handling assignment.
24177
24178         (Assign::Emit): Simplify and reuse code. 
24179
24180         * expression.cs (IndexerAccess, PropertyExpr): Implement
24181         IAssignMethod, clean up old code. 
24182
24183 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24184
24185         * typemanager.cs (ImplementsInterface): New method to determine if a type
24186         implements a given interface. Provides a nice cache too.
24187
24188         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24189         method.
24190
24191         (ConvertReferenceExplicit): Ditto.
24192
24193         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24194         various methods, with correct names etc.
24195
24196         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24197         Operator.UnaryNegation.
24198
24199         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24200         we have a unary plus or minus operator.
24201
24202         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24203         UnaryMinus.
24204
24205         * everywhere : update accordingly.
24206
24207         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24208         respectively.
24209
24210         * class.cs (Method::Define): For the case where we are implementing a method
24211         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24212         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24213
24214 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24215
24216         * interface.cs (FindMembers): Implement to work around S.R.E
24217         lameness.
24218
24219         * typemanager.cs (IsInterfaceType): Implement.
24220
24221         (FindMembers): Update to handle interface types too.
24222
24223         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24224         use IsAssignableFrom as that is not correct - it doesn't work.
24225
24226         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24227         and accordingly override EmitStatement.
24228
24229         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24230         using the correct logic :-)
24231
24232 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24233
24234         * ../errors/cs-11.cs : Add to demonstrate error -11 
24235
24236 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24237
24238         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24239         then pass this as a hint to ResolveLValue.
24240
24241         * expression.cs (FieldExpr): Add Location information
24242
24243         (FieldExpr::LValueResolve): Report assignment to readonly
24244         variable. 
24245
24246         (Expression::ExprClassFromMemberInfo): Pass location information.
24247
24248         (Expression::ResolveLValue): Add new method that resolves an
24249         LValue. 
24250
24251         (Expression::DoResolveLValue): Default invocation calls
24252         DoResolve. 
24253
24254         (Indexers): New class used to keep track of indexers in a given
24255         Type. 
24256
24257         (IStackStore): Renamed from LValue, as it did not really describe
24258         what this did.  Also ResolveLValue is gone from this interface and
24259         now is part of Expression.
24260
24261         (ElementAccess): Depending on the element access type
24262
24263         * typemanager.cs: Add `indexer_name_type' as a Core type
24264         (System.Runtime.CompilerServices.IndexerNameAttribute)
24265
24266         * statement.cs (Goto): Take a location.
24267
24268 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24269
24270         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24271         if two delegates are compatible.
24272
24273         (NewDelegate::DoResolve): Update to take care of the case when
24274         we instantiate a delegate from another delegate.
24275
24276         * typemanager.cs (FindMembers): Don't even try to look up members
24277         of Delegate types for now.
24278
24279 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24280
24281         * delegate.cs (NewDelegate): New class to take care of delegate
24282         instantiation.
24283
24284         * expression.cs (New): Split the delegate related code out into 
24285         the NewDelegate class.
24286
24287         * delegate.cs (DelegateInvocation): New class to handle delegate 
24288         invocation.
24289
24290         * expression.cs (Invocation): Split out delegate related code into
24291         the DelegateInvocation class.
24292
24293 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24294
24295         * expression.cs (New::DoResolve): Implement delegate creation fully
24296         and according to the spec.
24297
24298         (New::DoEmit): Update to handle delegates differently.
24299
24300         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24301         because of which we were printing out arguments in reverse order !
24302
24303         * delegate.cs (VerifyMethod): Implement to check if the given method
24304         matches the delegate.
24305
24306         (FullDelegateDesc): Implement.
24307
24308         (VerifyApplicability): Implement.
24309
24310         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24311         delegate invocations too.
24312
24313         (Invocation::Emit): Ditto.
24314
24315         * ../errors/cs1593.cs : Added.
24316
24317         * ../errors/cs1594.cs : Added.
24318
24319         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24320
24321 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24322
24323         * typemanager.cs (intptr_type): Core type for System.IntPtr
24324
24325         (InitCoreTypes): Update for the same.
24326
24327         (iasyncresult_type, asynccallback_type): Ditto.
24328
24329         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24330         correct.
24331
24332         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24333         too.
24334
24335         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24336         the builders for the 4 members of a delegate type :-)
24337
24338         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24339         type.
24340
24341         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24342
24343         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24344
24345 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24346
24347         * statement.cs (Break::Emit): Implement.   
24348         (Continue::Emit): Implement.
24349
24350         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24351         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24352         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24353         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24354         end loop
24355
24356         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24357         properties that track the label for the current loop (begin of the
24358         loop and end of the loop).
24359
24360 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24361
24362         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24363         use of emitting anything at all.
24364
24365         * class.cs, rootcontext.cs : Get rid of calls to the same.
24366
24367         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24368
24369         (Populate): Define the constructor correctly and set the implementation
24370         attributes.
24371
24372         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24373         have been defined.
24374
24375         (AddDelegateType): Implement.
24376
24377         (IsDelegateType): Implement helper method.
24378
24379         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24380
24381         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24382         and accordingly handle it.
24383
24384         * delegate.cs (Populate): Take TypeContainer argument.
24385         Implement bits to define the Invoke method. However, I still haven't figured out
24386         how to take care of the native int bit :-(
24387
24388         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24389         Qualify the name of the delegate, not its return type !
24390
24391         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24392         conversion.
24393
24394         (StandardConversionExists): Checking for array types turns out to be recursive.
24395
24396         (ConvertReferenceExplicit): Implement array conversion.
24397
24398         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24399
24400 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24401
24402         * cs-parser.jay (delegate_declaration): Store the fully qualified
24403         name as it is a type declaration.
24404
24405         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24406         readonly.
24407
24408         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24409         as TypeContainer::DefineType.
24410
24411         (Populate): Method in which all the definition of the various methods (Invoke)
24412         etc is done.
24413
24414         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24415         see.
24416
24417         (CloseDelegate): Finally creates the delegate.
24418
24419         * class.cs (TypeContainer::DefineType): Update to define delegates.
24420         (Populate, Emit and CloseType): Do the same thing here too.
24421
24422         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24423         delegates in all these operations.
24424
24425 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24426
24427         * expression.cs: LocalTemporary: a new expression used to
24428         reference a temporary that has been created.
24429
24430         * assign.cs: Handle PropertyAccess back here, so that we can
24431         provide the proper semantic access to properties.
24432
24433         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24434         a few more explicit conversions. 
24435
24436         * modifiers.cs: `NEW' modifier maps to HideBySig.
24437
24438         * expression.cs (PropertyExpr): Make this into an
24439         ExpressionStatement, and support the EmitStatement code path. 
24440
24441         Perform get/set error checking, clean up the interface.
24442
24443         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24444         them into toplevel access objects.
24445
24446 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24447
24448         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24449         SRE.
24450
24451         * typemanager.cs: Keep track here of our PropertyBuilders again to
24452         work around lameness in SRE.
24453
24454 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24455
24456         * expression.cs (LValue::LValueResolve): New method in the
24457         interface, used to perform a second resolution pass for LValues. 
24458
24459         (This::DoResolve): Catch the use of this in static methods.
24460
24461         (This::LValueResolve): Implement.
24462
24463         (This::Store): Remove warning, assigning to `this' in structures
24464         is 
24465
24466         (Invocation::Emit): Deal with invocation of
24467         methods on value types.  We need to pass the address to structure
24468         methods rather than the object itself.  (The equivalent code to
24469         emit "this" for structures leaves the entire structure on the
24470         stack instead of a pointer to it). 
24471
24472         (ParameterReference::DoResolve): Compute the real index for the
24473         argument based on whether the method takes or not a `this' pointer
24474         (ie, the method is static).
24475
24476         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24477         value types returned from functions when we need to invoke a
24478         method on the sturcture.
24479
24480
24481 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24482
24483         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24484         defining the type in the Modulebuilder or Typebuilder. This is to take
24485         care of nested types which need to be defined on the TypeBuilder using
24486         DefineNestedMethod.
24487
24488         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24489         methods in RootContext, only ported to be part of TypeContainer.
24490
24491         (TypeContainer::GetInterfaceOrClass): Ditto.
24492
24493         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24494
24495         * interface.cs (Interface::DefineInterface): New method. Does exactly
24496         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24497         too.
24498
24499         (Interface::GetInterfaces): Move from RootContext here and port.
24500
24501         (Interface::GetInterfaceByName): Same here.
24502
24503         * rootcontext.cs (ResolveTree): Re-write.
24504
24505         (PopulateTypes): Re-write.
24506
24507         * class.cs (TypeContainer::Populate): Populate nested types too.
24508         (TypeContainer::Emit): Emit nested members too.
24509
24510         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24511         instead just use the name argument passed in as it is already fully
24512         qualified.
24513
24514         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24515         to TypeContainer mapping to see if a type is user-defined.
24516
24517         * class.cs (TypeContainer::CloseType): Implement. 
24518
24519         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24520         the default constructor.
24521
24522         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24523         twice.
24524
24525         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24526
24527         * interface.cs (CloseType): Create the type here.
24528
24529         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24530         the hierarchy.
24531
24532         Remove all the methods which are now in TypeContainer.
24533
24534 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24535
24536         * delegate.cs (Define): Re-write bits to define the delegate
24537         correctly.
24538
24539 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24540
24541         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24542
24543         * expression.cs (ImplicitReferenceConversion): handle null as well
24544         as a source to convert to any reference type.
24545
24546         * statement.cs (Return): Perform any implicit conversions to
24547         expected return type.  
24548
24549         Validate use of return statement.  
24550
24551         * codegen.cs (EmitContext): Pass the expected return type here.
24552
24553         * class.cs (Method, Constructor, Property): Pass expected return
24554         type to EmitContext.
24555
24556 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24557
24558         * expression.cs: Make DoResolve take an EmitContext instead of a
24559         TypeContainer.
24560
24561         Replaced `l' and `location' for `loc', for consistency.
24562
24563         (Error, Warning): Remove unneeded Tc argument.
24564
24565         * assign.cs, literal.cs, constant.cs: Update to new calling
24566         convention. 
24567
24568         * codegen.cs: EmitContext now contains a flag indicating whether
24569         code is being generated in a static method or not.
24570
24571         * cs-parser.jay: DecomposeQI, new function that replaces the old
24572         QualifiedIdentifier.  Now we always decompose the assembled
24573         strings from qualified_identifier productions into a group of
24574         memberaccesses.
24575
24576 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24577
24578         * rootcontext.cs: Deal with field-less struct types correctly now
24579         by passing the size option to Define Type.
24580
24581         * class.cs: Removed hack that created one static field. 
24582
24583 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24584
24585         * statement.cs: Moved most of the code generation here. 
24586
24587 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24588
24589         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24590         seem very right.
24591
24592         (ElementAccess): Remove useless bits for now - keep checks as the spec
24593         says.
24594
24595 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24596
24597         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24598         and start performing checks according to the spec.
24599
24600 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24601
24602         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24603         rank_specifiers instead.
24604
24605         (rank_specifiers): Change the order in which the rank specifiers are stored
24606
24607         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24608
24609         * expression.cs (ElementAccess): Implement the LValue interface too.
24610
24611 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24612
24613         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24614         except that user defined conversions are not included.
24615
24616         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24617         perform the conversion of the return type, if necessary.
24618
24619         (New::DoResolve): Check whether we are creating an array or an object
24620         and accordingly do the needful.
24621
24622         (New::Emit): Same here.
24623
24624         (New::DoResolve): Implement guts of array creation.
24625
24626         (New::FormLookupType): Helper function.
24627
24628 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24629
24630         * codegen.cs: Removed most of the code generation here, and move the
24631         corresponding code generation bits to the statement classes. 
24632
24633         Added support for try/catch/finalize and throw.
24634
24635         * cs-parser.jay: Added support for try/catch/finalize.
24636
24637         * class.cs: Catch static methods having the flags override,
24638         virtual or abstract.
24639
24640         * expression.cs (UserCast): This user cast was not really doing
24641         what it was supposed to do.  Which is to be born in fully resolved
24642         state.  Parts of the resolution were being performed at Emit time! 
24643
24644         Fixed this code.
24645
24646 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24647
24648         * expression.cs: Implicity convert the result from UserCast.
24649
24650 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24651
24652         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24653         prevented it from working correctly. 
24654
24655         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24656         merely ConvertImplicit.
24657
24658 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24659
24660         * typemanager.cs: Make the LookupTypeContainer function static,
24661         and not per-instance.  
24662
24663         * class.cs: Make static FindMembers (the one that takes a Type
24664         argument). 
24665
24666         * codegen.cs: Add EmitForeach here.
24667
24668         * cs-parser.jay: Make foreach a toplevel object instead of the
24669         inline expansion, as we need to perform semantic analysis on it. 
24670
24671 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24672
24673         * expression.cs (Expression::ImplicitUserConversion): Rename to
24674         UserDefinedConversion.
24675
24676         (Expression::UserDefinedConversion): Take an extra argument specifying 
24677         whether we look for explicit user conversions too.
24678
24679         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24680
24681         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24682
24683         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24684         with the appropriate arguments.
24685
24686         * cs-parser.jay (cast_expression): Record location too.
24687
24688         * expression.cs (Cast): Record location info.
24689
24690         (Expression::ConvertExplicit): Take location argument.
24691
24692         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24693         to determine if we are doing explicit conversions.
24694
24695         (UserCast::Emit): Update accordingly.
24696
24697         (Expression::ConvertExplicit): Report an error if everything fails.
24698
24699         * ../errors/cs0030.cs : Add.
24700
24701 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24702
24703         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24704         virtual and newslot bits. 
24705
24706         * class.cs (TypeContainer::RegisterRequiredImplementations):
24707         Record methods we need.
24708
24709         (TypeContainer::MakeKey): Helper function to make keys for
24710         MethodBases, since the Methodbase key is useless.
24711
24712         (TypeContainer::Populate): Call RegisterRequiredImplementations
24713         before defining the methods.   
24714
24715         Create a mapping for method_builders_to_methods ahead of time
24716         instead of inside a tight loop.
24717
24718         (::RequireMethods):  Accept an object as the data to set into the
24719         hashtable so we can report interface vs abstract method mismatch.
24720
24721 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24722
24723         * report.cs: Make all of it static.
24724
24725         * rootcontext.cs: Drop object_type and value_type computations, as
24726         we have those in the TypeManager anyways.
24727
24728         Drop report instance variable too, now it is a global.
24729
24730         * driver.cs: Use try/catch on command line handling.
24731
24732         Add --probe option to debug the error reporting system with a test
24733         suite. 
24734
24735         * report.cs: Add support for exiting program when a probe
24736         condition is reached.
24737
24738 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24739
24740         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24741         we do a forcible conversion regardless of type, to check if 
24742         ForceConversion returns a null.
24743
24744         (Binary::error19): Use location to report error.
24745
24746         (Unary::error23): Use location here too.
24747
24748         * ../errors/cs0019.cs : Check in.
24749
24750         * ../errors/cs0023.cs : Check in.
24751
24752         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24753         case of a non-null MethodInfo object with a length of 0 !
24754
24755         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24756         an applicable member - according to the spec :-)
24757         Also fix logic to find members in base types.
24758
24759         (Unary::ResolveOperator): Same here.
24760
24761         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24762         as I was getting thoroughly confused between this and error19 :-)
24763
24764         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24765         (::FindMostEncompassedType): Implement.
24766         (::FindMostEncompassingType): Implement.
24767         (::StandardConversionExists): Implement.
24768
24769         (UserImplicitCast): Re-vamp. We now need info about most specific
24770         source and target types so that we can do the necessary conversions.
24771
24772         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24773         mathematical union with no duplicates.
24774
24775 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24776
24777         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24778         in order from base classes to child classes, so that we can in
24779         child classes look up in our parent for method names and
24780         attributes (required for handling abstract, virtual, new, override
24781         constructs: we need to instrospect our base class, and if we dont
24782         populate the classes in order, the introspection might be
24783         incorrect.  For example, a method could query its parent before
24784         the parent has any methods and would determine that the parent has
24785         no abstract methods (while it could have had them)).
24786
24787         (RootContext::CreateType): Record the order in which we define the
24788         classes.
24789
24790 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24791
24792         * class.cs (TypeContainer::Populate): Also method definitions can
24793         fail now, keep track of this.
24794
24795         (TypeContainer::FindMembers): Implement support for
24796         DeclaredOnly/noDeclaredOnly flag.
24797
24798         (Constructor::Emit) Return the ConstructorBuilder.
24799
24800         (Method::Emit) Return the MethodBuilder. 
24801         Check for abstract or virtual methods to be public.
24802
24803         * rootcontext.cs (RootContext::CreateType): Register all the
24804         abstract methods required for the class to be complete and the
24805         interface methods that must be implemented. 
24806
24807         * cs-parser.jay: Report error 501 (method requires body if it is
24808         not marked abstract or extern).
24809
24810         * expression.cs (TypeOf::Emit): Implement.
24811
24812         * typemanager.cs: runtime_handle_type, new global type.
24813
24814         * class.cs (Property::Emit): Generate code for properties.
24815
24816 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24817
24818         * expression.cs (Unary::ResolveOperator): Find operators on base type
24819         too - we now conform exactly to the spec.
24820
24821         (Binary::ResolveOperator): Same here.
24822
24823         * class.cs (Operator::Define): Fix minor quirk in the tests.
24824
24825         * ../errors/cs0215.cs : Added.
24826
24827         * ../errors/cs0556.cs : Added.
24828
24829         * ../errors/cs0555.cs : Added.
24830
24831 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24832
24833         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24834         single integer which is really efficient
24835
24836 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24837
24838         *  expression.cs (Expression::ImplicitUserConversion): Use location
24839         even in the case when we are examining True operators.
24840  
24841         * class.cs (Operator::Define): Perform extensive checks to conform
24842         with the rules for operator overloading in the spec.
24843
24844         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24845         some of the other conversions mentioned in the spec.
24846
24847         * typemanager.cs (array_type): New static member for the System.Array built-in
24848         type.
24849
24850         (cloneable_interface): For System.ICloneable interface.
24851
24852         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24853         we start resolving the tree and populating types.
24854
24855         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24856  
24857 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24858
24859         * expression.cs (Expression::ExprClassFromMemberInfo,
24860         Expression::Literalize): Create literal expressions from
24861         FieldInfos which are literals.
24862
24863         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24864         type casts, because they were wrong.  The test suite in tests
24865         caught these ones.
24866
24867         (ImplicitNumericConversion): ushort to ulong requires a widening
24868         cast. 
24869
24870         Int32 constant to long requires widening cast as well.
24871
24872         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24873         for integers because the type on the stack is not i4.
24874
24875 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24876
24877         * expression.cs (report118): require location argument. 
24878
24879         * parameter.cs: Do not dereference potential null value.
24880
24881         * class.cs: Catch methods that lack the `new' keyword when
24882         overriding a name.  Report warnings when `new' is used without
24883         anything being there to override.
24884
24885         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24886
24887         * class.cs: Only add constructor to hashtable if it is non-null
24888         (as now constructors can fail on define).
24889
24890         (TypeManager, Class, Struct): Take location arguments.
24891
24892         Catch field instance initialization in structs as errors.
24893
24894         accepting_filter: a new filter for FindMembers that is static so
24895         that we dont create an instance per invocation.
24896
24897         (Constructor::Define): Catch errors where a struct constructor is
24898         parameterless 
24899
24900         * cs-parser.jay: Pass location information for various new
24901         constructs. 
24902
24903         * delegate.cs (Delegate): take a location argument.
24904
24905         * driver.cs: Do not call EmitCode if there were problesm in the
24906         Definition of the types, as many Builders wont be there. 
24907
24908         * decl.cs (Decl::Decl): Require a location argument.
24909
24910         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24911         into integers, and find the most appropiate integer for it.
24912
24913         * literal.cs: Implement ULongLiteral.
24914
24915         * rootcontext.cs: Provide better information about the location of
24916         failure when CreateType fails.
24917
24918 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24919
24920         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24921         as well.
24922
24923         * expression.cs (Binary::CheckShiftArguments): Add missing type
24924         computation.
24925         (Binary::ResolveOperator): Add type to the logical and and logical
24926         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24927         before.
24928
24929         (Binary::DoNumericPromotions): In the case where either argument
24930         is ulong (and most signed types combined with ulong cause an
24931         error) perform implicit integer constant conversions as well.
24932
24933 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24934
24935         * expression.cs (UserImplicitCast): Method should always be
24936         non-null. 
24937         (Invocation::BetterConversion): Simplified test for IntLiteral.
24938
24939         (Expression::ImplicitNumericConversion): Split this routine out.
24940         Put the code that performs implicit constant integer conversions
24941         here. 
24942
24943         (Expression::Resolve): Become a wrapper around DoResolve so we can
24944         check eclass and type being set after resolve.
24945
24946         (Invocation::Badness): Remove this dead function
24947
24948         (Binary::ResolveOperator): Do not compute the expensive argumnets
24949         unless we have a union for it.
24950
24951         (Probe::Emit): Is needs to do an isinst and then
24952         compare against null.
24953
24954         (::CanConvert): Added Location argument.  If the Location argument
24955         is null (Location.Null), then we do not report errors.  This is
24956         used by the `probe' mechanism of the Explicit conversion.  We do
24957         not want to generate an error for something that the user
24958         explicitly requested to be casted.  But the pipeline for an
24959         explicit cast first tests for potential implicit casts.
24960
24961         So for now, if the Location is null, it means `Probe only' to
24962         avoid adding another argument.   Might have to revise this
24963         strategy later.
24964
24965         (ClassCast): New class used to type cast objects into arbitrary
24966         classes (used in Explicit Reference Conversions).
24967
24968         Implement `as' as well.
24969
24970         Reverted all the patches from Ravi below: they were broken:
24971
24972                 * The use of `level' as a mechanism to stop recursive
24973                   invocations is wrong.  That was there just to catch the
24974                   bug with a strack trace but not as a way of addressing
24975                   the problem.
24976
24977                   To fix the problem we have to *understand* what is going
24978                   on and the interactions and come up with a plan, not
24979                   just get things going.
24980
24981                 * The use of the type conversion cache that I proposed
24982                   last night had an open topic: How does this work across
24983                   protection domains.  A user defined conversion might not
24984                   be public in the location where we are applying the
24985                   conversion, a different conversion might be selected
24986                   (ie, private A->B (better) but public B->A (worse),
24987                   inside A, A->B applies, but outside it, B->A will
24988                   apply).
24989
24990                 * On top of that (ie, even if the above is solved),
24991                   conversions in a cache need to be abstract.  Ie, `To
24992                   convert from an Int to a Short use an OpcodeCast', not
24993                   `To convert from an Int to a Short use the OpcodeCast on
24994                   the variable 5' (which is what this patch was doing).
24995
24996 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24997
24998         * expression.cs (Invocation::ConversionExists): Re-write to use
24999         the conversion cache
25000
25001         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25002         cache all conversions done, not just user-defined ones.
25003
25004         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25005         to determine if a conversion exists instead of acutually trying to 
25006         perform the conversion. It's faster too.
25007
25008         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25009         and only then attempt the implicit conversion.
25010
25011 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25012
25013         * expression.cs (ConvertImplicit): Use a cache for conversions
25014         already found. Check level of recursion and bail out if necessary.
25015
25016 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25017
25018         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25019         Export standard methods that we expect for string operations.
25020
25021         * statement.cs (Block::UsageWarning): Track usage of variables and
25022         report the errors for not used variables.
25023
25024         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25025         operator. 
25026
25027 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25028
25029         * codegen.cs: remove unnneded code 
25030
25031         * expression.cs: Removed BuiltinTypeAccess class
25032
25033         Fix the order in which implicit conversions are
25034         done.  
25035
25036         The previous fixed dropped support for boxed conversions (adding a
25037         test to the test suite now)
25038
25039         (UserImplicitCast::CanConvert): Remove test for source being null,
25040         that code is broken.  We should not feed a null to begin with, if
25041         we do, then we should track the bug where the problem originates
25042         and not try to cover it up here.
25043
25044         Return a resolved expression of type UserImplicitCast on success
25045         rather than true/false.  Ravi: this is what I was talking about,
25046         the pattern is to use a static method as a "constructor" for
25047         objects. 
25048
25049         Also, do not create arguments until the very last minute,
25050         otherwise we always create the arguments even for lookups that
25051         will never be performed. 
25052
25053         (UserImplicitCast::Resolve): Eliminate, objects of type
25054         UserImplicitCast are born in a fully resolved state. 
25055
25056         * typemanager.cs (InitCoreTypes): Init also value_type
25057         (System.ValueType). 
25058
25059         * expression.cs (Cast::Resolve): First resolve the child expression.
25060
25061         (LValue): Add new method AddressOf to be used by
25062         the `&' operator.  
25063
25064         Change the argument of Store to take an EmitContext instead of an
25065         ILGenerator, because things like FieldExpr need to be able to call
25066         their children expression to generate the instance code. 
25067
25068         (Expression::Error, Expression::Warning): Sugar functions for
25069         reporting errors.
25070
25071         (Expression::MemberLookup): Accept a TypeContainer instead of a
25072         Report as the first argument.
25073
25074         (Expression::ResolvePrimary): Killed.  I still want to improve
25075         this as currently the code is just not right.
25076
25077         (Expression::ResolveMemberAccess): Simplify, but it is still
25078         wrong. 
25079
25080         (Unary::Resolve): Catch errors in AddressOf operators.
25081
25082         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25083         index to a byte for the short-version, or the compiler will choose
25084         the wrong Emit call, which generates the wrong data.
25085
25086         (ParameterReference::Emit, ::Store): same.
25087
25088         (FieldExpr::AddressOf): Implement.
25089
25090         * typemanager.cs: TypeManager: made public variable instead of
25091         property.
25092
25093         * driver.cs: document --fatal.
25094
25095         * report.cs (ErrorMessage, WarningMessage): new names for the old
25096         Error and Warning classes.
25097
25098         * cs-parser.jay (member_access): Turn built-in access to types
25099         into a normal simplename
25100
25101 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25102
25103         * expression.cs (Invocation::BetterConversion): Fix to cope
25104         with q being null, since this was introducing a bug.
25105
25106         * expression.cs (ConvertImplicit): Do built-in conversions first.
25107
25108 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25109
25110         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25111
25112 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25113
25114         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25115         I had introduced long ago (what's new ?).
25116
25117         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25118         the work of all the checking. 
25119         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25120         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25121
25122         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25123         that is the right way. 
25124
25125         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25126         overloading resolution. Use everywhere instead of cutting and pasting code.
25127
25128         (Binary::ResolveOperator): Use MakeUnionSet.
25129
25130         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25131         we have to convert to bool types. Not complete yet.
25132
25133 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25134
25135         * typemanager.cs (TypeManager::CSharpName): support ushort.
25136
25137         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25138         to provide an expression that performsn an implicit constant int
25139         conversion (section 6.1.6).
25140         (Expression::ConvertImplicitRequired): Reworked to include
25141         implicit constant expression conversions.
25142
25143         (Expression::ConvertNumericExplicit): Finished.
25144
25145         (Invocation::Emit): If InstanceExpression is null, then it means
25146         that we perform a call on this.
25147
25148 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25149
25150         * expression.cs (Unary::Emit): Remove some dead code.
25151         (Probe): Implement Resolve and Emit for `is'.
25152         (Expression::ConvertImplicitRequired): Attempt to do constant
25153         expression conversions here.  Maybe should be moved to
25154         ConvertImplicit, but I am not sure.
25155         (Expression::ImplicitLongConstantConversionPossible,
25156         Expression::ImplicitIntConstantConversionPossible): New functions
25157         that tell whether is it possible to apply an implicit constant
25158         expression conversion.
25159
25160         (ConvertNumericExplicit): Started work on explicit numeric
25161         conversions.
25162
25163         * cs-parser.jay: Update operator constants.
25164
25165         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25166         (Parameters::GetSignature): Hook up VerifyArgs here.
25167         (Parameters::VerifyArgs): Verifies that no two arguments have the
25168         same name. 
25169
25170         * class.cs (Operator): Update the operator names to reflect the
25171         ones that the spec expects (as we are just stringizing the
25172         operator names).
25173
25174         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25175         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25176         previous usage did only work for our methods.
25177         (Expression::ConvertImplicit): Handle decimal implicit numeric
25178         conversions as well.
25179         (Expression::InternalTypeConstructor): Used to invoke constructors
25180         on internal types for default promotions.
25181
25182         (Unary::Emit): Implement special handling for the pre/post
25183         increment/decrement for overloaded operators, as they need to have
25184         the same semantics as the other operators.
25185
25186         (Binary::ResolveOperator): ditto.
25187         (Invocation::ConversionExists): ditto.
25188         (UserImplicitCast::Resolve): ditto.
25189
25190 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25191
25192         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25193         operator, return after emitting body. Regression tests pass again !
25194
25195         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25196         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25197         (Invocation::OverloadResolve): Ditto.
25198         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25199
25200         * everywhere : update calls to the above methods accordingly.
25201
25202 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25203
25204         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25205
25206         * expression.cs (ExpressionStatement): New base class used for
25207         expressions that can appear in statements, so that we can provide
25208         an alternate path to generate expression that do not leave a value
25209         on the stack.
25210
25211         (Expression::Emit, and all the derivatives): We no longer return
25212         whether a value is left on the stack or not.  Every expression
25213         after being emitted leaves a single value on the stack.
25214
25215         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25216         facilties of ExpressionStatement if possible.
25217
25218         * cs-parser.jay: Update statement_expression.
25219
25220 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25221
25222         * driver.cs: Change the wording of message
25223
25224 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25225
25226         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25227         the type of the expression to the return type of the method if
25228         we have an overloaded operator match ! The regression tests pass again !
25229         (Unary::ResolveOperator): Ditto.
25230
25231         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25232         to find "op_Implicit", not "implicit" ;-)
25233         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25234         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25235
25236         * everywhere : Correct calls to the above accordingly.
25237
25238         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25239         (ConvertImplicit): Do user-defined conversion if it exists.
25240
25241 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25242
25243         * assign.cs: track location.
25244         (Resolve): Use implicit conversions on assignment.
25245
25246         * literal.cs: Oops.  Not good, Emit of short access values should
25247         pass (Bytes) or the wrong argument will be selected.
25248
25249         * expression.cs (Unary::Emit): Emit code for -expr.
25250
25251         (Unary::ResolveOperator): Handle `Substract' for non-constants
25252         (substract from zero from the non-constants).
25253         Deal with Doubles as well. 
25254
25255         (Expression::ConvertImplicitRequired): New routine that reports an
25256         error if no implicit conversion exists. 
25257
25258         (Invocation::OverloadResolve): Store the converted implicit
25259         expressions if we make them
25260
25261 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25262
25263         * class.cs (ConstructorInitializer): Take a Location argument.
25264         (ConstructorBaseInitializer): Same here.
25265         (ConstructorThisInitializer): Same here.
25266
25267         * cs-parser.jay : Update all calls accordingly.
25268
25269         * expression.cs (Unary, Binary, New): Take location argument.
25270         Update accordingly everywhere.
25271
25272         * cs-parser.jay : Update all calls to the above to take a location
25273         argument.
25274
25275         * class.cs : Ditto.
25276
25277 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25278
25279         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25280         (Invocation::BetterConversion): Same here
25281         (Invocation::ConversionExists): Ditto.
25282
25283         (Invocation::ConversionExists): Implement.
25284
25285 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25286
25287         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25288         Also take an additional TypeContainer argument.
25289
25290         * All over : Pass in TypeContainer as argument to OverloadResolve.
25291
25292         * typemanager.cs (CSharpName): Update to check for the string type and return
25293         that too.
25294
25295         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25296         a given method.
25297
25298 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25299
25300         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25301         (Invocation::BetterFunction): Implement.
25302         (Invocation::BetterConversion): Implement.
25303         (Invocation::ConversionExists): Skeleton, no implementation yet.
25304
25305         Okay, things work fine !
25306
25307 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25308
25309         * typemanager.cs: declare and load enum_type, delegate_type and
25310         void_type. 
25311
25312         * expression.cs (Expression::Emit): Now emit returns a value that
25313         tells whether a value is left on the stack or not.  This strategy
25314         might be reveted tomorrow with a mechanism that would address
25315         multiple assignments.
25316         (Expression::report118): Utility routine to report mismatches on
25317         the ExprClass.
25318
25319         (Unary::Report23): Report impossible type/operator combination
25320         utility function.
25321
25322         (Unary::IsIncrementableNumber): Whether the type can be
25323         incremented or decremented with add.
25324         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25325         complemented. 
25326         (Unary::ResolveOperator): Implement ++, !, ~,
25327
25328         (Invocation::Emit): Deal with new Emit convetion.
25329
25330         * All Expression derivatives: Updated their Emit method to return
25331         whether they leave values on the stack or not.
25332
25333         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25334         stack for expressions that are statements. 
25335
25336 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25337
25338         * expression.cs (LValue): New interface.  Must be implemented by
25339         LValue objects.
25340         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25341         LValue interface.
25342
25343         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25344         interface for generating code, simplifies the code.
25345
25346 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25347
25348         * expression.cs (everywhere): Comment out return statements in ::Resolve
25349         methods to avoid the warnings.
25350
25351 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25352
25353         * driver.cs (parse): Report error 2001 if we can not open the
25354         source file.
25355
25356         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25357         not resolve it.
25358
25359         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25360         object. 
25361
25362         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25363         otherwise nested blocks end up with the same index.
25364
25365         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25366
25367         * expression.cs:  Instead of having FIXMEs in the Resolve
25368         functions, throw exceptions so it is obvious that we are facing a
25369         bug. 
25370
25371         * cs-parser.jay (invocation_expression): Pass Location information.
25372
25373         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25374         Use a basename for those routines because .NET does not like paths
25375         on them. 
25376
25377         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25378         already defined.
25379
25380 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25381
25382         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25383         are loading the correct data types (throws an exception if not).
25384         (TypeManager::InitCoreTypes): Use CoreLookupType
25385
25386         * expression.cs (Unary::ResolveOperator): return the child
25387         expression for expressions which are just +expr.
25388         (Unary::ResolveOperator): Return negative literals for -LITERAL
25389         expressions (otherwise they are Unary {Literal}).
25390         (Invocation::Badness): Take into account `Implicit constant
25391         expression conversions'.
25392
25393         * literal.cs (LongLiteral): Implement long literal class.
25394         (IntLiteral): export the `Value' of the intliteral. 
25395
25396 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25397
25398         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25399
25400         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25401         instead of 'Operator'
25402
25403         * expression.cs (Binary::ResolveOperator): Update accordingly.
25404         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25405         and 'Minus'
25406
25407         * cs-parser.jay (unary_expression): Update to use the new names.
25408
25409         * gen-treedump.cs (GetUnary): Same here.
25410
25411         * expression.cs (Unary::Resolve): Implement.
25412         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25413         operators are found instead of making noise ;-)
25414         (Unary::ResolveOperator): New method to do precisely the same thing which
25415         Binary::ResolveOperator does for Binary expressions.
25416         (Unary.method, .Arguments): Add.
25417         (Unary::OperName): Implement.   
25418         (Unary::ForceConversion): Copy and Paste !
25419
25420         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25421         a unary operator.
25422
25423         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25424         for the inbuilt operators. Only overloading works for now ;-)
25425
25426 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25427
25428         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25429         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25430
25431         * expression.cs (This::Emit): Implement. 
25432         (This::Resolve): Implement.
25433         (TypeOf:Resolve): Implement.
25434         (Expression::ResolveSimpleName): Add an implicit this to instance
25435         field references. 
25436         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25437         Bind instance variable to Field expressions.
25438         (FieldExpr::Instance): New field used to track the expression that
25439         represents the object instance.
25440         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25441         binding 
25442         (FieldExpr::Emit): Implement.
25443
25444         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25445         the last instruction contains a return opcode to avoid generating
25446         the last `ret' instruction (this generates correct code, and it is
25447         nice to pass the peverify output).
25448
25449         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25450         initializer for static and instance variables.
25451         (Constructor::Emit): Allow initializer to be null in the case of
25452         static constructors.  Only emit initializer for instance
25453         constructors. 
25454
25455         (TypeContainer::FindMembers): Return a null array if there are no
25456         matches.
25457
25458         Also fix the code for the MemberTypes.Method branch, as it was not
25459         scanning that for operators (or tried to access null variables before).
25460
25461         * assign.cs (Assign::Emit): Handle instance and static fields. 
25462
25463         * TODO: Updated.
25464
25465         * driver.cs: Stop compilation if there are parse errors.
25466
25467         * cs-parser.jay (constructor_declaration): Provide default base
25468         initializer for non-static constructors.
25469         (constructor_declarator): Do not provide a default base
25470         initializers if none was specified.
25471         Catch the fact that constructors should not have parameters.
25472
25473         * class.cs: Do not emit parent class initializers for static
25474         constructors, that should be flagged as an error.
25475
25476 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25477
25478         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25479         Move back code into TypeContainer::Populate.
25480
25481 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25482
25483         * class.cs (TypeContainer::AddConstructor): Fix the check to
25484         compare against Name, not Basename. 
25485         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25486
25487         * cs-parser.jay : Update accordingly.
25488
25489         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25490         for methods, don't forget to look into the operators too.
25491         (RegisterMethodBuilder): Helper method to take care of this for
25492         methods, constructors and operators.
25493         (Operator::Define): Completely revamp.
25494         (Operator.OperatorMethod, MethodName): New fields.
25495         (TypeContainer::Populate): Move the registering of builders into
25496         RegisterMethodBuilder.
25497         (Operator::Emit): Re-write.
25498
25499         * expression.cs (Binary::Emit): Comment out code path to emit method
25500         invocation stuff for the case when we have a user defined operator. I am
25501         just not able to get it right !
25502
25503 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25504
25505         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25506         argument. 
25507
25508         (Expression::MemberLookup): Provide a version that allows to
25509         specify the MemberTypes and BindingFlags. 
25510
25511         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25512         so it was not fetching variable information from outer blocks.
25513
25514         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25515         Beforefieldinit as it was buggy.
25516
25517         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25518         that Ravi put here.  
25519
25520         * class.cs (Constructor::Emit): Only emit if block is not null.
25521         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25522         deal with this by semantically definining it as if the user had
25523         done it.
25524
25525         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25526         constructors as we now "emit" them at a higher level.
25527
25528         (TypeContainer::DefineDefaultConstructor): Used to define the
25529         default constructors if none was provided.
25530
25531         (ConstructorInitializer): Add methods Resolve and Emit. 
25532
25533         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25534
25535 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25536
25537         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25538         the default constructor builder with our hashtable for methodbuilders
25539         to methodcores.
25540
25541         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25542         and argument_count is 0 in which case we have a match.
25543         (Binary::ResolveOperator): More null checking and miscellaneous coding
25544         style cleanup.
25545
25546 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25547
25548         * rootcontext.cs (IsNameSpace): Compare against null.
25549
25550         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25551
25552         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25553         and Unary::Operator.
25554
25555         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25556         accordingly.
25557
25558         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25559         we have overloaded operators.
25560         (Binary::ResolveOperator): Implement the part which does the operator overload
25561         resolution.
25562
25563         * class.cs (Operator::Emit): Implement.
25564         (TypeContainer::Emit): Emit the operators we have too.
25565
25566         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25567         the case when we have a user-defined operator.
25568
25569 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25570
25571         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25572
25573 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25574
25575         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25576         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25577         (Constructor::Emit): Implement.
25578         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25579         if we have no work to do. 
25580         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25581         Emit method.
25582
25583         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25584         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25585
25586         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25587         of parent.parent.
25588
25589 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25590
25591         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25592         in the source.
25593         (Tree::RecordNamespace): Method to do what the name says ;-)
25594         (Tree::Namespaces): Property to get at the namespaces hashtable.
25595
25596         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25597         keep track.
25598
25599         * rootcontext.cs (IsNamespace): Fixed it :-)
25600
25601 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25602
25603         * class.cs (TypeContainer::FindMembers): Add support for
25604         constructors. 
25605         (MethodCore): New class that encapsulates both the shared aspects
25606         of a Constructor and a Method.  
25607         (Method, Constructor): Factored pieces into MethodCore.
25608
25609         * driver.cs: Added --fatal which makes errors throw exceptions.
25610         Load System assembly as well as part of the standard library.
25611
25612         * report.cs: Allow throwing exceptions on errors for debugging.
25613
25614         * modifiers.cs: Do not use `parent', instead use the real type
25615         container to evaluate permission settings.
25616
25617         * class.cs: Put Ravi's patch back in.  He is right, and we will
25618         have to cope with the
25619
25620 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25621
25622         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25623         FamORAssem, not FamANDAssem.
25624
25625 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25626
25627         * driver.cs: Added --parse option that only parses its input files
25628         and terminates.
25629
25630         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25631         incorrect.  IsTopLevel is not used to tell whether an object is
25632         root_types or not (that can be achieved by testing this ==
25633         root_types).  But to see if this is a top-level *class* (not
25634         necessarly our "toplevel" container). 
25635
25636 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25637
25638         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25639         parent instead of a direct call to GetType.
25640
25641 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25642
25643         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25644         Modifiers.TypeAttr. This should just be a call to that method.
25645
25646         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25647         object so that we can determine if we are top-level or not.
25648
25649         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25650         TypeContainer too.
25651
25652         * enum.cs (Enum::Define): Ditto.
25653
25654         * modifiers.cs (FieldAttr): Re-write.
25655
25656         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25657         (TypeContainer::HaveStaticConstructor): New property to provide access
25658         to precisely that info.
25659
25660         * modifiers.cs (MethodAttr): Re-write.
25661         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25662
25663         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25664         of top-level types as claimed.
25665
25666 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25667
25668         * expression.cs (MemberLookup): Fruitless attempt to lookup
25669         constructors.  Maybe I need to emit default constructors?  That
25670         might be it (currently .NET emits this for me automatically).
25671         (Invocation::OverloadResolve): Cope with Arguments == null.
25672         (Invocation::EmitArguments): new function, shared by the new
25673         constructor and us.
25674         (Invocation::Emit): Handle static and instance methods.  Emit
25675         proper call instruction for virtual or non-virtual invocations.
25676         (New::Emit): Implement.
25677         (New::Resolve): Implement.
25678         (MemberAccess:Resolve): Implement.
25679         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25680         to track instances.
25681         (FieldExpr::Resolve): Set type.
25682
25683         * support.cs: Handle empty arguments.
25684                 
25685         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25686         SimpleLookup): Auxiliary routines to help parse a qualifier
25687         identifier.  
25688
25689         Update qualifier_identifier rule.
25690
25691         * codegen.cs: Removed debugging messages.
25692
25693         * class.cs: Make this a global thing, this acts just as a "key" to
25694         objects that we might have around.
25695
25696         (Populate): Only initialize method_builders_to_methods once.
25697
25698         * expression.cs (PropertyExpr): Initialize type from the
25699         PropertyType. 
25700
25701         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25702         Resolve pattern.  Attempt to implicitly convert value to boolean.
25703         Emit code.
25704
25705         * expression.cs: Set the type for the int32/int32 argument case.
25706         (Binary::ResolveOperator): Set the return type to boolean for
25707         comparission operators
25708
25709         * typemanager.cs: Remove debugging print code.
25710
25711         (Invocation::Resolve): resolve type.
25712
25713         * class.cs: Allocate a MemberInfo of the correct size, as the code
25714         elsewhere depends on the test to reflect the correct contents.
25715
25716         (Method::) Keep track of parameters, due to System.Reflection holes
25717
25718         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25719         mapping here.
25720
25721         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25722         of the exact size and return that.
25723
25724         (Class::LookupMethodByBuilder): New function that maps
25725         MethodBuilders to its methods.  Required to locate the information
25726         on methods because System.Reflection bit us again.
25727
25728         * support.cs: New file, contains an interface ParameterData and
25729         two implementations: ReflectionParameters and InternalParameters
25730         used to access Parameter information.  We will need to grow this
25731         as required.
25732
25733         * expression.cs (Invocation::GetParameterData): implement a cache
25734         and a wrapper around the ParameterData creation for methods. 
25735         (Invocation::OverloadResolve): Use new code.
25736
25737 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25738
25739         * class.cs (TypeContainer::EmitField): Remove and move into 
25740         (Field::Define): here and modify accordingly.
25741         (Field.FieldBuilder): New member.
25742         (TypeContainer::Populate): Update accordingly.
25743         (TypeContainer::FindMembers): Implement.
25744
25745 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25746
25747         * statement.cs: (VariableInfo::VariableType): New field to be
25748         initialized with the full type once it is resolved. 
25749
25750 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25751
25752         * parameter.cs (GetParameterInfo): Use a type cache to compute
25753         things only once, and to reuse this information
25754
25755         * expression.cs (LocalVariableReference::Emit): Implement.
25756         (OpcodeCast::Emit): fix.
25757
25758         (ParameterReference::Resolve): Implement.
25759         (ParameterReference::Emit): Implement.
25760
25761         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25762         that are expressions need to stay as Expressions.
25763
25764         * typemanager.cs (CSharpName): Returns the C# name of a type if
25765         possible. 
25766
25767         * expression.cs (Expression::ConvertImplicit): New function that
25768         implements implicit type conversions.
25769
25770         (Expression::ImplicitReferenceConversion): Implements implicit
25771         reference conversions.
25772
25773         (EmptyCast): New type for transparent casts.
25774
25775         (OpcodeCast): New type for casts of types that are performed with
25776         a sequence of bytecodes.
25777
25778         (BoxedCast): New type used for casting value types into reference
25779         types.  Emits a box opcode.
25780
25781         (Binary::DoNumericPromotions): Implements numeric promotions of
25782         and computation of the Binary::Type.
25783
25784         (Binary::EmitBranchable): Optimization.
25785
25786         (Binary::Emit): Implement code emission for expressions.
25787
25788         * typemanager.cs (TypeManager): Added two new core types: sbyte
25789         and byte.
25790
25791 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25792
25793         * class.cs (TypeContainer::FindMembers): Method which does exactly
25794         what Type.FindMembers does, only we don't have to use reflection. No
25795         implementation yet.
25796
25797         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25798         typecontainer objects as we need to get at them.
25799         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25800
25801         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25802         typecontainer object.
25803
25804         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25805         of just a Report object.
25806
25807 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25808
25809         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25810         "remove_"
25811         (TypeContainer::Populate): Now define the delegates of the type too.
25812         (TypeContainer.Delegates): Property to access the list of delegates defined
25813         in the type.
25814
25815         * delegates.cs (Delegate::Define): Implement partially.
25816
25817         * modifiers.cs (TypeAttr): Handle more flags.
25818
25819 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25820
25821         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25822         and not <=
25823         (Operator::Define): Re-write logic to get types by using the LookupType method
25824         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25825         (Indexer::Define): Ditto.
25826         (Event::Define): Ditto.
25827         (Property::Define): Ditto.
25828
25829 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25830
25831         * class.cs (TypeContainer::Populate): Now define operators too. 
25832         (TypeContainer.Operators): New property to access the list of operators
25833         in a type.
25834         (Operator.OperatorMethodBuilder): New member to hold the method builder
25835         for the operator we are defining.
25836         (Operator::Define): Implement.
25837
25838 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25839
25840         * class.cs (Event::Define): Make the prefixes of the accessor methods
25841         addOn_ and removeOn_ 
25842
25843         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25844         of the location being passed in too. Ideally, this should go later since all
25845         error reporting should be done through the Report object.
25846
25847         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25848         (Populate): Iterate thru the indexers we have and define them too.
25849         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25850         for the get and set accessors.
25851         (Indexer::Define): Implement.
25852
25853 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25854
25855         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25856         my previous implementation, did not work.
25857
25858         * typemanager.cs: Add a couple of missing types (the longs).
25859
25860         * literal.cs: Use TypeManager.bool_type instead of getting it.
25861
25862         * expression.cs (EventExpr): New kind of expressions.
25863         (Expressio::ExprClassFromMemberInfo): finish
25864
25865 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25866
25867         * assign.cs: Emit stores to static fields differently.
25868
25869 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25870
25871         * Merge in changes and adjust code to tackle conflicts. Backed out my
25872         code in Assign::Resolve ;-) 
25873
25874 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25875
25876         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25877         instead Report.Error and also pass in the location.
25878         (CSharpParser::Lexer): New readonly property to return the reference
25879         to the Tokenizer object.
25880         (declare_local_variables): Use Report.Error with location instead of plain 
25881         old error.
25882         (CheckDef): Ditto.
25883
25884         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25885         (Operator.CheckBinaryOperator): Ditto.
25886
25887         * cs-parser.jay (operator_declarator): Update accordingly.
25888
25889         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25890         (CheckBinaryOperator): Same here.
25891
25892         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25893         on the name without any prefixes of namespace names etc. This is because we
25894         already might have something already fully qualified like 
25895         'System.Console.WriteLine'
25896
25897         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25898
25899 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25900
25901         * cs-tokenizer.cs (location): Return a string which also contains
25902         the file name.
25903
25904         * expression.cs (ElementAccess): New class for expressions of the
25905         type 'element access.'
25906         (BaseAccess): New class for expressions of the type 'base access.'
25907         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25908         respectively.
25909
25910         * cs-parser.jay (element_access): Implement action.
25911         (base_access): Implement actions.
25912         (checked_expression, unchecked_expression): Implement.
25913
25914         * cs-parser.jay (local_variable_type): Correct and implement.
25915         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25916
25917         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25918
25919         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25920         name and the specifiers.
25921
25922         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25923
25924         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25925         making them all public ;-)
25926
25927         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25928         class anyways.
25929
25930 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25931
25932         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25933         PropertyExprs.
25934         (FieldExpr, PropertyExprs): New resolved expressions.
25935         (SimpleName::MemberStaticCheck): Perform static checks for access
25936         to non-static fields on static methods. Maybe this should be
25937         generalized for MemberAccesses. 
25938         (SimpleName::ResolveSimpleName): More work on simple name
25939         resolution. 
25940
25941         * cs-parser.jay (primary_expression/qualified_identifier): track
25942         the parameter index.
25943
25944         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25945         (EmitContext::EmitBoolExpression): Chain to expression generation
25946         instead of temporary hack.
25947         (::EmitStatementExpression): Put generic expression code generation.
25948
25949         * assign.cs (Assign::Emit): Implement variable assignments to
25950         local variables, parameters and fields.
25951
25952 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25953
25954         * statement.cs (Block::GetVariableInfo): New method, returns the
25955         VariableInfo for a variable name in a block.
25956         (Block::GetVariableType): Implement in terms of GetVariableInfo
25957
25958         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25959         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25960
25961 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25962
25963         * cs-parser.jay (operator_declaration): Continue on my quest : update
25964         to take attributes argument.
25965         (event_declaration): Ditto.
25966         (enum_declaration): Ditto.
25967         (indexer_declaration): Ditto.
25968
25969         * class.cs (Operator::Operator): Update constructor accordingly.
25970         (Event::Event): Ditto.
25971
25972         * delegate.cs (Delegate::Delegate): Same here.
25973
25974         * enum.cs (Enum::Enum): Same here.
25975
25976 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25977
25978         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25979
25980         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25981
25982         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25983         being passed around as an arraylist.
25984         (Attributes::AddAttribute): Method to add attribute sections.
25985
25986         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25987         (struct_declaration): Update accordingly.
25988         (constant_declaration): Update.
25989         (field_declaration): Update.
25990         (method_header): Update.
25991         (fixed_parameter): Update.
25992         (parameter_array): Ditto.
25993         (property_declaration): Ditto.
25994         (destructor_declaration): Ditto.
25995
25996         * class.cs (Struct::Struct): Update constructors accordingly.
25997         (Class::Class): Ditto.
25998         (Field::Field): Ditto.
25999         (Method::Method): Ditto.
26000         (Property::Property): Ditto.
26001         (TypeContainer::OptAttribute): update property's return type.
26002
26003         * interface.cs (Interface.opt_attributes): New member.
26004         (Interface::Interface): Update to take the extra Attributes argument.
26005
26006         * parameter.cs (Parameter::Parameter): Ditto.
26007
26008         * constant.cs (Constant::Constant): Ditto.
26009
26010         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26011         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26012         the attributes as a parameter.
26013         (InterfaceProperty): Update constructor call.
26014         (InterfaceEvent): Ditto.
26015         (InterfaceMethod): Ditto.
26016         (InterfaceIndexer): Ditto.
26017
26018         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26019         pass the attributes too.
26020         (interface_event_declaration): Ditto.
26021         (interface_property_declaration): Ditto.
26022         (interface_method_declaration): Ditto.
26023         (interface_declaration): Ditto.
26024
26025 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26026
26027         * class.cs (Method::Define): Track the "static Main" definition to
26028         create an entry point. 
26029
26030         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26031         EntryPoint if we find it. 
26032
26033         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26034         (EmitContext::ig): Make this variable public.
26035
26036         * driver.cs: Make the default output file be the first file name
26037         with the .exe extension.  
26038
26039         Detect empty compilations
26040
26041         Handle various kinds of output targets.  Handle --target and
26042         rename -t to --dumper.
26043
26044         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26045         methods inherited from Expression return now an Expression.  This
26046         will is used during the tree rewriting as we resolve them during
26047         semantic analysis.
26048
26049         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26050         the spec.  Missing entirely is the information about
26051         accessability of elements of it.
26052
26053         (Expression::ExprClassFromMemberInfo): New constructor for
26054         Expressions that creates a fully initialized Expression based on
26055         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26056         a Type.
26057
26058         (Invocation::Resolve): Begin implementing resolution of invocations.
26059
26060         * literal.cs (StringLiteral):  Implement Emit.
26061
26062 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26063
26064         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26065         member.
26066
26067 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26068
26069         * cs-parser.jay (attribute_arguments): Implement actions.
26070         (attribute): Fix bug in production. Implement action.
26071         (attribute_list): Implement.
26072         (attribute_target): Implement.
26073         (attribute_target_specifier, opt_target_specifier): Implement
26074         (CheckAttributeTarget): New method to check if the attribute target
26075         is valid.
26076         (attribute_section): Implement.
26077         (opt_attributes): Implement.
26078
26079         * attribute.cs : New file to handle attributes.
26080         (Attribute): Class to hold attribute info.
26081
26082         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26083         (attribute_section): Modify production to use 2 different rules to 
26084         achieve the same thing. 1 s/r conflict down !
26085         Clean out commented, useless, non-reducing dimension_separator rules.
26086
26087         * class.cs (TypeContainer.attributes): New member to hold list
26088         of attributes for a type.
26089         (Struct::Struct): Modify to take one more argument, the attribute list.
26090         (Class::Class): Ditto.
26091         (Field::Field): Ditto.
26092         (Method::Method): Ditto.
26093         (Property::Property): Ditto.
26094
26095         * cs-parser.jay (struct_declaration): Update constructor call to
26096         pass in the attributes too.
26097         (class_declaration): Ditto.
26098         (constant_declaration): Ditto.
26099         (field_declaration): Ditto.
26100         (method_header): Ditto.
26101         (fixed_parameter): Ditto.
26102         (parameter_array): Ditto.
26103         (property_declaration): Ditto.
26104
26105         * constant.cs (Constant::Constant): Update constructor similarly.
26106         Use System.Collections.
26107
26108         * parameter.cs (Parameter::Parameter): Update as above.
26109
26110 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26111
26112         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26113         (TypeContainer.delegates): New member to hold list of delegates.
26114
26115         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26116         this time as I seem to be on crack ;-)
26117
26118 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26119
26120         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26121         tell whether an identifier represents a namespace.
26122
26123         * expression.cs (NamespaceExpr): A namespace expression, used only
26124         temporarly during expression resolution.
26125         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26126         utility functions to resolve names on expressions.
26127
26128 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26129
26130         * codegen.cs: Add hook for StatementExpressions. 
26131
26132         * class.cs: Fix inverted test for static flag in methods.
26133
26134 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26135
26136         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26137         to make it coincide with MS' number.
26138         (Operator::CheckBinaryOperator): Ditto.
26139
26140         * ../errors/errors.txt : Remove error numbers added earlier.
26141
26142         * ../errors/cs1019.cs : Test case for error # 1019
26143
26144         * ../errros/cs1020.cs : Test case for error # 1020
26145
26146         * cs-parser.jay : Clean out commented cruft.
26147         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26148         used anywhere - non-reducing rule.
26149         (namespace_declarations): Non-reducing rule - comment out.
26150
26151         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26152         with TypeContainer::AddEnum.
26153
26154         * delegate.cs : New file for delegate handling classes.
26155         (Delegate): Class for declaring delegates.
26156
26157         * makefile : Update.
26158
26159         * cs-parser.jay (delegate_declaration): Implement.
26160
26161 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26162
26163         * class.cs (Event::Define): Implement.
26164         (Event.EventBuilder): New member.
26165
26166         * class.cs (TypeContainer::Populate): Update to define all enums and events
26167         we have.
26168         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26169         readonly fields for all these cases ?
26170
26171 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26172
26173         * class.cs (Property): Revamp to use the convention of making fields readonly.
26174         Accordingly modify code elsewhere.
26175
26176         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26177         the Define method of the Property class.
26178
26179         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26180         trivial bug.
26181         (TypeContainer::Populate): Update to define all the properties we have. Also
26182         define all enumerations.
26183
26184         * enum.cs (Define): Implement.
26185
26186 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26187
26188         * cs-parser.jay (overloadable_operator): The semantic value is an
26189         enum of the Operator class.
26190         (operator_declarator): Implement actions.
26191         (operator_declaration): Implement.
26192
26193         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26194         validity of definitions.
26195         (Operator::CheckBinaryOperator): Static method to check for binary operators
26196         (TypeContainer::AddOperator): New method to add an operator to a type.
26197
26198         * cs-parser.jay (indexer_declaration): Added line to actually call the
26199         AddIndexer method so it gets added ;-)
26200
26201         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26202         already taken care of by the MS compiler ?  
26203
26204 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26205
26206         * class.cs (Operator): New class for operator declarations.
26207         (Operator::OpType): Enum for the various operators.
26208
26209 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26210
26211         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26212         ostensibly handle this in semantic analysis.
26213
26214         * cs-parser.jay (general_catch_clause): Comment out
26215         (specific_catch_clauses, specific_catch_clause): Ditto.
26216         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26217         (catch_args, opt_catch_args): New productions.
26218         (catch_clause): Rewrite to use the new productions above
26219         (catch_clauses): Modify accordingly.
26220         (opt_catch_clauses): New production to use in try_statement
26221         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26222         and re-write the code in the actions to extract the specific and
26223         general catch clauses by being a little smart ;-)
26224
26225         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26226         Hooray, try and catch statements parse fine !
26227
26228 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26229
26230         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26231         string from the hashtable of variables.
26232
26233         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26234         I end up making that mistake ;-)
26235         (catch_clauses): Fixed gross error which made Key and Value of the 
26236         DictionaryEntry the same : $1 !!
26237
26238 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26239
26240         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26241
26242         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26243         when the add and remove accessors are specified. 
26244
26245 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26246
26247         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26248         information about indexer_declarator.
26249         (indexer_declarator): Implement actions.
26250         (parsing_indexer): New local boolean used to keep track of whether
26251         we are parsing indexers or properties. This is necessary because 
26252         implicit_parameters come into picture even for the get accessor in the 
26253         case of an indexer.
26254         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26255
26256         * class.cs (Indexer): New class for indexer declarations.
26257         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26258         (TypeContainer::indexers): New member to hold list of indexers for the
26259         type.
26260
26261 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26262
26263         * cs-parser.jay (add_accessor_declaration): Implement action.
26264         (remove_accessor_declaration): Implement action.
26265         (event_accessors_declaration): Implement
26266         (variable_declarators): swap statements for first rule - trivial.
26267
26268         * class.cs (Event): New class to hold information about event
26269         declarations.
26270         (TypeContainer::AddEvent): New method to add an event to a type
26271         (TypeContainer::events): New member to hold list of events.
26272
26273         * cs-parser.jay (event_declaration): Implement actions.
26274
26275 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26276
26277         * cs-parser.jay (dim_separators): Implement. Make it a string
26278         concatenating all the commas together, just as they appear.
26279         (opt_dim_separators): Modify accordingly
26280         (rank_specifiers): Update accordingly. Basically do the same
26281         thing - instead, collect the brackets here.
26282         (opt_rank_sepcifiers): Modify accordingly.
26283         (array_type): Modify to actually return the complete type string
26284         instead of ignoring the rank_specifiers.
26285         (expression_list): Implement to collect the expressions
26286         (variable_initializer): Implement. We make it a list of expressions
26287         essentially so that we can handle the array_initializer case neatly too.
26288         (variable_initializer_list): Implement.
26289         (array_initializer): Make it a list of variable_initializers
26290         (opt_array_initializer): Modify accordingly.
26291
26292         * expression.cs (New::NType): Add enumeration to help us
26293         keep track of whether we have an object/delegate creation
26294         or an array creation.
26295         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26296         members to hold data about array creation.
26297         (New:New): Modify to update NewType
26298         (New:New): New Overloaded contructor for the array creation
26299         case.
26300
26301         * cs-parser.jay (array_creation_expression): Implement to call
26302         the overloaded New constructor.
26303
26304 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26305
26306         * class.cs (TypeContainer::Constructors): Return member
26307         constructors instead of returning null.
26308
26309 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26310
26311         * typemanager.cs (InitCoreTypes): Initialize the various core
26312         types after we have populated the type manager with the user
26313         defined types (this distinction will be important later while
26314         compiling corlib.dll)
26315
26316         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26317         on Expression Classification.  Now all expressions have a method
26318         `Resolve' and a method `Emit'.
26319
26320         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26321         generation from working.     Also add some temporary debugging
26322         code. 
26323
26324 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26325
26326         * codegen.cs: Lots of code generation pieces.  This is only the
26327         beginning, will continue tomorrow with more touches of polish.  We
26328         handle the fundamentals of if, while, do, for, return.  Others are
26329         trickier and I need to start working on invocations soon.
26330
26331         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26332         s.InitStatement. 
26333
26334         * codegen.cs (EmitContext): New struct, used during code
26335         emission to keep a context.   Most of the code generation will be
26336         here. 
26337
26338         * cs-parser.jay: Add embedded blocks to the list of statements of
26339         this block.  So code generation proceeds in a top down fashion.
26340
26341 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26342
26343         * statement.cs: Add support for multiple child blocks.
26344
26345 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26346
26347         * codegen.cs (EmitCode): New function, will emit the code for a
26348         Block of code given a TypeContainer and its ILGenerator. 
26349
26350         * statement.cs (Block): Standard public readonly optimization.
26351         (Block::Block constructors): Link children. 
26352         (Block::Child): Child Linker.
26353         (Block::EmitVariables): Emits IL variable declarations.
26354
26355         * class.cs: Drop support for MethodGroups here, delay until
26356         Semantic Analysis.
26357         (Method::): Applied the same simplification that I did before, and
26358         move from Properties to public readonly fields.
26359         (Method::ParameterTypes): Returns the parameter types for the
26360         function, and implements a cache that will be useful later when I
26361         do error checking and the semantic analysis on the methods is
26362         performed.
26363         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26364         and made a method, optional argument tells whether this is a class
26365         or a structure to apply the `has-this' bit.
26366         (Method::GetCallingConvention): Implement, returns the calling
26367         convention. 
26368         (Method::Define): Defines the type, a second pass is performed
26369         later to populate the methods.
26370
26371         (Constructor::ParameterTypes): implement a cache similar to the
26372         one on Method::ParameterTypes, useful later when we do semantic
26373         analysis. 
26374
26375         (TypeContainer::EmitMethod):  New method.  Emits methods.
26376
26377         * expression.cs: Removed MethodGroup class from here.
26378
26379         * parameter.cs (Parameters::GetCallingConvention): new method.
26380
26381 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26382
26383         * class.cs (TypeContainer::Populate): Drop RootContext from the
26384         argument. 
26385
26386         (Constructor::CallingConvention): Returns the calling convention.
26387         (Constructor::ParameterTypes): Returns the constructor parameter
26388         types. 
26389
26390         (TypeContainer::AddConstructor): Keep track of default constructor
26391         and the default static constructor.
26392
26393         (Constructor::) Another class that starts using `public readonly'
26394         instead of properties. 
26395
26396         (Constructor::IsDefault): Whether this is a default constructor. 
26397
26398         (Field::) use readonly public fields instead of properties also.
26399
26400         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26401         track of static constructors;  If none is used, turn on
26402         BeforeFieldInit in the TypeAttributes. 
26403
26404         * cs-parser.jay (opt_argument_list): now the return can be null
26405         for the cases where there are no arguments. 
26406
26407         (constructor_declarator): If there is no implicit `base' or
26408         `this', then invoke the default parent constructor. 
26409
26410         * modifiers.cs (MethodAttr): New static function maps a set of
26411         modifiers flags into a MethodAttributes enum
26412         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26413         MethodAttr, TypeAttr to represent the various mappings where the
26414         modifiers are used.
26415         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26416
26417 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26418
26419         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26420         method arguments.
26421
26422         * interface.cs (PopulateIndexer): Implemented the code generator
26423         for interface indexers.
26424
26425 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26426
26427         * interface.cs (InterfaceMemberBase): Now we track the new status
26428         here.  
26429
26430         (PopulateProperty): Implement property population.  Woohoo!  Got
26431         Methods and Properties going today. 
26432
26433         Removed all the properties for interfaces, and replaced them with
26434         `public readonly' fields. 
26435
26436 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26437
26438         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26439         initialize their hashtables/arraylists only when they are needed
26440         instead of doing this always.
26441
26442         * parameter.cs: Handle refs and out parameters.
26443
26444         * cs-parser.jay: Use an ArrayList to construct the arguments
26445         instead of the ParameterCollection, and then cast that to a
26446         Parameter[] array.
26447
26448         * parameter.cs: Drop the use of ParameterCollection and use
26449         instead arrays of Parameters.
26450
26451         (GetParameterInfo): Use the Type, not the Name when resolving
26452         types. 
26453
26454 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26455
26456         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26457         and instead use public readonly fields.
26458
26459         * class.cs: Put back walking code for type containers.
26460
26461 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26462
26463         * class.cs (MakeConstant): Code to define constants.
26464
26465         * rootcontext.cs (LookupType): New function.  Used to locate types 
26466
26467
26468 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26469
26470         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26471         this System.Reflection code is.  Kudos to Microsoft
26472
26473         * typemanager.cs: Implement a type cache and avoid loading all
26474         types at boot time.  Wrap in LookupType the internals.  This made
26475         the compiler so much faster.  Wow.  I rule!
26476
26477         * driver.cs: Make sure we always load mscorlib first (for
26478         debugging purposes, nothing really important).
26479
26480         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26481         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26482
26483         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26484         on namespaces that have been imported using the `using' keyword.
26485
26486         * class.cs (TypeContainer::TypeAttr): Virtualize.
26487         (Class::TypeAttr): Return attributes suitable for this bad boy.
26488         (Struct::TypeAttr): ditto.
26489         Handle nested classes.
26490         (TypeContainer::) Remove all the type visiting code, it is now
26491         replaced with the rootcontext.cs code
26492
26493         * rootcontext.cs (GetClassBases): Added support for structs. 
26494
26495 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26496
26497         * interface.cs, statement.cs, class.cs, parameter.cs,
26498         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26499         Drop use of TypeRefs, and use strings instead.
26500
26501 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26502
26503         * rootcontext.cs: 
26504
26505         * class.cs (Struct::Struct): set the SEALED flags after
26506         checking the modifiers.
26507         (TypeContainer::TypeAttr): new property, returns the
26508         TypeAttributes for a class.  
26509
26510         * cs-parser.jay (type_list): Oops, list production was creating a
26511         new list of base types.
26512
26513         * rootcontext.cs (StdLib): New property.
26514         (GetInterfaceTypeByName): returns an interface by type name, and
26515         encapsulates error handling here.
26516         (GetInterfaces): simplified.
26517         (ResolveTree): Encapsulated all the tree resolution here.
26518         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26519         types. 
26520
26521         * driver.cs: Add support for --nostdlib, to avoid loading the
26522         default assemblies.
26523         (Main): Do not put tree resolution here. 
26524
26525         * rootcontext.cs: Beginning of the class resolution.
26526
26527 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26528
26529         * rootcontext.cs: Provide better error reporting. 
26530
26531         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26532
26533         * rootcontext.cs (CreateInterface): Handle the case where there
26534         are no parent interfaces.
26535
26536         (CloseTypes): Routine to flush types at the end.
26537         (CreateInterface): Track types.
26538         (GetInterfaces): Returns an array of Types from the list of
26539         defined interfaces.
26540
26541         * typemanager.c (AddUserType): Mechanism to track user types (puts
26542         the type on the global type hash, and allows us to close it at the
26543         end). 
26544
26545 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26546
26547         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26548         RecordInterface instead.
26549
26550         * cs-parser.jay: Updated to reflect changes above.
26551
26552         * decl.cs (Definition): Keep track of the TypeBuilder type that
26553         represents this type here.  Not sure we will use it in the long
26554         run, but wont hurt for now.
26555
26556         * driver.cs: Smaller changes to accomodate the new code.
26557
26558         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26559         when done. 
26560
26561         * rootcontext.cs (CreateInterface):  New method, used to create
26562         the System.TypeBuilder type for interfaces.
26563         (ResolveInterfaces): new entry point to resolve the interface
26564         hierarchy. 
26565         (CodeGen): Property, used to keep track of the code generator.
26566
26567 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26568
26569         * cs-parser.jay: Add a second production for delegate_declaration
26570         with `VOID'.
26571
26572         (enum_body): Put an opt_comma here instead of putting it on
26573         enum_body or enum_member_declarations so we can handle trailing
26574         commas on enumeration members.  Gets rid of a shift/reduce.
26575
26576         (type_list): Need a COMMA in the middle.
26577
26578         (indexer_declaration): Tell tokenizer to recognize get/set
26579
26580         * Remove old targets.
26581
26582         * Re-add the parser target.
26583
26584 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26585
26586         * cs-parser.jay: Add precendence rules for a number of operators
26587         ot reduce the number of shift/reduce conflicts in the grammar.
26588
26589 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26590
26591         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26592         and put it here.
26593
26594         Get rid of old crufty code.
26595
26596         * rootcontext.cs: Use this to keep track of the parsed
26597         representation and the defined types available to the program. 
26598
26599         * gen-treedump.cs: adjust for new convention.
26600
26601         * type.cs: Split out the type manager, and the assembly builder
26602         from here. 
26603
26604         * typemanager.cs: the type manager will live here now.
26605
26606         * cil-codegen.cs: And the code generator here. 
26607
26608 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26609
26610         * makefile: Fixed up for easy making.
26611
26612 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26613
26614         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26615         the 
26616
26617         (unary_expression): Expand pre_increment_expression and
26618         post_decrement_expression to reduce a shift/reduce.
26619
26620 2001-07-11  Simon Cozens
26621
26622         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26623
26624         Improve allow_keyword_as_indent name.
26625
26626 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26627
26628         * Adjustments for Beta2. 
26629
26630 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26631
26632         * decl.cs: Added `Define' abstract method.
26633         (InTransit): new property, used to catch recursive definitions. 
26634
26635         * interface.cs: Implement `Define'. 
26636
26637         * modifiers.cs: Map Modifiers.constants to
26638         System.Reflection.TypeAttribute flags.
26639
26640         * class.cs: Keep track of types and user-defined types.
26641         (BuilderInit): New method for creating an assembly
26642         (ResolveType): New function to launch the resolution process, only
26643         used by interfaces for now.
26644
26645         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26646         that are inserted into the name space. 
26647
26648 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26649
26650         * ARGH.  I have screwed up my tree so many times due to the use of
26651         rsync rather than using CVS.  Going to fix this at once. 
26652
26653         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26654         load types.
26655
26656 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26657
26658         * Experiment successful: Use System.Type rather that our own
26659         version of Type.  
26660
26661 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26662
26663         * cs-parser.jay: Removed nsAliases from here.
26664
26665         Use new namespaces, handle `using XXX;' 
26666
26667         * namespace.cs: Reimplemented namespace handling, use a recursive
26668         definition of the class.  Now we can keep track of using clauses
26669         and catch invalid using clauses.
26670
26671 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26672
26673         * gen-treedump.cs: Adapted for all the renaming.
26674
26675         * expression.cs (Expression): this class now has a Type property
26676         which returns an expression Type.
26677
26678         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26679         `Type', as this has a different meaning now in the base
26680
26681 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26682
26683         * interface.cs, class.cs: Removed from all the sources the
26684         references to signature computation, as we can not do method
26685         signature computation during the parsing time, as we are not
26686         trying to solve at that point distinguishing:
26687
26688         class X {
26689                 void a (Blah x) {}
26690                 void a (NS.Blah x) {}
26691         }
26692
26693         Which depending on the context might be valid or not, as we do not
26694         know if Blah is the same thing as NS.Blah at that point.
26695
26696         * Redid everything so the code uses TypeRefs now instead of
26697         Types.  TypeRefs are just temporary type placeholders, that need
26698         to be resolved.  They initially have a pointer to a string and the
26699         current scope in which they are used.  This is used later by the
26700         compiler to resolve the reference to an actual Type. 
26701
26702         * DeclSpace is no longer a CIR.Type, and neither are
26703         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26704         are all DeclSpaces, but no Types. 
26705
26706         * type.cs (TypeRefManager): This implements the TypeRef manager,
26707         which keeps track of all the types that need to be resolved after
26708         the parsing has finished. 
26709
26710 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26711
26712         * ARGH.  We are going to have to store `foreach' as a class rather
26713         than resolving it, as we need to verify error 1579 after name
26714         resolution.   *OR* we could keep a flag that says `This request to
26715         IEnumerator comes from a foreach statement' which we can then use
26716         to generate the error.
26717
26718 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26719
26720         * class.cs (TypeContainer.AddMethod): we now add methods to the
26721         MethodGroup instead of the method hashtable.  
26722
26723         * expression.cs: Add MethodGroup abstraction, which gets us one
26724         step closer to the specification in the way we handle method
26725         declarations.  
26726
26727         * cs-parser.jay (primary_expression): qualified_identifier now
26728         tried to match up an identifier to a local variable reference or
26729         to a parameter reference.
26730
26731         current_local_parameters is now a parser global variable that
26732         points to the current parameters for the block, used during name
26733         lookup.
26734
26735         (property_declaration): Now creates an implicit `value' argument to
26736         the set accessor.
26737
26738 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26739
26740         * parameter.cs: Do not use `param' arguments as part of the
26741         signature, per the spec.
26742
26743 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26744
26745         * decl.cs: Base class for classes, structs and interfaces.  This
26746         is the "Declaration Space" 
26747
26748         * cs-parser.jay: Use CheckDef for checking declaration errors
26749         instead of having one on each function.
26750
26751         * class.cs: Factor out some code for handling error handling in
26752         accordance to the "Declarations" section in the "Basic Concepts"
26753         chapter in the ECMA C# spec.
26754
26755         * interface.cs: Make all interface member classes derive from
26756         InterfaceMemberBase.
26757
26758 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26759
26760         * Many things: all interfaces are parsed and generated in
26761         gen-treedump.  Support for member variables, constructors,
26762         destructors, properties, constants is there.
26763
26764         Beginning of the IL backend, but very little done, just there for
26765         testing purposes. 
26766
26767 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26768
26769         * cs-parser.jay: Fix labeled statement.
26770
26771         * cs-tokenizer.cs (escape): Escape " and ' always.
26772         ref_line, ref_name: keep track of the line/filename as instructed
26773         by #line by the compiler.
26774         Parse #line.
26775
26776 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26777
26778         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26779         to match the values in System.CodeDOM.
26780
26781         Divid renamed to Divide.
26782
26783         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26784         statements. 
26785         (Statements.set): remove.
26786
26787         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26788         statements. 
26789
26790         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26791         falseStatements always have valid values. 
26792
26793         * cs-parser.jay: Use System.CodeDOM now.
26794