2007-08-08 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2007-08-08  Marek Safar  <marek.safar@gmail.com>
2
3         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4         
5 2007-08-07  Miguel de Icaza  <miguel@novell.com>
6
7         * expression.cs: Fix the previous commit, the creation of the
8         arguments array list needs also to be conditional on the arguments
9         not being null.
10
11         * class.cs: Add a little bit of help to help narrow down problems.
12
13         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
14         not try to copy in that case. 
15
16         * driver.cs: When building SMCS, include a new different set of
17         default assemblies here.   Do this here so we can control whether
18         to include the default assemblies with /noconfig.
19
20 2007-08-03  Marek Safar  <marek.safar@gmail.com>
21
22         A fix for bug #81979
23         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
24         only.
25
26 2007-08-03  Marek Safar  <marek.safar@gmail.com>
27
28         A fix for bug #82300
29
30         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
31         we are in probing scope.
32
33 2007-08-03  Marek Safar  <marek.safar@gmail.com>
34
35         A fix for bug #82301
36
37         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
38         (Statement.CloneTo): Clone and not map children blocks.
39
40 2007-08-03  Marek Safar  <marek.safar@gmail.com>
41
42         A fix for bug #82299
43
44         * expression.cs (LocalVariableReference.CloneTo): Remap local info
45         variable too.
46         
47         * statement.cs (Statement.CloneTo): Clone variables before statements
48         to allow remaping of local variables.
49
50 2007-08-03  Marek Safar  <marek.safar@gmail.com>
51
52         A fix for bug #82296
53
54         * anonymous.cs,
55         * report.cs: Log crash details for future clone problems.
56         
57         * statement.cs (Return.Clone): Don't clone non-existent expression.
58
59 2007-08-03  Raja R Harinath  <harinath@gmail.com>
60
61         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
62         (Class.AddBasesForPart): Move CS0537 check here from ...
63         * cs-parser.jay (class_declaration): ... here.  Move calling of
64         'AddBasesForPart' to ...
65         (class_bases): ... here.
66         (struct_declaration, interface_declaration): Update to changes.
67
68 2007-08-02  Marek Safar  <marek.safar@gmail.com>
69
70         A fix for bug #81923
71
72         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
73         conversion is allowed.
74
75 2007-08-02  Marek Safar  <marek.safar@gmail.com>
76
77         A fix for bug #81564
78
79         * ecore.cs (EventExpr): Add IsBase handling.
80
81         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
82         too.    
83         
84 2007-08-02  Raja R Harinath  <harinath@gmail.com>
85
86         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
87         * cs-parser.jay: Some whitespace cleanups.
88         (current_delegate): New.
89         (type_name): New.
90         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
91         a dummy code block, and use 'type_name' instead of 'member_name'.
92         (interface_declaration, class_declaration): Likewise.
93         (delegate_declaration): Likewise.  Rearrange slightly and use
94         'current_delegate'.
95         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
96         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
97
98 2007-08-02  Marek Safar  <marek.safar@gmail.com>
99
100         A fix for bug #82039
101
102         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
103         available.
104
105         * typemanager.cs (CSharpName): Split to string overload.
106
107 2007-08-02  Marek Safar  <marek.safar@gmail.com>
108
109         * expression.cs,
110         * report.cs: Updated warning CS0472.
111
112 2007-08-01  Marek Safar  <marek.safar@gmail.com>
113
114         A fix for bug #82181
115         * cs-parser.jay,
116         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
117
118 2007-08-01  Marek Safar  <marek.safar@gmail.com>
119
120         A fix for bug #82277
121         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
122
123 2007-08-01  Marek Safar  <marek.safar@gmail.com>
124
125         ** C# 3.0 Type Inference (major bits are working)
126         
127         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
128         (.ImplicitStandardConversionExists): Uses compatible.
129         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
130         (.InferReturnType): New method.
131         (.Compatible): Refactored.
132         (.ResolveParameters): Uses factory to create resolved parameters.
133         (.CompatibleMethod): Add probing mode support.
134         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
135         clearly distinguish between 2 different operations.
136         (LambdaMethod): Moved to lambda.cs.
137         (AnonymousMethod): Removed unused fields and methods.
138         (AnonymousDelegate): Simplified.
139         
140         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
141         
142         * convert. cs (ImplicitConversionStandard): Compatible works differently.
143         
144         * delegate.cs (Delegate): New mehods to reduce code duplication.
145         (.GetConstructor): New method.
146         (.GetInvokeMethod): New method.
147         (DelegateCreation): Updated.
148         
149         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
150         does not exist.
151         (OverloadResolve): Made probing little bit faster.
152         
153         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
154         when probing is on.
155         
156         * generic.cs (TypeInferenceContext): Dummy implementation.
157         
158         * iterators.cs: Updated after Resolve/Define rename.
159         
160         * lambda.cs (LambdaExpression)
161         (.ResolveParameters): Handles both type of arguments and type inference too.
162         
163         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
164         (InflateTypes): Updated.
165         
166         * support.cs (InflateTypes): Changed signature and updated.
167         
168         * typemanager.cs (LookupMemberCache): Better dynamic type check.
169         (MemberLookup_FindMembers): More MS tricks.
170         (GetParameterData): Ditto.
171         (GetDelegateParameters): Uses quick path for dynamic types.
172         
173 2007-08-01  Marek Safar  <marek.safar@gmail.com>
174
175         * class.cs (MethodData.Define): EmitContext is required for generic stuff
176         only.
177
178 2007-07-31  Marek Safar  <marek.safar@gmail.com>
179
180         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
181         syntax.
182         
183 2007-07-26  Jb Evain  <jbevain@novell.com>
184
185         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
186         which takes a boolean 'report_errors', similar to the GetMethod.
187         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
188         in .net 2.1, do not report errors here.
189
190         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
191         System.Runtime.CompilerServices.RequiredAttributeAttribute and
192         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
193         in .net 2.1.
194
195         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
196         of the type InternalsVisibleToAttribute before the first call
197         to CoreLookupType which is allowed to fail (third boolean parameter
198         to true). Because, during the resolution for a type that is not
199         immediately found, we try to check if the type is not defined in
200         a friend assembly, and to do so, we need the
201         InternalVisibleToAttribute.
202
203 2007-07-23  Miguel de Icaza  <miguel@novell.com>
204
205         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
206         feature that allows structs to be compared against null and inline
207         the result as true or false.
208
209         Notice that the same code is not permitted inside a generic block
210         of code that would do:
211
212         class Foo<T> where T : struct {
213             bool Eval (T x)
214             {
215                  return x == null;
216             }
217         }
218
219         It is only allowed if the type of T is not bound (no where
220         clause).   In my opinion, this CSC 2 behavior is broken but people
221         seem to be using it (IronRuby does, a few bug reports on bugzilla
222         have it and some people have complained about it).
223
224         All of the users that depend on this behavior have code that is
225         very likely broken. 
226         
227         * report.cs (Warning, Error): make these take object arguments,
228         not strings, as that allows us to take advantage of Format.
229
230 2007-07-20  William Holmes  <billholmes54@gmail.com>
231
232         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
233           Left member variable for the Count.
234         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
235           MemberName.CountTypeArguments to avoid a NRE. 
236
237         This code is contributed under the MIT X11 license
238
239 2007-07-18  Marek Safar  <marek.safar@gmail.com>
240
241         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
242
243 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
244
245         * doc.cs : generic method arguments are written as ``x while generic
246           type arguments are `x. Combined with the previous change, fixed bug
247           #79706.
248
249 2007-07-18  Raja R Harinath  <rharinath@novell.com>
250
251         Fix #82120
252         * expression.cs (Binary.ResolveOperator): When converting
253         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
254
255 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
256
257         * doc.cs : when T: or whatever x: is specified, it does not really
258           check the doc comment's syntax correctness. Fixed bug #82006.
259
260 2007-07-18  Marek Safar  <marek.safar@gmail.com>
261
262         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
263         LambdaExpression better.
264         
265         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
266         
267         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
268         
269         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
270         as it can be generated.
271         
272         * expression.cs (Invocation.Error_InvalidArguments): Show correct
273         modifiers.
274         
275         * lambda.cs (LambdaExpression): Refactored to share same code with
276         AnonymousMethodExpression.
277         
278 2007-07-17  Marek Safar  <marek.safar@gmail.com>
279
280         * anonymous.cs (MakeName): Include host name for easier debugging.
281         (LambdaMethod): New class for lambda spcecific stuff.
282         
283         * attribute.cs: Set EmitContext return type.
284
285         * class.cs: Set EmitContext return type.
286         
287         * codegen.cs (EmitContext): Return type cannot be null to stop messing
288         with null/void meaning.
289         
290         * iterators.cs (ContainerType): Implemented.
291         
292         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
293         
294         * statement.cs (Return): Updated to lambda expressions.
295         (Block.CloneTo): Parent can be null.
296                 
297 2007-07-13  Marek Safar  <marek.safar@gmail.com>
298
299         A fix for bug #81917
300         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
301         
302         * class.cs (FixedField): Check whether field is in unsafe scope.
303
304         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
305         (FieldExpr.Emit): Fixed buffers cannot be volatile.
306
307         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
308         FieldExpr.
309         
310         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
311                 
312 2007-07-13  Marek Safar  <marek.safar@gmail.com>
313
314         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
315         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
316         from Report class.
317
318 2007-07-13  Marek Safar  <marek.safar@gmail.com>
319
320         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
321         
322 2007-07-13  Marek Safar  <marek.safar@gmail.com>
323
324         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
325         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
326         
327         * codegen.cs(EmitContext): Add ProbingMode flag.
328         
329         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
330         
331         * driver.cs: For now set both warning values.
332         
333         * ecore.cs (SimpleName): Name is readonly.
334         (MethodGroup.OverloadResolve): One quick path for probing.
335         
336         * expression.cs (Unary): Set Oper r/o.
337         (Binary): Set Oper r/o.
338         (ParameterReference): Set few instance variables as r/o.
339         (ParameterReference.DoResolveBase): Don't capture aruments when 
340         the probing is on.
341         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
342         (Arglist): arguments are private.
343         (SizeOf): type is private and r/o.
344         (MemberAccess): arguments are private.
345
346         * report.cs: Enhanced reporting on/off capabilities.
347         
348         * lambda.cs: Uses ec.IsInProbingMode.
349         (ContextualReturn): Derives from return.
350         
351         * rootcontext.cs: For now set both warning values.
352         
353         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
354         copy if one exists.
355         (Return.Resolve): Don't die immediately.
356         (Block.Resolve): Speed-up probing.
357         (Block.CloneTo): Clone only child blocks.
358
359 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
360
361         * iterators.cs: reverted Miguel's latest change (r81925) as it
362         breaks the build in System.
363
364 2007-07-13  Miguel de Icaza  <miguel@novell.com>
365
366         * iterators.cs (Yield.CheckContext): Check for the iterator type
367         also here as we can call into Yield even in codepaths that are not
368         directly checked by
369         (MethodOrOperator is the only path that was checked).
370
371         In addition to the standard check, use a more specific check for
372         constructors to report a more verbose error. 
373
374 2007-07-12  Miguel de Icaza  <miguel@novell.com>
375
376         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
377         report the warning and continue 
378
379         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
380         values on the stack on the call to Emit.   Use EmitStatement if
381         possible, or using Emit + Pop if not possible.   Fixes #82064
382
383 2007-07-12  Raja R Harinath  <rharinath@novell.com>
384
385         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
386         avoid try...finally in some cases.
387
388 2007-07-10  Marek Safar  <marek.safar@gmail.com>
389
390         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
391         
392         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
393         instead of method. Re-use standard error handling.
394         (ConstructorInitializer.Emit): Simplified.
395         
396         * delegate.cs: Updated after Invocation.EmitCall change.
397         
398         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
399         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
400         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
401         method and don't permanently changing input arguments.
402         (MethodGroupExpr): Introduced resolved best_candidate, when method group
403         is resolved it has one of the candidates is the best one which is later
404         used to emit. Removed a few unused method.
405         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
406
407         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
408         (Binary.ResolveOperator): Ditto.
409         (ConditionalLogicalOperator.DoResolve): Ditto.
410         (Invocation): Uses method group.
411         (Invocation.DoResolve): Simplified.
412         (Invocation.EmitCall): Removed useless is_static.
413         (Invocation.Emit): Delegate to method group.
414         (Invocation.EmitStatement): Simplified.
415         (New): Uses method group.
416         (MemberAccess.DoResolve): Don't destroy original expression.
417         
418         * statement.cs (ForEach.Resolve): Use null for no method arguments.
419         
420 2007-07-04  Marek Safar  <marek.safar@gmail.com>
421
422         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
423         
424         * anonymous.cs,
425         * lambda.cs: Add custom error message type.
426
427 2007-07-03  Marek Safar  <marek.safar@gmail.com>
428
429         * lambda.cs: Simplified little bit.
430         
431         * parameter.cs: Introduced ImplicitLambdaParameter.
432         (Parameters.CreateFullyResolved): New factory instead of ctor.
433         
434         * anonymous.cs,
435         * class.cs,
436         * delegate.cs: Updated parameter creation.
437         
438 2007-07-03  Marek Safar  <marek.safar@gmail.com>
439
440         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
441         arguments.
442         
443         * generic.cs: Synchronized with gmcs.
444         
445 2007-07-03  Marek Safar  <marek.safar@gmail.com>
446
447         * class.cs (Indexer): Check return type as soon as possible.
448         
449         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
450         members too.
451         
452         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
453         
454         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
455         
456         * parameter.cs (Parameter): Use expression type when it is available.
457         
458         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
459         method modifier for the first parameter only.
460
461 2007-06-24  Marek Safar  <marek.safar@gmail.com>
462
463         A fix for bug #81938
464         * typemanager.cs (ChangeType): Fixed couple of char conversions.
465         
466         * constant.cs: Tide up an exception message.
467
468 2007-06-22  Marek Safar  <marek.safar@gmail.com>
469
470         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
471         an uninitialized variable is used.
472         
473         * expression.cs (LocalVariableReference.DoResolve): Ditto.
474
475 2007-06-22  Marek Safar  <marek.safar@gmail.com>
476
477         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
478         not found error handling.
479
480         * expression.cs (ArrayCreation): Removed redundant fields and little bit
481         simplified.
482         (ArrayCreation.ResolveArrayElement): To be ready to customization.
483         (ArrayCreation.DoResolve): Simplified.
484         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
485         its own resolve process.
486         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
487
488 2007-06-20  Marek Safar  <marek.safar@gmail.com>
489
490         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
491         more error details.
492         
493 2007-06-20  Marek Safar  <marek.safar@gmail.com>
494
495         * cs-tokenizer.cs: Removed var related stuff.
496         
497         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
498         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
499         a type and a keyword at same time.
500         
501         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
502         matches to "var".
503         
504         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
505         implicitly typed arrays, more changes will follow.
506         
507         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
508         
509 2007-06-19  Marek Safar  <marek.safar@gmail.com>
510
511         * ecore.cs (VarExpr): Removed Handled field.
512         
513         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
514         build-in assign functionality.
515         (ForEach.Resolve): Removed all implicitly typed local variable code and
516         simplified.
517         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
518         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
519
520 2007-06-18  Marek Safar  <marek.safar@gmail.com>
521
522         * assign.cs: Removed implicitly typed local variable check.
523         
524         * expression.cs (LocalVariableReference.DoResolve): Add check for self
525         referencing implicitly typed local variable.
526         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
527         variable here.
528         
529         * statement.cs (Fixed): Removed unsupported implicitly typed local
530         variable code.
531
532 2007-06-15  Marek Safar  <marek.safar@gmail.com>
533
534         * decl.cs (MemberName): Moved all Unbound stuff to parser.
535
536 2007-06-14  Marek Safar  <marek.safar@gmail.com>
537
538         A fix for bugs #81855 and #76274
539         * attribute.cs (AttachTo): Always set owner for global attributes to
540         prefined owner.
541         
542         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
543         usefull too.
544         
545         * cs-parser.jay: Assembly and module attributes must precede all other
546         elements except using clauses and extern alias declarations.
547
548 2007-06-13  Marek Safar  <marek.safar@gmail.com>
549
550         A fix for bug #81748
551         * cs-tokenizer.cs,
552         * expression.cs: More checks for non ISO-1 features.
553
554 2007-06-12  Marek Safar  <marek.safar@gmail.com>
555
556         A fix for bug #81807
557         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
558         present inside switch statement and it is required by nullable check.
559
560 2007-06-12  Marek Safar  <marek.safar@gmail.com>
561
562         A fix for bug #81840
563         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
564         when type matching fails.
565         
566         * namespace.cs: Tiny error message change.
567
568 2007-06-12  Marek Safar  <marek.safar@gmail.com>
569
570         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
571         reporting. Added automatic property check.
572         
573         * class.cs: Updated after CheckAbstractAndExtern relocation.
574         (AEventPropertyAccessor.GetSignatureForError): Customized.
575         
576 2007-06-11  Marek Safar  <marek.safar@gmail.com>
577
578         * class.cs (DefineBaseTypes): Base type can be undefined.
579         
580         * ecore.cs (TypeLookup): Minor refactoring.
581         (DoResolveAsTypeStep): Removed redundant check.
582
583         * namespace.cs (Lookup): Removed redundant check.
584                 
585         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
586         ResolveAsTypeTerminal step.
587         (BootstrapCorlib_*): Simplified.
588         (PopulateCoreType): Core types can be now external.
589
590 2007-06-07  Marek Safar  <marek.safar@gmail.com>
591
592         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
593          verification only.
594          (InferTypeArguments): Infers anonymous expression type arguments.
595          (Compatible): Split to Compatible and InferTypeArguments. 
596         
597         * lambda.cs: Updated.
598
599 2007-06-08  Marek Safar  <marek.safar@gmail.com>
600
601         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
602
603 2007-06-07  Raja R Harinath  <harinath@gmail.com>
604
605         Fix #80477, cs0135-2.cs, cs0135-3.cs
606         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
607         names to the "known" variables list.
608         (Block.CheckInvariantMeaningInBlock): Handle the fact the
609         parameter names are also "known".
610         (Block.CheckError136): Remove.
611         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
612         null.
613
614 2007-06-07  Marek Safar  <marek.safar@gmail.com>
615
616         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
617
618 2007-06-06  Marek Safar  <marek.safar@gmail.com>
619
620         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
621         internal error not an user error.
622          
623         * expression.cs (IsApplicable): Refactored to make debugging easier.
624
625         * support.cs: More tricks for non-mono runtimes.
626         
627         * typemanager.cs (CoreLookupType): Made public.
628         (InitSystemCore): All linq specific stuff moved to linq.cs
629
630 2007-06-05  Marek Safar  <marek.safar@gmail.com>
631
632         * typemanager.cs (CSharpSignature): One more missing build-in types
633         replacement.
634         More tricks for non-mono runtime.
635
636 2007-06-05  Raja R Harinath  <harinath@gmail.com>
637
638         * statement.cs (Block.CheckError136_InParents): Remove.
639         (Block.AddVariable): Use GetParameterInfo instead.
640         (ToplevelBlock.ProcessArguments): Likewise.
641
642 2007-06-04  Raja R Harinath  <rharinath@novell.com>
643
644         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
645         information too.
646         (ToplevelBlock.GetParameterInfo): Split out of ...
647         (ToplevelBlock.GetParameterRefernce): ... this.
648         (ToplevelBlock.ParameterMap): Remove.
649         * expression.cs (ParameterReference): Update to use
650         ToplevelParameterInfo.
651
652         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
653         regression.
654
655         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
656         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
657
658         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
659         (ToplevelBlock.ProcessParameters) ... here.
660         (ToplevelBlock..ctor): Invoke it.
661
662         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
663         new parameters.
664
665         * statement.cs (IKnownVariable): New interface.
666         (LocalInfo): Implement it.
667         (ToplevelParameterInfo): New class.
668         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
669         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
670         GetKnownVariableInfo.
671
672 2007-06-03  Raja R Harinath  <harinath@gmail.com>
673
674         Partly speed up CS0136 error checks.
675         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
676         'recurse' parameter.
677         (Block.DoCheckError136): Only check errors in parameters.  Move
678         local variable checks ...
679         (Block.AddVariable): ... here, and ...
680         (ToplevelBlock.ResolveMeta): ... here.
681
682 2007-06-02  Raja R Harinath  <harinath@gmail.com>
683
684         * statement.cs (Block.IsChildOf): Remove.
685
686         * statement.cs (Statement.Clone): Move special case code ...
687         (Block.CloneTo): ... here.
688
689 2007-05-29  Raja R Harinath  <rharinath@novell.com>
690
691         * statement.cs (ToplevelBlock.container): Remove field.  It's
692         redundant with 'Parent'.
693         (ToplevelBlock.ContainerBlock): Remove accessor.
694         (ToplevelBlock..ctor): Update to changes.  Register anonymous
695         child with parent here, ...
696         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
697         current_block.
698         (start_anonymous): Don't save current_block.
699         (top_current_block): Remove.
700
701         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
702         (Block.Resolve): Update to changes.
703         (Block..ctor): Move setting of "correct" 'Toplevel'
704         and 'Explicit' fields to ...
705         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
706
707 2007-05-27  Raja R Harinath  <harinath@gmail.com>
708
709         Kill Block.Implicit
710         * statement.cs (Block.Implicit): Remove.
711         (Block): Update to changes.
712         * flowanalysis.cs: Likewise.
713
714         Mildly speed up CheckInvariantMeaningInBlock
715         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
716         Recursively call AddKnownVariable to all enclosing blocks.
717         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
718         Remove recursive calls.
719         (Block): Update to changes.
720
721         New ExplicitBlock invariants
722         * statement.cs (Block.Explicit): New field.  It points to the
723         immediately enclosing non-implicit block.
724         (Block..ctor): Maintain the invariant.
725         * cs-parser.jay: Take advantage of invariant.
726
727         Introduce ExplicitBlock
728         * statement.cs (ExplicitBlock): New.
729         (ToplevelBlock): Derive from it.
730         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
731         sense of flag.
732         (Block.Implicit): Update to changes.
733         * cs-parser.jay: Update to changes.
734
735         Remove unused field
736         * codegen.cs (EmitContext.IsLastStatement): Remove.
737         * statement.cs (Block.DoEmit): Update to changes.
738
739 2007-05-25  Raja R Harinath  <rharinath@novell.com>
740
741         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
742         modifying current_block directly.
743
744 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
745         
746         * class.cs: Implemented automatic properties (C# 3.0)
747           Thanks to Marek for the help.
748
749 2007-05-23  Raja R Harinath  <rharinath@novell.com>
750
751         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
752         variable as assigned, note also that all its components are
753         assigned too.
754         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
755
756 2007-05-19  Marek Safar  <marek.safar@gmail.com>
757
758         * anonymous.cs, class.cs: Emit Compiler generated attribute when
759         member is marked as compiler generated.
760         
761         * decl.cs (MemberCore): Refactored ModFlags into property.
762
763         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
764         (Check): Check only accessibility modifiers.
765
766 2007-05-18  Raja R Harinath  <rharinath@novell.com>
767
768         Track all assignable slots in one bit array
769         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
770         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
771         logic from VariableMap constructor here.  Use the same 'offset'
772         variable that's later used for computing offsets of local
773         variables.
774         * flowanalysis.cs (UsageVector.parameters): Remove.
775         (UsageVector): Update to changes.
776         (VariableMap): Remove.
777
778         Avoid creating ParameterMap in every block
779         * statement.cs (Block.ParameterMap): Move ...
780         (ToplevelBlock.ParameterMap): ... here.
781         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
782         only once.
783         * flowanalysis.cs (FlowBranching.param_map): Remove.
784         (FlowBranching.UsageVector): Update to changes.
785         (FlowBranchingToplevel.CheckOutParameters): Likewise.
786
787         * statement.cs (Block.CloneTo): Clone Toplevel field too.
788
789         * expression.cs (ParameterReference): Distinguish between block
790         where parameter was referenced and declared.
791
792 2007-05-18  Marek Safar  <marek.safar@gmail.com>
793
794         * flowanalysis.cs, statement.cs: Put back improved error handling.
795
796 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
797         
798         * assign.cs:
799         * expression.cs:
800           Imporved object and collection initialization (C# 3.0).
801
802 2007-05-15  Marek Safar  <marek.safar@gmail.com>
803
804         A fix for bug #81380
805         * expression.cs (Is.DoResolve): Only value types have constant `is'
806         behaviour.
807
808 2007-05-15  Raja R Harinath  <rharinath@novell.com>
809
810         * statement.cs (ToplevelBlock.child): Remove.
811
812 2007-05-15  Raja R Harinath  <harinath@gmail.com>
813
814         Rationalize ResolveMeta: refactoring
815         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
816         out constant handling code into ...
817         (Block.DoResolveConstants): ... this.
818
819         Rationalize ResolveMeta: kill local_map
820         * statement.cs (Block.local_map, Block.LocalMap): Remove.
821         (Block.AssignableSlots): New.
822         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
823         for locals -- move code from VariableMap here.  Avoid unnecessary
824         allocations.
825         * flowanalysis.cs (FlowBranching.local_map): Remove.
826         (FlowBranching..ctor): Use Block.AssignableSlots.
827         (VariableMap): Remove unused constructors.
828
829 2007-05-11  Raja R Harinath  <rharinath@novell.com>
830
831         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
832
833 2007-05-11  Marek Safar  <marek.safar@gmail.com>
834
835         * typemanager.cs (IsFriendAssembly): Should not be called for building
836         assembly.
837
838 2007-05-09  Marek Safar  <marek.safar@gmail.com>
839
840         * literal.cs (NullConstant): Print null in all cases.
841         
842         * expression.cs (Binary.ResolveOperator): Implemented delegate
843          comparison based on C# 2.0 changes.
844
845 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
846
847         This code is contributed under the MIT X11 license
848         
849         The following enables support for several C# 3.0 language features:
850         
851         * cs-tokenizer.cs: Added support for the "var" keyword.
852         
853         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
854           Added VarExpr class to facilitate type inferencing.
855         
856         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
857           to support anonymous types.
858         
859         * assign.cs: Added support for type inferencing and initialization.
860         
861         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
862         
863         * expression.cs: Added implicit array support to ArrayCreation.
864           Added 5 types and 1 interface:
865           
866           IInitializable                Implementing classes can inject initializing
867                                         statements after object instantiation.
868           
869           Initializer                   Stores data for object initialization.
870           
871           AnonymousType                 An expression for anonymous types.
872           
873           AnonymousTypeParameter        Stores data about an anonymous type's field.
874           
875           NewInitialize                 An expression for object initialization.
876           
877           CollectionInitialize          An expression for collection initialization.
878         
879         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
880           statements.
881
882 2007-05-06  Marek Safar  <marek.safar@gmail.com>
883
884         A fix for bug #81500
885         * cs-tokenizer.cs: Add special handling for coalescing operator.
886
887 2007-05-06  Marek Safar  <marek.safar@gmail.com>
888
889         A fix for bug #81529
890         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
891         its value from base class until it is redefined.
892
893 2007-05-02  Raja R Harinath  <rharinath@novell.com>
894
895         Fix regression in cs0631-3.cs
896         * cs-parser.jay (operator_declarator): Add opt_attributes to error
897         fallback.  Make error fallback catch more cases.
898
899 2007-05-01  Miguel de Icaza  <miguel@novell.com>
900
901         * cs-parser.jay: Allow parameters in operator declarations to have
902         attributes. 
903
904 2007-04-27  Miguel de Icaza  <miguel@novell.com>
905
906         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
907         exists. 
908
909         * lambda.cs (ContextualReturn.Resolve): An expression is valid
910         inside the ContextualReturn, it does not have to be an
911         ExpressionStatement. 
912
913 2007-04-24  Miguel de Icaza  <miguel@novell.com>
914
915         * lambda.cs (ContextualReturn.Resolve): if the return type is not
916         set, set it.
917
918 2007-04-23  Miguel de Icaza  <miguel@novell.com>
919
920         * anonymous.cs (AnonymousContainer): split the virtual Resolve
921         method in two methods: ResolveNoDefine and Resolve.
922
923         ResolveNoDefine will stop just after ResolveTopBlock has been
924         called.   
925
926         Resolve will then continue by creating a method and issuing the
927         call to method.Define ().
928
929         (AnonymousMethod): Split and implement the new Resolve and
930         ResolveNoDefine as well.
931
932         * lambda.cs (LambdaExpression): Split the anonymous method
933         resolution code into a separate routine (CoreCompatibilityTest)
934         from DoCompatibleTest.
935
936         (LambdaExpression.TryBuild): New method, this method tries to
937         build the LambdaExpression with the given set of types to be used
938         as the types for the various parameters of the lambda expression. 
939
940         If the compilation succeed with the given types, the infered type
941         of the Anonymous method is returned, otherwise null is returned.
942
943 2007-04-23  Marek Safar  <marek.safar@gmail.com>
944
945         A fix for bug #81414
946         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
947
948 2007-04-22  Miguel de Icaza  <miguel@novell.com>
949
950         * cs-tokenizer.cs: Change various identifiers here from the
951         camelCasing to the recommended Linux-like style for instance
952         variables from the Coding Guidelines. 
953
954 2007-04-19  Martin Baulig  <martin@ximian.com>
955
956         * convert.cs
957         (Convert.ImplicitReferenceConversionCore): Allow conversions from
958         System.Enum to System.ValueType.
959
960 2007-04-13  Martin Baulig  <martin@ximian.com>
961
962         Rewrote implicit reference conversions.  We need to distinguish
963         between implicit reference conversions (13.1.4) and implicit
964         boxing conversions (13.1.5).
965
966         According to the spec, there's an an implicit conversion
967         "From a one-dimensional array-type S[] to IList<T> and base
968         interfaces of this interface, provided there is an implicit
969         reference conversion from S to T."  Note that this does not
970         include boxing conversions.
971
972         * convert.cs
973         (Convert.ImplicitTypeParameterBoxingConversion): New method.
974         (Convert.ImplicitReferenceConversion): Split into
975         ImplicitReferenceConversionCore() and
976         ImplicitBoxingConversionExist().
977         (Convert.ImplicitReferenceConversionExists): Use the new
978         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
979
980 2007-04-12  Martin Baulig  <martin@ximian.com>
981
982         * convert.cs (Convert.ImplicitReferenceConversion): Move the
983         `TypeManager.null_type' checks up to the top of the method.
984
985 2007-04-11  Marek Safar  <marek.safar@gmail.com>
986
987         A fix for bug #81350
988         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
989         extension methods.
990
991 2007-04-11  Martin Baulig  <martin@ximian.com>
992
993         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
994         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
995         to make this work for generic classes; fixes #79561.
996
997 2007-04-11  Martin Baulig  <martin@ximian.com>
998
999         * expression.cs (As): Add support for nullable types; fixes #79371.
1000
1001 2007-04-11  Martin Baulig  <martin@ximian.com>
1002
1003         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
1004         `type.FullName' is null; fixes #80243.
1005
1006 2007-04-11  Martin Baulig  <martin@ximian.com>
1007
1008         * expression.cs (Invocation.IsApplicable): Don't modify the method
1009         if type inference succeeded, but the method was not applicable.
1010         Fixes #81250.
1011
1012 2007-04-10  Marek Safar  <marek.safar@gmail.com>
1013
1014         A fix for bug #81324
1015         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
1016         internal and external namespaces containers.
1017
1018 2007-04-10  Martin Baulig  <martin@ximian.com>
1019
1020         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
1021         TypeManager.DropGenericMethodArguments() so we also call
1022         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
1023
1024 2007-04-10  Martin Baulig  <martin@ximian.com>
1025
1026         * iterators.cs (Iterator.CreateIterator): Don't crash if
1027         `method.ReturnType' is null.  This happens if something went wrong
1028         while resolving that typ (we already reported an error in this case).
1029
1030 2007-04-10  Martin Baulig  <martin@ximian.com>
1031
1032         * expression.cs (New.DoResolve): Don't call CheckComImport() on
1033         generic interfaces; report the CS0144 directly.
1034
1035 2007-04-10  Martin Baulig  <martin@ximian.com>
1036
1037         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
1038         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
1039
1040 2007-04-10  Martin Baulig  <martin@ximian.com>
1041
1042         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
1043
1044 2007-04-09  Raja R Harinath  <rharinath@novell.com>
1045
1046         A better fix
1047         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
1048         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
1049
1050         Fix #81338
1051         * statement.cs (For.Resolve): If resolution fails, use
1052         KillFlowBranching.
1053
1054 2007-04-08  Marek Safar  <marek.safar@gmail.com>
1055
1056         * anonymous.cs (MakeName): Make faster and zero-based.
1057         (VerifyExplicitParameterCompatibility): Back to mode where generic
1058         parameter is ignored.
1059         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
1060
1061         * class.cs (EmitType): Method can emit another new method.
1062
1063         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
1064
1065         * driver.cs: Updated.
1066
1067         * lambda.cs: Reuse predefined empty parameters.
1068
1069         * parameter.cs: Updated
1070
1071         * support.cs: Implemented InflateTypes.
1072
1073         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
1074         (InitSystemCore): Introduced to isolate 3.0 dependencies.
1075
1076 2007-04-03  Martin Baulig  <martin@ximian.com>
1077
1078         Fix #80632.
1079
1080         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
1081         version of TypeManager.IsOverride() which also works with generic
1082         types.  
1083
1084 2007-04-03  Martin Baulig  <martin@ximian.com>
1085
1086         Fix #81044.
1087
1088         * convert.cs
1089         (Convert.ExplicitReferenceConversion): We need to cast when
1090         converting from IList<T> to S[].
1091
1092 2007-04-01  Marek Safar  <marek.safar@gmail.com>
1093
1094         * decl.cs (FindExtensionMethods): Consider all candidates with same name
1095         at this level.
1096         
1097         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
1098
1099 2007-03-31  Marek Safar  <marek.safar@gmail.com>
1100
1101         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
1102         argument and return type inferring.
1103
1104         * codegen.cs (InferReturnType): Flag whether return can be inferred.
1105         (ReturnType): Turned to property.
1106
1107         * statement.cs (Return): Implemented return type inferring.
1108
1109         * support.cs (ReflectionParameters): Use local types if possible.
1110
1111 2007-03-30  Raja R Harinath  <rharinath@novell.com>
1112
1113         * flowanalysis.cs (FlowBranching.Reachability): Remove.
1114         (FlowBranching.UsageVector): Update to changes.
1115
1116         Prepare to kill 'Reachability'
1117         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
1118         argument of constructor.
1119
1120 2007-03-29  Raja R Harinath  <rharinath@novell.com>
1121
1122         Prepare to kill 'Reachability'
1123         * flowanalysis.cs (UsageVector.is_unreachable): New.
1124         (UsageVector): Update to maintain 'is_unreachable' in parallel to
1125         'reachability', and verify they're consistent.
1126
1127         Fix #81121
1128         * expression.cs (New.EmitStatement): Handle type parameters here too.
1129
1130 2007-03-29  Martin Baulig  <martin@ximian.com>
1131
1132         Fix #79148.
1133
1134         * anonymous.cs
1135         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
1136         CompilerGeneratedClass.
1137         (ScopeInfo.EmitScopeInstance): Make this protected.
1138         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
1139         `ec.CurrentAnonymousMethod.Scope == Scope'.
1140
1141         * statement.cs (Block.ScopeInfo): Make this a property.
1142
1143 2007-03-27  Raja R Harinath  <harinath@gmail.com>
1144
1145         Prepare to kill 'Reachability'
1146         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
1147         (FlowBranching.UsageVector.Reachability): Remove property.
1148         (FlowBranching.UsageVector.IsUnreachable): New property.
1149         (FlowBranching.UsageVector.ResetBarrier): New.
1150         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
1151         * codegen.cs, statement.cs: Update to changes.
1152
1153 2007-03-27  Martin Baulig  <martin@ximian.com>
1154
1155         Fix #81209.
1156
1157         * decl.cs
1158         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
1159         generic types.
1160
1161 2007-03-26  Raja R Harinath  <rharinath@novell.com>
1162
1163         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
1164         instead of TriState.  Remove all mention of TriState.
1165
1166         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
1167         replaced by a boolean.  Add boolean 'is_unreachable' field, check
1168         and maintain invariants.
1169
1170 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1171
1172         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
1173
1174 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1175
1176         * expression.cs: Stop using obsolete 2.0 opcodes.
1177
1178 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1179
1180         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
1181         one of the latests Martin's fixes.
1182
1183 2007-03-23  Miguel de Icaza  <miguel@novell.com>
1184
1185         * expression.cs: On BigEndian systems, swap the bytes, temporary
1186         solution until we get a new bitconverter class.
1187
1188 2007-03-23  Martin Baulig  <martin@ximian.com>
1189
1190         Fix #81158.
1191
1192         * decl.cs (MemberCache.AddMembers): Add generic methods both as
1193         "Method" and "Method`1".  Normally, a cache lookup is done on the
1194         "Method" form (ie. without the generic arity), but this one makes
1195         lookups on the full form work as well.
1196
1197 2007-03-22  Raja R Harinath  <rharinath@novell.com>
1198
1199         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
1200         unused properties.
1201
1202 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
1203         * class.cs: 
1204         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
1205         ordered_member_list, to TypeBuilder to store members to be defined
1206         in the order they were parsed in.
1207         - ordered_explicit_member_list contains all properties indexers
1208           and methods that are defined as explicit implementation of an
1209           interface or base class.
1210         - ordered_member_list contains all properties indexers and methods
1211           that are not defined as explicit implementation of an interface
1212           or base class.
1213
1214         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
1215         functionality in these removed classes has been replaced with 
1216         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
1217         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
1218
1219         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
1220         to CheckForDuplications inside GetMethod and SetMethod Define Method
1221         to handle method property and indexer name conflicts.
1222
1223         Fixes #79434
1224
1225         All code is contributed under the MIT/X11 license.
1226
1227 2007-03-20  Martin Baulig  <martin@ximian.com>
1228
1229         * class.cs (TypeContainer.Interfaces): Removed; they're now
1230         included in `TypeContainer.Types'.
1231
1232 2007-03-20  Martin Baulig  <martin@ximian.com>
1233
1234         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
1235
1236         * class.cs (TypeContainer.CreateType): New public method.  This is
1237         now called before DefineType() to create the TypeBuilders.
1238         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
1239         has already been created by CreateType().
1240         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
1241         don't resolve our base classes here; this has been moved into
1242         DefineBaseTypes().  We're now called from CreateType().
1243         (TypeContainer.DefineBaseTypes): New private method; resolve our
1244         base classes here.  We're now called from DefineType().
1245
1246         * rootcontext.cs
1247         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
1248         our types first to create all the TypeBuilders.  After that, call
1249         TypeContainer.DefineType() on all the types which'll resolve their
1250         base classes and setup the resolve order.
1251
1252 2007-03-20  Martin Baulig  <martin@ximian.com>
1253
1254         * class.cs (TypeContainer.Enums): Removed; they're now included in
1255         `TypeContainer.Types'.  
1256
1257 2007-03-20  Martin Baulig  <martin@ximian.com>
1258
1259         * class.cs
1260         (TypeContainer.DefineType): Don't call ResolveMembers() here.
1261         (TypeContainer.DoResolveMembers): Call DefineType() on our
1262         `compiler_generated' classes; moved here from DefineNestedTypes().
1263
1264         * rootcontext.cs
1265         (RootContext.ResolveTree): Call ResolveMembers() on all
1266         TypeContainer's in the `type_container_resolve_order'.
1267
1268 2007-03-19  Marek Safar  <marek.safar@gmail.com>
1269
1270         * class.cs: Use corlib to handle InternalMethodImplAttribute.
1271
1272 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1273
1274         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
1275         implementation flags.
1276
1277 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1278
1279         * class.cs: More optimizations for type parameters.
1280
1281 2007-03-15  Marek Safar  <marek.safar@gmail.com>
1282
1283         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
1284
1285         * ecore.cs, parameter.cs: More common code for both corlibs.
1286
1287         * typemanager.cs (IsGenericMethod): Simplified.
1288
1289 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1290
1291         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1292         'returns'.
1293         * statement.cs, iterators.cs, lambda.cs: Update to changes.
1294
1295         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
1296         unconditionally.  Simplify explanation.
1297         (Try.Resolve, Using.Resolve): Likewise.
1298
1299 2007-03-15  Martin Baulig  <martin@ximian.com>
1300
1301         Fix #80731.
1302
1303         * decl.cs (DeclSpace): If we're a partial class, use our
1304         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
1305
1306 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1307
1308         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1309         'throws'.
1310         (FlowBranching.UsageVector): Update to changes.
1311         (FlowBranching.MergeSiblings): Likewise.
1312         * statement.cs: Likewise.
1313
1314 2007-03-15  Martin Baulig  <martin@ximian.com>
1315
1316         Fix #79302.
1317
1318         * decl.cs
1319         (MemberCache): Added a special .ctor for type parameters.
1320
1321         * typemanager.cs
1322         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
1323         `MemberCache'.  
1324
1325 2007-03-09  Martin Baulig  <martin@ximian.com>
1326
1327         * enum.cs (Enum): Make this a TypeContainer.
1328         (EnumMember): Derive from `Const'.
1329
1330         * const.cs
1331         (Const.DoResolveValue): New protected virtual method; move most of
1332         the functionality of ResolveValue() here so we can override it in
1333         `EnumMember'.
1334         (Const.CreateConstantReference): Make this virtual.
1335
1336         * class.cs (Kind): Add `Kind.Enum'.
1337         (TypeContainer.Emit): Don't emit the enums here; they're already
1338         in the `RootContext.typecontainer_resolve_order'.
1339
1340         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
1341         here; they're already in the `typecontainer_resolve_order'.
1342
1343         * ecore.cs (EnumConstant.ConvertImplicitly): Add
1344         TypeManager.DropGenericTypeArguments().
1345
1346         * typemanager.cs
1347         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
1348         (TypeManager.IsEnumType): Likewise.
1349         (TypeManager.EnumToUnderlying): Likewise.
1350         (TypeManager.IsEqual): Add support for enums.
1351
1352 2007-03-12  Raja R Harinath  <rharinath@novell.com>
1353
1354         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
1355         DefaultParameterValueAttribute to be undefined, say if System.dll
1356         is not referenced.
1357
1358 2007-03-11  Marek Safar  <marek.safar@gmail.com>
1359
1360         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
1361         any mscorlib.
1362
1363 2007-03-10  Marek Safar  <marek.safar@gmail.com>
1364
1365         * class.cs, parameter.cs: Unified parameters verification.
1366
1367 2007-03-08  Martin Baulig  <martin@ximian.com>
1368
1369         * cs-parser.jay (constructor_header): Pass the location to the
1370         newly created TopLevelBlock.
1371
1372 2007-03-07  Martin Baulig  <martin@ximian.com>
1373
1374         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
1375
1376 2007-03-06  Miguel de Icaza  <miguel@novell.com>
1377
1378         * convert.cs (ExplicitReferenceConversionExists): Sync this method
1379         with the changes from David, fixes the build.
1380
1381 2007-03-05  David Mitchell  <dmitchell@logos.com>
1382
1383         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
1384         and its base interfaces to a one-dimensional array type S[],
1385         provided there is an implicit or explicit reference conversion
1386         from S to T.
1387
1388 2007-03-03  Marek Safar  <marek.safar@gmail.com>
1389
1390         * cs-tokenizer.cs: Implemented basic linq grammar.
1391
1392         * driver.cs: Set linq lang version on demand.
1393
1394 2007-02-26  Marek Safar  <marek.safar@gmail.com>
1395
1396         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
1397
1398 2007-02-25  Marek Safar  <marek.safar@gmail.com>
1399
1400         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
1401         (Fixes #80455)
1402
1403         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
1404         here.
1405         Check property and event extern attributes.
1406
1407         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
1408         charset.
1409
1410 2007-02-24  Marek Safar  <marek.safar@gmail.com>
1411
1412         A fix for bug #80407
1413         * ecore.cs: Don't report ambiguity error when methods have same parent.
1414
1415 2007-02-23  Marek Safar  <marek.safar@gmail.com>
1416
1417         A fix for bug #80878
1418         * class.cs, cs-parser.jay: Event property can host anonymous methods.
1419
1420 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1421
1422         * attribute.cs: Enable ExtensionAttribute presence test.
1423
1424 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1425
1426         * class.cs: Warn about missing GetHashCode only when Equals is override.
1427
1428         * decl.cs: Check accessibility of type arguments.
1429
1430         * typemanager.cs: Correctly report nullable array.
1431
1432 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1433
1434         * class.cs, report.cs: Capture more details when things go wrong.
1435
1436 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1437
1438         A fix for bug #80650
1439         * cs-parser.jay: Anonymous container starts at constructor declaration
1440         and not at block beginning because it has to be usable in constructor
1441         initializer.
1442
1443         * statement.cs: Use context location and not block one for error reporting.
1444
1445 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1446
1447         A fix for bug #78712
1448         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
1449         too.
1450
1451 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1452
1453         A fix for bug #80493 by Atsushi Enomoto
1454         * cs-parser.jay: Ignore invalid attribute target.
1455
1456 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1457  
1458         * cs-tokenizer.cs: Ignore '\0' as white space character.
1459
1460 2007-02-17  Miguel de Icaza  <miguel@novell.com>
1461
1462         * cs-parser.jay: Add support for lambda expressions to the mcs
1463         compiler as well.
1464
1465         * lambda.cs: Only clone when we are probing, not on the final call
1466         (Compatible is the final call). 
1467
1468         * statement.cs (CloneContext): Introduce class to provide block
1469         remapping during clone.
1470
1471         All statements Clone themselves now.
1472
1473         (Clone): special handling for blocks, when we clone a block, we
1474         register the block inside this routine, as children of the block
1475         might trigger a lookup. 
1476         
1477         * expression.cs: Add support for CloneContext in all expressions. 
1478         
1479 2007-02-17  Marek Safar  <marek.safar@gmail.com>
1480  
1481         A fix for bug #80493
1482         * statement.cs: Report ambiguous warning when interfaces are not related.
1483
1484 2007-02-15  Marek Safar  <marek.safar@gmail.com>
1485
1486         C# 3.0 extension methods.
1487
1488         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
1489         cannot be used directly.
1490
1491         * class.cs (Class.Emit): Emit extension attribute if any class method
1492         is extension method.
1493         (Method.Define): Add basic extension method validation conditions.
1494         (Method.Emit): Emit extension attribute for method.
1495
1496         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
1497         extension method exists. Currently we follow same approach as Microsoft
1498         does, emit even if a method or a class are private but this can change
1499         later.
1500
1501         * cs-parser.jay: Add handling of `this' keyword in method parameters
1502         context.
1503
1504         * decl.cs (DeclSpace.IsStaticClass): New property.
1505         (MemberCache.FindExtensionMethods): Looks for extension methods with
1506         defined name and extension type.
1507
1508         * doc.cs: Updated after OverloadResolve changes.
1509
1510         * driver.cs: Add new soft reference to System.Core.dll.
1511
1512         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
1513         (ExtensionMethodGroupExpr): Represents group of extension methods.
1514
1515         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
1516         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
1517         to MethodGroupExpr and made non-static for easier customization.
1518         (Invocation.DoResolve): Add extension method lookup when no standard
1519         method was found.
1520         (MemberAccess.DoResolve): Try extension methods if no member exists.
1521
1522         * modifiers.cs: Add METHOD_EXTENSION modifier.
1523
1524         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
1525         as well as candidate extension type.
1526         (ComputeNamespaces): When assembly constains extension methods registers
1527         them.
1528         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
1529         extension method lookup.
1530         (Namespace.LookupExtensionMethod): Looks for extension method in this
1531         namespace.
1532         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
1533         find a method which matches name and extensionType.
1534
1535         * parameter.cs (Parameter): Add This modifer.
1536         (HasExtensionMethodModifier): New property.
1537         (Resolve): Add extension parameter check.
1538         (ModFlags): turned to property to exclude this modifier as it is not real
1539         parameter modifier.
1540         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
1541
1542         * support.cs (ParameterData): Add ExtensionMethodType.
1543         (ReflectionParameters): Implemented ExtensionMethodType interface property.
1544
1545         * typemanager.cs: Add type and ctor extension attribute type.
1546
1547 2007-02-15  Miguel de Icaza  <miguel@novell.com>
1548
1549         * report.cs (DisableErrors, EnableErrors): used to prevent error
1550         output when we are "trying" to compile various methods with
1551         different types. 
1552
1553         * ecore.cs (Expression): Add Clone method that calls the virtual
1554         CloneTo method.  The current CloneTo method in Expression throws
1555         an exception so we can track down all the places where this must
1556         be implemented (not using abstract, because that would be a lot of
1557         up-front-work before we can start testing the implementation
1558         idea). 
1559
1560         Important: we only need Clone capabilities for expressions created
1561         by the parser, as the expressions we will be cloning are
1562         expressions in the pre-resolved state.   This vastly simplifies
1563         the work required. 
1564         
1565         (SimpleName): Add CloneTo that does nothing.
1566         (EmptyCast): Add CloneTo.
1567         
1568         * expression.cs (Binary): Implement CloneTo.
1569         (Invocation.IsApplicable): Store the current ec in
1570         EmitContext.TempEc and restore it on return.  This is used so we
1571         do not have to sprinkle hundres of methods with an extra
1572         EmitContext, we know that the only user is the lambda expression
1573         ImplicitConversionExists code. 
1574         
1575         (Argument): Add Cloning capabilities.
1576         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
1577         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
1578         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
1579         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
1580         IndexerAccess): Add Clone capability.
1581
1582         (LocalVariableReference, This): TODO: needs cloned Block mapping.
1583
1584         (Argument): Add cloning capability.
1585
1586         * assign.cs (Assign): Implement CloneTo.
1587
1588         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
1589         
1590         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
1591         version by calling Convert with the EmitContext (that we are
1592         currently storing in ec, this is not great, but will do for now,
1593         to avoid passing EmitContext parameters to hundreds of functions
1594         that do not need them now).
1595
1596         (SetExpression): Remove, it is not needed.
1597         
1598         (ContextualReturn): Implement CloneTo.
1599
1600         * statement.cs (Statement): Implement cloning infrastructure,
1601         similar to expressions.
1602
1603         (Block): Partial implementation of Clone for statements.
1604
1605         (Return): Implement clone.
1606         
1607         * constant.cs (Constant.CloneTo): New method, does nothing.
1608
1609         * codegen.cs (TempEc): Add a static EmitContext as a temporary
1610         solution, until we decide how to exactly do this.  
1611         
1612 2007-02-14  Marek Safar  <marek.safar@gmail.com>
1613  
1614         A fix for bug #80493
1615         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
1616         a property is override we need to use second accessor.
1617
1618 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1619  
1620         A fix for bug #80418
1621         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1622         methods.
1623
1624 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1625
1626         Another fix for bug #80749
1627         * pending.cs: Abstract class has priority over interfaces.
1628
1629 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1630
1631         Another fix for bug #80749
1632         * pending.cs: Abstract class has priority over interfaces.
1633
1634 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1635
1636         Another fix for bug #80749
1637         * pending.cs: Abstract class has priority over interfaces.
1638
1639 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1640
1641         Another fix for bug #80749
1642         * pending.cs: Abstract class has priority over interfaces.
1643
1644 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1645
1646         * class.cs Better error message.
1647
1648         * driver.cs: Add shorter versions of -optimize option.
1649
1650 2007-02-13  Martin Baulig  <martin@ximian.com>
1651
1652         * class.cs (Constructor.Emit): Check the return value of
1653         ec.ResolveTopBlock() and return on error.
1654
1655 2007-02-13  Raja R Harinath  <rharinath@novell.com>
1656
1657         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1658         message to fix error message regression.
1659
1660 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1661
1662         * delegate.cs: Delegate creation expression cannot be of Nullable type.
1663
1664 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1665
1666         A fix for bug #80749
1667         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1668         its parent container.
1669
1670         * class.cs (DefineFieldInitializers): Each initializer can has different
1671         resolve context.
1672
1673         * const.cs: Updated.
1674
1675 2007-02-11  Miguel de Icaza  <miguel@novell.com>
1676
1677         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1678         now all the heavy lifting to check that embedded statements or
1679         expressions have the right form is done in the ContextualReturn.
1680
1681         (ContextualReturn): New class.  
1682
1683         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1684         method that can be invoked to report 201, so we do not replicate
1685         this everywhere.
1686
1687         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1688         
1689         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1690         treating tabs as spaces. 
1691
1692 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1693
1694         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1695         * assign.cs: Use full implicit conversion for right side check.
1696
1697 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1698
1699         * statement.cs (Switch): Switch over boolean type is not standardized.
1700
1701 2007-02-08  Marek Safar  <marek.safar@gmail.com>
1702
1703         A fix for bug #80755
1704         * decl.cs (FindBaseEvent): Don't use method cache for events.
1705
1706 2007-02-07  Marek Safar  <marek.safar@gmail.com>
1707
1708         * cs-parser.jay: Better syntax error handling.
1709
1710         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1711         instead of underlying type value.
1712
1713 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1714
1715         * driver.cs: Check define identifier before is registered.
1716
1717         * namespace.cs: Use existing error message.
1718
1719         * report.cs: New warning.
1720
1721 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1722
1723         A fix for bug #80742
1724         * expression.cs: Delegate Invoke method can be called directly.
1725
1726 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1727
1728         A fix for bug #80676
1729         * class.cs (IsEntryPoint): The Main method can have params modifier.
1730
1731 2007-02-04  Miguel de Icaza  <miguel@novell.com>
1732
1733         * parameter.cs (Parameter, Parameters): Add Clone method.
1734
1735         * anonymous.cs (Compatible): Turn method into virtual method, so
1736         LambdaExpression can implement a different behavior.
1737
1738         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1739         out the basic checking here, so it can be used by
1740         LambdaExpressions.
1741         
1742         * lambda.cs: Introduce "Compatible" function that will do the
1743         heavy lifting.
1744
1745 2007-02-02  Marek Safar  <marek.safar@gmail.com>
1746
1747         * attribute.cs: Unified one error message.
1748
1749         * class.cs (Class): Use type attributes and not properties to test static
1750         class.
1751         (IsEntryPoint): Don's pass local variable.
1752
1753         * convert.cs: Removed duplicate check.
1754
1755         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1756
1757         * driver.cs: Don't crash when soft reference does not exist.
1758
1759         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1760         (UsingEntry): Removed redundant allocation.
1761
1762         * parameter.cs: Add fast path for type parameters.
1763
1764         * support.cs: Don't allocate attribute when it's not used.
1765
1766 2007-01-30  Miguel de Icaza  <miguel@novell.com>
1767
1768         * anonymous.cs
1769         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1770         this into a virtual method, so we can override it in LambdaExpression.
1771
1772         * driver.cs: Improve diagnostics in case of failure. 
1773
1774         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1775         write a function that is slightly more complex and that parses:
1776
1777         type identifier [, type identifier]* )
1778
1779         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1780         this expression:
1781
1782                 (canEmpty ? i >= 0 : i > 0)
1783
1784 2007-01-30  Raja R Harinath  <rharinath@novell.com>
1785
1786         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1787         exception on possibly valid code.
1788
1789 2007-01-29  Raja R Harinath  <rharinath@novell.com>
1790
1791         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1792         Push/PopPosition.
1793         (parse_opt_type_arguments): Remove.  It's almost the same as
1794         parse_less_than.
1795         (parse_namespace_or_typename): Use parse_less_than.
1796
1797 2007-01-28  Miguel de Icaza  <miguel@novell.com>
1798
1799         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1800         this bug took a few hours to find, because the state saved and
1801         restored by PushPosition and PopPosition was ignoring the state of
1802         parse_generic_less_than.
1803
1804         I can also now remove the handling of OP_LT and OP_GT, this solves
1805         the big mistery.
1806         
1807         * cs-tokenizer.cs: store the location for the ARROW token, we use
1808         that in the parser.
1809
1810         (PushPosition, PopPosition): save/restore also `current_token',
1811         restore `parse_generic_less_than' (was missing).
1812
1813         (parse_opt_type_arguments): use parse_type, not
1814         parse_namespace_or_typename to parse types.
1815
1816         * lambda.cs: Empty new file, will eventually have the lambda
1817         expression implementation.
1818
1819         * lambda.test: used to test the internal tokenizer. 
1820
1821         * report.cs (FeatureIsNotISO1): Rename from
1822         FeatureIsNotStandardized, because it was about the language level
1823         (1 vs 2) it was not about standarization.
1824
1825         (FeatureRequiresLINQ): New.
1826
1827         * support.cs (SeekableStreamReader): Only require that the reader
1828         is a TextReader, not a StreamReader, so we can plug StringReader. 
1829
1830         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1831         given position in the input stream the following tokens can be
1832         parsed as a type followed by an identifier.
1833
1834         (is_punct): after a '(' if parse_type_and_parameter returns true,
1835         then return a special token OPEN_PARENS_LAMBDA which is used to
1836         avoid reduce/reduce errors in the grammar for the
1837         lambda_expression rules.
1838
1839         (parse_type): implement a type parser inside the
1840         tokenizer, the parser only returns true or false depending on
1841         whether the input at a given position can be parsed as a type.
1842
1843         (peek_token): new method used during type parsing.
1844
1845 2007-01-28  Raja R Harinath  <rharinath@novell.com>
1846
1847         Fix #80531
1848         * anonymous.cs (ScopeInfo.InflateParameters): New.
1849         (AnonymousContainer.Resolve): Use it to redirect types of
1850         delegate parameters.
1851
1852 2007-01-27  Raja R Harinath  <rharinath@novell.com>
1853
1854         Fix #80530
1855         * expression.cs (Error_InvalidArguments): Don't use two different
1856         messages for CS1503.  Use ExtraInformation and
1857         SymbolRelatedToPreviousError instead.
1858
1859         Fix #80358
1860         * decl.cs (DeclSpace.initialize_type_params): Don't access
1861         'type_params' of a partial class directly.
1862
1863 2007-01-26  Miguel de Icaza  <miguel@novell.com>
1864
1865         * constant.cs: Removed a handful of out-of-range checks that were
1866         not necessary. 
1867
1868 2007-01-25  Marek Safar  <marek.safar@gmail.com>
1869
1870         * expression.cs (CheckUselessComparison): Add additional check for char
1871         constants.
1872
1873         * namespace.cs: Fixed typo.
1874
1875 2007-01-23  Miguel de Icaza  <miguel@novell.com>
1876
1877         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1878         gone, instead we inline the test, preventing the needless casts to
1879         longs, ulongs and doubles for the parameters, avoiding calls to
1880         methods that overchecked stuff, and instead inlined things
1881         nicely. 
1882
1883 2007-01-20  Marek Safar  <marek.safar@gmail.com>
1884
1885         * cs-parser.jay: Better parameter error handling.
1886
1887 2007-01-17  Marek Safar  <marek.safar@gmail.com>
1888
1889         A fix for bug #80368, #80522
1890         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1891         whether array initializer contains constants only.
1892         (ArrayCreation.Emit): Use better formula to decide when
1893         are array initializers for static initialization.
1894         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1895         have to emit even constants otherwise they are pre-initialized.
1896
1897 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
1898             Raja R Harinath  <rharinath@novell.com>
1899
1900         Fix emit order of 'get' vs. 'set'.
1901         * support.cs (Accessors): New.
1902         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1903         Note the order in which accessors are declared in the source.
1904         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1905         Refactored from Property.Define and Indexer.Define.
1906         (PropertyBase.DefineAccessors): New helper that calls the above in
1907         appropriate order as noted by the parser.
1908         (Property.Define, Indexer.Define): Update to changes.
1909         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1910
1911 2007-01-17  Raja R Harinath  <rharinath@novell.com>
1912
1913         Fix cs0029-6.cs and gcs0029-2.cs (regression)
1914         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1915         there's an implicit conversion from the current type to the target
1916         type before converting the underlying constant.
1917
1918 2007-01-16  Marek Safar  <marek.safar@gmail.com>
1919
1920         * const.cs (ResolveValue): Updated after constant conversion was made more
1921         generic.
1922
1923         * constant.cs (GetAttributableValue): constant to object conversion is
1924         used for attributes only.
1925         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1926         constant conversions.
1927         (LongConstant.ConvertImplicitly): Ditto.
1928
1929         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1930         (ImplicitConversionStandard): Handle constant conversion as extra step.
1931         It solves the issue when constant conversion was called indirectly like
1932         inside array initializer and constant folding was skipped.
1933
1934         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1935         this change.
1936
1937         * statement.cs(ImplicitConversionStandard): Updated after constant
1938         conversion was made more generic.
1939
1940 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
1941
1942         * expression.cs (As.DoResolve): Use GenericConstraints instead of
1943         Constraints, solves the problem where the compiler incorrectly
1944         reported that a type parameter was not constrained to a class (Bug
1945         80518)
1946
1947 2007-01-14  Marek Habersack  <grendello@gmail.com>
1948
1949         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1950
1951 2007-01-14  Marek Safar  <marek.safar@gmail.com>
1952
1953         A fix for bug #80368
1954         * assign.cs (FieldInitializer): New class implements field
1955         initializer statement.
1956
1957         * attribute.cs: Update after FieldMember rename.
1958
1959         * class.cs (PropertyBasedMember): New common class for property based
1960         types.
1961         (InterfaceMemberBase): New base class for all members which can be used as
1962         an interface members.
1963         (MethodCore): Moved really common code to InterfaceMemberBase.
1964         (Method.Define): Equal and GetHasCode detection is relevant for methods
1965         only.
1966         (MethodData.Define): Don't assume that public event implements an
1967         interface automatically.
1968         (MethodData.DefineMethodBuilder): Issue an error even if only extern
1969         modifier is used.
1970         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1971         (FieldMember): Merged with FieldBase.
1972         (EventProperty.AEventPropertyAccessor): New specialization to check whether
1973         event extern modifier can be used.
1974         (EventField.EventFieldAccessor): Moved event field specific code here.
1975         (Event.AllowedModifiers): Even event can be extern.
1976         (Event.FindOutBaseMethod): New override specific to events.
1977         (Indexer.parameters): Reintroduce parameters because base class holds
1978         only properties common data.
1979         (Indexer.CheckForDuplications): Indexers are threated as methods so we
1980         need do extra parameters check.
1981
1982         * const.cs: Update after FieldMember rename.
1983
1984         * decl.cs (MemberCache.FindBaseEvent): New method.
1985
1986         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1987         to reflect that indexer is now derived from PropertyBased.
1988
1989         * ecore.cs (GetMemberType): Made public.
1990         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1991         obsolete event.
1992
1993         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1994         
1995         * typemanager.cs (CSharpSignature): Correctly print event accessors.
1996         (RegisterEvent): Removed.
1997         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1998         (GetPrivateFieldOfEvent): Renamed to GetEventField.
1999
2000 2007-01-11  Raja R Harinath  <rharinath@novell.com>
2001
2002         Fix #80249
2003         * statement.cs (CollectionForeach.TryType): Prefer generic
2004         GetEnumerator over non-generic variant.  Fix code to follow comments.
2005
2006 2007-01-09  Raja R Harinath  <rharinath@novell.com>
2007
2008         Fix #80446
2009         * support.cs (ReflectionParameter): Don't use an invalid index on
2010         the generic parameter data.
2011
2012 2007-01-08  Miguel de Icaza  <miguel@novell.com>
2013
2014         * driver.cs: Just add a tiny bit of infrastructure.
2015
2016 2007-01-02  Marek Safar  <marek.safar@gmail.com>
2017
2018         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
2019         where field type is struct from current assembly.
2020         
2021         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
2022         it is possible.
2023
2024 2007-01-02  Marek Safar  <marek.safar@gmail.com>
2025
2026         A fix for bug #80381
2027         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
2028         the core types.
2029
2030         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
2031         messages.
2032         (Namespace.LookupType): Always use core types from corlib when speficied.
2033
2034         * report.cs: A new warning.
2035
2036         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
2037         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
2038         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
2039
2040         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
2041         (InitCoreTypes): Set expression type of object_type and value_type
2042         immediately after lookup.
2043
2044 2007-01-01  Miguel de Icaza  <miguel@novell.com>
2045
2046         * cs-tokenizer.cs: Accept Pc class characters (Connector
2047         Punctuation) as valid identifiers.  Fixes #78259
2048
2049         * expression.cs (Invocation.DoResolve): Moved the check for the
2050         use of `this' for doing method calls to the Invocation resolution
2051         step, after overload resolution has taken place instead of doing
2052         the check at the low-level `This.DoResolve' level.
2053
2054         The `This.DoResolve'(appens before overload resolution, so it has
2055         no way of knowing if the method that will be called will be
2056         instace or static, triggering an erroneous report for cs0188 (Bug
2057         78113).
2058
2059         We now do the check for instance method invocations after we know
2060         what method will be called.
2061
2062         (This.CheckThisUsage): Move the actual use of this structure
2063         checking into its own method and expose it. 
2064
2065         * Everywhere that called Error_ValueCannotBeConverted: pass a new
2066         EmitContext.
2067
2068         Exceptions: Null.ConvertImplicitly,
2069         Constant.ImplicitConversionRequired as there are too many call
2070         sites for passing the ec. 
2071
2072         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
2073         EmitContext, if the value is null, then we do not try to provide
2074         the extra information from the error (If a userdefined conversion
2075         exists, as UserDefinedConversion requires a non null-EmitContext).
2076
2077         Fixes: #80347
2078
2079 2006-12-30  Raja R Harinath  <rharinath@novell.com>
2080
2081         * flowanalysis.cs (MyBitVector): Document some invariants.
2082         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
2083         introduced below, and add a couple of others, 
2084
2085 2006-12-30  Marek Safar  <marek.safar@gmail.com>
2086
2087         * attribute.cs (GetMethodObsoleteAttribute): Uses new
2088         GetPropertyFromAccessor and GetEventFromAccessor.
2089         
2090         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
2091         overrides non-obsolete one.
2092         (Indexer.Define): Error message has been moved to the parser.
2093
2094         * cs-parser.jay: Better syntax errors handling.
2095
2096         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
2097         when an invocation has no arguments.
2098
2099         * ecore.cs: Removed not used caching.
2100
2101         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
2102         implementation.
2103
2104         * report.cs: Add a new warning.
2105
2106         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
2107
2108         * typemanager.cs (enumeration_type): Removed.
2109         (CSharpSignature): Reuses IsSpecialMethod.
2110         (IsEqual): Hack for MS BCL.
2111         (GetPropertyFromAccessor): New method.
2112         (GetEventFromAccessor): New method.
2113         (IsSpecialMethod): Fixed to handle more cases.
2114
2115 2006-12-30  Marek Safar  <marek.safar@gmail.com>
2116
2117         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
2118         Made white spaces array static.
2119
2120         * ecore.cs (RemoveGenericArity): Optimized.
2121
2122         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
2123         10 times faster).
2124         (MyBitVector.initialize_vector): Simplified.
2125
2126 2006-12-22  Miguel de Icaza  <miguel@novell.com>
2127
2128         * ecore.cs: Am not entirely happy with this hack, but it seems to
2129         address the issue in 80257 (a small test case for
2130         CreativeDocs.NET). 
2131
2132         I set the MethodGroupExpr.Type to an internal compiler type
2133         (itself in this case) to force the resolution to take place.   Why
2134         it does not take place with a null is beyond me.
2135
2136 2006-12-20  Marek Safar  <marek.safar@gmail.com>
2137
2138         A fix for bug #80288
2139         * expression.cs (ResolveOperator): Consider user defined conversion for
2140         logical and operator too.
2141         (EmitBranchable): Optimization for logical and when full constant folding
2142         could not be applied but one operand is constant.
2143
2144 2006-12-19  Marek Safar  <marek.safar@gmail.com>
2145
2146         * class.cs (GetClassBases): Write 5 times every day, will never use
2147         FullName for error reporting.
2148
2149         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
2150
2151 2006-12-19  Martin Baulig  <martin@ximian.com>
2152
2153         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
2154         the symbol file info here.
2155
2156 2006-12-18  Marek Safar  <marek.safar@gmail.com>
2157
2158         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
2159         of `elseif' is taking then following sections are not taking.
2160         Fixes an issue reported on mono mailing list.
2161
2162 2006-12-18  Marek Safar  <marek.safar@gmail.com>
2163
2164         A fix for bug #80300
2165         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
2166         a caller is not taking.
2167
2168 2006-12-18  Raja R Harinath  <rharinath@novell.com>
2169
2170         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
2171         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
2172         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
2173         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
2174         * class.cs: Update to changes.
2175
2176 2006-12-17  Marek Safar  <marek.safar@gmail.com>
2177
2178         A fix for bug #79934
2179         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
2180         partial container.
2181
2182         * class.cs (ResolveMembers): Register an iterator in current container and
2183         not in shared one.
2184
2185 2006-12-16  Raja R Harinath  <rharinath@novell.com>
2186
2187         Fix test-543.cs
2188         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
2189         satisfy a params annotated parameter.
2190
2191 2006-12-16  Marek Safar  <marek.safar@gmail.com>
2192
2193         A fix for bug #77014
2194         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
2195         paramters correctly and not rely on hacks in Parameters class.
2196         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
2197         at any possition.
2198         (Invocation.VerifyArgumentsCompat): Ditto.
2199         (Invocation.EmitArguments): Changed to correctly emit params arguments at
2200         any possition.
2201
2202         * parameter.cs (HasParams): Don't assume that params is the last one.
2203
2204         * support.cs (ReflectionParameters.ctor): Look for params attribute
2205         correctly.
2206         (ReflectionParameters.ParameterType): Removed hack when we returned last
2207         parameter for out of range parameters.
2208         (ParameterName, ParameterModifier): Ditto.
2209
2210 2006-12-14  Marek Safar  <marek.safar@gmail.com>
2211
2212         A fix for bug #79987
2213         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
2214         when assembly is not CLS compliant but type is. I have no idea why is this
2215         allowed.
2216
2217         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
2218
2219 2006-12-13  Miguel de Icaza  <miguel@novell.com>
2220
2221         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
2222         in struct constructors, they are basically no-ops.
2223
2224 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2225
2226         * cs-tokenizer.cs (Position): Save preprocessor status too.
2227
2228 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2229
2230         A fix for bug #77794
2231         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
2232
2233 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2234
2235         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
2236         Fixes #69299.
2237         (pp_expr): Report error for an invalid expression.
2238         (handle_preprocessing_directive): Simplified; add more error checking.
2239
2240 2006-12-11  Marek Safar  <marek.safar@gmail.com>
2241
2242         A fix for bug #74939
2243         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
2244         directives handling.
2245
2246 2006-12-10  Marek Safar  <marek.safar@gmail.com>
2247
2248         A fix for bugs #80093, and #75984
2249         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
2250         logic, it seems to me as it worked before "by coincidence".
2251         (xtoken): Simplified to use reworked handle_preprocessing_directive.
2252         (cleanup): Enabled endif check.
2253
2254 2006-12-09  Marek Safar  <marek.safar@gmail.com>
2255
2256         A fix for bug #80162
2257         * statement.cs (CollectionForeach.TryType): Generics and non-generics
2258         enumerators are never ambiguous.
2259
2260 2006-12-08  Raja R Harinath  <rharinath@novell.com>
2261
2262         Fix #80060
2263         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
2264
2265 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2266
2267         A fix for bug #80144
2268         * class.cs (EventProperty.Define): Explicit implementation means
2269         that an even is used.
2270
2271 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2272
2273         Fixes the operators implementation (part II)
2274
2275         * cfold.cs (DoConstantNumericPromotions): Renamed to
2276         DoBinaryNumericPromotions and simplified.
2277         (BinaryFold): Couple of conversion fixes; simplified.
2278
2279         * constant.cs, ecore.cs, literal.cs
2280         (ToType): Renamed to ConvertImplicitly.
2281         (Reduce): Renamed to ConvertExplicitly.
2282
2283         * class.cs, convert.cs: Updated.
2284
2285         * expression.cs: TryReduce doesn't throw an exception.
2286
2287 2006-12-01  Marek Safar  <marek.safar@gmail.com>
2288
2289         A fix for bug #80108
2290         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
2291         compatible.
2292
2293 2006-11-30  Marek Safar  <marek.safar@gmail.com>
2294
2295         Fixes unary operators implementation (part I)
2296         Also fixes #80026
2297
2298         * cfold.cs (Error_CompileTimeOverflow): Made internal
2299
2300         * const.cs (IConstant): Changed to use reference to constant and
2301         not constant itself.
2302         Updated IConstant implementations.
2303
2304         * constant.cs (CreateConstant): New factory method.
2305         Updated IConstant implementation.
2306
2307         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
2308
2309         * ecore.cs: Updated to use CreateConstantReference.
2310
2311         * enum.cs: Reflects IConstant changes.
2312
2313         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
2314
2315         * literal.cs (NullConstant): Change to be independently usable.
2316
2317 2006-11-29  Martin Baulig  <martin@ximian.com>
2318
2319         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
2320         we need to emit the scope initializer before calling the base .ctor.
2321
2322         * anonymous.cs: Merged back from the new anonymous methods branch.
2323         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
2324
2325         * expression.cs (ParameterReference.DoResolveBase): Create a
2326         "normal" ScopeInfo when capturing parameters rather than using the
2327         root scope; this makes things work with anonymous methods having
2328         parameters.
2329
2330         * statement.cs
2331         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
2332
2333 2006-11-22  Marek Safar  <marek.safar@gmail.com>
2334
2335         A fix for bug #79987
2336         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
2337         check to a base class.
2338         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
2339         only when assembly has missing attribute.
2340         * report.cs: Update.
2341
2342 2006-11-21  Marek Safar  <marek.safar@gmail.com>
2343
2344         * cs-tokenizer.cs: Merged with gmcs version.
2345
2346 2006-11-20  Marek Safar  <marek.safar@gmail.com>
2347
2348         * cs-tokenizer.cs,
2349         * cs-parser.jay: Better error message when partial keyword is misplaced.
2350
2351 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
2352
2353         A fix for bug #79810
2354         report.cs: CS1058 only applies to 2.0 profile (gmcs).
2355         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
2356         a RuntimeWrappedException by default.
2357
2358 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2359
2360         A fix for bug #79843
2361         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
2362         implementation.
2363         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
2364
2365 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2366
2367         * driver.cs, namespace.cs: Uses faster IndexOf version.
2368
2369 2006-11-17  Marek Safar  <marek.safar@gmail.com>
2370
2371         A fix for bug #79941
2372         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
2373         operators.
2374         (Operator.Define): Implicit/Explicit operator of same type is duplicate
2375         even if internal name is different.
2376         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
2377         (UserDefinedConversion): Simplified as the operators cannot be internal.
2378         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
2379         conversions.
2380         (MethodLookup): Replaced EmitContext with parentType.
2381         * expression.cs: Updated.
2382
2383 2006-11-09  Raja R Harinath  <rharinath@novell.com>
2384
2385         * driver.cs (BadAssembly): Handle all the ugliness of
2386         DefineDynamicAssembly.
2387
2388 2006-11-08  Raja R Harinath  <rharinath@novell.com>
2389
2390         Address parts of #58244 -- most of what's left is in the runtime
2391         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
2392         CS1509 error checks, and handle them for all assembly loads, not
2393         just the first invocation.
2394         (LoadModule): Likewise.  Move handling of 'adder_method' ...
2395         * codegen.cs (AssemblyClass.AddModule): ... here.
2396
2397 2006-11-02  Marek Safar  <marek.safar@gmail.com>
2398
2399         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
2400         IEnumerable<T> is ambiguous.
2401
2402 2006-10-31  Marek Safar  <marek.safar@gmail.com>
2403
2404         A fix for bug #67689
2405         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
2406         GetEnumerator is ambiguous.
2407
2408         * report.cs: Add new warning.
2409
2410 2006-10-29  Marek Safar  <marek.safar@gmail.com>
2411
2412         A fix for bug #78602
2413         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2414         to protected member can be nested type.
2415
2416 2006-10-28  Marek Safar  <marek.safar@gmail.com>
2417
2418         A fix for bug #78965
2419         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2420         to protected member must derive from current type.
2421
2422 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2423
2424         assign.cs: Reuses error method.
2425
2426         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
2427         instead of type for constants.
2428         (Expression.Error_ValueAssignment): Common error method.
2429
2430         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
2431         for any assignment.
2432
2433 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2434
2435         A fix for bug #79081
2436         * expression.cs (MemberAccess.DoResolve): Check nested type
2437         accessibility.
2438
2439 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
2440
2441         * doc.cs : nested delegates were not handled. Fixed bug #79754.
2442
2443 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2444
2445         A fix for bug #76591
2446         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
2447
2448 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2449
2450         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
2451         type forwarder of the same type multiple times.
2452
2453 2006-10-26  Raja R Harinath  <rharinath@novell.com>
2454
2455         Fix #78820
2456         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
2457         instance as an rvalue, even when we later resolve as an lvalue.
2458
2459 2006-10-25  Martin Baulig  <martin@ximian.com>
2460
2461         * anonymous.cs: Fix #79673.
2462
2463 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
2464
2465         A fix for bug #79666
2466         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
2467         ignored when is optimized (= default value) as its value is already set.
2468
2469 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2470
2471         A fix for bug #79724
2472         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
2473         TypeContainer for type lookup.
2474
2475 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2476
2477         A fix for bug #79231
2478         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
2479         * expression.cs (OverloadResolve): Always convert type name for
2480         an error message.
2481         (ResolveNamespaceOrType): Don't confuse a nested type with any 
2482         other member.
2483
2484 2006-10-18  Martin Baulig <martin@ximian.com>
2485
2486         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
2487
2488 2006-10-17  Miguel de Icaza  <miguel@novell.com>
2489
2490         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
2491         an int32, but requesting an int64 from the conversion
2492
2493 2006-10-12  Martin Baulig  <martin@ximian.com>
2494
2495         * anonymous.cs
2496         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
2497         
2498 2006-10-12  Martin Baulig  <martin@ximian.com>
2499
2500         * statement.cs
2501         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
2502
2503 2006-10-11  Miguel de Icaza  <miguel@novell.com>
2504
2505         * convert.cs: Remove broken code: I was doing the "Existance"
2506         tests for Implicit conversions.
2507
2508 2006-10-10  Miguel de Icaza  <miguel@novell.com>
2509
2510         * convert.cs: Added one missing case in
2511         ImplicitStandardConversionExists uint64 to intptr.
2512
2513         Fixes #59800
2514         
2515         * typemanager.cs (uintptr_type): another core known type.   
2516
2517         * ecore.cs (OperatorCast): routine used to do cast operations that
2518         depend on op_Explicit.  We could change some of the Decimal
2519         conversions to use this.
2520
2521         This one has a probe mechanism that checks both types for an op_
2522         which it coudl be used to eliminate two classes: CastToDecimal
2523         and CastFromDecimal.
2524
2525         * convert.cs: Implement the conversions documented in #59800
2526         
2527 2006-10-10  Martin Baulig  <martin@ximian.com>
2528
2529         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
2530         before RootScope.ResolveMembers().
2531
2532         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
2533         `CurrentType' if appropriate.
2534
2535 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
2536
2537         A fix for bug #78568
2538         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
2539         when contains binary operators.
2540         * cs-parser.jay: Updated.
2541
2542 2006-10-09  Martin Baulig  <martin@ximian.com>
2543
2544         * delegate.cs
2545         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
2546         moved that into Define() and also do the other type parameter
2547         checks there.  Fixes #79094.  Added gtest-292.cs.
2548
2549         * expression.cs
2550         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
2551         since that doesn't include type parameters; don't use `Ldelema'
2552         for type parameters.  Fixes #78980.  Added gtest-293.cs.
2553
2554 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
2555
2556         A fix for #77796
2557         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
2558         conversion is allowed.
2559
2560 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2561
2562         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
2563         error reporting when no error occurs.
2564
2565 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2566
2567         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
2568         does not exist.
2569
2570 2006-10-06  Raja R Harinath  <rharinath@novell.com>
2571
2572         Fix #79584
2573         * class.cs (DefineTypeBuilder): Check circular dependencies before
2574         setting the parent of the TypeBuilder.
2575         (CheckRecursiveDefinition): Don't use 'BaseType', since
2576         it may not be valid until after DefineTypeBuilder.  Use
2577         'base_type' instead.
2578
2579 2006-10-04  Martin Baulig  <martin@ximian.com>
2580
2581         Merged the Anonymous Methods patch.
2582
2583         * anonymous.cs, iterators.cs: The new anonymous methods code.
2584
2585         * statement.cs (Variable): New public abstract class.
2586         (LocalInfo.Variable): New public property.
2587         (LocalInfo.ResolveVariable): New public method.
2588         (Block.Flags): Add `IsIterator'.
2589         (Block.AddVariable): Improved the CS0136 check.
2590         (Block.AnonymousChildren): New public property.
2591         (Block.AddAnonymousChild): New public method.
2592         (ToplevelBlock): Update to use the new anonymous method framework.
2593         (ToplevelBlock.ctor): `container' is now a `Block' and not a
2594         `ToplevelBlock'; this is required to correctly implement the
2595         CS0136 check.
2596         (Fixed, Using): Use `TemporaryVariable' instead of directly
2597         creating the `LocalBuilder'.
2598
2599         * parameter.cs (Parameter.ResolveVariable): New public method.
2600         (Parameters.ResolveVariable): Likewise.
2601
2602         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
2603
2604         * class.cs (TypeContainer): Replaced the `iterators' list and
2605         corresponding methods with a list of `CompilerGeneratedClass'es.
2606         (TypeContainer.ResolveMembers): New public method.
2607         (Method): `IIteratorContainer' has been replaced by
2608         `IAnonymousHost'.
2609
2610         * expression.cs (VariableReference): New public abstract base
2611         class for `LocalVariableReference', `ParameterReference' and
2612         `This'.
2613
2614         * codegen.cs (EmitContext): Removed `capture_context',
2615         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
2616         (EmitContext.EmitThis): Removed.
2617
2618         * cs-parser.jay: Replace `iterator_container' with
2619         `anonymous_host'.       
2620
2621 2006-10-04  Martin Baulig  <martin@ximian.com>
2622
2623         * generic.cs (GenericMethod): Don't make this abstract.
2624         (Constraints.Clone): Added dummy implementation.
2625
2626 2006-10-04  Raja R Harinath  <harinath@gmail.com>
2627
2628         Fix #79577
2629         * namespace.cs (LookForAnyGenericType): Avoid nullref on
2630         'declspaces'.  Avoid allocating arrays willy-nilly.
2631
2632         Fix #79553
2633         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2634         cases out of the switch.
2635
2636 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2637
2638         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2639         message when non-generic type is used with the type arguments.
2640         * expression.cs: Updated.
2641
2642 2006-09-28  Raja R Harinath  <rharinath@novell.com>
2643
2644         Fix #79013
2645         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2646         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2647         Change semantics slightly.  Don't insist on having only one
2648         temporary EmptyExpression -- just throttle the creation of new ones.
2649
2650         Fix #79451
2651         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2652         non-interfaces too.  If no methods are found, don't try to create
2653         a MethodGroupExpr.
2654
2655 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2656
2657         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2658         generic type.
2659
2660         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2661         us produce better error message.
2662
2663 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
2664
2665         * expression.cs (Binary.ResolveOperator): Warn about a side effect
2666         of the `|' operator.
2667
2668         * report.cs: A new warning added.
2669
2670 2006-09-27  Martin Baulig  <martin@ximian.com>
2671
2672         * generic.cs (GenericMethod): Don't make this abstract.
2673
2674 2006-09-27  Martin Baulig  <martin@ximian.com>
2675
2676         * report.cs
2677         (InternalErrorException): Added overloaded ctor taking a params array.
2678
2679 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
2680
2681         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2682         Fixed the cases when same error was reported twice.
2683
2684         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2685         now report symbol information.
2686
2687 2006-09-25  Martin Baulig  <martin@ximian.com>
2688
2689         * class.cs: Completely unified with the gmcs version.
2690
2691 2006-09-25  Martin Baulig  <martin@ximian.com>
2692
2693         * typemanager.cs (TypeManager.IsNullableType): New public function.
2694         (TypeManager.IsNullableTypeOf): Likewise.
2695         (TypeManager.IsNullableValueType): Likewise.
2696
2697         * class.cs (MethodCore): Added the `GenericMethod' argument from
2698         gmcs and also unified all classes derived from `MethodCore' with gmcs.
2699
2700 2006-09-24  Raja R Harinath  <harinath@gmail.com>
2701
2702         * convert.cs: Unify with gmcs version.
2703
2704 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2705
2706         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2707         verify them as well.
2708
2709         * report.cs: New warning.
2710
2711 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2712
2713         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2714         for anonymous block with out argument.
2715
2716 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2717
2718         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2719         not used private events only.
2720
2721 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
2722
2723         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2724
2725         * const.cs (Const.Define): Check for constant type.
2726         (Const.IsConstantTypeValid): Looks for valid constant types.
2727
2728         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2729
2730         * ecore.cs (EmptyConstantCast): New common class for all constant based
2731         EmptyCast(s).
2732
2733         * expression.cs (Is.DoResolve): Handle null constant especially.
2734         (New.DoResolve): Check for new void().
2735         (MemberAccess.DoResolve): Cope with all kind of nulls.
2736
2737         * literal.cs (NullConstant): Uses EmptyConstantCast.
2738         (NullDefault): Based on EmptyConstantCast.
2739         (NullLiteral): Uses EmptyConstantCast.
2740
2741         * statement.cs (Block.ResolveMeta): Check for constant type.
2742
2743 2006-09-22  Martin Baulig  <martin@ximian.com>
2744
2745         * delegate.cs, attribute.cs: Merged with the gmcs versions.
2746
2747 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2748
2749         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2750         not the null type.
2751
2752         Fix part of #79451
2753         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2754         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
2755         code slightly.
2756
2757 2006-09-22  Martin Baulig  <martin@ximian.com>
2758
2759         * ecore.cs: Merged with the gmcs version.
2760
2761         * generic.cs (ConstructedType): New dummy class.
2762         (TypeArguments): Don't make this abstract.
2763
2764         * typemanager.cs
2765         (TypeManager.IsGenericTypeDefinition): New method.
2766         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2767
2768 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2769
2770         * expression.cs (ComposedCast): Check for arrays of TypedReference
2771         before creating the type, not after.
2772
2773 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
2774
2775         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2776         after ToType change.
2777
2778         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2779         when constant must be implicitly convertible.
2780
2781         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2782
2783         * ecore.cs (NullCast): Derives from NullConstant.
2784
2785         * expression.cs (Is.DoResolve): Removed useless variables.
2786         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2787         (New.Constantify): Add enum support.
2788         (MemberAccess.DoResolve): Add warning when accessing null constant or
2789         variable.
2790
2791         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2792         property.
2793
2794         * literal.cs (NullConstant): New abstract class with common
2795         functionality for all null specializations.
2796         (NullDefault): Represents default(X) when result can be
2797         reduced to null.
2798         (NullLiteral): Updated.
2799
2800         * report.cs: Add new warning.
2801
2802 2006-09-21  Martin Baulig  <martin@ximian.com>
2803
2804         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2805
2806 2006-09-21  Martin Baulig  <martin@ximian.com>
2807
2808         * generic.cs (GenericConstraints): New dummy class.
2809         (Constraints): Likewise.
2810         (TypeParameter): Likewise.
2811         (TypeParameterName): Likewise.
2812         (GenericMethod): Likewise.
2813
2814         * typemanager.cs (TypeManager.GetGenericArguments): New method.
2815
2816         * decl.cs: Merged with the gmcs version.
2817
2818 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2819
2820         * generic.cs (TypeParameter): Implement IMemberContainer.
2821         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
2822
2823         * rootcontext.cs: Unify with gmcs version.
2824
2825         * report.cs: Unify with gmcs version.
2826         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2827         from gmcs/generics.cs.
2828         * generics.cs (TypeParameter): New dummy class.
2829
2830         * support.cs: Unify with gmcs version.
2831
2832 2006-09-20  Raja R Harinath  <rharinath@novell.com>
2833
2834         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2835         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2836
2837         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2838         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2839         * mcs.exe.sources: Add generic.cs.
2840
2841         * codegen.cs: Unify with gmcs version.
2842
2843         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2844         (EmitContext): Add GenericDeclContainer implementation.
2845         * decl.cs (MemberCore, DeclSpace): Likewise.
2846         * namespace.cs: Remove #ifdef GMCS_SOURCE.
2847
2848         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2849         MCS TypeManager has a corresponding dummy method.
2850
2851 2006-09-19  Martin Baulig  <martin@ximian.com>
2852
2853         * expression.cs: Completely merged with the gmcs version.
2854
2855 2006-09-19  Martin Baulig  <martin@ximian.com>
2856
2857         * expression.cs (Invocation): Merged with the gmcs version.
2858         (ArrayAccess.GetStoreOpcode): Likewise.
2859
2860 2006-09-19  Martin Baulig  <martin@ximian.com>
2861
2862         * typemanager.cs
2863         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2864         (TypeManager.IsGenericMethodDefinition): Likewise.
2865
2866 2006-09-19  Martin Baulig  <martin@ximian.com>
2867
2868         * typemanager.cs
2869         (TypeManager.IsEqual): Moved the gmcs implementation here.
2870         (TypeManager.DropGenericTypeArguments): Likewise.
2871         (TypeManager.DropGenericMethodArguments): Likewise.
2872         (TypeManager.GetTypeArguments): Moved here from gmcs.
2873         (TypeManager.HasGenericArguments): Likewise.
2874
2875 2006-09-19  Martin Baulig  <martin@ximian.com>
2876
2877         * expression.cs (Binary): Merged with the gmcs version.
2878
2879 2006-09-19  Martin Baulig  <martin@ximian.com>
2880
2881         * expression.cs (Probe, As, Is): Merged with the gmcs version.
2882
2883 2006-09-19  Martin Baulig  <martin@ximian.com>
2884
2885         * typemanager.cs: Merged with the gmcs version.
2886
2887 2006-09-16  Raja R Harinath  <rharinath@novell.com>
2888
2889         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2890         * driver.cs: Likewise.
2891
2892 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
2893
2894         A fix for #79401
2895         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2896         only if parent type is class.
2897         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2898         update.
2899
2900 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
2901
2902         * cs-parser.jay,
2903         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2904         keywords are used.
2905         * typemanager.cs(CSharpName): Converts NullType to null.
2906
2907 2006-09-15  Martin Baulig  <martin@ximian.com>
2908
2909         * typemanager.cs
2910         (TypeManager.GetMethodName): Added mcs implementation.
2911         (TypeManager.IsEqual): Likewise.
2912
2913         * ecore.cs
2914         (SimpleName.RemoveGenericArity): Added dummy implementation.
2915
2916         * pending.cs: Merged with the gmcs version.     
2917
2918 2006-09-15  Martin Baulig  <martin@ximian.com>
2919
2920         * statement.cs: Merge with the gmcs version.
2921
2922 2006-09-15  Martin Baulig  <martin@ximian.com>
2923
2924         * statement.cs (Switch): Merge with the gmcs implementation
2925         (without nullables), which is newer.
2926
2927 2006-09-15  Martin Baulig  <martin@ximian.com>
2928
2929         * statement.cs (Block.Variables): Make this public.
2930         (ToplevelBlock.Parameters): Make this a property.
2931         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2932
2933 2006-09-15  Martin Baulig  <martin@ximian.com>
2934
2935         * namespace.cs: Merge with the gmcs version.
2936
2937 2006-09-15  Martin Baulig  <martin@ximian.com>
2938
2939         * decl.cs (MemberName): Minor code cleanups.
2940
2941 2006-09-15  Martin Baulig  <martin@ximian.com>
2942
2943         * parameter.cs: Merge with the gmcs version.
2944
2945 2006-09-15  Martin Baulig  <martin@ximian.com>
2946
2947         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2948         and an error in mcs.
2949
2950 2006-09-15  Martin Baulig  <martin@ximian.com>
2951
2952         * flowanalysis.cs: Merged from GMCS; added the generics code into
2953         a `GMCS_SOURCE' conditional so we can share this file.
2954
2955 2006-09-08  Martin Baulig  <martin@ximian.com>
2956
2957         * typemanager.cs (TypeManager.interlocked_type): New public field.
2958         (TypeManager.int_interlocked_compare-exchange): New public field.
2959         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2960         enumerator types here and call InitGenericCoreTypes().
2961         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2962         after calling InitEnumUnderlyingTypes().
2963
2964         * rootcontext.cs
2965         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2966         `classes_second_stage'. 
2967
2968 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
2969
2970         * assign.cs, ecore.cs, expression.cs: Share error message text.
2971         * class.cs (FieldMember.Define): Check for varible of static type.
2972         * driver.cs (LoadAssembly): Uses error output for errors.
2973         * statement.cs: Updated.
2974
2975 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
2976
2977         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2978         type instance.
2979
2980 2006-09-07  Martin Baulig  <martin@ximian.com>
2981
2982         * driver.cs
2983         (MainDriver): Revert r62663 from Marek; see #70506 for details.
2984
2985 2006-08-29  Miguel de Icaza  <miguel@novell.com>
2986
2987         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2988         
2989 2006-08-17  Miguel de Icaza  <miguel@novell.com>
2990
2991         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2992         #52019 and #79064, the use of the \uXXXX sequence in source code
2993         to represent unicode characters.
2994
2995 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
2996
2997         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2998         support.
2999         * class.cs, ecore.cs, statement.cs: Merged to one error message.
3000
3001 2006-08-13  Miguel de Icaza  <miguel@novell.com>
3002
3003         * assign.cs: Catch attempts to assign to a method groups in += and
3004         report as 1656
3005
3006 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
3007
3008         A fix for #79056
3009         * cs-parser.jay: Don't destroy current array type by typeof of array's.
3010
3011 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
3012
3013         * class.cs (Method.Define): Issue a warning when generic method looks like
3014         an entry point.
3015         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
3016         as well.
3017
3018 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
3019  
3020         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
3021         looking for ctor.
3022         * decl.cs (MemberCache.FindMembers): When container is interface we need to
3023         search all base interfaces as a member can be ambiguous.
3024         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
3025         Constructor member type filter. 
3026         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
3027         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
3028         reporting for returned memberinfos.
3029         * report.cs: Updated.
3030         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
3031         version to work on all runtimes.
3032         (TypeManager.RealMemberLookup): Removed members filtering.
3033
3034 2006-08-08  Raja R Harinath  <rharinath@novell.com>
3035
3036         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
3037         (PropertyExpr.EmitAssign): Likewise.
3038         * expression.cs (Indirection.EmitAssign): Likewise.
3039         (LocalVariableReference.EmitAssign): Likewise.
3040         (ParameterReference.EmitAssign): Likewise.
3041         (Invocation.EmitArguments): Likewise.
3042         (ArrayAccess.EmitAssign): Likewise.
3043         (IndexerAccess.EmitAssign): Likewise.
3044         (This.EmitAssign): Likewise.
3045         (ConditionalLogicalOperator.Emit): Likewise.
3046
3047         Fix #79026
3048         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
3049         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
3050         leave it in after returning it.
3051         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
3052
3053 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
3054
3055         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
3056         message.
3057
3058 2006-08-03  Raja R Harinath  <rharinath@novell.com>
3059
3060         Fix cs0146-3.cs and cs0146-4.cs.
3061         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
3062         enclosing types don't depend on the current type.
3063
3064 2006-08-02  Raja R Harinath  <rharinath@novell.com>
3065
3066         Fix #77963
3067         * class.cs (TypeContainer.DoDefineMembers): Use
3068         FindBaseMemberWithSameName on Parent, since we're interested in
3069         whether we hide inherited members or not.
3070         (FindBaseMemberWithSameName): Make slightly more robust.
3071
3072         Fix the non-generic testcase from #77396
3073         * decl.cs (DeclSpace.DeclContainer): Remove override.
3074
3075         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
3076         declspaces for doppelgangers too.
3077         (UsingEntry): Implement IResolveContext.
3078         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
3079         'this' as the resolve context.
3080         (LocalAliasEntry): Likewise.
3081
3082         Implement parts of #77403
3083         * roottypes.cs (RootDeclSpace): New.  Used to represent the
3084         toplevel declaration space.  Each namespace declaration introduces
3085         a "partial" root declaretion space.
3086         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
3087         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
3088         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
3089         from 'current_namespace.SlaveDeclSpace'.
3090         (namespace_declaration): Likewise.
3091         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
3092         check.  It can't happen now.
3093         * decl.cs (DeclSpace.LookupType): Likewise.
3094         * driver.cs (MainDriver): Sanity check.
3095
3096 2006-08-01  Raja R Harinath  <rharinath@novell.com>
3097
3098         * decl.cs (DeclSpace.FindNestedType): Remove.
3099         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
3100         LookupTypeContainer to get the container of the nested type.
3101         * class.cs (TypeContainer.FindNestedType): Make non-override.
3102
3103 2006-07-31  Raja R Harinath  <rharinath@novell.com>
3104
3105         * decl.cs (DeclSpace.PartialContainer): Move field from ...
3106         * class.cs (TypeContainer.PartialContainer): ... here.
3107         (TypeContainer.AddBasesForPart): New helper.
3108         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
3109         instead.
3110         * cs-parser.jay (current_class): Convert to DeclSpace.
3111         (struct_declaration, interface_declaration, class_declaration):
3112         Use AddBasesForPart instead of .Bases directly.
3113         * const.cs, iterators.cs: Update to changes.
3114
3115 2006-07-28  Raja R Harinath  <rharinath@novell.com>
3116
3117         * class.cs (TypeContainer.AddMemberType): Rename from
3118         AddToTypeContainer.
3119         (TypeContainer.AddMember): Rename from AddToMemberContainer.
3120         (AddTypeContainer): New.  Combine AddClassOrStruct and
3121         AddInterface.
3122         (AddPartial): Update.  Add 'is_partial' argument.
3123         * roottypes.cs: Update to changes.
3124         * cs-parser.jay (push_current_class): New helper for handling
3125         current_container and current_class.
3126         (struct_declaration, interface_declaration, class_declaration):
3127         Use it.
3128
3129 2006-07-26  Raja R Harinath  <rharinath@novell.com>
3130
3131         * roottypes.cs: Rename from tree.cs.
3132
3133         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
3134         * tree.cs (Tree, ITreeDump): Remove types.
3135         * rootcontext.cs (tree, Tree): Remove fields.
3136         (root, ToplevelTypes): New.
3137         * *.cs: Update to rename.
3138
3139         * tree.cs (Tree.RecordDecl): Remove.
3140         (RootTypes.AddToTypeContainer): Record the toplevel type in its
3141         namespace here.
3142         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
3143
3144 2006-07-23  Raja R Harinath  <harinath@gmail.com>
3145
3146         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
3147         DoFlowAnalysis and OmitStructFlowAnalysis here.
3148         (ec.With): Rename from WithUnsafe and generalize.
3149         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
3150         (ec.WithFlowAnalyis): New.
3151         * ecore.cs, expression.cs, statement.cs: Update.
3152
3153 2006-07-22  Raja R Harinath  <harinath@gmail.com>
3154
3155         * statement.cs (Block.ResolveMeta): Simplify slightly.
3156
3157         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
3158         multiple boolean fields.  Convert InUnsafe, constant_check_state,
3159         check_state to flags.
3160         (CheckState, ConstantCheckState): Update.
3161         (InUnsafe): New read-only property.
3162         (FlagsHandle): Rename from CheckStateHandle and convert to handle
3163         arbitrary flags.
3164         (WithUnsafe): New helper similar to WithCheckState.
3165         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
3166         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
3167
3168 2006-07-21  Raja R Harinath  <rharinath@novell.com>
3169
3170         Make comparisons use the same IL irrespective of whether they're
3171         in a 'checked' or 'unchecked' context: one of the issues in #78899
3172         * codegen.cs (EmitContext.CheckState): Make read-only property.
3173         (EmitContext.ConstantCheckState): Likewise.
3174         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
3175         helper that implement a save/restore stack for CheckState
3176         values.  This is the only way to change check-state.
3177         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
3178         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
3179         (CheckedExpr.EmitBranchable): New forwarding method.
3180         (UnCheckedExpr): Likewise.
3181         * statement.cs (Block.ResolveMeta): Use WithCheckState.
3182         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
3183         (Checked.Resolve, checked.DoEmit): Likewise.
3184
3185 2006-07-20  Miguel de Icaza  <miguel@novell.com>
3186
3187         * anonymous.cs: Cache the resolved anonymous delegate, and return
3188         this so that the ResolveTopBlock is only triggered once, not
3189         twice.
3190
3191         Currently we trigger ResolvetopBlock twice due to a first pass of
3192         argument check compatibility, and a second pass that does the
3193         actual resolution.   
3194         
3195 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
3196
3197         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
3198         modifiers.
3199         * rootcontext.cs (Reset): Add helper_classes.
3200
3201 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
3202
3203         A fix for #78860
3204         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
3205         correctly.
3206
3207 2006-07-13  Miguel de Icaza  <miguel@novell.com>
3208
3209         * statement.cs (Lock): Handle expressions of type
3210         TypeManager.null_type specially.  Fixes #78770
3211
3212 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
3213
3214         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
3215         to an event.
3216
3217 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
3218
3219         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
3220         for accessors as well.
3221         * ecore.cs (EventExpr): Add AccessorTable.
3222
3223 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
3224
3225         A fix for #78738
3226         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
3227         for CS0122 where appropriate.
3228         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
3229         level attributes.
3230         (Filter): Assembly can be null in the case of top level attributes.
3231
3232 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
3233
3234         A fix for #78690
3235
3236         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
3237         is done at global level.
3238
3239 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3240
3241         A fix for #77002, Implemented TypeForwarder support.
3242
3243         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
3244         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
3245         * typemanager.cs (): Add type_forwarder_attr_type.
3246
3247 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3248
3249         * report.cs: Add CS0469 warning.
3250
3251 2006-06-21  Martin Baulig  <martin@ximian.com>
3252
3253         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
3254         the `try'-block, so we also report CS0016 etc. there.
3255
3256 2006-06-21  Martin Baulig  <martin@ximian.com>
3257
3258         * delegate.cs
3259         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
3260
3261 2006-06-21  Martin Baulig  <martin@ximian.com>
3262
3263         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
3264         also report CS1686 for parameters.
3265
3266 2006-06-21  Martin Baulig  <martin@ximian.com>
3267
3268         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
3269         instead of an error if the value is not implicitly convertible to
3270         the switch types; fixes #77964.
3271
3272 2006-06-21  Raja R Harinath  <rharinath@novell.com>
3273
3274         Fix #78673
3275         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
3276         FieldBuilder is null.
3277
3278         Fix #78662
3279         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
3280         'left' and 'right' before error-checking.
3281
3282 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
3283
3284         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
3285         Fixed bug #78601.
3286         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
3287         (FieldExpr.DoResolve): likewise.
3288         (PropertyExpr.InstanceResolve): likewise.
3289         (EventExpr.InstanceResolve): likewise. 
3290
3291 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
3292
3293         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
3294         attribute applicable tests for attribute argument.
3295
3296 2006-06-02  Raja R Harinath  <rharinath@novell.com>
3297
3298         Fix #78079
3299         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
3300         (Binary.OverloadResolve_PredefinedIntegral): New.
3301         (Binary.OverloadResolve_PredefinedFloating): New.
3302         (Binary.OverloadResolve_PredefinedString): New.
3303         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
3304         Follow the standard more closely, and treat numeric promotions in
3305         terms of overload resolution.
3306         (Binary.CheckShiftArguments): Simplify.
3307
3308 2006-06-01  Raja R Harinath  <rharinath@novell.com>
3309
3310         * flowanalysis.cs (MyBitVector): Simplify representation.
3311         (MyBitVector.Clone): Avoid allocating BitArray.
3312         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
3313         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
3314         (*): Update.  Change all references to MyBitVector.And and
3315         MyBitVector.Or to &= and |=.
3316
3317 2006-05-29  Raja R Harinath  <rharinath@novell.com>
3318
3319         Fix cs0231-[34].cs.
3320         * cs-parser.jay (formal_parameter_list): Extend the pattern below
3321         to param arguments too.
3322
3323 2006-05-26  Miguel de Icaza  <miguel@novell.com>
3324
3325         * cs-parser.jay: Catch another parsing form for arglist being
3326         followed by other arguments.  Fixes #78313.
3327
3328 2006-05-24  Raja R Harinath  <rharinath@novell.com>
3329
3330         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
3331         checking of out parameters to ...
3332         (FlowBranchingToplevel.Merge): ... here.
3333         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
3334         set, propagate the origin upward, and only complain if there was
3335         no other error.
3336         (FlowBranchingException.AddContinueOrigin): Likewise.
3337         (FlowBranchingException.AddReturnOrigin): Likewise.
3338         (FlowBranchingException.AddGotoOrigin): Likewise.       
3339
3340 2006-05-23  Raja R Harinath  <rharinath@novell.com>
3341
3342         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
3343         unreachable, skip it.
3344         (FlowBranchingException.Merge): Always propagate jumps, even if
3345         the finally block renders subsequent code unreachable.
3346
3347 2006-05-18  Raja R Harinath  <rharinath@novell.com>
3348
3349         Fix #77601
3350         * statement.cs (Goto.Resolve): Move responsibility for resolving
3351         'goto' to FlowBranching.AddGotoOrigin.
3352         (Goto.SetResolvedTarget): New.  Callback to set the
3353         LabeledStatement that's the target of the goto.
3354         (Goto.DoEmit): Use Leave instead of Br when crossing an
3355         unwind-protect boundary.
3356         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
3357         LookupLabel and adjust to new semantics.
3358         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
3359         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
3360         Goto.SetResolvedTarget to update target.
3361         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
3362         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
3363         AddBreakOrigin & co.  Delay propagation until ...
3364         (FlowBranchingException.Merge): ... this.
3365
3366         * statement.cs (Block.Resolve): Always depend on flow-branching to
3367         determine unreachability.  Kill workaround that originally emitted
3368         only one statement after an "unreachable" label (see infloop in
3369         test-515.cs).
3370
3371         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
3372         This is still "wrong", but anything better would probably need a
3373         multi-pass algorithm.
3374         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
3375         usage vector.  Force current usage vector to be reachable, to
3376         optimistically signify backward jumps.
3377         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
3378         detected.
3379         (FlowBranchingLabeled.Merge): New.  If no backward jump was
3380         detected, return the original salted-away usage vector instead,
3381         updated with appropriate changes.  Print unreachable warning if
3382         necessary.
3383         * statement.cs (Block.Resolve): Don't print unreachable warning on
3384         a labeled statement.
3385
3386 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
3387
3388         * driver.cs: Pass filename without path to AssemblyBuilder's 
3389         AddResourceFile. Fixes bug #78407.
3390
3391 2006-05-17  Raja R Harinath  <rharinath@novell.com>
3392
3393         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
3394         * flowanalysis.cs (FlowBranchingLabeled): ... here.
3395         (FlowBranching.MergeChild): Overwrite
3396         reachability information from Labeled branchings too.
3397
3398 2006-05-16  Raja R Harinath  <rharinath@novell.com>
3399
3400         * statement.cs (Goto.Resolve): Merge jump origins here ...
3401         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
3402
3403         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
3404         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
3405         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
3406         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
3407         here, ...
3408         * statement.cs (Goto.Resolve): ... not here.
3409         (Goto.Emit): Remove CS1632 check.
3410
3411 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
3412
3413         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
3414         error message.
3415
3416 2006-05-11  Raja R Harinath  <rharinath@novell.com>
3417
3418         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
3419         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
3420         (FlowBranchingException.Label): Likewise.
3421
3422         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
3423         given value.
3424         (MyBitVector.Or): Use it to avoid losing information (Count).
3425         (FlowBranching.MergeOrigins): Likewise.
3426
3427         * flowanalysis.cs (UsageVector.IsDirty): Remove.
3428         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
3429         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
3430         (UsageVector.ToString): Simplify.
3431         (UsageVector.MergeSiblings): Move here from ...
3432         (FlowBranching.Merge): ... here.
3433         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
3434         not a MyBitVector.
3435
3436 2006-05-10  Raja R Harinath  <rharinath@novell.com>
3437
3438         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
3439         null bitvector is treated as all-true.
3440
3441         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
3442         (MyBitVector): Rationalize invariants.  'vector != null' implies
3443         that we have our own copy of the bitvector.  Otherwise,
3444         'InheritsFrom == null' implies all inherited bits are true.
3445
3446 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
3447
3448         * statement.cs (LocalInfo): Add IsConstant.
3449         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
3450         local variable for constants.
3451
3452 2006-05-09  Raja R Harinath  <rharinath@novell.com>
3453
3454         * flowanalysis.cs (MyBitVector.Empty): New.
3455         (MyBitVector): Don't allow InheritedFrom to be null.
3456         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
3457         (UsageVector, FlowBranching): Update to changes.
3458
3459         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
3460         recursion.  The 'Parent == null' condition isn't sufficient for
3461         anonymous methods.
3462         (FlowBranching.AddBreakOrigin): Likewise.
3463         (FlowBranching.AddContinueOrigin): Likewise.
3464         (FlowBranching.AddReturnOrigin): Likewise.
3465         (FlowBranching.StealFinallyClauses): Likewise.
3466         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
3467         (FlowBranching.CheckOutParameters): Likewise.
3468         (FlowBranchingToplevel): Terminate all the above recursions here.
3469         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
3470         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
3471
3472         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
3473         toplevel block.
3474         (FlowBranchingToplevel): New.  Empty for now.
3475         (FlowBranching.MergeTopBlock): Update.
3476         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
3477         branching for the anonymous delegate.
3478         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
3479
3480         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
3481         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
3482         information at the start of the merge.  Reorganize.
3483
3484 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3485
3486         * class.cs (MethodData.Define): Method cannot implement interface accessor.
3487
3488 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3489
3490         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
3491         to newly introduced ctor.
3492
3493         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
3494         message to one place.
3495         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
3496         global namespace.
3497
3498 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3499
3500         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
3501
3502         * ecore.cs (Expression.ResolveAsConstant): Updated.
3503
3504         * statement.cs (ResolveMeta): Updated.
3505
3506 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3507
3508         * cs-parser.jay: __arglist cannot be used in initializer.
3509
3510 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3511
3512         A fix for #77879
3513         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
3514         private types.
3515
3516 2006-05-05  Raja R Harinath  <rharinath@novell.com>
3517
3518         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
3519         (LabeledStatement): Add 'name' parameter.
3520         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
3521         (Block.AddLabel): Update to changes.
3522         * cs-parser.jay (labeled_statement): Likewise.
3523
3524         * flowanalysis.cs (BranchingType.Labeled): New.
3525         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
3526         (FlowBranchingLabeled): New.  Does nothing for now, but will
3527         eventually handle 'goto' flows.
3528         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
3529         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
3530         that's terminated ...
3531         (Block.Resolve): ... here.
3532
3533         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
3534         (UsageVector.MergeFinallyOrigins): Likewise.
3535         (FlowBranching.InTryOrCatch): Likewise.
3536         (FlowBranching.AddFinallyVector): Likewise.
3537         (FlowBranchingException): Update to changes.
3538
3539         Fix #78290
3540         * statement.cs (Return.Resolve): Move error checking to ...
3541         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
3542         (FlowBranchingException): Handle return origins like break and
3543         continue origins.
3544         (FlowBranching.UsageVector.CheckOutParameters): Remove.
3545
3546 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3547
3548         A fix for #76122
3549         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
3550         filter.
3551
3552 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3553
3554         A fix for #77543
3555         * class.cs (MethodData.Define): Do public accessor check only when method
3556         implements an interface.
3557
3558 2006-05-04  Raja R Harinath  <rharinath@novell.com>
3559
3560         Remove special handling of 'break'
3561         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
3562         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
3563         (UsageVector.Break): Remove.
3564         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
3565         reachability.
3566         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
3567
3568         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
3569         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
3570
3571 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3572
3573         A fix for #75726
3574         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
3575         be the interface member.
3576
3577 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3578
3579         A fix for #60069
3580         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
3581         for emitting small (int) values.
3582
3583 2006-05-03  Raja R Harinath  <rharinath@novell.com>
3584
3585         Fix #59427
3586         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
3587         control-flow passes through the 'finally' after merging-in all the
3588         control-flows from 'try' and the 'catch' clauses.
3589
3590         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
3591         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
3592         always true at the only non-recursive entry point.
3593         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
3594         FlowBranchingBreakable.
3595         (FlowBranchingLoop): Remove.
3596         * statement.cs (Return.DoResolve): Update to changes.
3597
3598         Fix #76471, #76665
3599         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
3600         (FlowBranching.CreateBranching): Handle it: create a
3601         FlowBranchingContinuable.
3602         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
3603         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
3604         except that it handles the 'continue' command.
3605         (FlowBranching.UsageVector.MergeOrigins): Rename from
3606         MergeBreakOrigins.
3607         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
3608         except that it overrides AddContinueOrigin.
3609         (FlowBranchingException): Override AddContinueOrigin, similar to
3610         AddBreakOrigin.
3611         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
3612         Create a new branching around the embedded statement.
3613         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
3614         control flow after the embedded statement.
3615         (Continue.Resolve): Move all error checking to AddContinueOrigin.
3616
3617         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3618         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3619         FlowBranchingBreakable.
3620         (FlowBranchingSwitch): Remove.
3621
3622         Fix test-503.cs
3623         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
3624         error reporting to ...
3625         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3626         Rename from 'AddBreakVector'.  Add new location argument.  Return
3627         a bool indicating whether the 'break' crosses an unwind-protect.
3628         (FlowBranchingException.AddBreakOrigin): Add.
3629         (FlowBranchingException.Merge): Propagate 'break's to surrounding
3630         flowbranching after updating with the effects of the 'finally'
3631         clause.
3632         (FlowBranchingBreakable): New common base class for
3633         FlowBranchingLoop and FlowBranchingSwitch.
3634
3635         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3636         embedded statement.
3637         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3638
3639 2006-05-02  Raja R Harinath  <rharinath@novell.com>
3640
3641         * statement.cs (Do.Resolve): If the loop is infinite, set the
3642         barrier.
3643         (While.Resolve, For.Resolve): Set a barrier after the embedded
3644         statement.  There's no direct control flow that goes from the end
3645         of the embedded statement to the end of the loop.
3646         * flowanalysis.cs (FlowBranching.Infinite): Remove.
3647         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
3648         above ensure that the reachability is correctly computed.
3649
3650         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3651         (UsageVector.MergeBreakOrigins): If the current path is
3652         unreachable, treat it as if all parameters/locals are initialized.
3653         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
3654         infinite loops before merging-in break origins.
3655
3656         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3657         (Reachability.Reachable): Split part into ...
3658         (Reachability.Unreachable): ... this.  Simplify.
3659         (Reachability.IsUnreachable): Use 'Unreachable' instead.
3660
3661         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3662         (Reachability.SetThrowsSometimes): Likewise.
3663         (FlowBranchingBlock.MergeTopBlock): Don't compare against
3664         TriState.Always, use corresponding property.
3665         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3666         (Block.Resolve): Likewise.  Remove some redundant checks.
3667
3668 2006-05-02  Raja R Harinath  <harinath@gmail.com>
3669
3670         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3671         (Reachability.Meet): Don't bother checking AlwaysThrows --
3672         barrier is always set.
3673         (FlowBranchingBlock.Merge): Likewise.
3674
3675 2006-05-01  Raja R Harinath  <harinath@gmail.com>
3676
3677         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3678         checks for unreachable.
3679
3680 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
3681
3682         A fix for #77980
3683         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3684
3685         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3686         whether field is really assigned.
3687
3688 2006-04-30  Raja R Harinath  <harinath@gmail.com>
3689
3690         * flowanalysis.cs (Reachability): Make 4-argument constructor
3691         private.
3692         (Reachability.Meet): Rename from 'And'.  Remove static variant.
3693         (Reachability.Always): Rename from the highly misleading
3694         'Reachability.Never'.
3695         (FlowBranching.Merge): Update to changes.  Mark an impossible
3696         situation with a 'throw'.
3697         (*): Update to changes.
3698
3699 2006-04-29  Raja R Harinath  <harinath@gmail.com>
3700
3701         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3702         Remove 'Undefined'.
3703         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3704         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3705         (*): Update to changes.
3706         * statement.cs: Update to changes.
3707
3708 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
3709
3710         A fix for #78049
3711         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3712
3713 2006-04-28  Raja R Harinath  <harinath@gmail.com>
3714
3715         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3716         dummy UsageVector.
3717
3718         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3719         argument to two arguments: an usage-vector and a bool.  Move call
3720         to FlowBranching.Merge () ...
3721         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3722
3723         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3724         handling of loop and switch reachability to ...
3725         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3726
3727 2006-04-27  Raja R Harinath  <harinath@gmail.com>
3728
3729         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3730         handling to FlowBranchingLoop.InLoop.
3731         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3732
3733 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
3734
3735         A fix for #78115
3736         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3737         anonymous method is allowed from AnonymousContainer here.
3738
3739         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3740
3741 2006-04-24  Raja R Harinath  <rharinath@novell.com>
3742
3743         Fix #78156
3744         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3745
3746 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
3747
3748         A fix for #49011.
3749         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3750         (DoubleConstant.Reduce): Ditto.
3751
3752 2006-04-23  Raja R Harinath  <rharinath@novell.com>
3753
3754         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3755         Remove 'lvalue_right_side' argument.  Move parts to ...
3756         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3757         (LocalVariable.DoResolveLValue): ... these.
3758
3759 2006-04-21  Raja R Harinath  <rharinath@novell.com>
3760
3761         Fix cs1655.cs
3762         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3763         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3764         (LocalVariableReference.DoResolveBase): Use it to implement new
3765         CS1655 check.
3766         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3767         (Argument.Resolve): Simplify.  Move CS1510 check ...
3768         * ecore.cs (Expression.ResolveLValue): ... here.
3769         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3770         (PropertyExpr.DoResolveLValue): Likewise.
3771         (FieldExpr.Report_AssignToReadonly): Likewise.
3772         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
3773         LValueMemberAccess or LValueMemberOutAccess on instance depending
3774         on it.
3775         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3776         DoResolve as appropriate.
3777
3778 2006-04-20  Raja R Harinath  <rharinath@novell.com>
3779
3780         Fix #75800
3781         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3782         implicit conversions on 'out' and 'ref' arguments.
3783
3784         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3785         improve clarity.  Remove dead code.
3786
3787         Fix #66031
3788         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3789         (Catch.Resolve): Resolve VarBlock if it exists.
3790
3791 2006-04-19  Miguel de Icaza  <miguel@novell.com>
3792
3793         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3794         twice, this was some residual code, the enumerator was emitted
3795         properly in the two branche of if later.
3796
3797 2006-04-19  Raja R Harinath  <rharinath@novell.com>
3798
3799         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
3800         cast is never an lvalue.
3801         (Cast.DoResolve, Cast.ResolveRest): Combine.
3802         (Argument.Emit): Simplify slightly.  Move 'Expr is
3803         IMemoryLocation' check ...
3804         (Argument.Resolve): ... here.
3805         (Argument.Error_LValueRequired): Remove.  Inline into only user.
3806
3807         Simplifications.  Fix cs0191-2.cs
3808         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3809         CS1649 and CS1651 to ...
3810         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
3811         the actual selection of the error code and message to a lookup
3812         table.  Add a dummy return value to simplify callsites.
3813         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3814         readonly fields of other instances of the same type.  Move CS0197
3815         warning from ...
3816         * expression.cs (Argument.Resolve): ... here.  Simplify code.
3817         Ensure that ec.InRefOutArgumentResolving is only set during LValue
3818         resolution of an out or ref argument.  The code simplification
3819         above uses this invariant.
3820
3821 2006-04-18  Raja R Harinath  <rharinath@novell.com>
3822
3823         Possibly fix #77752.  Fix cs1690-[4-7].cs.
3824         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3825         CheckMarshallByRefAccess.  Drop parameter.
3826         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
3827         warning.
3828         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3829         InstanceExpression.
3830         * report.cs (AllWarnings): Add CS1690.
3831         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3832         for ref access too.
3833         (LocalVariableReference.DoResolveBase): Update.
3834
3835 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3836
3837         * class.cs (MethodOrOperator): Moved common parts from method class.
3838         detect obsolete attributes.
3839         (Method.Define): Simplified as it reuses code from base.
3840         (Constructor.ValidAttributeTargets): Fixed issue found during
3841         refactoring.
3842         (Destructor.ValidAttributeTargets): Fixed issue found during
3843         refactoring.
3844         (Operator): Finished refactoring set off by #78020. Operator class is now
3845         ordinary method class.
3846
3847         * anonymous.cs: Updated.
3848
3849         * decl.cs (DeclSpace): Add IsGeneric
3850
3851 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3852
3853         * class.cs (Constructor.Emit): Don't emit the attributes twice.
3854
3855 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3856
3857         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3858         detect obsolete attributes.
3859         (Method.CreateEmitContext): Moved to MethodOrOperator.
3860
3861 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3862
3863         A fix for #78048.
3864         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3865         customized exception to make crash detection easier.
3866         (MethodOrOperator): Started to work on new base class for methods and
3867         operators.
3868         (Method): Derives from MethodOrOperator.
3869         (Constructor.Emit): Emits its own attributes.
3870         (AbstractPropertyEventMethod.Emit): Ditto.
3871         (Operator): Derives from MethodOrOperator, will refactor fully in extra
3872         patch.
3873         (Operator.Emit): It's temporary more tricky than should be.
3874         
3875         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3876
3877         * report.cs (InternalErrorException): Add ctor with inner exception.
3878
3879 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
3880
3881         A fix for #76744.
3882         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3883         only not visible.
3884
3885 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
3886
3887         A fix for #77916.
3888         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3889         array.
3890
3891 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3892
3893         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3894         attribute is present and Guid not.
3895         (Interface.ApplyAttributeBuilder): Ditto.
3896
3897         * attribute.cs: Add error message.
3898
3899 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3900
3901         A fix for #78020.
3902
3903         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3904         sources (it's composite) so hold them in extra array as they are used in
3905         Emit phase only. It worked in the previous versions by mistake.
3906         (Attribute.Emit): Emit attribute for more owners when exist.
3907
3908         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3909         it has now different behaviour.
3910
3911 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
3912
3913         * constant.cs (Constant.IsDefaultInitializer): New method.
3914
3915         * class.cs: Updated.
3916
3917         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3918         re-initialize default values. It saves KBs almost for every assembly.
3919         Thanks Zoltan for the idea.
3920         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3921         (ArrayCreation.DoResolve): Resolve only once.
3922         (ArrayCreation.Emit): Emit static initializer only when it is faster.
3923         (ArrayCreation.GetAttributableValue): Cope with optimized values.
3924
3925 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
3926
3927         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3928         From #77961.
3929
3930 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3931
3932         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3933         in an embedded statement too.
3934
3935 2006-04-01  Raja R Harinath  <rharinath@novell.com>
3936
3937         Fix #77958
3938         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3939
3940 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3941
3942         A fix for #77966.
3943
3944         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3945         was not specified.
3946
3947         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3948
3949 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
3950
3951         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3952         phase.
3953
3954         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3955         LocalTemporary change.
3956
3957         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3958         TypeContainer.
3959         (ClassOrStruct.DefineFieldInitializers): Implemented static field
3960         initializers optimization.
3961         (ClassOrStruct.TypeAttr): Moved from modifiers.
3962         (Constructor.CheckBase): Don't crash when static ctor has parameters.
3963         (FieldBase.ResolveInitializer): Resolves initializer.
3964         (FieldBase.HasDefaultInitializer): New property.
3965
3966         * cs-parser.jay: Removed message.
3967
3968         * expression.cs (CompilerGeneratedThis): New specialization.
3969
3970         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3971
3972 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
3973
3974         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3975
3976 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3977
3978         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3979         be now EnumConstants only.
3980
3981 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3982
3983         * attribute.cs, driver.cs: Reset more caches.
3984
3985 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3986
3987         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3988
3989 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3990
3991         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3992         for easier reuse. Updated all overrides.
3993         (IntegralConstant): New base class for all integral constants.
3994         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3995         of the constant range, report custom error.
3996         (UIntConstant.Reduce): Fixed uint conversion.
3997
3998         * ecore.cs, literal.cs: Reduce updates.
3999
4000 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4001
4002         A fix for #75813.
4003
4004         * class.cs (Constructor.Define): Removed extra if for default ctors.
4005         A patch from Atsushi Enomoto.
4006
4007 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4008
4009         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
4010         GetAttributableValue.
4011
4012         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
4013         when required.
4014
4015         * convert.cs (ImplicitConversionRequired): Error message moved to
4016         DoubleLiteral.
4017
4018         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
4019         automatic implicit conversion of an output value.
4020         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
4021
4022         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
4023         conversion.
4024         (TypeOf.GetAttributableValue): Add extra handling for object type.
4025
4026         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
4027         special error message.
4028
4029 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
4030
4031         * class.cs (Constructor.Emit): Don't crash when struct ctor is
4032         InternalCall.
4033         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
4034         compatible with MS runtime.
4035
4036 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
4037
4038         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
4039         attribute arguments here.
4040
4041         * class.cs (Indexer.Define): The check was moved to attribute class.
4042
4043 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
4044
4045         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
4046         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
4047         easier.
4048
4049 2006-03-22  Raja R Harinath  <rharinath@novell.com>
4050
4051         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
4052         mcs to keep code differences small.
4053         * attribute.cs (Attribute.GetParameterDefaultValue): New.
4054         * typemanager.cs (parameter_default_value_attribute_type): New.
4055         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
4056         CS1908 check.
4057
4058 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
4059
4060         * expression.cs (StringConcat.Append): Reverted back to no warning state.
4061
4062 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
4063
4064         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
4065
4066         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
4067         the blocks too.
4068
4069 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
4070
4071         * doc-bootstrap.cs : fix build.
4072
4073 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
4074
4075         * expression.cs (StringConcat.Append): Issue a warning when empty string
4076         is going to append.
4077
4078 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
4079
4080         * assign.cs (CompoundAssign.ResolveSource): Removed.
4081
4082         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
4083         clean up.
4084
4085         * class.cs (TypeContainer.FindMethods): Removed.
4086         (TypeContainer.CheckMemberUsage): Made static.
4087
4088         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
4089
4090         * constant.cs (CheckRange): Removed unused type argument.
4091         (CheckUnsigned): Removed unused type argument.
4092
4093         * cs-parser.jay: Updated after MemberAccess clean up.
4094         Uses Length for empty string test.
4095
4096         * cs-tokenizer.cs: Uses Length for empty string test.
4097         (IsCastToken): Made static.
4098         (is_hex): Made static.
4099         (real_type_suffix): Made static.
4100
4101         * decl.cs (SetupCache): Made static.
4102         (OnGenerateDocComment): Removed unused ds argument.
4103
4104         * delegate.cs (VerifyDelegate): Removed unused argument.
4105
4106         * doc.cs: Uses Length for empty string test.
4107
4108         * driver.cs: Uses Length for empty string test.
4109
4110         * enum.cs (IsValidEnumType): Made static
4111
4112         * expression.cs (EnumLiftUp): Removed unused argument.
4113         (ResolveMethodGroup): Ditto.
4114         (BetterConversion): Ditto.
4115         (GetVarargsTypes): Ditto.
4116         (UpdateIndices): Ditto.
4117         (ValidateInitializers): Ditto.
4118         (MemberAccess.ctor): Ditto.
4119         (GetIndexersForType): Ditto.
4120
4121         * flowanalysis.cs: (MergeFinally): Removed unused argument.
4122
4123         * iterators.cs: Updated after MemberAccess clean up.
4124
4125         * location.cs: Uses Length for empty string test.
4126
4127         * namespace.cs: Uses Length for empty string test.
4128
4129          * report.cs (CheckWarningCode): Made static.
4130
4131         * statement.cs (LabeledStatement): Removed unused argument.
4132
4133         * typemanager.cs (FilterNone): Removed.
4134
4135 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4136
4137         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
4138         obsolete.
4139
4140         * class.cs: Updated.
4141
4142 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4143
4144         * cs-parser.jay.cs: __arglist is not allowed for delegates.
4145
4146 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4147
4148         A fix for #77822.
4149
4150         * expression.cs (VerifyArgumentsCompat): Reverted to double error
4151         reporting, it's more tricky than I thought.
4152
4153 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4154
4155         A fix for #77816.
4156
4157         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
4158         host container.
4159         (AnonymousMethod.ImplicitStandardConversionExists): New method.
4160         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
4161         Add more error reporting; Fixed issue with params.
4162
4163         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
4164
4165         * cs-parser.jay: AnonymousMethod requires host container.
4166
4167         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
4168
4169 2006-03-18  Raja R Harinath  <harinath@gmail.com>
4170
4171         * class.cs: Change 'TypeContainer ds' constructor argument to
4172         'DeclSpace parent'.  Some classes were missed below due to
4173         different naming convention.
4174
4175         * class.cs (MemberCore.Parent): Delete.  This makes the
4176         ParentContainer changes below enforceable by the compiler.
4177
4178         Treat pointers to enclosing declaration space as 'DeclSpace', not
4179         'TypeContainer'.
4180         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
4181         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
4182
4183         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
4184         of TypeContainer.
4185         (Block.AddThisVariable): Likewise.
4186         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
4187         (AbstractPropertyEventMethod.Emit): Likewise.
4188         (AbstractPropertyEventMethod.EmitMethod): Likewise.
4189         (GetMethod.Define, SetMethod.Define): Likewise.
4190         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
4191         (DelegateMethod.EmitMethod): Likewise.
4192
4193         Fix regression test-partial-13.cs.
4194         Rationalize use of PartialContainer.  Ensure that the partial
4195         class semantics can be tied to type-correctness, i.e., any
4196         violation will cause a compile error.
4197         * class.cs, const.cs: Access all fields that belong to class
4198         TypeContainer via ParentContainer.  Arguments of EmitContexts and
4199         Resolve()-like functions still use 'Parent'.
4200
4201         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
4202         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
4203         (PropertyMethod.CheckModifiers): Remove unused argument.
4204         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
4205         DeclSpace.
4206
4207 2006-03-17  Raja R Harinath  <harinath@gmail.com>
4208
4209         Make semantics of PartialContainer simpler.
4210         * decl.cs (DeclSpace.IsPartial): Remove.
4211         * class.cs (TypeContainer.IsPartial): Likewise.
4212         (TypeContainer..ctor): Set PartialContainer to point to self.
4213         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
4214         (TypeContainer.FindNestedType): Likewise.
4215         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
4216
4217 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
4218
4219         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
4220
4221 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
4222
4223         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
4224         classes.
4225
4226 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
4227
4228         * class.cs (Operator.Define): An error for base conversion was not
4229         reported correctly.
4230
4231 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
4232
4233         * iterator.cs : yield break is allowed in try statement which has
4234           catch clauses. Fixed bug #77767.
4235
4236 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
4237
4238         A fix for #77593, #77574.
4239
4240         * class.cs (MethodCore.CheckBase): Another if for operator.
4241
4242 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
4243
4244         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
4245         were not resolved
4246
4247         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
4248         (DelegateCreation.ImplicitStandardConversionExists): New method for just
4249         conversion test.
4250         
4251         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
4252         not needed.
4253
4254         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
4255         Updated after another emitcontext usage was clean up. It should help us to
4256         synchronize with gmcs easier.
4257
4258 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
4259
4260         A fix for #77353.
4261
4262         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
4263         (Event.Define): ditto
4264         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
4265
4266         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
4267         Removed redundant code and set NewSlot for Invoke method too.
4268
4269         * parameter.cs (Parameters.ctor): Add custom, type ctor.
4270         (Parameters.MergeGenerated): New method. Use this method when you merge
4271         compiler generated argument with user arguments.
4272
4273 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
4274
4275         * attribute.cs (ResolveAsTypeTerminal): Removed.
4276
4277         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
4278         specialization for predefined types; 30% speed up.
4279         Finally placed obsolete check to right place.
4280         (Expression.ResolveType): Removed.
4281
4282         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
4283         Updated after ResolveType was removed.
4284
4285         * expression.cs (Cast.ctor): Check void cast.
4286         (Binary.ResolveAsTypeTerminal): Is never type.
4287         (Conditional.ResolveAsTypeTerminal): Is never type.
4288
4289         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
4290
4291 2006-03-01  Raja R Harinath  <rharinath@novell.com>
4292
4293         Fix #77679.
4294         * expression.cs (ParameterReference.DoResolveBase): Change return
4295         type to bool.
4296         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
4297         Update.
4298
4299         Fix #77628.
4300         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
4301
4302         Fix #77642.
4303         * typemanager.cs (GetFullNameSignature): Don't nullref on
4304         protected accessors.
4305
4306 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
4307
4308         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
4309         these two separated members to simplify the code.
4310         (Attribute.Resolve): Refactored to use new fields and methods.
4311         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
4312         implemented obsolete attribute checking.
4313         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
4314         implemented obsolete checking again. It look line never ending quest ;-)
4315         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
4316
4317         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
4318
4319         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
4320
4321         *class.cs (Property.Define): Add RegisterProperty call.
4322
4323         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
4324         argument groups (only 2).
4325
4326         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
4327         encoding expression to arguments.
4328         (Expression.ExprClassToResolveFlags): Just turned to property.
4329
4330         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
4331         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
4332         optimized as well as implemented support for zero-length attributes.
4333
4334         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
4335         Add caching of PropertyInfo's.
4336
4337 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4338
4339         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
4340         error multiple times.
4341
4342 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4343
4344         New partial class implementation.
4345         A fix for #77027, #77029, #77403
4346
4347         * attribute.cs (Attributable): Made attributes protected.
4348
4349         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
4350         the replacements of ClassPart and PartialContainer.
4351         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
4352         (TypeContainer.AddInterface): Ditto.
4353         (TypeContainer.AddPartial): The main method for partial classes. It checks
4354         for errors and merges ModFlags and attributes. At the end class is added to
4355         partial_parts list.
4356         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
4357         required here.
4358         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
4359         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
4360         from the rest of partial classes.
4361         (TypeContainer.GetClassBases): Simplified.
4362         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
4363         DefineType.
4364         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
4365         (TypeContainer.HasExplicitLayout): Uses Flags now.
4366         (PartialContainer): Removed.
4367         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
4368         (StaticClass): Was merged with Class.
4369         (Class.GetClassBases): class and static class bases are verified here.
4370         (Class.TypeAttr): Added static attributes when class is static.
4371         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
4372         (MemberBase): In some cases we need to call parent container for partial
4373         class. It should be eliminated but it's not easy now.
4374
4375         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
4376
4377         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
4378         partial classed to accumulate class comments.
4379         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
4380
4381         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
4382
4383         * driver.cs (MainDriver): Tree.GetDecl was removed.
4384
4385         * modifiers.cs (Modifiers): Add partial modifier.
4386
4387         * tree.cs (Tree.decl): Removed.
4388         (RootTypes): Started to use this class more often for root types
4389         specializations.
4390
4391 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4392
4393         A fix for #77615
4394
4395         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
4396         external interface does not have an attribute.
4397
4398 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4399
4400         Another prerequisites for new partial classs implementation.
4401         
4402         * attribute.cs (Attribute.Equal): Implemented.
4403         (Attribute.Emit): Changed as attributes can be applied more than twice.
4404         (Attributes.Emit): Check for duplicate attributes here.
4405
4406         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
4407         as a parameter, clean-up.
4408
4409 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4410
4411         A fix for #77485
4412
4413         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
4414         contains obsolete attribute check which can in some cases look for base
4415         type of current class which is not initialized yet.
4416         (TypeContainer.BaseType): Replacement of ptype.
4417
4418         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
4419
4420 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4421
4422         First of prerequisites for new partial classs implemention.
4423         
4424         * attribute.cs (Attributable): Extended by ResolveContext;
4425         Attributes finally have correct context for resolving in all cases.
4426         (AttachTo): Attribute owner is assigned here.
4427
4428         * codegen.cs (IResolveContext): Introduce new interface to hold
4429         all information needed in resolving phase.
4430         (EmitContext): Implements IResolveContext; more clean-up needed here.
4431         
4432         * decl.cs (MemberCore): Implemented IResolveContext.
4433
4434         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
4435         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
4436         parameter.cs, statement.cs, tree.cs, typemanager.cs:
4437         Refactored to use new IResolveContext instead of EmitContext; cleanup
4438
4439 2006-02-06  Miguel de Icaza  <miguel@novell.com>
4440
4441         * codegen.cs (EmitScopeInitFromBlock): check here the
4442         capture_context, there is no need to make two calls to the
4443         EmitContext. 
4444
4445         * anonymous.cs: Add some debugging messages that might help me
4446         track other instances of this problem in the future (the
4447         regression of test 467).
4448
4449         * cs-parser.jay: track the variable block, as we need to initalize
4450         any captured variables declared in this block for the "catch"
4451         portion of the "Try" statement.
4452
4453         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
4454         scope initialization for captured variables. 
4455
4456         Also, move the emit for the variables after the block location has
4457         been marked.
4458
4459 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
4460
4461         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
4462
4463 2006-02-02  Miguel de Icaza  <miguel@novell.com>
4464
4465         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
4466         commit yesterday, the initialization for the roots is necessary.
4467         What is not necessary is the scope activation.
4468
4469 2006-02-02  Raja R Harinath  <rharinath@novell.com>
4470
4471         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
4472         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
4473         CS0206 checks.
4474         (Argument.Resolve): Remove CS0206 checks.
4475
4476 2006-02-01  Miguel de Icaza  <miguel@novell.com>
4477
4478         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
4479         scopes for all the roots, the scopes will now be emitted when the
4480         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
4481
4482         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
4483         code.  This reduces a lot of existing cruft.
4484         
4485         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
4486         that the ScopeInfo is generated as we enter the scope, not at the
4487         time of use, which is what we used to do before.
4488
4489         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
4490         every time a Block is about to be emitted if we have a
4491         CaptureContext. 
4492
4493 2006-02-01  Raja R Harinath  <rharinath@novell.com>
4494
4495         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4496         (Reset): Update.
4497         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
4498
4499         * typemanager.cs (cons_param_array_attribute): Make private.
4500         (Reset): Set it to null.
4501         (InitCoreHelpers): Don't initialize it.
4502         (ConsParamArrayAttribute): New.  Initialize it as needed.
4503         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
4504
4505 2006-01-31  Miguel de Icaza  <miguel@novell.com>
4506
4507         * expression.cs: There might be errors reported during the
4508         selection of applicable methods.  If there are errors, do not
4509         continue execution as it will lead the compiler to crash.
4510
4511 2006-01-30  Miguel de Icaza  <miguel@novell.com>
4512
4513         * expression.cs: Member access is not allowed on anonymous
4514         methods.  Fixes #77402.
4515
4516 2006-01-30  Raja R Harinath  <rharinath@novell.com>
4517
4518         Fix #77401
4519         * cs-parser.jay (VariableDeclaration): Don't set
4520         current_array_type to null.
4521         (field_declaration, event_declaration, declaration_statement):
4522         Set it to null here.
4523
4524 2006-01-28  Raja R Harinath  <harinath@gmail.com>
4525
4526         * typemanager.cs (GenericParameterPosition): New.
4527         * doc.cs: Use it.
4528
4529 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
4530
4531         * doc.cs : To process "include" elements, first we should create
4532           another list than XmlNodeList, because it could result in node
4533           removal, which could result in that the XmlNodeList gives up
4534           yielding next node.
4535
4536           (Also made code identical to gmcs again.)
4537
4538 2006-01-25  Miguel de Icaza  <miguel@novell.com>
4539
4540         * ecore.cs: Introduce an error report that we were not catching
4541         before, if not silent, we must report the error.  Gonzalo ran into
4542         it.
4543
4544 2006-01-23  Miguel de Icaza  <miguel@novell.com>
4545
4546         A fix for bug: #76957
4547         
4548         * iterators.cs (MoveNextMethod.CreateMethodHost): call
4549         ComputeMethodHost before creating the method, this is a new
4550         requirement. 
4551
4552         * anonymous.cs (AnonymousContainer): Now we track all the scopes
4553         that this method references (RegisterScope).  The actual scope
4554         where the method is hosted is computed with the ComputeMethodHost
4555         before we create the method.
4556
4557         Moved the Deepest routine here.
4558
4559         (AnonymousContainer.ComputeMethodHost): New routine used to
4560         compute the proper ScopeInfo that will host the anonymous method.
4561
4562         (ScopeInfo): Deal with multiple roots.  The problem was that we
4563         did not have a unique root where all ScopeInfos could be hanged
4564         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
4565         of roots.  
4566
4567         Remove AdjustMethodScope which is now computed at the end.  Remove
4568         LinkScope which did a partial link, instead link all ScopeInfos
4569         before code generation from the new "LinkScopes" routine. 
4570
4571         Simplify all the Add* routines as they no longer need to maintain
4572         the tree, they just need to record that they are using variables
4573         from a ScopeInfo.
4574
4575         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
4576         routines to produce the forest of ScopeInfo trees.
4577
4578         * class.cs (TypeContainer.AppendMethod): This is just like
4579         AddMethod, but ensures that an interface implementation method
4580         (IEnumerable.XXX) is not inserted at the beginning of the queue of
4581         methods, but at the end.
4582
4583         We use this functionality to ensure that the generated MoveNext
4584         method in the iterator class is resolved/emitted before the
4585         enumerator methods created.   
4586
4587         This is required because the MoveNext method computes the right
4588         ScopeInfo for the method.  And the other methods will eventually
4589         need to resolve and fetch information computed from the anonymous
4590         method. 
4591
4592 2006-01-21  Raja R Harinath  <harinath@gmail.com>
4593             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
4594
4595         Fix rest of #76995.
4596         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
4597         the 'aliases' hash.
4598         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
4599         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
4600
4601 2006-01-18  Raja R Harinath  <rharinath@novell.com>
4602
4603         Fix #76656, cs0231-2.cs.
4604         * cs-parser.jay (formal_parameter_list): Make error case catch
4605         more issues.
4606         (parenthesized_expression_0): Add CS1026 check.
4607         (invocation_expression): Remove unused { $$ = lexer.Location }.
4608
4609 2006-01-17  Raja R Harinath  <rharinath@novell.com>
4610
4611         Fix #76824.
4612         * cs-parser.jay (statement_expression): Don't list out the
4613         individual statement-expressions.  Convert syntax error into
4614         CS0201 check.
4615
4616 2006-01-16  Raja R Harinath  <rharinath@novell.com>
4617
4618         Fix #76874.
4619         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4620         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
4621         CheckIntermediateModification.
4622         (FieldExpr.DoResolve): Add new two-argument version that
4623         allows us to resolve the InstanceExpression as an lvalue.
4624         The one-argument variant is now just a wrapper.
4625         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4626         Resolve the lhs as an lvalue if the it has a value type.
4627         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4628         from Assign.DoResolve.
4629         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4630         resolved as an lvalue.
4631         (PropertyExpr.DoResolve): Update.
4632         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4633         has a value type.  Move CS1612 check here from
4634         CheckIntermediateModification.
4635         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4636         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
4637         'right_side' of a ResolveLValue on an 'out' argument.
4638         (EmptyExpression.LValueMemberAccess): New.  Used as the
4639         'right_side' of a propagated ResolveLValue on a value type.
4640         (LocalVariableReference.DoResolveBase): Recognize
4641         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4642         Add CS1654 check.
4643         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4644         EmptyExpression.Null.
4645
4646 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
4647
4648         * typemanager.cs : added IsGenericParameter(). In mcs it always
4649           return false.
4650         * doc.cs : for generic parameters, use GenericParameterPosition,
4651           not FullName.
4652
4653 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
4654
4655         * expression.cs: Fix Console.WriteLine ((this = x).foo);
4656
4657 2006-01-12  Miguel de Icaza  <miguel@novell.com>
4658
4659         This fixes the problem where we used ldfld instead of ldflda to
4660         load the "THIS" pointer on captured parameters, when THIS is a
4661         value type.  See bug #77205.
4662         
4663         * iterators.cs (CapturedThisReference.Emit): Pass false to
4664         EmitThis (we do not need the address).
4665
4666         * codegen.cs (EmitThis): it needs to know whether we need the
4667         address of `this' or not.  This is used by value types.  
4668
4669         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4670         every other call passes false.
4671
4672 2006-01-12  Raja R Harinath  <rharinath@novell.com>
4673
4674         Fix #77221.
4675         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4676         GetOverride.
4677         * expression.cs (Invocation.OverloadResolve): Update.
4678         (Invocation.DoResolve): Avoid double resolution of invocation.
4679
4680 2006-01-11  Raja R Harinath  <rharinath@novell.com>
4681
4682         Fix #77180.
4683         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4684         unary negation of floating point types as 0-expr; negation cannot
4685         overflow in floating point types.
4686
4687         Fix #77204.
4688         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4689         on operands of 'void' type.
4690
4691         Fix #77200.
4692         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4693         and ExclusiveOr for boolean constants too.
4694
4695 2006-01-09  Raja R Harinath  <rharinath@novell.com>
4696
4697         Fix #75636.
4698         * expression.cs (Invocation.OverloadResolve): Replace reflected
4699         override methods with their base virtual methods, rather than
4700         skipping over them.
4701         * typemanager.cs (TypeManager.GetOverride): New.
4702
4703 2006-01-05  Jb Evain  <jbevain@gmail.com>
4704
4705         * class.cs (Property.Define, Indexer.Define): do not tag the
4706         properties as SpecialName | RTSpecialName.
4707
4708 2006-01-04  Miguel de Icaza  <miguel@novell.com>
4709
4710         * class.cs (MethodCore.IsDuplicateImplementation): This method was
4711         doing a low-level comparission of parameter types.  It was lacking
4712         a check for __argslist. 
4713
4714 2005-12-30  Miguel de Icaza  <miguel@novell.com>
4715
4716         * expression.cs (ParameterReference.DoResolveBase): Allow
4717         reference parameters if they are local to this block. 
4718
4719         This allows the ref and out parameters of a delegate to be used in
4720         an anonymous method, for example:
4721
4722         delegate void set (out int x);
4723
4724         set s = delegate (out int x){
4725                 x = 0;
4726         };
4727
4728         This is used by functionality introduced late in the C# language.
4729         
4730         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4731         method that take ref and out parameters. 
4732
4733         Fixes #77119 which was a late change in the spec.
4734
4735 2005-12-23  Miguel de Icaza  <miguel@novell.com>
4736
4737         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4738         parent if its the same scope.  Fixes #77060.
4739
4740 2005-12-21  Miguel de Icaza  <miguel@novell.com>
4741
4742         * driver.cs: Report the case of no source files and no -out:
4743         argument provided.
4744
4745 2005-12-20  Raja R Harinath  <rharinath@novell.com>
4746
4747         Fix #77035.
4748         * expression.cs (ComposedCast.GetSignatureForError): Define.
4749
4750 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4751
4752         Fix #76995
4753
4754         * namespace.cs (NamespaceEntry): Add extern_aliases as a
4755         ListDictionary, to contain the ExternAliasEntry entries (in
4756         addition to the NamespaceEntry.aliases hashtable). This field is
4757         shared between the original entry and its doppelganger (bodyless 
4758         copy of it).
4759         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4760         extern_aliases field.
4761         (NamespaceEntry.Lookup): Move the IsImplicit check after the
4762         lookup in extern_aliases.
4763
4764 2005-12-16  Raja R Harinath  <rharinath@novell.com>
4765
4766         Fix #77006.
4767         * class.cs (TypeContainer.Mark_HasEquals): New.
4768         (TypeContainer.Mark_HasGetHashCode): New.
4769         (ClassPart): Override them.
4770         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4771
4772         Fix #77008.
4773         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4774         'parent' argument to the base constructor.
4775
4776         Remove all mention of TypeContainer from decl.cs.
4777         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4778         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4779         (DeclSpace.DeclSpace): Likewise.
4780         (DeclSpace.DefineMembers): Remove unused argument.
4781         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
4782         debugging check -- we don't care if the debug code throws an
4783         InvalidCastException instead of an InternalErrorException.
4784         * class.cs (TypeContainer.DefineMembers): Update to changes.
4785         (TypeContainer.DoDefineMembers): Likewise.
4786         (TypeContainer.GetMethods): Likewise.
4787         (PropertyMember.Define): Likewise.
4788         (MemberBase.Parent): New property that forwards to
4789         MemberCore.Parent, but ensures that we get a TypeContainer.
4790         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4791         (RootContext.PopulateTypes): Likewise.  Remove special case code
4792         for !RootContext.StdLib: DefineMembers is idempotent.
4793
4794 2005-12-14  Miguel de Icaza  <miguel@novell.com>
4795
4796         * convert.cs (ExplicitConversionCore): Check the return value from
4797         ExplicitConversionCore which can return null on failure.  Fixes #76914
4798
4799 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
4800
4801         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4802
4803 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
4804
4805         * doc.cs : The search for referenced namespace was insufficient to
4806           get global one as it used to do. Fixed bug #76965.
4807
4808 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
4809
4810         * doc.cs : check name in cref in the last phase that whether it is
4811           namespace or not.
4812
4813 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4814
4815         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4816           Mono.C5.
4817
4818 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4819
4820         * doc.cs : so it turned out that we cannot skip override check for 
4821           interface members. Fixed bug #76954.
4822
4823 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4824
4825         * cs-tokenizer.cs : fixed bug #75984:
4826           - #warning and #error should not be handled when the source line
4827             is disabled.
4828           - #line is not checked strictly when the source line is disabled.
4829           - #define and #undef is on the other hand checked strictly at any
4830             state.
4831
4832 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
4833
4834         * cs-tokenizer.cs : missing Location (actually, filename) in one of
4835           CS1027 report.
4836
4837 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4838
4839         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4840
4841         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4842         event initializers.
4843         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4844         (FieldBase.Initializer): Initializer is now optional.
4845         (EventField.Define): Only event field can have initializer.
4846
4847         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4848
4849         * const.cs (Const): Reuse initializer.
4850
4851         * cs-parser.jay: Updated after FieldBase changes.
4852         Added current_array_type to simplify array initializers.
4853
4854         * ecore.cs (NullCast.IsDefaultValue): Implemented.
4855
4856         * expression.cs, iterators.cs: Updated.
4857
4858         * namespace.cs (NamespaceEntry): Made UsingFound private.
4859
4860 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4861
4862         * parameterCollection.cs: Obsolete, removed.
4863         * parser.cs: Obsolete, removed.
4864
4865 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4866
4867         Fix #76849.
4868         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4869
4870         * enum.cs (Enum.Define): Set obsolete context here.
4871
4872 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4873
4874         * doc.cs :
4875           - FindDocumentedMember() now expects 1) paramList as null
4876             when "we don't have to check the number of parameters" and
4877             2) Type.EmptyTypes when "there is no arguments".
4878           - Introduced FoundMember struct to hold the exact type which was
4879             used to find the documented member (the above change broke
4880             test-xml-044; it might be better just to use DeclaringType than
4881             what MS does, like this change does, but it depends on usage.)
4882
4883 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4884
4885         * doc.cs : documented member might be from DeclaringType for nested
4886           types. Fixed bug #76782.
4887
4888 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
4889
4890         * anonymous.cs: Have the param code handle leaving copies on the
4891         stack etc. Allows anonymous params to take part in the assignment
4892         code (++, +=, etc). Fixes bug #76550
4893
4894         * expression.cs: Handle the prepare_for_load/leave_copy by passing
4895         it down to the anon code.
4896
4897         * iterators.cs: Use dummy var here
4898
4899         * codegen.cs: Handle new vars
4900
4901 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4902
4903         Fix #76849.
4904         * class.cs (MethodData.Define): Set proper Obsolete context.
4905
4906         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4907         obsolete context.
4908         (FieldExpr.DoResolve): Ditto.
4909
4910 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4911
4912         Fix #76849.
4913         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4914         parent is not obsolete.
4915
4916 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
4917
4918         * doc.cs : (FindDocumentedMember) find parameterless members first
4919           and get CS0419 in the early stage. Fixed first case of bug #76727.
4920
4921 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
4922
4923         Fix #76859.
4924         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4925         no error was reported.
4926
4927         *expression.cs (Binary.DoResolve): left can be null.
4928
4929 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
4930
4931         Fix #76783.
4932         * class.cs (MethodData.Emit): Parameters should be labeled first.
4933
4934 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
4935
4936         Fix #76761.
4937         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4938
4939 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
4940
4941         * attribute.cs (AreParametersCompliant): Moved to Parameter.
4942
4943         * class.cs (MethodCore): Parameter clean up.
4944         (IMethodData): Added ParameterInfo.
4945         (MethodData): Parameter clean up.
4946         (Indexer.Define): Parameter clean up.
4947
4948         * anonymous.cs,
4949         * codegen.cs,
4950         * cs-parser.jay,
4951         * decl.cs,
4952         * doc.cs,
4953         * ecore.cs,
4954         * flowanalysis.cs,
4955         * iterators.cs,
4956         * pending.cs,
4957         * statement.cs,
4958         * typemanager.cs: Parameter clean up.
4959
4960         * delegate.cs (Define): Get rid of duplicated code.
4961
4962         * expression.cs (ParameterReference): Removed useless parameters
4963         and simplified.
4964         (Invocation): Ditto.
4965
4966         * parameter.cs (ParamsParameter): New class, params specialization.
4967         (ArglistParameter): Attemp to separate arglist.
4968         (Parameter): Refactored to be reusable and faster.
4969         (Parameter.Modifier): Made understandable.
4970         (Parameters): Changed to be used as a class for `this' assembly
4971         parameters. Refactored to use new specialized classes.
4972
4973         * support.cs (ParameterData): Added Types property.
4974         (InternalParameters): Deleted.
4975
4976 2005-08-20  Martin Baulig  <martin@ximian.com>
4977
4978         Merging this patch from GMCS to fix #75867.
4979
4980         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4981         scope if we don't already have it.
4982
4983 2005-11-17  Martin Baulig  <martin@ximian.com>
4984
4985         * anonymous.cs
4986         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4987         inherit the scope from our parent.  Fixes #76653.
4988
4989 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4990
4991         * doc.cs : the previous patch does not actually fix the bug.
4992           PropertyInfo override check is now implemented and really fixed it.
4993         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4994
4995 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4996
4997         * doc.cs : apply "override filter" also to properties.
4998           Fixed bug #76730.
4999
5000 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
5001
5002         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
5003           no need to check overrides. For classes, omit those results from 
5004           interfaces since they must exist in the class. Fixed bug #76726.
5005
5006 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5007
5008         * typemanager.cs : (GetFullNameSignature) differentiate indexers
5009           with different parameters. Fixed the second problem in #76685.
5010
5011 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5012
5013         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
5014           get expected 'protected' access in CheckValidFamilyAccess()).
5015           Fixed bug #76692.
5016
5017 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5018
5019         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
5020           Fixed bug #76705.  CS1569 was incorrectly commented out.
5021
5022 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
5023
5024         * doc.cs : use Invocation.IsOverride() to do real override check.
5025         * expression.cs : made Invocation.IsOverride() internal.
5026
5027 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
5028
5029         * doc.cs : use TypeManager.FindMembers() instead of (possible)
5030           TypeBuilder.FindMembers() and filter overriden base members out.
5031           Fixed bug #76990.
5032
5033 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5034
5035         * doc.cs : ref/out parameters are represented as '@' (instead of
5036           '&' in type FullName). Fixed bug #76630 (additionally crefs).
5037
5038 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5039
5040         * doc.cs : when there was no '.' in cref to methods in doc comment,
5041           then parameters were missing in the output. Fixed bug #76691.
5042
5043 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5044
5045         * driver.cs : don't output docs when there is an error.
5046           Fixed bug #76693.
5047
5048 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5049
5050         * doc.cs :
5051           Now it should detect indexers. Fixed primary concern in bug #76685.
5052           Fixed CS0419 message to not show the identical member signature in
5053           the message.
5054
5055 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5056
5057         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
5058           instead of Type.FindMembers() since it does not handle events.
5059           Fixed bug #71604.
5060
5061 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
5062
5063         * codegen.cs: Fixed typo (speficied -> specified).
5064
5065 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
5066
5067         Fix #76369.
5068         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
5069
5070 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
5071
5072         * attribute.cs: Changed error message.
5073
5074         * cs-tokenizer.cs: One more check.
5075
5076 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
5077
5078         * statement.cs (Block.Resolve): Ignore empty statement.
5079
5080 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
5081
5082         * report.cs: Made error/warning methods more strict to avoid
5083         their misuse.
5084
5085         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
5086         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
5087         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
5088         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
5089
5090 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
5091
5092         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
5093         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
5094
5095         * class.cs (TypeContainer.IsComImport): New property.
5096         (Constructor.Define): Create proper ctor for ComImport types.
5097
5098         * expression.cs (New.CheckComImport): Fixed.
5099
5100 2005-11-07  Miguel de Icaza  <miguel@novell.com>
5101
5102         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
5103         that a parameter has been captured does not mean that we do not
5104         have to do the rest of the processing.  This fixes the second part
5105         of #76592.  If there was another anonymous method capturing
5106         values in the past, the Scope would never be set for the second
5107         method that captured the same parameter.
5108
5109         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
5110         properly manipulate the stack.   Second part of fix for #76592.
5111
5112         * expression.cs (New): Add support for invoking "new" on
5113         interfaces that have been flagged with the ComImport attribute and
5114         the CoClass.  Fixes #76637 
5115
5116         * statement.cs (Try.DoEmit): When a variable is captured, do not
5117         try to emit the vi.LocalBuilder variable as it has been captured.
5118         Create a temporary variable and store the results on the
5119         FieldBuilder.  Fixes #76642
5120
5121 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
5122
5123         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
5124
5125         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
5126
5127         * expression.cs (Binary.DoResolve): Added && optimalization.
5128     
5129         * typemanager.cs (AddUserType): Removed useless argument.
5130
5131 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
5132
5133         * statement.cs (Block.variables): Uses ListDictionary.
5134
5135 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
5136
5137         Fix #75969.
5138         * class.cs (PartialContainer.EmitType): Customized to emit
5139         security attributes.
5140         (ClassPart.ApplyAttributeBuilder): Transform security attribute
5141         for partial classes.
5142
5143 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
5144
5145         Fix #76599.
5146         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
5147         access has to be fixed.
5148         
5149         * typemanager.cs (IsUnmanagedType): Wrong common field type.
5150
5151 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
5152
5153         Fix #76590.
5154         * ecore.cs (NullCast.Reduce): Implemented.
5155
5156         * expression.cs (ArrayCreation.CheckIndices): Correcly check
5157         constant type.
5158         
5159         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
5160         properly.
5161         (Foreach.Resolve): Catch null properly.
5162
5163 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
5164  
5165         * cs-tokenizer.cs: Warning text fix.
5166
5167         * driver.cs: AllWarningNumbers exposed on public interface.
5168
5169         * report.cs (): Reviewed warning numbers.
5170         (IsValidWarning): Use binary search.
5171
5172 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
5173  
5174         * driver.cs: Implemeted resource visibility.
5175         (Resources): New class for code sharing between /res: and
5176         /linkres:
5177  
5178 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
5179
5180         Fix #76568.
5181         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
5182         folding.
5183         
5184         * convert (Convert.ImplicitReferenceConversion): NullCast holds
5185         contants only.
5186         
5187         * ecore.cs (NullCast): Child is contant only.
5188         
5189         * literal.cs (NullLiteral.Reduce): null can be converted to any
5190         reference type.
5191
5192 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
5193
5194         * driver.cs: Use Encoding.Default as default code page instead
5195           of ISO-28591.
5196
5197 2005-10-27  Raja R Harinath  <rharinath@novell.com>
5198
5199         Fix #76085.
5200         * expression.cs (Invocation.Error_InvalidArguments): Handle
5201         __arglist parameters.
5202         (Invocation.VerifyArgumentsCompat): Likewise.
5203         * support.cs (ReflectionParameters.GetSignatureForError): Print
5204         __arglist parameters.
5205         (InternalParamters.GetSignatureForError): Likewise.
5206         * parameter.cs (Parameters.GetSignatureForError): Likewise.
5207
5208 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
5209
5210         * attribute.cs (GetPropertyValue): Made public.
5211
5212         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
5213         Resolve.
5214         Add new property WrapNonExceptionThrows to handle 2.0 assembly
5215         attribute.
5216         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
5217         is not defined.
5218         
5219         * driver.cs: Reflect method name change.
5220         
5221         * statement.cs (Try.Resolve): Warn when try has both general
5222         exception handlers.
5223         
5224         * typemanager.cs: runtime_compatibility_attr_type new predefined
5225         type.
5226
5227 2005-10-26  Raja R Harinath  <harinath@gmail.com>
5228
5229         Fix #76419.
5230         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
5231         treat it as an empty parameter list.
5232
5233 2005-10-26  Raja R Harinath  <rharinath@novell.com>
5234
5235         Fix #76271.     
5236         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
5237         ResolveAsTypeStep silent.
5238         * statement.cs (Block.AddConstant): Mark block as used.
5239         (Block.ResolveMeta): Avoid piling on error messages
5240         if a constant initializer resolution fails.
5241
5242 2005-10-25  Raja R Harinath  <rharinath@novell.com>
5243
5244         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
5245         Remove.
5246         (NamespaceEntry.VerifyAllUsing): New.
5247         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
5248         behaviour.  Delegates actual resolution of alias to ...
5249         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
5250         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
5251         Update.
5252         * driver.cs (Driver.MainDriver): Update.
5253         
5254         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
5255         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
5256         property.
5257         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
5258         Remove.
5259         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
5260         RootNamespace.DefineNamespacesForAll.
5261
5262 2005-10-24  Raja R Harinath  <harinath@gmail.com>
5263
5264         * typemanager.cs (assemblies, external_aliases, modules)
5265         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
5266         (ComputeNamespaces, GetRootNamespace): Remove extra staging
5267         overhead.  Move resposibility ...
5268         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
5269         * driver.cs, attribute.cs, codegen.cs: Update to changes.
5270
5271 2005-10-23  Raja R Harinath  <harinath@gmail.com>
5272
5273         * namespace.cs (RootNamespace.all_namespaces): Renamed from
5274         cached_namespaces.  Improve usage.
5275         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
5276         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
5277         Move from GlobalRootNamespace and simplify.
5278         (RootNamespace.Global): Make instance variable.
5279         (RootNamespace.RootNamespace): Add "alias name" parameter.
5280         (GlobalRootNamespace): Simplify drastically.
5281         (Namespace.Lookup): Don't use GetNamespace.
5282         * typemanager.cs (GetRootNamespace): Rename from
5283         ComputeNamespaceForAlias.
5284         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
5285
5286 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5287
5288         * anonymous.cs (AnonymousContainer): Don't crash when container
5289         doesn't exist.
5290
5291 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5292
5293         * expression.cs (Binary.DoResolve): Warn when comparing same
5294         values.
5295
5296 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5297
5298         Fix #76486.
5299         * expression.cs (Binary.DoResolve): It looks like there are no
5300         convetsion rules in enum context.
5301
5302 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5303
5304         Add support for extern alias qualifiers.
5305         * typemanager.cs: Move some LookupTypeReflection code
5306         to namespace.cs, to have cleaner code. Added some methods
5307         to help us keep track of the extern aliased references.
5308         * driver.cs: Add suport for extern alias assemblies on command
5309         line and check for their warnings/errors. Also keep track of the
5310         extern aliased assemblies.
5311         * namespace.cs: Move the global functionality of Namespace
5312         to GlobalRootNamespace/RootNamespace. Now the global namespace
5313         is GlobalRootNamespace.Globa. Also the code moved from 
5314         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
5315         Finally added LocalAliasEntry (AliasEntry before) and
5316         ExternAliasEntry, to handle alias statements.
5317         * cs-parser.jay: Add support in the grammar for extern alias
5318         statement.
5319         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
5320         Update callings to Namespace (now in GlobalRootNamespace).
5321
5322 2005-10-18  Raja R Harinath  <rharinath@novell.com>
5323
5324         Fix #76371.
5325         * class.cs (TypeContainer.DefineType): Move updating of
5326         topological sort earlier in the code.
5327         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
5328
5329 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
5330
5331         Fix #76273.
5332         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
5333         
5334         * constant.cs (Constant.TryReduce): Moved from Cast class.
5335         (Reduce): Made little bit more OO and fixed missing conversions.
5336         
5337         * ecore.cs (Reduce): Implemented.
5338         (Binary.EnumLiftUp): New method to upgrade values to enum values.
5339         
5340         * literal.cs (Reduce): Implemented.
5341         
5342         * class.cs: Reverted Miguel's wrong commit.
5343
5344 2005-10-14  Miguel de Icaza  <miguel@novell.com>
5345
5346         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
5347
5348 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
5349
5350         * cs-parser.jay, expression.cs : CS0214 was missing error location
5351           for constants. Fixed bug #76404.
5352
5353 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
5354
5355         Fix #76370.
5356         * convert.cs (ExplicitConversionCore): Fixed object->enum
5357         conversion.
5358
5359 2005-10-10  Raja R Harinath  <rharinath@novell.com>
5360
5361         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5362         InstanceExpression.
5363         (PropertyExpr.EmitCall): Likewise.
5364         * expression.cs (Invocation.EmitArguments): Handle case where
5365         arguments == null.
5366         (Invocation.EmitCall): Avoid allocating temporary variable if
5367         there are no arguments.
5368
5369 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5370
5371         Fix #76323.
5372         * convert.cs (ImplicitConversionStandard): Move conversion of
5373         void* to arbitrary pointer types ...
5374         (ExplicitConversionStandard): .. here.
5375         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
5376         error to always print typenames.
5377
5378 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5379
5380         * convert.cs (GetConversionOperator): Rename from
5381         GetConversionOperators.  Move operator selection code from ...
5382         (UserDefinedConversion): ... here.
5383
5384 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
5385
5386         * convert.cs (ExplicitConversionCore): Removed duplicate enum
5387         conversion.
5388
5389 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
5390
5391         * assign.cs (Assign.DoResolve): Error method changed.
5392
5393         * cfold.cs (DoConstantNumericPromotions): Error method changed.
5394         
5395         * const.cs (ResolveValue): Reset in_transit immediately.
5396         
5397         * constant.cs: Error method changed.
5398         
5399         * convert.cs: Removed useless location parameter.
5400         (ExplicitNumericConversion): Don't do double enum check.
5401         (ExplicitConversionCore): Renamed from ExplicitConversion.
5402         (ExplicitUnsafe): Extracted from ExplicitConversion.
5403         (ExplicitConversion): Uses for error reporting.
5404         
5405         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
5406         error messages.
5407         (ResolveBoolean): Uses common error method.
5408         (CastToDecimal): Get rid of ec.
5409         (CastFromDecimal): Optimized.
5410         (ConvCast): Get rid of ec.
5411         
5412         * enum.cs (ResolveValue): Reset in_transit immediately.
5413         (Emit): Return after first error.
5414         
5415         * expression.cs: Convert changes.
5416         
5417         * literal.cs: Error method changed.
5418         
5419         * statement.cs: Error method changed.
5420
5421 2005-10-03  Raja R Harinath  <rharinath@novell.com>
5422
5423         * support.cs (SeekableStreamReader.Position): Don't error out when
5424         the requested position is just beyond the end of the current
5425         buffered data.
5426
5427 2005-09-28  Raja R Harinath  <rharinath@novell.com>
5428
5429         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
5430         try to keep in sync with the byte count of the underlying Stream.
5431         However, this limits us to a window size of 2048 characters: i.e.,
5432         the maximum lookahead of our lexer/parser can be 2048 characters.
5433
5434 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
5435
5436         Fix #76255.
5437         * driver.cs: Fix compilation files with full root path.
5438
5439 2005-09-25  Miguel de Icaza  <miguel@novell.com>
5440
5441         * report.cs (SymbolRelatedToPreviousError): Format the output so
5442         it does not use an open parenthesis that is never closed. 
5443
5444         * driver.cs: Follow coding guidelines
5445
5446 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5447
5448         Fix #72930.
5449         * const.cs (Const.ResolveValue): Check for assigning non-null
5450         value to reference type.
5451
5452 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5453
5454         * anonymous.cs: Implemented ExprClassName.
5455         
5456         * assign.cs (Assign.DoResolve): Don't chrash when type is not
5457         delegate.
5458         
5459         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
5460         check.
5461         
5462         * class.cs (StaticClass.DefineContainerMembers): Report protected
5463         members as error.
5464         
5465         * codegen.cs: if(ed) PRODUCTION.
5466         
5467         * convert.cs (Error_CannotImplicitConversion): Better error
5468         distinction.
5469         
5470         * cs-parser.jay: More error checks.
5471         
5472         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
5473         
5474         * driver.cs (CSCParseOption): Enabled wrong option check.
5475         
5476         * ecore.cs (Expression.ExprClassName): Turned to property.
5477         (MemberExpr.CheckIntermediateModification): For checking boxed
5478         value types     modification.
5479         
5480         * statement.cs (Fixed.Resolve): Expression type must be
5481         convertible to fixed type.
5482         (CollectionForeach.GetEnumeratorFilter,TryType):
5483         Small refactoring for easier error checking.
5484
5485 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
5486
5487         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
5488         attributes.
5489         
5490         * class.cs (GeneratedBaseInitializer): New class for customization
5491         compiler generated initializers.
5492         (MemberBase.DoDefine): Check Obsolete attribute here.
5493         (FieldMember.DoDefine): Ditto.
5494         
5495         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
5496         constants.
5497         
5498         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
5499         (MemberCore.GetObsoleteAttribute): Removed argument.
5500         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
5501         (MemberCore.CheckObsoleteType): New helper.
5502         
5503         * delegate.cs,
5504         * enum.cs,
5505         * statement.cs: Updates after MemberCore changes.
5506         
5507         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
5508         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
5509         
5510         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
5511         obsolete attribute for compiler construct.
5512         (As.DoResolve): Cache result.
5513         
5514         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
5515
5516 2005-09-26  Raja R Harinath  <rharinath@novell.com>
5517
5518         Fix #76133.
5519         * expression.cs (This.VerifyFixed): In a value type T, the type of
5520         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
5521         value type R, 'this' is treated as a value parameter.
5522
5523 2005-09-22  Miguel de Icaza  <miguel@novell.com>
5524
5525         * statement.cs (Lock): Use the TemporaryVariable class instead of
5526         manually using local variables as those do not work when variables
5527         are captured.
5528
5529         * ecore.cs: Moved the TemporaryVariable class from being a nested
5530         class inside Foreach to be a public class that can be employed in
5531         other places. 
5532
5533 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
5534
5535         * cs-parser.jay: interface_accessors replaced by
5536         accessor_declarations.
5537
5538         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
5539         location.
5540         
5541         * statement.cs (GotoCase.Resolve): Convert null constant to
5542         null case.
5543         (SwitchLabel.ResolveAndReduce): Ditto.
5544         (SwitchLabel.NullStringCase): Custom null stamp.
5545         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
5546         
5547         typemanager.cs (CSharpSignature): Don't skip first argument
5548         for full names.
5549
5550 2005-09-18  Miguel de Icaza  <miguel@novell.com>
5551
5552         * driver.cs: Set InEmacs based on the environment variable EMACS. 
5553
5554         * location.cs (InEmacs): in this mode, do not report column
5555         location as it confuses Emacs.
5556
5557 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
5558
5559         * cfold.cs, constant.cs, convert.cs, ecore.cs,
5560         expression.cs, iterators.cs, literal.cs: Store constants and
5561         literals location.
5562         
5563         * class.cs (MemberBase.ShortName): Pass location.
5564         
5565         * cs-parser.jay: Some location fixes.
5566         
5567         * ecore.cs (Expression.Location): Made virtual.
5568
5569 2005-09-05  Miguel de Icaza  <miguel@novell.com>
5570
5571         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
5572         if the underlying types are the same, otherwise we need to produce
5573         code that will do the proper cast.
5574
5575         This was exposed by Marek's constant rewrite which produced
5576         invalid code for the call site:
5577
5578         enum X : long { a }
5579         void Method (X v) {}
5580
5581         Method ((X) 5)
5582
5583         This fixes test-49.cs
5584
5585 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5586
5587         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
5588           Type/Object should be allowed as well. Fixed bug #75968.
5589
5590 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5591
5592         * expression.cs : (Binary.DoResolve): when one is enum constant and
5593           another is constant 0, then return enum one *as enum type*.
5594           Fixed bug 74846.
5595
5596 2005-09-02  Raja R Harinath  <rharinath@novell.com>
5597
5598         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
5599         internal.
5600
5601         Fix #75941.
5602         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
5603         flow-branching for LocalVariableReferences in case we were invoked
5604         from a MemberAccess.
5605         * expression.cs (LocalVariableReference.VerifyAssigned): New.
5606         Carved out of ...
5607         (LocalVariableReference.DoResolveBase): ... this.
5608         (MemberAccess.Resolve): Do the check that was disabled during
5609         SimpleNameResolve.
5610
5611 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5612
5613         * class.cs :
5614           (PartialContainer.Create): check abstract/sealed/static strictly
5615           but abstract/sealed can exist only at one side. Fixed bug #75883.
5616
5617 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
5618
5619         Fix #75945.
5620         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5621         specified, don't default to UnmanagedType.I4.
5622
5623 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5624
5625         * expression.cs : conditional operator should check possibly
5626           incorrect assign expression. Fixed bug #75946.
5627
5628 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5629
5630         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5631           Reverting the change. gmcs is much complex than mcs on this matter.
5632
5633 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5634
5635         * cs-tokenizer.cs : To read another token ahead of the actual 
5636           consumption, use new SavedToken and cache token instead of moving
5637           back the stream with SeekableStreamReader (it seemed problematic).
5638         * cs-parser.jay,
5639           driver.cs : Thus use StreamReader directly.
5640         * support.cs : Thus removed SeekableStreamReader.
5641
5642 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5643
5644         Fix #75934.
5645         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5646         (ScopeInfo.EmitScopeType): Use it to construct field names from
5647         names of captured locals.
5648
5649         Fix #75929.
5650         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5651         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5652         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
5653         (ExplicitConversion): Remove enum cases already handled by
5654         implicit conversion.  Move implicit conversion check to the beginning.
5655         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5656         * expression.cs (ArrayCreation.EmitDynamicInitializers):
5657         Don't treat System.Enum as a struct.
5658
5659 2005-08-30  Jb Evain  <jbevain@gmail.com>
5660
5661         * attribute.cs: handles as expression in parameters.
5662
5663 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5664
5665         Fix #75802.
5666         * class.cs (TypeContainer.VerifyClsName): Don't use a
5667         PartialContainer when verifying CLS compliance.
5668         (AbstractPropertyEventMethod): Set Parent here, ...
5669         (PropertyMethod): ... not here.
5670
5671 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
5672
5673         * attribute.cs : escaped attribute name should not be allowed to be
5674           resolved (e.g. @class as classAttribute). Fixed bug #75930.
5675
5676 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5677
5678         Fix #75927.
5679         * convert.cs (ImplicitStandardConversionExists): Allow zero also
5680         when converting a long constant to unsigned long.
5681         * expression.cs (Invocation.OverloadResolve): Add sanity check to
5682         detect where IsApplicable and VerifyArgumentsCompat disagree.
5683
5684 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5685         and Carlos Alberto Cortez  <carlos@unixmexico.org>
5686
5687         Fix #75848.
5688         * class.cs (TypeContainer.CanElideInitializer): New helper.
5689         (TypeContainer.EmitFieldInitializers): Use it to determine if we
5690         can safely emitting the initializer of a field.
5691
5692 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5693
5694         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5695           allowed inside a switch (without loop). Fixed bug #75433.
5696
5697 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
5698
5699         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5700         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5701
5702 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5703
5704         * driver.cs : kinda reverting the default encoding changes (not exact 
5705           revert since I noticed that "codepage:reset" might not work fine).
5706
5707 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5708
5709         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5710           Location. Now getter and setter store location correctly.
5711           (errors/cs0111-12.cs now reports the expected location.)
5712
5713 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5714
5715         * driver.cs : Use default encoding on the environment.
5716           Removed (now that) extra parameter for SeekableStreamReader.
5717         * support.cs : (SeekableStreamReader) third .ctor() argument for
5718           StreamReader is not required (always true). preamble size could
5719           be acquired in simpler and safe way.
5720
5721 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5722
5723         * cs-parser.jay: report CS0642 at warning level 3
5724           and report CS0642 for an if else statement also
5725           fixes bug #74745. Patch by John Luke (and a bit
5726           modified by me).
5727           Removed extra CS0642 warning check for "while",
5728           "for" and "fixed".
5729         * statement.cs: In Block.Resolve(), CS0642 check
5730           is reimplemented to check a sequence of an empty
5731           statement and a block.
5732
5733           Both fix bug #66777.
5734
5735 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
5736
5737         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5738         detection until I fix it.
5739         
5740         * cs-tokenizer.cs: Changed error message.
5741         
5742         * cs-parser.jay: Fixed 2 error locations.
5743         
5744         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5745         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5746         properties.
5747         
5748         * enum.cs (GetSignatureForError): Fixed.
5749         
5750         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5751         method detection.
5752         
5753         * class.cs,
5754         * typemanager.cs (RegisterProperty): Removed.
5755         
5756         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5757
5758 2005-08-24  Raja R Harinath  <rharinath@novell.com>
5759
5760         Fix #75874.
5761         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5762         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5763
5764 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5765
5766         * expression.cs : tiny fix is required for not warning positive ulong.
5767           See test-441.cs.
5768
5769 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5770
5771         * expression.cs : add CS0652 check for constant and integral
5772           expression. Fixed bug #53974.
5773
5774 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5775
5776         * expression.cs : in DoNumericPromotions(), check if there is implicit
5777           conversion overload for string (to check CS0034). Fixed bug #52492.
5778
5779 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5780
5781         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5782
5783 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5784
5785         * ecore.cs : report location when it is *not* Null.
5786
5787 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5788
5789         * codegen.cs,
5790           ecore.cs,
5791           flowanalysis.cs,
5792           expression.cs:
5793           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5794           correctly. Fixed bug #75721.
5795
5796 2005-08-23  Raja R Harinath  <rharinath@novell.com>
5797
5798         * support.cs (SeekableStreamReader.Position): Avoid an expensive
5799         loop that performs 'min (pos, char_count)'.
5800
5801         Fix #75862.
5802         * expression.cs (Unary.ResolveOperator): Don't discard implicit
5803         converted value in Operator.OnesComplement.
5804
5805 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
5806
5807         * anonymous.cs: If the anon method is pulled into a helper class,
5808         it needs to be `internal' not `private'. Fixes runtime behavior on
5809         msft. bug #75704
5810
5811 2005-08-20  Martin Baulig  <martin@ximian.com>
5812
5813         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5814         scope if we don't already have it.
5815
5816         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5817         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5818         fixes #75867.
5819
5820 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
5821
5822         Fix #75803
5823         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5824         is a partial class.
5825
5826 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
5827
5828         The big constants rewrite
5829         Fix #75746, #75685 and more
5830         As a side effect saved 1MB for MWF ;-)
5831         
5832         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5833         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5834         enum based for corlib compilation.
5835         
5836         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5837         subtractions.
5838         
5839         * class.cs (FixedField.Define): Use ResolveAsConstant.
5840         
5841         * const.cs (IConstant): Interface constants and enums.
5842         (Const.ResolveValue): New method for constant resolvning.
5843         (ExternalConstant): Constants from imported assemblies.
5844         
5845         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5846         conversion; like enums.
5847         (Constant.ToType): Converts this constant to different type.
5848         (Constant.Increment): Adds 1.
5849         
5850         * convert.cs (ImplicitConversionRequired): Simplified.
5851         
5852         * cs-parser.jay: Create EnumMember directly.
5853         
5854         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5855         
5856         * doc.cs (GenerateEnumDocComment): Removed.
5857         
5858         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5859         (ConvertIntLiteral): Removed.
5860         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5861         
5862         * enum.cs (EnumMember): Implement IConstant.
5863         (Enum.IsValidEnumConstant): Removed.
5864         (Enum.GetNextDefaultValue): Removed.
5865         (Enum.FindMembers): Updated.
5866         (Enum.GenerateDocComment): Iterate enum members.
5867         
5868         * expression.cs (Cast.TryReduce): Handle enums correctly.
5869         (New.Constantify): Made public.
5870         (MemberAccess.DoResolve): Removed contant specific if(s).
5871         
5872         * literal.cs (NullLiteral): Implement new abstract methods.
5873         
5874         * statement.cs (GotoCase.Resolve): Use new constant methods.
5875         (SwitchLabel.ResolveAndReduce): Use new constant methods.
5876         
5877         * typemanager.cs (LookupEnum): Removed.
5878         (IsEnumType): Fixed to work with corlib.
5879         (RegisterConstant): Removed.
5880         (LookupConstant): Removed.
5881         (GetConstant): Changed to work with IConstant.
5882
5883 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
5884
5885         * location.cs : Fixed overflown (>255) column number.
5886
5887 2005-08-03  Raja R Harinath  <rharinath@novell.com>
5888
5889         First cut of the qualified-alias-member feature.
5890         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5891         token.
5892         * cs-parser.jay (DOUBLE_COLON): New token.
5893         (namespace_or_type_name): Add rule for recognizing
5894         qualified-alias-members.
5895         (primary_expression): Likewise.
5896         (element_access): Allow QualifiedAliasMember as a possible
5897         type-bearing expression.
5898         (local_variable_type, local_variable_pointer_type): Likewise.
5899         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
5900         aliases in the current and enclosing namespace declarations.
5901         (NamespaceEntry.UsingAlias): Add CS0440 warning.
5902         * decl.cs (MemberName.is_double_colon): New.
5903         (MemberName.MemberName): Add new constructor for alias-member.
5904         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5905         * expression.cs (QualifiedAliasMember): New expression type.
5906
5907 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5908
5909         * location.cs : it borked when no argument was specified.
5910
5911 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5912
5913         * location.cs : tiny ToString() format fix.
5914
5915 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5916
5917         * statement.cs : oops, it was missing.
5918
5919 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5920
5921         A set of fixes for precise line/column location.
5922
5923         * location.cs :
5924           "token" field now holds a file/line "delta", a line number offset 
5925           from the segment, and a column number. See also:
5926           http://lists.ximian.com/pipermail/mono-devel-list/2004-
5927           December/009508.html
5928           Removed static IsNull. Use instance IsNull property instead.
5929         * cs-tokenizer.cs :
5930           For some tokens it stores Location. For Identifier it stores
5931           LocatedToken which is a pair of string name and location.
5932           Column numbers are adjusted only at getChar().
5933         * report.cs :
5934           Use Location.ToString() for reporting (it now contains column).
5935         * cs-parser.jay :
5936           Largely modified to use LocatedToken instead of
5937           string (IDENTIFIER), and to acquire Location from some tokens.
5938         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5939           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5940           codegen.cs :
5941           Now MemberName holds Location. DeclSpace.ctor() receives Location
5942           as a parameter. Removed extra parameters to all derived classes.
5943           Replaced Location.IsNull() with instance property.
5944         * assign.cs, expression.cs :
5945           Added .ctor() overload that omits Location.
5946         * attribute.cs :
5947           Added "nameEscaped" flag that indicates the identifier was escaped
5948           in the source file. This fixes bug #57047.
5949
5950 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
5951
5952         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5953         New method, looking for lo-case imported cls type.
5954
5955         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5956         here.
5957
5958         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5959
5960         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5961
5962         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5963         all_imported_types.
5964         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5965
5966         Optimized to save 3.5 MB for SWF compilation.
5967
5968 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5969
5970         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5971         (PartialContainer.Create): Moved logic AddToContainer.
5972         (PartialContainer.MarkForDuplicationCheck): Shares name.
5973         
5974         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5975         place.
5976         
5977         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5978         initialization.
5979         (Namespace.GetSignatureForError): New method.
5980         
5981         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5982         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5983
5984 2005-08-01  Raja R Harinath  <rharinath@novell.com>
5985
5986         Fix #75669.
5987         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5988         member lookup rather than qualifier_type, since qualifier_type can
5989         be null.
5990
5991 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5992
5993         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5994         enum member.
5995
5996 2005-07-31  Miguel de Icaza  <miguel@novell.com>
5997
5998         * statement.cs: Copy the local exception into the exception
5999         captured local.  Fixes 75674
6000
6001 2005-07-31  Raja R Harinath  <harinath@gmail.com>
6002
6003         Fix #75658.
6004         * expression.cs (Invocation.OverloadResolve): Don't report error
6005         CS1501 if error CS1502 has been reported.
6006         (New.DoResolve): Delegate CS1501 reporting to
6007         Invocation.OverloadResolve.
6008
6009         Fix #75656.
6010         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
6011         invariant-meaning-in-block property in an enclosing block if
6012         necessary.
6013
6014 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
6015
6016         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
6017         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
6018         (Switch.CheckSwitch): Just save 50kb for SWF.
6019
6020 2005-07-27  Martin Baulig  <martin@ximian.com>
6021
6022         * anonymous.cs (CaptureContext.AddField): Added
6023         `AnonymousContainer am' argument; compute its toplevel scope if
6024         it's not already computed.  Fixes #75649.
6025
6026 2005-07-26  Raja R Harinath  <rharinath@novell.com>
6027
6028         Fix #75628.
6029         * class.cs (Constructor.Emit): Reset block to null if the block
6030         resolve fails.
6031
6032 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
6033
6034         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
6035
6036 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
6037
6038         * class.cs (MethodData.Define): Check whether accessor implementing
6039         interface is public.
6040
6041         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
6042
6043 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
6044
6045         Fix #57245
6046         * namespace.cs (LookupType): Moved same type check to...
6047         
6048         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
6049         with the same name.
6050
6051 2005-07-21  Raja R Harinath  <rharinath@novell.com>
6052
6053         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
6054         already found a typebuilder.
6055         * class.cs (MethodCore.IsDuplicateImplementation): Compare
6056         MemberNames, not strings.
6057
6058         * const.cs (Error_ExpressionMustBeConst): 
6059         Rename from Error_EpressionMustBeConst.
6060         * const.cs, class.cs, statement.cd: Update.
6061
6062 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
6063
6064         Fix #65573
6065
6066         * const.cs (Const.LookupConstantValue): Report missing contant expression
6067         everytime.
6068         (Error_EpressionMustBeConstant): Only one error method.
6069
6070         * class.cs, statement.c: Updated.
6071
6072 2005-07-20  Raja R Harinath  <rharinath@novell.com>
6073
6074         * statement.cs (Block.Flags): Add back HasVarargs.
6075         (Block.flags): Make protected.
6076         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
6077
6078         * typemanager.cs (types, typecontainers, user_types): Remove.
6079         (UserTypes, TypeContainers): Likewise.
6080         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
6081         (CleanUp, Reset): Update.
6082         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
6083         (GetNestedType): Use Type.GetNestedType.
6084         (CoreLookupType): Take two arguments, the namespace and the
6085         basename of the type.  Update to use the Namespace.Lookup
6086         mechanism.
6087         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
6088         (RealMemberLookup): Use IsNestedChildOf instead of playing with
6089         string concatenation and substring matches.
6090         * class.cs, enum.cs, delegate.cs: Update to changes.
6091
6092 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
6093
6094         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
6095         Expression and made virtual.
6096
6097         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
6098         (ImplicitStandardConversionExists): Fixed `byte' typo ?
6099
6100         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
6101
6102         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
6103         error message.
6104
6105         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
6106         change.
6107
6108 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
6109
6110         Fix #57707
6111         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
6112         AssemblyCultureAttribute is not used on executable.
6113
6114         * rootcontext.cs,
6115         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
6116
6117 2005-07-16  Raja R Harinath  <rharinath@novell.com>
6118
6119         Fix #60638.
6120         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
6121         New.  Reports CS0252/CS0253.
6122         Mostly taken from preliminary patch by Duncak Mak.
6123         (Binary.DoResolveOperator): Store results of operator lookup.
6124         Use them to detect if we need to warn about unintended reference
6125         comparisons.
6126
6127 2005-07-15  Raja R Harinath  <rharinath@novell.com>
6128
6129         Fix #72969.
6130         * namespace.cs (Namespace.Lookup): Add back location parameter.
6131         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
6132         * delegate.cs, ecore.cs, expression.cs: Update to changes.
6133
6134         * codegen.cs (EmitContext.DeclSpace): Make readonly.
6135         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
6136         (Namespace.LookupType): ... this.
6137         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
6138         of namespaces.
6139         * typemanager.cs (LookupTypeReflection): Remove buggy code that
6140         purported to handle pointers.
6141         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
6142         CoreLookupType.
6143
6144 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
6145
6146         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
6147         type as namespace.
6148
6149 2005-07-15  Raja R Harinath  <rharinath@novell.com>
6150
6151         * namespace.cs (Namespace.Lookup): Drop location parameter.
6152         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
6153         (NamespaceEntry.Lookup): ... this.
6154         (NamespaceEntry.Error_AmbiguousTypeReference):
6155         Move here from DeclSpace.
6156         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
6157         names ...
6158         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
6159         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
6160         Move to NamespaceEntry.
6161         * delegate.cs, expression.cs: Update to changes.
6162
6163 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
6164
6165         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
6166         CheckAttributeType and refactored.
6167         (Attribute.ResolvePossibleAttributeType): Changed to reuse
6168         ResolveAsTypeTerminal error handling.
6169         (ResolveAsTypeTerminal): Introduced because of global attributes extra
6170         handling.
6171         (GetSignatureForError): Print errors in same way.
6172
6173         * class.cs,
6174         * codegen.cs: Reflect attribute GetSignatureForError change.
6175
6176         * ecore.cs,
6177         * expression.cs: Add silent parameter to ResolveAsTypeStep.
6178
6179         * namespace.cs (UsingEntry): Refactored to make fields private.
6180
6181         * assign.cs,
6182         statement.cs: Error_UnexpectedKind has extra parameter.
6183
6184 2005-07-14  Raja R Harinath  <rharinath@novell.com>
6185
6186         * ecore.cs (IAlias): Remove.
6187         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
6188         that implement the interface.
6189         * namespace.cs (Namespace): Likewise.
6190         (Namespace.declspaces): Renamed from 'defined_names'.
6191         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
6192         DeclSpace instead of an IAlias.
6193         * tree.cs (Tree.AddDecl): Update.
6194
6195 2005-07-12  Raja R Harinath  <rharinath@novell.com>
6196
6197         * statement.cs (Block.Flags); Remove HasVarargs.
6198         (Block.HasVarargs): Move to ToplevelBlock.
6199         (Block.ThisVariable, Block.AddThisVariable): Likewise.
6200         (Block.Variables): Make protected.  Initialize variable hashtable
6201         if necessary.
6202         (Block.AddVariable): Update.
6203         (Block.Resolve): Update to changes.
6204         (ToplevelBlock.HasVarargs): New boolean.
6205         (ToplevelBlock.ThisVariable): Move here from Block.
6206         (ToplevelBlock.AddThisVariable): Likewise.
6207         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
6208         * expression.cs (This.ResolveBase): Update to changes.
6209         (ArglistAccess.DoResolve): Likewise.
6210
6211 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
6212
6213         Fix #75321
6214         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
6215
6216         * class.cs (TypeContainer.VerifyMembers): Distinguish between
6217         not used and not used & assigned.
6218         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
6219
6220 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
6221
6222         Fix #75053
6223         * expression.cs (Is.DoResolve): null is never provided type.
6224
6225 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
6226
6227         Fix #52496
6228         * cs-parser.jay: Less strict event error rule to catch more errors.
6229
6230 2005-07-08  Martin Baulig  <martin@ximian.com>
6231
6232         Fix test-iter-10.cs - distinguish whether we `yield' in a property
6233         gettter (allowed) or setter (not allowed).
6234
6235         * class.cs (Accessor): Implement IIteratorContainer.
6236         (Accessor.Yields): New public field.
6237         (PropertyBase.PropertyMethod.Define): Handle iterators on a
6238         per-accessor basis.
6239
6240         * cs-parser.jay
6241         (get_accessor_declaration, set_accessor_declaration): Set the
6242         `yields' flag on the accessor, not the property.
6243         (property_declaration): Do the iterators check on a per-accessor
6244         basis and not for the whole property.
6245
6246 2005-07-08  Martin Baulig  <martin@ximian.com>
6247
6248         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
6249         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
6250
6251 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
6252
6253         Fix #74975
6254         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
6255         (ExtractSecurityPermissionSet): Cope with self referencing security
6256         attributes properly.
6257
6258         * driver.cs (SetOutputFile): Made public property OutputFile.
6259
6260 2005-07-07  Raja R Harinath  <rharinath@novell.com>
6261
6262         Fix #75486.
6263         * class.cs (TypeContainer.first_nonstatic_field): Rename from
6264         has_nonstatic_fields.  Make into a FieldBase pointer.
6265         (TypeContainer.AddField): Add CS0282 check.
6266         (TypeContainer.EmitType): Update.
6267
6268 2005-07-06  Miguel de Icaza  <miguel@novell.com>
6269
6270         * cs-tokenizer.cs (consume_identifier): Do not create strings to
6271         compare if they start with __.
6272
6273 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6274
6275         * statement.cs (Switch.SwitchGoverningType): Only look at
6276         UserCasts that don't need implicit standard conversions to one of
6277         the allowed switch types (Fixes test-322.cs).
6278         (LocalInfo.Resolve): Re-enable sanity-test.
6279
6280 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
6281
6282         * cs-tokenizer.cs (consume_identifier): Detect double undescores
6283         
6284         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
6285         
6286         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
6287
6288 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6289
6290         Fix #75472.
6291         * ecore.cs (SimpleName.GetSignatureForError): Add.
6292         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
6293         (MemberAccess.GetSignatureForError): Add.
6294
6295 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
6296  
6297         The big error and warning messages review.
6298         
6299         * anonymous.cs,
6300         * assign.cs,
6301         * attribute.cs,
6302         * class.cs,
6303         * codegen.cs,
6304         * convert.cs,
6305         * cs-parser.jay,
6306         * cs-tokenizer.cs,
6307         * decl.cs,
6308         * delegate.cs,
6309         * doc.cs,
6310         * driver.cs,
6311         * ecore.cs,
6312         * enum.cs,
6313         * expression.cs,
6314         * flowanalysis.cs,
6315         * iterators.cs,
6316         * literal.cs,
6317         * location.cs,
6318         * modifiers.cs,
6319         * namespace.cs,
6320         * parameter.cs,
6321         * pending.cs,
6322         * report.cs,
6323         * rootcontext.cs,
6324         * statement.cs,
6325         * support.cs,
6326         * tree.cs,
6327         * typemanager.cs: Updated.
6328         
6329         * class.cs: (MethodCore.SetYields): Moved here to share.
6330         (PropertyMethod.Define): Moved iterator setup here.
6331         
6332         * iterators.cs: Add orig_method to have full access to parent
6333         container.
6334
6335 2005-07-05  Raja R Harinath  <rharinath@novell.com>
6336
6337         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
6338         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
6339         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
6340         variable of struct type.
6341         * expression.cs (Unary.ResolveOperator): Update to change.
6342         (Indirection.VerifyFixed): Likewise.
6343         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
6344         (ParameterReference.VerifyFixed): Value parameters are fixed.
6345         (This.VerifyFixed): Treat 'this' as a value parameter.
6346         * statement.cs (LocalInfo.IsFixed): Remove.
6347
6348 2005-07-01  Martin Baulig  <martin@ximian.com>
6349
6350         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
6351         `ec.EmitThis ()' to get the correct scope.
6352
6353 2005-07-01  Martin Baulig  <martin@ximian.com>
6354
6355         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
6356         instance is a ParameterReference; fixes #75299.
6357
6358 2005-07-01  Martin Baulig  <martin@ximian.com>
6359
6360         Reverted Marek's latest patch (r46725):
6361         - it contains structural changes which are neither mentioned in
6362           the ChangeLog nor explained anywhere; for example the additional
6363           argument of EmitContext's and Iterator's .ctor's and the
6364           TypeContainer.DefineMembers() change.
6365         - structural changes like this should go in in seperate patches
6366           and not be hidden in a huge patch which just seems to affect
6367           warnings and errors.
6368           a big and hard to understand patch.
6369         - it breaks iterators and causes regressions, for instance in
6370           test-iter-03.cs.      
6371
6372 2005-06-30  Raja R Harinath  <rharinath@novell.com>
6373
6374         Fix #75412.
6375         * expression.cs (Indexers.map): Remove.
6376         (Indexers.Append): Filter out inaccessible setters and getters.
6377         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
6378
6379         Fix #75283.
6380         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
6381         Refactored from ...
6382         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
6383         (FieldExpr.Emit, PropertyExpr.Emit): Update.
6384         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
6385         * expression.cs (Invocation.EmitCall): Add CS0120 check.
6386
6387 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
6388
6389         Fix #75322
6390         * class.cs (FieldBase.GetInitializerExpression): One more field
6391         for backup.
6392
6393 2005-06-28  Miguel de Icaza  <miguel@novell.com>
6394
6395         * pending.cs: Do not define a proxy if the base method is virtual,
6396         it will be picked up by the runtime (bug 75270).
6397
6398 2005-06-08  Martin Baulig  <martin@ximian.com>
6399
6400         The big Iterators rewrite :-)
6401
6402         * iterators.cs: Rewrite this to use the anonymous methods framework.
6403
6404         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
6405         before the TypeContainers; see 2test-21.cs.
6406
6407         * class.cs
6408         (TypeContainer.DefineType): Don't create a new EmitContext if we
6409         already have one (this only happens if we're an Iterator).
6410         (TypeContainer.Define): Also call Define() on all our iterators.
6411         (Method.CreateEmitContext): Added support for iterators.
6412
6413         * anonymous.cs
6414         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
6415         (AnonymousContainer.CreateMethodHost): Moved here from
6416         AnonymousMethod and made abstract.
6417         (AnonymousContainer.CreateScopeType): New abstract method.
6418         (AnonymousContainer.IsIterator): New public property.
6419         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
6420         get the ScopeTypeBuilder rather than manually defining it here. 
6421         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
6422         iterators here.
6423
6424         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
6425         before RootContext.DefineTypes().
6426
6427         * codegen.cs (EmitContext.RemapToProxy): Removed.
6428         (EmitContext.CurrentAnonymousMethod): Changed type from
6429         AnonymousMethod -> AnonymousContainer.
6430         (EmitContext.ResolveTopBlock): Protect from being called twice.
6431         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
6432         (EmitContext.EmitThis): Removed the iterators hacks; use the
6433         anonymous methods framework for that.
6434
6435         * statement.cs
6436         (ToplevelBlock.Container): Make this a property, not a field.
6437         (ToplevelBlock.ReParent): New public method; move the
6438         ToplevelBlock into a new container.
6439         (Foreach.TemporaryVariable): Simplify.
6440
6441 2005-06-05  Martin Baulig  <martin@ximian.com>
6442
6443         * statement.cs (LocalInfo.CompilerGenerated): New flag.
6444         (Block.AddTemporaryVariable): New public method; creates a new
6445         `LocalInfo' for a temporary variable.
6446         (Block.EmitMeta): Create the LocalBuilders for all the temporary
6447         variables here.
6448         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
6449         non-iterator variables.
6450
6451 2005-06-05  Martin Baulig  <martin@ximian.com>
6452
6453         * statement.cs (Foreach.TemporaryVariable): Create the
6454         LocalBuilder in the Emit phase and not in Resolve since in some
6455         situations, we don't have an ILGenerator during Resolve; see
6456         2test-19.cs for an example.
6457
6458 2005-06-04  Martin Baulig  <martin@ximian.com>
6459
6460         **** Merged r45395 from GCS ****
6461
6462         The big Foreach rewrite - Part II.
6463
6464         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
6465         with `PropertyInfo ienumerator_getcurrent'.
6466
6467         * codegen.cs (VariableStorage): Removed.
6468
6469         * statement.cs
6470         (Foreach): Derive from Statement, not ExceptionStatement.
6471         (Foreach.CollectionForeach): New nested class.  Moved all the code
6472         dealing with collection foreach here.
6473         (Foreach.ForeachHelperMethods): Removed.
6474         (Foreach.TemporaryVariable): Implement IMemoryLocation.
6475
6476 2005-05-23  Martin Baulig  <martin@ximian.com>
6477
6478         * statement.cs (Try.DoResolve): Don't create a `finally' if we
6479         don't need to.  Fix #75014.
6480
6481 2005-05-20  Martin Baulig  <martin@ximian.com>
6482
6483         Merged r44808 from GMCS.
6484
6485         * class.cs (TypeContainer.CircularDepException): Removed.
6486         (TypeContainer.DefineType): Removed the `InTransit' stuff.
6487         (TypeContainer.CheckRecursiveDefinition): Check for circular class
6488         (CS0146) and interface (CS0529) dependencies here.
6489
6490 2005-06-21  Raja R Harinath  <rharinath@novell.com>
6491
6492         * expression.cs (Invocation.EmitCall): Fix initialization
6493         'this_call' to reflect current behaviour.  Fix indentation.
6494
6495         * convert.cs (FindMostEncompassedType): Add two trivial special
6496         cases (number_of_types == 0 || number_of_types == 1).
6497         (FindMostEncompasingType): Likewise.
6498
6499 2005-06-17  Raja R Harinath  <rharinath@novell.com>
6500
6501         Some cleanups preparing for the fix of #75283.
6502         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
6503         error testing.
6504         (EventExpr.InstanceResolve): Likewise.
6505         (EventExpr.DoResolve): Remove redundant checks.
6506
6507 2005-06-10  Duncan Mak  <duncan@novell.com>
6508
6509         * cs-tokenizer.cs (process_directives): New flag for controlling
6510         the processing of preprocessor directives.
6511         (x_token): After seeing a '#', return Token.NONE instead of going
6512         to handle_preprocessing_directive() when not processing
6513         directives. This avoids unnecessary processing during the token peek in
6514         is_punct().
6515
6516         This fixes #74939.
6517
6518         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
6519         the existing error reporting methods instead of Report.Error.
6520
6521         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
6522         after Raja's rewrite.
6523
6524 2005-06-08  Miguel de Icaza  <miguel@novell.com>
6525
6526         * class.cs: Small fix.
6527
6528 2005-06-08  Raja R Harinath  <rharinath@novell.com>
6529
6530         Fix #75160.
6531         * class.cs (GetPartialBases): Fix return value check of
6532         part.GetClassBases.
6533
6534 2005-06-07  Raja R Harinath  <rharinath@novell.com>
6535
6536         Ensure that partial classes are registered in their enclosing
6537         namespace.  Initial part of fix of #75160.
6538         * tree.cs (Tree.RecordDecl): Add new namespace argument.
6539         Register declspace with namespace here, not in
6540         DeclSpace.RecordDecl.
6541         * cs-parser.jay: Pass namespace to RecordDecl.
6542         * class.cs (PartialContainer.Create): Likewise.
6543         (ClassPart.DefineType): New sanity-check.  Throws an exception if
6544         called.
6545         * decl.cs (Declspace.RecordDecl): Remove.
6546         * namespace.cs (NamespaceEntry.DefineName): Remove.
6547
6548 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
6549
6550         * rootcontext.cs: Reset TargetExt as well.
6551
6552 2005-06-03  Raja R Harinath  <rharinath@novell.com>
6553
6554         * ecore.cs (Expression.Resolve): Emit CS0654 error when
6555         -langversion:ISO-1.
6556
6557 2005-06-02  Raja R Harinath  <rharinath@novell.com>
6558
6559         Fix #75080, cs0119.cs.
6560         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
6561         of ...
6562         (Expression.Resolve): ... this.  Use it.  Remove bogus code
6563         allowing ExprClass.Type and ExprClass.Namespace for
6564         ResolveFlags.VariableOrValue.
6565         (Expression.Resolve) [1-argument variant]: Change default resolve
6566         flags based on language version.
6567         (Expression.Error_UnexpectedKind): Use a simple string array
6568         rather than an ArrayList.
6569         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
6570         not ExprClass.Type.
6571         (TypeOfVoid.DoResolve): Likewise.
6572         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
6573         flags argument -- it always has the same value.
6574
6575 2005-05-31  Raja R Harinath  <rharinath@novell.com>
6576
6577         Fix #75081.
6578         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
6579         Use it in the error message.
6580         * assign.cs, expression.cs, statement.cs: Update.
6581
6582 2005-05-30  Raja R Harinath  <rharinath@novell.com>
6583
6584         Fix #75088.
6585         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
6586         the "almostMatchedMember" case too.
6587         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
6588         that failed the accessibility checks to 'almost_match'.
6589
6590 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
6591
6592         * attribute.cs: Use internal MethodBuilder methods to set
6593         ExactSpelling and SetLastError on PInvoke methods, instead
6594         of passing them via charset.  Fixes #75060.
6595
6596 2005-05-27  Raja R Harinath  <rharinath@novell.com>
6597
6598         * parameter.cs (Parameter): Remove TODO comment.
6599         (Parameter.DefineParameter): Remove Location parameter.
6600         (Parameters.LabelParameters): Likewise.
6601         * class.cs (Constructor.Emit): Update to change.
6602         (MethodData.Emit): Likewise.
6603         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
6604         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
6605
6606 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
6607
6608         * parameter.cs,
6609           Removed Parameters.Location and added Parameter.Location instead.
6610           Removed Location parameter from Emit() and GetSignature().
6611         * anonymous.cs,
6612           class.cs,
6613           cs-parser.jay,
6614           delegate.cs,
6615           iterators.cs,
6616           statement.cs :
6617           Modified all related calls.
6618
6619 2005-05-26  Raja R Harinath  <rharinath@novell.com>
6620
6621         Improve user-defined conversion handling.
6622         * convert.cs (GetConversionOperators): Rewrite.  Return only the
6623         applicable operators.
6624         (AddConversionOperators): New.  Helper for GetConversionOperators.
6625         (FindMostEncompassedType, FindMostEncompassingType): Verify that
6626         there is only one most encompassed/encompassing type.
6627         (FindMostSpecificSource, FindMostSpecificTarget): Remove
6628         "applicable operator" handling.
6629         (UserConversion): Move cache here from GetConversionOperators.
6630         Directly cache the chosen operator, rather than the whole
6631         MethodGroup.
6632         (ExplicitNumericConversion): Fix buggy implementation of Decimal
6633         case.  Allow conversion of decimal to sbyte and byte too.
6634         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6635         New static methods.  Used to avoid allocating EmptyExpressions in
6636         convert.cs.
6637
6638 2005-05-24  Duncan Mak  <duncan@novell.com>
6639
6640         * ecore.cs (CastFromDecimal): New class for casting a decimal to
6641         another class, used in Convert.ExplicitNumericConversion.
6642         (CastToDecimal): New class, similar to above, but casts to
6643         System.Decimal, used in Convert.ImplicitNumericConversion and also
6644         in explicit convesion from double/float to decimal.
6645
6646         * convert.cs (ImplicitNumericConversion): Handle implicit
6647         conversions to System.Decimal.
6648         (ExplicitNumericConversion): handle explicit conversions to
6649         System.Decimal.
6650
6651         This fixes #68711.
6652         
6653 2005-05-20  Miguel de Icaza  <miguel@novell.com>
6654
6655         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6656         know the type at this stage, just break through.   Fixes #75008 
6657
6658 2005-05-19  Martin Baulig  <martin@ximian.com>
6659
6660         * delegate.cs
6661         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6662         to disable error reporting.
6663
6664         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6665         here since we don't want to report an error; see the new test-336.cs.
6666
6667 2005-05-19  Raja R Harinath  <rharinath@novell.com>
6668
6669         * statement.cs (ToplevelBlock.GetParameterReference)
6670         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6671         Move here from class Block.
6672         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6673         * expression.cs (ParameterReference.DoResolveBase): Likewise.
6674
6675 2005-05-18  Martin Baulig  <martin@ximian.com>
6676
6677         Fix #74978.
6678
6679         * flowanalysis.cs
6680         (FlowBranching.Reachability): Add non-static public And() and Or()
6681         methods.
6682         (FlowBranchingSwitch): New class; do the `break_origins' thing
6683         like in FlowBranchingLoop.
6684         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6685         reachability, not just locals and parameters.
6686         (FlowBranching.MergeChild): Remove some of the hacks for loop and
6687         switch; MergeBreakOrigins() now takes care of that.
6688
6689 2005-05-18  Martin Baulig  <martin@ximian.com>
6690
6691         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6692         a loop and may leave it, reset the barrier; fixes #74974.
6693
6694 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
6695         
6696         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6697         is back.
6698         
6699         * cs-parser.jay: Catch more lexical errors.
6700         
6701         * report.cs: Add one more Error method.
6702         
6703         * rootcontext.cs,
6704         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6705
6706 2005-05-17  Martin Baulig  <martin@ximian.com>
6707
6708         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6709         #70970. 
6710
6711 2005-05-16  Raja R Harinath  <rharinath@novell.com>
6712
6713         Fix test-382.cs.  Emit values of decimal constants.
6714         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6715         Carved out of ...
6716         (TypeContainer.AddField): ... this.
6717         (TypeContainer.EmitFieldInitializers): Allow the list of fields
6718         with initializers to include 'Const's.
6719         (ClassPart.RegisterFieldForInitialization): Forward to
6720         PartialContainer.
6721         * const.cs (Const.Const): Pass initializer to base class.
6722         (Const.Define): In case of decimal constants, register them for
6723         initialization in a static constructor.
6724
6725 2005-05-14  Martin Baulig  <martin@ximian.com>
6726
6727         * statement.cs (Block.Resolve): Correctly handle unreachable code;
6728         do not call ResolveUnreachable() on unreachable statements in
6729         here, see the comment in the source code.
6730
6731 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6732
6733         Fix #74934.
6734         * expression.cs (BinaryResolveOperator): If one of the operands of
6735         an equality comparison is 'null' and the other is a pointer type,
6736         convert the null to a NullPointer.
6737         * convert.cs (ImplicitReferenceConversion): If the expression is a
6738         NullLiteral and the target type is a pointer type, return a
6739         NullPointer instead.
6740         (ImplicitConversionStandard): Likewise.
6741
6742 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
6743         
6744         * cs-parser.jay: Set readonly context based on special constructs.
6745         
6746         * expression.cs (LocalVariableReference.DoResolveBase): Improved
6747         readonly variable error handling.
6748         
6749         * rootcontext.cs (EmitCode): Don't verify members when error
6750         occurred.
6751         
6752         * statement.cs (LocalInfo): Add reaodnly context information.
6753         (SetReadOnlyContext, GetReadOnlyContext): New methods.
6754
6755 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6756
6757         * statement.cs (Block.Resolve): Revert change below.  Modify fix
6758         for #74041 to initialize 'resolved' to false only for explicit
6759         blocks.  Fixes #74873.
6760
6761 2005-05-12  Raja R Harinath  <harinath@gmail.com>
6762
6763         Fix #74920.
6764         * typemanager.cs (unmanaged_enclosing_types): New.
6765         (IsUnmanagedType): Avoid infloops by using
6766         'unmanaged_enclosing_types' to talk with recursive invocations.
6767
6768 2005-05-13  Martin Baulig  <martin@ximian.com>
6769
6770         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6771         instance variable, not a local.  Fix #74873.
6772         (Block.ResolveUnreachable): Set it to true here.
6773
6774 2005-05-11  Duncan Mak  <duncan@novell.com>
6775
6776         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6777         continuing to process for 'arg'.
6778         (handle_preprocessing_directive): Check the argument of the #endif
6779         directive and report error CS1025 if there are any trailing
6780         characters.
6781
6782         According to the C# spec, having even whitespace after the #endif
6783         directive is illegal; however, because we call arg.TrimEnd ()
6784         beforehand, we have the same behavior as csc, allowing whitespace
6785         after the directive.
6786
6787         Fixes #74892.
6788
6789 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
6790
6791         Fix #74863.
6792         
6793         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6794         (Constructor.GetObsoleteAttribute): Implemented correctly.
6795
6796 2005-05-10  Martin Baulig  <martin@ximian.com>
6797
6798         * support.cs (ReflectionParameters.ParameterModifier): Use
6799         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6800         and `ParameterAttributes.In'.  Fixes #74884.
6801
6802 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
6803
6804         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6805         
6806         * expression.cs (Argument.GetParameterModifier): Turned to property.
6807         (Invocation.Error_InvalidArguments): Add more descriptive errors.
6808         
6809         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6810         its C# equivalent.
6811         
6812 2005-05-09  Raja R Harinath  <rharinath@novell.com>
6813
6814         Fix #74852.
6815         * decl.cs (MemberCache.AddMethods): Register override methods,
6816         rather than non-override methods.
6817         * typemanager.cs (RegisterOverride): New.
6818         (IsOverride): Update.
6819
6820 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
6821
6822         Fix #73105.
6823         
6824         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6825         recursive declaration.
6826         
6827         * statement.cs (Block.ResolveMeta): Report any error in resolving.
6828         
6829 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
6830
6831         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6832         
6833         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6834
6835 2005-05-05  Raja R Harinath  <rharinath@novell.com>
6836
6837         Fix #74797.
6838         * decl.cs (DeclSpace.FamilyAccessible): 
6839         Use TypeManager.IsNestedFamilyAccessible.
6840
6841         Fix reopened #64812.
6842         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6843         internal'.
6844
6845 2005-05-04  Raja R Harinath  <rharinath@novell.com>
6846             Abin Thomas  <projectmonokochi@rediffmail.com>
6847             Anoob V E  <projectmonokochi@rediffmail.com>
6848             Harilal P R  <projectmonokochi@rediffmail.com>
6849
6850         Fix #64812.
6851         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6852         allow access to all static members.
6853
6854 2005-05-04  Martin Baulig  <martin@ximian.com>
6855
6856         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6857
6858 2005-05-04  Martin Baulig  <martin@ximian.com>
6859
6860         Fix #74655.
6861
6862         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6863         section at the end; make things work if `default' is not the last
6864         section.        
6865
6866 2005-05-04  Martin Baulig  <martin@ximian.com>
6867
6868         Fix #70400.
6869
6870         * statement.cs (Switch): Replaced the `got_default' field with a
6871         `default_section' one.
6872         (Switch.CheckSwitch): Set `default_section' here.
6873         (Switch.Resolve): If we're a constant switch and the constant is
6874         not found, use the default section.
6875
6876 2005-05-03  Martin Baulig  <martin@ximian.com>
6877
6878         * expression.cs (ArrayAccess.EmitGetLength): New public method.
6879
6880         * statement.cs (Foreach.ArrayForeach): New nested class.
6881         (Foreach.TemporaryVariable): New nested class.
6882         (Foreach.EmitArrayForeach): Removed; this is now in the new
6883         ArrayForeach class.
6884
6885 2005-05-03  Raja R Harinath  <rharinath@novell.com>
6886
6887         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
6888         more conservative.
6889         (VerifyPendingMethods): Revert change below.
6890
6891         * typemanager.cs (IsOverride, RegisterNonOverride): New.
6892         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6893         that used to trigger warning -28.  Remove warning -28.
6894         * expression.cs (Invocation.OverloadResolve): Use
6895         TypeManager.IsOverride to distinguish override methods.
6896
6897         Fix #74773.
6898         * pending.cs (VerifyPendingMethods): If a base type implements the
6899         requested interface, don't bother checking individual methods of
6900         the base type.  As a side-effect, this prevents the creation of
6901         unnecessary proxies.
6902
6903 2005-05-02  Martin Baulig  <martin@ximian.com>
6904
6905         Fix #70182.
6906
6907         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6908         Also `And' the locals if the old vector is null.
6909         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6910         null; in this case we basically reset all the variables.        
6911
6912 2005-05-02  Martin Baulig  <martin@ximian.com>
6913
6914         Fix #74529.
6915
6916         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6917         Added `FlowBranching branching' argument; always `and' the
6918         variables instead of `or'ing them unless we're an infinite loop.
6919
6920         * statement.cs (While.Resolve): Create a new sibling unless we're
6921         infinite.       
6922
6923 2005-05-02  Martin Baulig  <martin@ximian.com>
6924
6925         Fix #70140.
6926
6927         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6928         arguments; use it instead of creating a new TopLevelBlock.
6929         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6930         our ConstructorInitializer.
6931
6932         * statement.cs
6933         (TopLevelBlock.TopLevelBranching): New public property.
6934         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6935         and create our `TopLevelBranching'.
6936
6937         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6938         anonymous method host, use `block.TopLevelBranching' rather than
6939         creating a new branching.
6940
6941 2005-04-20  Miguel de Icaza  <miguel@novell.com>
6942
6943         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6944         a ScopeInfo, if any of the current children is a child of the new
6945         entry, move those children there.
6946
6947 2005-04-30  Martin Baulig  <martin@ximian.com>
6948
6949         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6950         at the beginning of a SwitchSection.  Fix #73335.
6951
6952 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
6953
6954         Fix #74378
6955         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6956         
6957         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6958         (FieldExpr.DoResolve): Obsolete members are ignored for field
6959         initializers.
6960         
6961 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
6962
6963         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6964         of arrays detection.
6965
6966         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6967         verification.
6968         (Field.VerifyClsCompliance): Volatile fields are not compliant.
6969
6970         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6971         arrays report.
6972
6973 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
6974
6975         * cs-parser.jay: Use the prefered version of -unsafe in error
6976         message.
6977
6978 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
6979
6980         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6981         circumstances.
6982
6983 2005-04-20  John Luke  <john.luke@gmail.com>
6984
6985         * driver.cs: fix typo in error message, --outout to --output
6986
6987 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
6988
6989         * codegen.cs (InRefOutArgumentResolving): New field.
6990         
6991         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6992         fields outside contructor.
6993         
6994         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6995         
6996 2005-04-19  Miguel de Icaza  <miguel@novell.com>
6997
6998         * anonymous.cs (CaptureContext.EmitParameterInstance): The
6999         parameter code was not completed ever, so it was not as up-to-date
7000         as local variables.  Must finish it.
7001
7002         The bug fix was to compare the Toplevel of the block, not the
7003         current block.  Thanks for Ben for pointing this out. 
7004
7005 2005-04-19  Raja R Harinath  <rharinath@novell.com>
7006
7007         * decl.cs (AddMethods): Use the declaring type of the problem
7008         method to determine if we want to squash a warning.
7009
7010 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
7011
7012         * attribute.cs: Removed debug output.
7013
7014         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
7015         
7016         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
7017         Report.Stderr.
7018         
7019 2005-04-18  Raja R Harinath  <rharinath@novell.com>
7020
7021         Fix #74481.
7022         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
7023         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
7024         all null comparisons against reference types.
7025
7026 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
7027
7028         Fix# 74565
7029         * class.cs (TypeContainer.CircularDepException) New nested
7030         exception class.
7031         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
7032         (TypeContainer.DefineType): Removed error, reset InTransit before
7033         exit.
7034         (Class.DefineType): Throw exception when is in Transit.
7035         Catch exception and report error.
7036         (Struct.DefineType): Throw exception when is in Transit.
7037         Catch exception and report error.
7038         (Interface.DefineType): Throw exception when is in Transit.
7039         Catch exception and report error.
7040
7041         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
7042         handle nested exception handlers.
7043
7044         * flowanalysis.cs (InTryWithCatch): New method, search for try with
7045         a catch.
7046
7047         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
7048         InFinally and InCatch storage.
7049
7050         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
7051         (Catch.Resolve): Set and Restore ec.InCatch.
7052         (Try.Resolve): Set and Restore ec.InFinally.
7053         (Try.HasCatch): True when try has catch.
7054
7055 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
7056
7057         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
7058           for the same event member, so exclude such cases from warning 419.
7059           Fixed bug #74633.
7060
7061 2005-04-16  Miguel de Icaza  <miguel@novell.com>
7062
7063         * expression.cs (Binary.ResolveOperator): Apply patch from John
7064         Luke to fix bug 59864: operators &, | and ^ on enumerations
7065         require that the same enum type on both sides.
7066
7067         * driver.cs: Add warnings to old flag usage, this is to assist
7068         people who produce Makefiles and hope that the Makefiles will be
7069         used on Windows.
7070
7071         * class.cs (TypeContainer.EmitType): Moved the definition of the
7072         special $PRIVATE$ field from the resolve phase to the Emit phase.
7073         During resolve we do not know if we are a struct with
7074         HasExplicitLayout, we know this only after the attributes for the
7075         type are emitted.
7076
7077         Set the FieldOffset to zero on the dummy field that we create for
7078         the class.   Fixes 74590.
7079
7080 2005-04-16  Raja R Harinath  <rharinath@novell.com>
7081
7082         Fix #73834.
7083         * ecore.cs (PropertyExpr.resolved): New.
7084         (DoResolve): Use it to handle a case of double resolution here.
7085         Handle a case of identical-name-and-type-name.
7086         * expression.cs (ArrayCreation.CheckIndices): Avoid double
7087         resolution by storing the results of expression resolution back
7088         into the "probes" array.
7089
7090 2005-04-15  Raja R Harinath  <rharinath@novell.com>
7091
7092         Fix cs0208-7.cs and cs0208-8.cs.
7093         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
7094         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
7095         error reporting to point out the reason a struct is not unmanaged.
7096
7097 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7098
7099         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
7100           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
7101
7102 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7103
7104         Fix #74528.
7105         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
7106         IdenticalNameAndTypeName here.
7107         (EventExpr.InstanceResolve): Likewise.
7108
7109 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
7110
7111         C# 2.0 DefaultCharSetAttribute implementation
7112         
7113         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
7114         which allows us to set GlobalNamespace for every resolve.
7115         (Attribute.ResolveArguments): Cut from Resolve.
7116         (Attribute.GetCharSetValue): Returns CharSet named argument.
7117         (Attribute.DefinePInvokeMethod): Gets default charset from
7118         module settings.
7119         (GlobalAttribute.ResolveAsTypeStep): Override.
7120         (GlobalAttribute.ResolveArguments): Override.
7121         
7122         * class.cs (TypeAttr): Is protected.
7123         
7124         * codegen.cs (ModuleClass.DefaultCharSet): New member.
7125         (ModuleClass.DefaultCharSetType): New memeber.
7126         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
7127         
7128         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
7129         charset from module.
7130         
7131         * delegate.cs (TypeAttr): Override.
7132         (Delegate.DefineType): Use this TypeAttr.
7133         
7134         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
7135         at very early stage (before types are defined) to resolve model
7136         module attributes. It will probably not work with corlib but it
7137         should be ok.
7138         
7139         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
7140         charset from module.
7141         
7142         * typemanager.cs (default_charset_type): New type.
7143
7144 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7145
7146         * decl.cs (MemberCache.AddMethods): Don't warn if
7147         System.Object.Finalize has buggy MethodAttributes.
7148
7149         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
7150         removed below.
7151
7152 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7153
7154         * doc.cs : detect ambiguous reference to overloaded members.
7155           Fixed bug #71603. MS 1.1 csc does not detect it.
7156
7157 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7158
7159         * doc.cs : delegates must not be referenced with parameters.
7160           Fixed bug #71605.
7161
7162 2005-04-12  Miguel de Icaza  <miguel@novell.com>
7163
7164         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
7165
7166 2005-04-10  Miguel de Icaza  <miguel@novell.com>
7167
7168         * driver.cs (MainDriver): Stop processing if the CLS stage found
7169         errors. 
7170
7171         (CompilerCallableEntryPoint.InvokeCompiler): Always
7172         reset after execution;   Take a TextWriter argument for the
7173         output.
7174
7175         * report.cs: Use the error stream instead of hardcoding stderr. 
7176
7177 2005-04-09  Miguel de Icaza  <miguel@novell.com>
7178
7179         * class.cs: Reduce code paths to test, too small of an
7180         optimization to make it worth the extra testing.  Always perform
7181         it. 
7182
7183 2005-04-08  Raja R Harinath  <rharinath@novell.com>
7184
7185         Fix #74510.
7186         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
7187         operators that had errors reported on them.
7188
7189 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
7190
7191         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
7192         argument types.
7193         (Attribute.Resolve): Add named argument type checking.
7194         
7195         * class.cs (FixedField.Define): Use IsPrimitiveType
7196         
7197         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
7198         
7199         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
7200         unsafe parameter types.
7201         
7202         * statement.cs (Using.ResolveExpression): Add better error description.
7203         
7204         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
7205         
7206 2005-04-08  Raja R Harinath  <rharinath@novell.com>
7207
7208         Fix #74484.
7209         * attribute.cs (Attribute.GetAttributeUsage): Resolve
7210         AttributeUsageAttribute in the emitcontext of the attribute class,
7211         not in the emitcontext of the attributable entity it was attached to.
7212         * cs-parser.jay: Use 'current_class', not 'current_container',
7213         when creating a GlobalAttribute.
7214
7215 2005-04-08  Alp Toker  <alp@atoker.com>
7216
7217         * pending.cs: The fix to #58413 failed to compile methods implementing
7218         interfaces with/without params modifiers and vice versa, even though
7219         params modifiers aren't part of the signature. Make the modifier check
7220         less strict as in csc.
7221
7222 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
7223             Anoob V E  <projectmonokochi@rediffmail.com>
7224             Harilal P R  <projectmonokochi@rediffmail.com>
7225
7226         Fix #58413.
7227         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
7228         modifiers of pending methods.
7229         (PendingImplementation.PendingImplementation): Initialize it.
7230         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
7231         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
7232         with ParameterData.  Add check for modifiers.
7233         * class.cs (MethodData.Define): Update to changes.
7234
7235 2005-04-07  Raja R Harinath  <rharinath@novell.com>
7236
7237         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
7238
7239 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
7240
7241         * class.cs (PropertyMethod.Define): Check private accessor in abstract
7242         property.
7243         
7244         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
7245         
7246         * rootcontext.cs,
7247         * typemanager.cs: Registered RequiredAttributeAttribute.
7248         
7249 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
7250
7251         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
7252         Warning CS0169 is back at level 3.
7253         (IMethodData.SetMemberIsUsed): New method.
7254         
7255         * decl.cs (IsUsed): New value; moved from FieldBase.Status
7256         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
7257         
7258         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
7259
7260         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
7261         contants.
7262         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
7263         is used.
7264         
7265         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
7266         is used.
7267         
7268         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
7269         to avoid the problems with nested types.
7270
7271 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
7272             Anoob V.E  <projectmonokochi@rediffmail.com>
7273             Harilal P.R  <projectmonokochi@rediffmail.com>
7274             Raja R Harinath  <rharinath@novell.com>
7275
7276         Fix #73820.
7277         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
7278         attribute.
7279         * typemanager (GetConstructor): Make public.
7280
7281 2005-04-05  John Luke  <john.luke@gmail.com>
7282             Raja R Harinath  <rharinath@novell.com>
7283
7284         Fix #62232.
7285         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
7286         struct too.  Return false quicker in a few cases.
7287         (VerifyUnManaged): Use it.
7288
7289 2005-04-05  Raja R Harinath  <rharinath@novell.com>
7290
7291         Fix #74041.
7292         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
7293         not 'unreachable_seen'.
7294
7295 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
7296
7297         * attribute.cs (Attribute.GetValue): Removed unused.
7298         
7299         * codegen.cs (CodeGen.TrimExt): Removed unused.
7300         
7301         * cs-parser.jay (output): Removed unused.
7302         
7303         * cs-tokenizer.cs (hex_digits): Removed unused.
7304         
7305         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
7306         
7307         * expression.cs (Indirection.LoadExprValue): Removed unused.
7308         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
7309         
7310         * iterators.cs (Iterator.param_types): Removed unused.
7311         
7312         * statement.cs (Goto.block): Removed unused.
7313         (ToplevelBlock.did): Removed unused.
7314         (Switch.ResolveConstantSwitch): Removed unused.
7315
7316 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
7317
7318         * rootcontext.cs: Allow mcs to bootstrap with the compilation
7319         resetting thingy.
7320
7321 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7322
7323         Fix #74232 and cs0208-3.cs.
7324         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
7325         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
7326         unmanaged type.  Don't use FieldBuilders when 't' is a
7327         TypeBuilder.  Use ModFlags and MemberType fields.
7328         * class.cs (MemberBase.member_type): Rename from MemberType.
7329         (MemberBase.MemberType): New property.  Determines member_type on
7330         demand.
7331         (MemberBase.DoDefine): Don't initialize MemberType here.
7332         (FieldMember.Define): Likewise.
7333
7334 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
7335
7336         Fix #74241
7337         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
7338         Attributes are emitted there.
7339         
7340 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7341
7342         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
7343         keyword in 'partial enum' too.
7344         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
7345         is not allowed).
7346         Report from Kamil Skalski <nazgul@omega.pl>.
7347
7348         Fix #74309.
7349         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
7350         have partial containers too.
7351
7352         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
7353         in block' checks to Block.CheckInvariantMeaningInBlock.
7354         * statement.cs (Block.GetKnownVariableInfo): Make private.
7355         (Block.IsVariableUsedInChildBlock): Remove.
7356         (Block.IsVariableUsedInBlock): Likewise.
7357         (Block.CheckInvariantMeaningInBlock): New.  Show location of
7358         conflicting declaration.
7359         (Block.AddVariable): Make error messages less long-winded and more
7360         specific.  Show location of conflicting declaration.
7361         * parameter.cs (Parameters.Location): New readonly property.
7362
7363 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7364
7365         Clean up semantics of invoking ResolveMemberAccess.
7366         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
7367         can have an instance, ensure that we pass in a non-TypeExpression
7368         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
7369         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
7370         argument.  Update to changes and simplify.
7371         (FieldExpr.Emitinstance): Remove CS0120 check.
7372         (PropertyExpr.EmitInstance): Likewise.
7373         * expression.cs (Argument.Resolve): Likewise.
7374         (Invocation.DoResolve): Update to changes in semantics of
7375         InstanceExpression.
7376
7377 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
7378
7379         Fix #74241
7380         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
7381         customization.
7382         
7383         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
7384
7385 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7386
7387         Fix difference in behaviour with commandline invocation.
7388         * driver.cs (Driver.Reset): New.
7389         (CompilerCallableEntryPoint): Call it.
7390
7391         * statement.cs (If.Resolve): Avoid spurious "uninitialized
7392         variable" warnings if the boolean expression failed to resolve.
7393
7394 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
7395
7396         * attribute.cs: Fix the union of several permissions when some of them
7397         are unrestricted (so the result isn't an unrestricted permission set).
7398         Fix #74036.
7399
7400 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7401
7402         * ecore.cs (MemberExpr): New class.  Convert from interface
7403         IMemberExpr.
7404         (MemberExpr.ResolveMemberAccess): Refactor and move here from
7405         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
7406         error checks.
7407         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
7408         (MethodGroupExpr.IsExplicitImpl): Remove.
7409         (Expression.GetFieldFromEvent): Remove.
7410         (SimpleName.MemberStaticCheck): Remove.
7411         (SimpleName.DoSimpleNameResolve): Update to changes.
7412         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
7413         (MemberAccess.IdenticalNameAndTypeName): Remove.
7414         (MemberAccess.error176): Move to MemberExpr.
7415         (MemberAccess.DoResolve): Update to changes.
7416         (BaseAccess.DoResolve): Likewise.
7417
7418 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
7419
7420         C# 2.0 Conditional attribute class implementation
7421         
7422         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
7423         Analyzes class whether it has attribute which has ConditionalAttribute
7424         and its condition is not defined.
7425         
7426         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
7427         (Class.IsExcluded): New method. Search for at least one defined
7428         condition in ConditionalAttribute of attribute class.
7429
7430 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7431
7432         * ecore.cs (PropertyExpr): Derive from Expression, not
7433         ExpressionStatement.
7434         (PropertyExpr.EmitStatement): Remove.
7435
7436 2005-03-29  Raja R Harinath  <rharinath@novell.com>
7437
7438         Fix #74060.
7439         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
7440         internal field "value__" of an enum be private.  The examples for
7441         "value__" that I found on MSDN all used FieldAttributes.Private.
7442
7443         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
7444         Don't mention IL method attribute names.
7445
7446         Fix #47991.  Remove a TODO.
7447         * statement.cs (Block.Toplevel): Make into a field.
7448         (Block.Parameters): Move into ToplevelBlock.
7449         (Block.known_variables): Rename from child_variable_names.
7450         (Block.Block): Remove variants that take Parameters.  Initialize
7451         'Toplevel' with the immediately surrounding toplevel block.
7452         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
7453         LocalInfo parameter.
7454         (Block.GetKnownVariableInfo): New.
7455         (Block.IsVariableNameUsedInChildBlock): Update.
7456         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
7457         the block, even though it may not be in scope.
7458         (Block.AddVariable): Remove Parameters parameter.  Use
7459         Toplevel.Parameters instead.
7460         (Block.AddConstant): Remove Parameters parameter.
7461         (Block.GetParameterReference): Update to use Toplevel.Parameters.
7462         (Block.IsParamaterReference): Likewise.
7463         (Block.IsLocalParameter): Likewise.  Simplify a lot.
7464         (ToplevelBlock.Parameters): New.  Moved from Block.
7465         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
7466         initialize Parameters to a non-null value.
7467         * cs-parser.jay: Update to changes.
7468         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
7469         simple names that mean different things in the same block.  Use
7470         Block.IsVariableNameUsedInBlock.
7471
7472 2005-03-28  Raja R Harinath  <rharinath@novell.com>
7473
7474         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7475         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7476         GetTypeHandle.  It is possible for a reflected type to derive from
7477         a TypeBuilder (e.g., int[] derives from the TypeBuilder
7478         System.Array during mscorlib compilation).
7479         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7480         contain a method_hash, don't create one either.  Don't create a
7481         deep copy of the base cache's method_hash.
7482         (MemberCache.SetupCache): Rename back from DeepCopy.
7483         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7484         already initialized.  If we see an override function, add its
7485         underlying base virtual function to the member_hash too.
7486
7487         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
7488
7489 2005-03-26  Raja R Harinath  <harinath@acm.org>
7490
7491         Fix #73038.
7492         * assign.cs (Assign.DoResolve): When the RHS of an assignment
7493         fails to resolve, ensure that the LHS is still resolved as an
7494         lvalue.
7495
7496 2005-03-25  Raja R Harinath  <harinath@acm.org>
7497
7498         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
7499         ec.ContainerType.
7500         (Enum.current_ec): Remove.
7501         (Enum.LookupEnumValue): Remove EmitContext argument.
7502         Just uses the one created during DefineType.
7503         (Enum.FindMembers): Update.
7504         * expression.cs (MemberAccess.DoResolve): Update.
7505
7506 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
7507
7508         * assign.cs (Assign.DoResolve): Check for CS1717 when
7509         source and target are same (uses Equals).
7510
7511         * expression.cs (LocalVariableReference, ParameterReference,
7512         This): Implemented Equals, GetHashCode.
7513
7514         * statement.cs (Block.GetParameterReference): Removed useless
7515         local variable.
7516
7517 2005-03-22  Raja R Harinath  <rharinath@novell.com>
7518
7519         Fix cs0128.cs
7520         * statement.cs (Block.AddVariable): Ensure that we skip implicit
7521         blocks before deciding whether the error is cs0136 or cs0128.
7522
7523         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
7524         (using_alias_directive, using_namespace_directive): Pass
7525         MemberName, not an expression to Namespace.UsingAlias and
7526         Namespace.Using.
7527         (MakeName): Use the MemberName of the namespace.
7528         * namespace.cs (Namespace.MemberName): New.
7529         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
7530         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
7531         Likewise.
7532         * decl.cs (MemberName.Name): Make readonly.
7533         (MemberName.FromDotted): New "constructor".
7534         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
7535         (MemberCore.Name): Compute from MemberName on demand.
7536         (MemberCore.SetMemberName): Provide a way to change the
7537         MemberName.
7538         (MemberCore.AddToContainer): Don't take a fullname parameter.
7539         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
7540         fully qualified name of the container to the member name.
7541         (TypeContainer.AddToTypeContainer): Use a fully qualified name
7542         only if the type is a member of the root container.
7543         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
7544         MemberName.Left rather than searching for an embedded ".".
7545         (PartialContainer.CreatePart): Update to changes in RootContext.
7546         (MemberBase.ShortName): Turn into a property.  Use
7547         MemberCore.SetMemberName.
7548         (MemberBase.ExplicitInterfaceName): Remove.
7549         (MemberBase.UpdateMemberName): Remove.
7550         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
7551         (PropertyBase.SetMemberName): New override.
7552         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
7553         (Tree.GetDecl): New.
7554         (Tree.AllDecls): Rename from Decls.
7555         * attribute.cs, enum.cs, report.cs: Update to changes.
7556         * driver.cs (MainDriver): Use MemberName.FromDotted on
7557         RootContext.MainClass.
7558
7559 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
7560
7561         * class.cs (FixedField.Define): Check for CS1664 and more sanity
7562         checks.
7563
7564         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
7565
7566 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
7567
7568         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
7569         property accessor modifiers.
7570
7571         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
7572         fixed buffer attribute (CS1716).
7573         (PropertyMethod.HasCustomAccessModifier): When property accessor
7574         has custom modifier.
7575
7576         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
7577         modifiers.
7578         (PropertyExpr.DoResolveLValue): Add CS0272.
7579
7580 2005-03-17  Miguel de Icaza  <miguel@novell.com>
7581
7582         * convert.cs: When converting to a pointer, use the proper Conv.U
7583         or Conv.I depending on the source data type.
7584
7585         * cs-tokenizer.cs: Make the size for large decimal constants,
7586         fixes #72957.
7587
7588 2005-03-17  Martin Baulig  <martin@ximian.com>
7589
7590         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7591         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7592
7593 2005-03-17  Martin Baulig  <martin@ximian.com>
7594
7595         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7596         to bool so we can return an error condition.
7597         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7598         returned an error.
7599
7600 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
7601
7602         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
7603         attributes.
7604
7605 2005-03-16  Raja R Harinath  <rharinath@novell.com>
7606
7607         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
7608         Refactor to avoid traversing the list of assemblies, and to avoid
7609         string concatenation.
7610         * typemanager.cs (guid_attr_type): Remove.
7611         (negative_hits, pointers, references): Remove hashes.
7612         (type_hash): New.
7613         (GetConstructedType): New.  Uses type_hash to handle constructed
7614         types (arrays, references, pointers).
7615         (GetReferenceType, GetPointerType): Use it.
7616         (GetNestedType): New.  Uses type_hash to handle nested types of
7617         reflected types.
7618         (LookupType, LookupTypeDirect): Remove.
7619         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
7620         'types' hash and LookupTypeReflection directly.
7621         (params_string, params_object): Use GetConstructedType.
7622         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
7623         top-level types.
7624         (Namespace.Lookup): Use cached_types.
7625         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7626         provided by old TypeManager.LookupType.
7627         * rootcontext.cs (MakeFQN): Remove.
7628         * decl.cs (DeclSpace.MakeFQN): Likewise.
7629         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7630         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7631         TypeManager.GetConstructedType.
7632         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7633
7634 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
7635
7636         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7637         indexers.
7638
7639         * cs-parser.jay: Reports CS1527 for any namespace element.
7640
7641         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7642         Added CS0407.
7643
7644         * expression.cs (ParameterReference.IsAssigned): Changed error to
7645         CS0269.
7646         (Error_WrongNumArguments): Moved CS0245 detection here.
7647
7648         * statement.cs (Return.Resolve): Add CS1622 report.
7649
7650 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
7651
7652         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7653
7654 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
7655
7656         * attribute.cs expression.cs: Get rid of some allocations.
7657
7658 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
7659
7660         * doc.cs : just eliminate the latest change.
7661
7662 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7663
7664         * doc.cs : commented out the latest change. It breaks xml-030.cs
7665
7666 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7667
7668         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7669           fail. So invoke CreateType() in FindDocumentedType().
7670
7671 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7672
7673         * cs-tokenizer.cs : added IsKeyword().
7674         * doc.cs : Detect keyword incorrectly used as identifier.
7675           Allow identifiers prefixed by @.
7676
7677 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
7678
7679         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7680         It caused exception in namespace resolving (again!).
7681         
7682         * class.cs (Class.ctor): Removed exit.
7683         (PropertyMethod.ctor): ditto.
7684         
7685         * codegen.cs (Codegen.Reset): Reset static data.
7686         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7687         
7688         * cs-tokenizer.cs (Cleanup): Removed.
7689         
7690         * driver.cs (GetSystemDir): Rewrote to one line command.
7691         It caused problem with unloaded dynamic modules.
7692         (UnixParseOption): Removed Exit.
7693         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7694         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7695         Now can be mcs used as library.
7696         
7697         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7698         empty location.
7699         
7700         * location.cs (Reset): Reset static data.
7701         
7702         * namespace.cs (Reset): Reset static data.
7703         
7704         * report.cs (Report.Reset): Reset static data.
7705         
7706         * rootcontext.cs (RootContext.Reset): Reset static data.
7707         
7708         * tree.cs (RootTypes.ctor): Use Location.Null
7709         
7710         * typemanager.cs (TypeManager.Reset): Reset static data.
7711         (CoreLookupType): Removed Exit.
7712         (TypeHandle.Reset): Reset static data.
7713         
7714 2005-03-10  Raja R Harinath  <rharinath@novell.com>
7715
7716         Fix #73516.
7717         * typemanager.cs (ComputeNamespaces): Import namespaces from
7718         referenced modules too.
7719
7720 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7721
7722         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7723         than '.'.
7724
7725 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7726
7727         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7728         enclosing DeclSpace.  This ensures that a name-lookup populates
7729         more caches and there are fewer 'TypeExpression's.  Carve out
7730         nested type lookup into ...
7731         (LookupNestedTypeInHierarchy): ... this.
7732
7733 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7734
7735         Clean up a few partial-class semantics.  
7736         Fixes test-357.cs and cs1618-2.cs.
7737         * cs-parser.jay (struct_declaration): Use 'current_class' as
7738         parent of newly-created struct.  Remove call to Register ().
7739         Use 'pop_current_class' to complete handing the current struct.
7740         (interface_declaration): Likewise.
7741         (class_declaration): Likewise.
7742         (enum_declaration): Use 'current_class' as parent of newly created
7743         enum.
7744         (delegate_declaration): Likewise.
7745         (pop_current_class): New function.  This is used to handle closing
7746         up the 'current_class' and 'current_container', and pointing them
7747         to the enclosing class/container.
7748         (CSharpParser): Initialize 'current_class' too.
7749         * decl.cs (MemberCore): Add check for invariant: a partial
7750         container is not a parsed entity, and thus does not enclose any
7751         parsed members.
7752         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7753         (DeclSpace.BaseTypeExpr): Use it.
7754         (DeclSpace.LookupType): Add check for invariant.
7755         * class.cs (TypeContainer): Add check for invariant: a nested
7756         class should have the same NamespaceEntry as its enclosing class.
7757         (TypeContainer.EmitFieldInitializers): Make virtual.
7758         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7759         MemberCore.
7760         (TypeContainer.Register): Remove.
7761         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7762         null.  Use TypeResolveEmitContext for resolving base types and
7763         interfaces.  Move initialization of Parts.TypeBuilder here from
7764         ...
7765         (TypeContainer.DefineNestedTypes): ... here.
7766         (PartialContainer): Take a Namespace not a NamespaceEntry.
7767         (PartialContainer.Create): Don't use Register.  Call the
7768         appropriate Add... function directly.
7769         (ClassPart): Take both the PartialContainer and the enclosing
7770         class as constructor arguments.
7771         (ClassPart.EmitFieldInitializers): Override.
7772         (ClassPart.PartFindNestedTypes): Remove.
7773         (FieldBase.GetInitializerExpression): Resolve the initializer
7774         expression in the emit context of the enclosing class.
7775         * tree.cs (RootTypes): Remove Register ().
7776         
7777 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
7778
7779         * cs-parser.jay: Removed CS0134.
7780         
7781         * driver.cs: Removed CS1901.
7782         
7783         * expression.cs (SizeOf.DoResolve): Don't report CS0233
7784         for predefined types.
7785
7786 2005-03-07  Duncan Mak  <duncan@novell.com>
7787
7788         * codegen.cs (Save):  Catch UnauthorizedAccessException as
7789         well. Fixes bug #73454.
7790
7791 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
7792
7793         * cs-tokenizer.cs (xtoken): Add CS1035.
7794         
7795         * class.cs (MethodData.Define): Add CS0683.
7796         (FieldMember.ctor): Add CS0681.
7797
7798 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7799
7800         * ecore.cs (SimpleName.DoResolve): Rename from
7801         SimpleName.DoResolveAllowStatic.
7802         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7803         Pass 'intermediate' flag to MemberStaticCheck.
7804         (SimpleName.MemberStaticCheck): Skip "static check" only in case
7805         of "intermediate" lookups via MemberAccess.
7806         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
7807         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7808
7809 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7810
7811         Fix #73394.
7812         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7813         slipped in because of variable names that are identical to a
7814         builtin type's BCL equivalent ('string String;', 'int Int32;').
7815         (PropertyExpr.EmitInstance): Likewise.
7816
7817 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
7818
7819         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7820         
7821         * report.cs (warning_ignore_table): Made public.
7822
7823 2005-03-04  Raja R Harinath  <rharinath@novell.com>
7824
7825         Fix #73282.
7826         * class.cs (MethodData.Emit): Pass 'container' to
7827         container.GetObsoleteAttribute instead of 'container.Parent'.
7828
7829 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
7830
7831         * cs-parser.jay: Add 1534 error test.
7832
7833         * iterators.cs (Yield.CheckContext): Add error 1629.
7834         (Iterator.ctor): Save unsafe modifier.
7835         (MoveNextMethod.DoEmit): Restore unsafe context.
7836
7837         * namespace.cs (UsingAlias): Better error message.
7838
7839 2005-03-03  Dan Winship  <danw@novell.com>
7840
7841         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7842         the warning message [#73219]
7843
7844 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7845
7846         Fix compile with MCS 1.0.0.0.
7847         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7848         w_restore to not depend on string constant folding.
7849
7850 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7851
7852         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
7853         CS0246 check to users who passed 'silent = false'.
7854         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7855         check.
7856         (SimpleName.SimpleNameResolve): Update.
7857         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7858         (MemberAccess.IdenticalNameAndTypeName): Update.
7859         * doc.cs (FindDocumentedTypeNonArray): Update.
7860
7861 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
7862
7863         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7864         * parameters.cs (ComputeAndDefineParameters): Remove.
7865         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7866         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7867         Use GetParameterInfo.
7868
7869 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
7870
7871         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7872
7873 2005-03-02  Raja R Harinath  <rharinath@novell.com>
7874
7875         Unify DeclSpace.LookupType and DeclSpace.FindType.
7876         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
7877         is in charge of defining nested types on demand.
7878         (DeclSpace.LookupType): Use it when the current_type is a
7879         TypeBuilder.  Use LookupTypeDirect for reflected types.
7880         (DeclSpace.FindType): Remove.
7881         (DeclSpace.LookupInterfaceOrClass): Likewise.
7882         (DeclSpace.DefineTypeAndParents): Likewise.
7883         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7884         DeclSpace.LookupType.
7885         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7886         * typemanager.cs (LookupType): Simplify.
7887         (AddUserType): Remove type from negative_hits.
7888         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7889         * class.cs (TypeContainer.FindMembers): Move handling of nested
7890         types ...
7891         (TypeContainer.FindMembers_NestedTypes): ... here.
7892         (TypeContainer.FindNestedType): Implement override.
7893         (ClassPart.FindNestedType): Delegate to PartialContainer.
7894         (ClassPart.PartFindNestedType): Looks up the nested types of the
7895         part alone.
7896
7897 2005-03-02  Martin Baulig  <martin@ximian.com>
7898
7899         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7900         static constructor in static classes.
7901
7902 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7903
7904         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7905         sizeParamIndex is not specified.
7906
7907 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
7908
7909         Fix #73117
7910         * report.cs (WarningMessage.IsEnabled): Missing null check.
7911
7912 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7913
7914         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7915         in the fields and not in the properties.
7916
7917 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
7918
7919         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
7920         fields as well.
7921
7922 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7923
7924         * attribute.cs: Small refactoring (improved robustness).
7925         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7926         (ValidateGuid): Removed.
7927         (Resolve): Removed referenced to above mentioned.
7928         (GetAttributeUsage): Made private and changed to work without
7929         class assistance.
7930         (GetIndexerAttributeValue): Don't crash.
7931         (GetConditionalAttributeValue): Ditto.
7932         (GetClsCompliantAttributeValue): Ditto.
7933         (ExtractSecurityPermissionSet): All attributes exceptions are
7934         error 648.
7935         (GetPropertyValue): New helper.
7936         (GetMethodImplOptions): New method.
7937         (DefinePInvokeMethod): Reuse common code. Implemented handling of
7938         some missing properties.
7939         
7940         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7941         (Method.ApplyAttributeBuilder): Updated.
7942         
7943         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7944         exception.
7945
7946 2005-02-28  Raja R Harinath  <rharinath@novell.com>
7947
7948         Fix #73052.
7949         * report.cs (Report.SymbolRelatedToPreviousError): Handle
7950         non-simple types (array, pointer, reference).
7951
7952 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7953
7954         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7955
7956         * class.cs (MethodCore.IsDuplicateImplementation): Special error
7957         for operators.
7958         (Method.CheckBase): Catch wrong destructor here.
7959         (MethodData.Define): Add errors 550, 668.
7960
7961         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7962
7963         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7964
7965         * pending.cs (VerifyPendingMethods): Add error 551.
7966
7967         * typemanager.cs (CSharpName): Next error report helper.
7968
7969 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
7970
7971         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7972         attributes. Removed useless attribute double check.
7973         It saves almost 2MBs for corlib.
7974
7975 2005-02-25  Raja R Harinath  <rharinath@novell.com>
7976
7977         Fix #72924.
7978         * statement.cs (ExpressionStatement.Resolve): Make robust to being
7979         called twice in case of error.
7980
7981 2005-02-23  Chris Toshok  <toshok@ximian.com>
7982
7983         Fix compiler portions of #72827.
7984         * statement.cs (Block.Emit): call Begin/EndScope on the
7985         EmitContext instead of the ILGenerator.
7986
7987         * codegen.cs (EmitContext.BeginScope): new method, call
7988         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7989         we have one.)
7990         (EmitContext.BeginScope): same, but EndScope and CloseScope
7991
7992         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7993         offset and call the superclass's OpenScope(int) with it.
7994         (SymbolWriter.CloseScope): get the current il
7995         offset and call superclass's CloseScope(int) with it.
7996
7997 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
7998
7999         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
8000         CS1677 for out and ref as well.
8001
8002         * class.cs (Method.Define): Add error CS1599 detection.
8003         
8004         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
8005         
8006         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
8007         
8008         * delegate.cs (Delegate.Define): Add error CS1599 detection.
8009         
8010         * support.cs.cs (ModifierDesc): New helper method.
8011
8012 2005-02-23  Raja R Harinath  <rharinath@novell.com>
8013             Abin Thomas  <projectmonokochi@rediffmail.com>
8014             Anoob V E  <projectmonokochi@rediffmail.com>
8015             Harilal P R  <projectmonokochi@rediffmail.com>
8016
8017         Fix #57851, #72718.
8018         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
8019         MemberLookup (used for error reporting) actually returns a result.
8020         Fix error report number (122, not 112).
8021
8022 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
8023             Anoob V E  <projectmonokochi@rediffmail.com>
8024             Harilal P R  <projectmonokochi@rediffmail.com>
8025
8026         Fix #71134.
8027         * pending.cs (PendingImplementation.GetAbstractMethods):
8028         Find NonPublic members too.
8029
8030 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
8031
8032         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
8033         Fixed error 217.
8034         
8035         * class.cs (MethodCore.CheckMethodAgainstBase):
8036         Add error 239 report.
8037
8038 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8039
8040         Fix #68955.
8041         * expression.cs (Invocation.IsApplicable): Make public.
8042         (Invocation.IsParamsMethodApplicable): Likewise.
8043         * delegate.cs (Delegate.VerifyApplicability): Don't use
8044         Invocation.VerifyArgumentCompat for parameter applicability
8045         testing.  Use Invocation.IsApplicable and
8046         Invocation.IsParamsMethodApplicable.
8047
8048 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
8049
8050         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
8051         
8052         * class.cs (Operator.Define): Add error 217 report.
8053         
8054 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8055
8056         * namespace.cs (UsingEntry.Resolve): Undo change below.
8057
8058 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8059
8060         Fix #72756.
8061         * ecore.cs (Expression.MemberLookupFailed): Add argument to
8062         disable the error message when the extended MemberLookup also
8063         fails.
8064         (Expression.MemberLookupFinal): Update.
8065         (SimpleName.DoSimpleNameResolve): Update.
8066         * expression.cs (MemberAccess.ResolveNamespaceOrType):
8067         Don't use MemberLookupFinal.
8068         (New.DoResolve): Update.
8069         (BaseAccess.CommonResolve): Update.
8070
8071 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8072
8073         Fix #72732.
8074         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
8075         occured previously, don't resolve again.
8076
8077 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
8078
8079         Fix #69949
8080         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
8081         argument. Call ResolveAttributeUsage for unresolved.
8082         when types doesn't match ctor arguments.
8083         
8084         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
8085         for nested attribute classes.
8086         (Class.attribute_usage): Removed.
8087         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
8088         for attribute class.
8089         
8090         * ecore.cs (IsAttribute): Removed.
8091         
8092         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
8093         
8094         * rootcontext.cs (RegisterAttribute): Removed, attributes are
8095         now normal types.
8096         (attribute_types): Removed.
8097         (EmitCode): Global attributes are emited as the latest.
8098
8099 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
8100
8101         * class.cs (EmitFieldInitializers): Don't emit field initializer
8102         for default values when optimilization is on.
8103         
8104         * constant.cs (Constant.IsDefaultValue): New property.
8105         
8106         * driver.cs: Add /optimize handling.
8107         
8108         * constant.cs,
8109         * ecore.cs,
8110         * literal.cs: Implement new IsDefaultValue property.
8111         
8112         * rootcontext.cs (Optimize): New field, holds /optimize option.
8113
8114 2005-02-18  Raja R Harinath  <rharinath@novell.com>
8115
8116         Fix crasher in re-opened #72347.
8117         * namespace.cs (Namespace.Lookup): Return null if
8118         DeclSpace.DefineType returns null.
8119
8120         Fix #72678.
8121         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
8122
8123 2005-02-18  Raja R Harinath  <rharinath@novell.com>
8124
8125         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
8126         now returns null if it cannot resolve to an lvalue.
8127         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
8128         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
8129         returned null.  Remove check for SimpleName.
8130         (EventExpr.DoResolveLValue): New.
8131         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
8132         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
8133         error from ...
8134         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
8135         avoid CS0131 error.
8136         (Unary.ResolveOperator): Move CS0211 check ...
8137         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
8138         CS0131 error.
8139         (Unary.DoResolveLValue): Simplify.
8140         (AddressOf.DoResolveLValue): New.
8141         (ArrayAccess.DoResolveLValue): New.
8142
8143 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
8144
8145         * attribute.cs (Attribute.Resolve): Add arguments casting for
8146         when types doesn't match ctor arguments.
8147
8148 2005-02-16  Raja R Harinath  <rharinath@novell.com>
8149
8150         Fix parts of #63202.
8151         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
8152         lookup of operator in base type.  Ensure that all checks happen
8153         when the operator resolves to an "op_..." method.
8154
8155 2005-02-15  Raja R Harinath  <rharinath@novell.com>
8156
8157         Fix #71992.
8158         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
8159         'ignore_cs0104' parameter.  Pass it to ...
8160         (NamespaceEntry.Lookup): ... this.
8161         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8162         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
8163         (TypeLookupExpression.DoResolveAsTypeStep): Update.
8164         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
8165         Update.  Request that cs0104 errors be ignored.
8166         (ComposedCast.ResolveAsTypeStep): Update.
8167
8168 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8169
8170         Fix #59209.
8171         * expression.cs (Invocation.BetterFunction): Remove support for
8172         comparing virtual functions and their overrides.
8173         (Invocation.IsOverride): New.
8174         (Invocation.OverloadResolve): Don't consider 'override' functions
8175         during candidate selection.  Store them in a lookaside list.
8176         If the selected method is a 'virtual' function, use the list to
8177         find any overrides that are closer to the LHS type.
8178
8179 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
8180
8181         * expression.cs (New.DoResolve): Add complex core type reduction.
8182         (New.Constantify): Converts complex core type syntax like 'new int ()'
8183         to simple constant.
8184         
8185 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8186
8187         * decl.cs (EntryType.EntryType): New constructor to create an
8188         updated copy of a cache entry.
8189         (MemberCache.AddMethods): Use it.
8190         (MemberCache.ClearDeclaredOnly): Remove.
8191         (MemberCache.MemberCache): Update.
8192
8193 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8194
8195         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
8196         variable.  This one is represents the actual low-level declaration
8197         of the method, as opposed to the semantic level `IsStatic'.   
8198
8199         An anonymous method which is hosted into a static method might be
8200         actually an instance method.  IsStatic would reflect the
8201         container, while MethodIsStatic represents the actual code
8202         generated.
8203
8204         * expression.cs (ParameterReference): Use the new MethodIsStatic
8205         instead of IsStatic.
8206
8207         * anonymous.cs (AnonymousMethod.Compatible): Pass the
8208         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
8209         set on the current EmitContext. 
8210
8211         * expression.cs (Cast): Overload DoResolveLValue so we can pass
8212         resolve our casted expression as an LValue.  This triggers the
8213         proper LValue processing that is later required by Assign.
8214
8215         This fixes 72347.
8216
8217         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
8218
8219 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
8220
8221         C# 2.0 Fixed buffer implementation
8222
8223         * anonymous.cs: Update after RegisterHelperClass renaming.
8224
8225         * attribute.cs (AttributeTester.fixed_buffer_cache):
8226         Cache of external fixed buffers.
8227         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
8228         implementation if field is fixed buffer else null.
8229
8230         * class.cs
8231         (TypeContainer.AddField): Accept FieldMember instead of Field.
8232         (FieldBase.IsFieldClsCompliant): Extracted code from
8233         VerifyClsCompliance descendant customization.
8234         (FixedField): New class handles fixed buffer fields.
8235         (FixedFieldExternal): Keeps information about imported fixed
8236         buffer.
8237         (IFixedField): Make access to internal or external fixed buffer
8238         same.
8239
8240         * cs-parser.jay: Add fixed buffer parsing.
8241
8242         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
8243         buffer.
8244
8245         * expression.cs (Indirection): Extended implementation to accept
8246         fixed buffer field.
8247         (PointerArithmetic.Emit): Get element from fixed buffer as well.
8248         (ElementAccess.MakePointerAccess): Get type as parameter.
8249         (DoResolve): Add fixed buffer field expression conversion.
8250         (DoResolveLValue): Ditto.
8251         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
8252         (ArrayPtr): Derives from FixedBufferPtr.
8253         (ArrayPtr.Emit): Add extra emit for array elements.
8254
8255         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
8256
8257         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
8258         for compiler generated types.
8259         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
8260
8261         * statement.cs (Fixed): Refactored to be easier add fixed buffer
8262         and consume less memory.
8263         (Fixed.Resolve): Add fixed buffer case.
8264
8265         * typemanager.cs (compiler_generated_attr_ctor,
8266         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
8267         (HasElementType): Add our own implementation to work on every
8268         runtime.
8269
8270 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8271
8272         * anonymous.cs (CaptureContext): Track whether `this' has been
8273         referenced.   
8274
8275         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
8276         only captured `this' if it was implicitly done (instance
8277         methods/variables were used). 
8278
8279         * codegen.cs (EmitContext.CaptureThis): New method to flag that
8280         `this' must be captured.
8281
8282 2005-01-30  Miguel de Icaza  <miguel@novell.com>
8283  
8284         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
8285         is null it means that there has been no need to capture anything,
8286         so we just create a sibling.
8287
8288         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
8289
8290         Just a partial fix.  The other half is fairly elusive.
8291         
8292 2005-02-10  Raja R Harinath  <rharinath@novell.com>
8293
8294         Fix #52586, cs0121-4.cs.
8295         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
8296         and return a hashtable.
8297         (MemberCache.ClearDeclaredOnly): New.
8298         (MemberCache.MemberCache): Update to change.  Make a deep copy of
8299         the method_hash of a base type too.
8300         (MemberCache.AddMethods): Adapt to having a deep copy of the base
8301         type methods.  Overwrite entries with the same MethodHandle so
8302         that the ReflectedType is correct.  The process leaves in base
8303         virtual functions and their overrides as distinct entries.
8304         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
8305         matters since it was boxed in a ArrayList before.
8306         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
8307         modifier.
8308         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
8309         case of a virtual function and its override (choose the overload
8310         as better).
8311         (Invocation.OverloadResolve): Avoid 'override' members during
8312         'applicable_type' calculation.
8313
8314 2005-02-09  Raja R Harinath  <rharinath@novell.com>
8315
8316         Combine two near-redundant caches.
8317         * typemanager.cs (method_params): Rename from method_internal_params.
8318         (TypeManager.GetParameterData): New.  Replace
8319         Invocation.GetParameterData.
8320         (TypeManager.LookupParametersByBuilder): Remove.
8321         * expression.cs (Invocation.method_parameter_cache): Remove.
8322         (Invocation.GetParameterData): Remove.
8323         Update to changes.
8324         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
8325         Update to changes.
8326
8327 2005-02-08  Raja R Harinath  <rharinath@novell.com>
8328
8329         Fix #72015.
8330         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
8331         TypeManager.multicast_delegate_type is null, resolve it by looking
8332         up "System.MulticastDelegate".
8333         * rootcontext.cs (RootContext.ResolveCore): Simplify.
8334
8335 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
8336             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
8337             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
8338
8339         Fix cs0164.cs.
8340         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
8341         (LabeledStatement.AddReference): New.  Set 'referenced'.
8342         (Goto.Resolve): Use it.
8343
8344 2005-02-05  John Luke  <john.luke@gmail.com>
8345
8346         * driver.cs: remove duplicate -doc line in Usage ()
8347
8348 2005-02-04  Raja R Harinath  <rharinath@novell.com>
8349
8350         * location.cs (Location.AddFile): Fix CS2002 error report.
8351
8352 2005-02-02  Martin Baulig  <martin@ximian.com>
8353
8354         * delegate.cs (Delegate.DefineType): Report an internal error if
8355         TypeManager.multicast_delegate_type is null.  See bug #72015 for
8356         details.        
8357
8358 2005-02-02  Raja R Harinath  <rharinath@novell.com>
8359
8360         Fix a crasher in a variant of #31984.
8361         * const.cs (Constant.CheckBase): New override that defers the
8362         new-or-override check in case the base type hasn't been populated
8363         yet.
8364         (Constant.Define): Ensure the new-or-override check is performed.
8365
8366 2005-02-01  Duncan Mak  <duncan@ximian.com>
8367
8368         * const.cs (LookupConstantValue): Check that `ce' is not null
8369         before calling GetValue ().
8370
8371 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8372
8373         Fix test-334.cs (#69519).
8374         * cs-parser.jay (using_alias_directive): Pass in an expression to
8375         NamespaceEntry.UsingAlias.
8376         (using_namespace_directive): Pass in an expression to
8377         NamespaceEntry.Using.
8378         (namespace_name): Don't flatten to a string.
8379         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
8380         (NamespaceEntry.AliasEntry.Resolve): Lookup using
8381         ResolveAsTypeStep.
8382         (NamespaceEntry.UsingEntry): Likewise.
8383         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
8384         changes.
8385         (NamespaceEntry.LookupForUsing): Remove.
8386         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
8387         names.
8388         (NamespaceEntry.Lookup): Remove support for dotted names.
8389
8390 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8391
8392         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
8393         split into two.
8394         (NamespaceEntry.ImplicitParent): Compute on demand.
8395         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
8396         parallels the current.
8397         (NamespaceEntry.LookupForUsing): Use it.
8398         (NamespaceEntry.Lookup): If the current namespace-entry is
8399         implicit, don't search aliases and using tables.
8400
8401 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8402
8403         Fix #31984.
8404         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
8405         BaseCache here.
8406         (TypeContainer.BaseCache): Compute on demand.
8407         (TypeContainer.FindMembers): Define constants and types if they're
8408         not already created.
8409         (FieldMember.Define): Move resetting of ec.InUnsafe before error
8410         check.
8411         * const.cs (Constant.Define): Make idempotent.
8412
8413 2005-01-29  Miguel de Icaza  <miguel@novell.com>
8414
8415         * pending.cs: Produce better code (no nops produced by using Ldarg
8416         + value).
8417         
8418         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
8419         i - 1' it should be arg + 1.
8420
8421         Fixes bug #71819.
8422
8423 2005-01-28  Raja R Harinath  <rharinath@novell.com>
8424
8425         * attribute.cs (Attribute.CheckAttributeType): Make private
8426         non-virtual.
8427         (Attribute.ResolveType): Make virtual.
8428         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
8429         handling of RootContext.Tree.Types.
8430
8431 2005-01-27  Raja R Harinath  <rharinath@novell.com>
8432
8433         Update attribute-handling to use the SimpleName/MemberAccess
8434         mechanisms.
8435         * cs-parser.jay (attribute): Pass in an expression to the
8436         constructors of Attribute and GlobalAttribute.
8437         * attribute.cs (Attribute): Take an expression for the name.
8438         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
8439         passed in attribute name expression.
8440         (Attribute.CheckAttributeType): Use it.
8441         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
8442         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
8443         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
8444         argument to prevent error messages if the lookup fails.
8445
8446 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
8447
8448         * expression.cs (Indirection): Implemented IVariable interface
8449         to support indirection in AddressOf operator.
8450         (PointerArithmetic.Emit): Add optimalization for case where
8451         result can be precomputed.
8452
8453 2005-01-26  Martin Baulig  <martin@ximian.com>
8454
8455         * class.cs (TypeContainer.AttributeTargets): Return the correct
8456         AttributeTargets depending on our `Kind' instead of throwing an
8457         exception; fixes #71632.
8458
8459 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
8460
8461         Fix #71257
8462         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
8463         constant members.
8464
8465 2005-01-25  Raja R Harinath  <rharinath@novell.com>
8466
8467         Fix #71602.
8468         * expression.cs (MemberAccess.DoResolve): Don't complain with
8469         cs0572 when the LHS of a member access has identical name and type
8470         name.
8471
8472 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
8473
8474         Fix #71651, #71675
8475         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
8476         CreatePermission.
8477         Create custom PermissionSet only for PermissionSetAttribute.
8478
8479 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
8480
8481         Fix #71649
8482         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
8483         delegates in static class.
8484
8485 2005-01-24  Martin Baulig  <martin@ximian.com>
8486
8487         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8488         merging an implicit block, just use its reachability.
8489
8490         * statement.cs (Block.Resolve): Make the unreachable code check
8491         work wrt. implicit blocks; see test-337 from #63842.
8492
8493 2005-01-21  Alp Toker  <alp@atoker.com>
8494  
8495         * cs-parser.jay: destructor_declaration's container is PartialContainer
8496         not Class when partial types are used, so use Kind prop instead of
8497         'is'.
8498         
8499 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
8500
8501         * cs-parser.jay: Improve error reporting when an interface
8502         declares new types.
8503
8504 2005-01-20  Dick Porter  <dick@ximian.com>
8505
8506         * support.cs: SeekableStreamReader fix from Sandor Dobos
8507         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
8508         chars are read.  Fixes bug 70369.
8509
8510 2005-01-20  Raja R Harinath  <rharinath@novell.com>
8511
8512         * cs-parser.jay (catch_clause): Simplify current_block handling
8513         somewhat.
8514
8515 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
8516
8517         * convert.cs (ImplicitStandardConversionExists): Synchronize the
8518         code with ImplicitStandardConversion to handle the implicit
8519         conversion of method groups into valid delegate invocations. 
8520
8521         The problem is that in parameter handling we were using this code
8522         path.  Fixes bug #64698
8523
8524 2005-01-19  Raja R Harinath  <rharinath@novell.com>
8525
8526         * cs-parser.jay: Fix several infelicities.
8527         - Avoid assigning to the parser value stack.  Code like 
8528           '$3 = null' is unclean.  Synthesize a value for the code block
8529           instead. 
8530         - Avoid using oob_stack for storing location information.  Use ...
8531         (_mark_): ... this.  New (empty) rule.  Saves the current location
8532         in $$.
8533         (foreach_statement): Avoid using oob_stack for current_block
8534         handling.  Use technique used in for_statement and
8535         using_statement.  Synthesize a value for the code block to store
8536         additional intermediate information.
8537
8538 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
8539
8540         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
8541         of a different type is only allowed to private fields of a
8542         containing type, not on fields of a base class.
8543
8544         See test-174.cs and error cs0122-9.cs
8545
8546 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8547
8548         Fix test-335.cs (bug #58126).
8549         * cs-parser.jay (argument): Split out non-expression parts of the
8550         rule into 'non_simple_argument'.
8551         (invocation_expression): Support parenthesized invocations with
8552         multiple arguments, and with single non-simple arguments.
8553
8554 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8555
8556         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
8557         places.
8558
8559 2005-01-12  Raja R Harinath  <rharinath@novell.com>
8560
8561         Fix cs0038-1.cs, cs1640-6.cs.
8562         * ecore.cs (Expression.Resolve): Remove special-case for
8563         SimpleName in error-handling.
8564         (Expression.almostMatchedMembers): Relax access permission to
8565         protected.
8566         (Expression.MemberLookupFailed): Handle duplicates in
8567         almostMatchedMembers list.
8568         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
8569         * expression.cs (New.DoResolve): Report CS1540 for more cases.
8570         * typemanager.cs (GetFullNameSignature): Use the MethodBase
8571         overload if the passed in MemberInfo is a MethodBase.
8572
8573 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
8574
8575         Fix #70749
8576         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
8577         for non-CAS & merge permission sets properly.
8578
8579 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8580
8581         Improve standard-compliance of simple name and member access 
8582         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
8583         * ecore.cs (FullNamedExpression): New abstract base class 
8584         for Namespaces and TypeExpressions.
8585         (ResolveFlags.SimpleName): Remove.
8586         (SimpleName): Remove support for dotted names.
8587         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
8588         DeclSpace.FindType and DeclSpace.LookupType.
8589         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
8590         (Expression.ExprClassName): Make member function.
8591         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
8592         a namespace.  Remove creation of dotted "SimpleName"s.
8593         (MemberAccess.DoResolve): Likewise.
8594         * decl.cs (DeclSpace.Cache): Make private.
8595         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
8596         (DeclSpace.FindType): Update.
8597         (DeclSpace.LookupType): Move here from RootContext.  Return a 
8598         FullNamedExpression.
8599         * namespace.cs (Namespace): Derive from FullNamedExpression
8600         so that it can be part of expression resolution.
8601         (Namespace.Lookup): Return an FullNamedExpression.
8602         (NamespaceEntry.LookupAlias): Lookup aliases only in current
8603         namespace.
8604         * rootcontext.cs (NamespaceLookup): Remove.
8605         (LookupType): Move to DeclSpace.
8606         * attribute.cs (CheckAttributeType): Update.
8607         * doc.cs (FindDocumentedType): Remove allowAlias argument.
8608         (FindDocumentedTypeNonArray): Likewise.
8609
8610 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8611
8612         Fix cs0509.cs, cs1632.cs.
8613         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
8614         is the same as IsInterface.
8615         (TypeContainer.GetClassBases): Likewise.
8616         * statement.cs (LabeledStatement.ig): New field.
8617         (LabeledStatement.LabelTarget): Save ILGenerator which created the
8618         label.
8619         (LabeledStatement.DoEmit): Check that the label was created with
8620         the same ILGenerator.
8621
8622 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8623
8624         Fix #71058
8625         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8626         accessors to its properties.
8627
8628         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8629         from accessors to property.
8630         
8631 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8632
8633         Fix #70722
8634         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8635         only for overrides.
8636         
8637 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
8638
8639         * attribute.cs: Check for null and empty strings.  
8640
8641         I have lost another battle to Paolo.
8642
8643 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
8644
8645         Fix #70942
8646         * class.cs (PropertyMethod): Set Parent field in ctors.
8647         (SetMethod.InternalParameters): Add unsafe switch hack.
8648         Override MarkForDuplicationCheck where it is appropriate.
8649
8650         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8651         It says whether container allows members with the same name.
8652         Base default is no.
8653         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8654         Removed is_method parameter.
8655
8656 2005-01-06  Duncan Mak  <duncan@ximian.com>
8657
8658         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8659         because the previous change led to incorrect reporting of CS1032
8660         ("Cannot define/undefine preprocessor symbols after first token in
8661         file"). Instead of using `tokens_seen' as the only flag that
8662         triggers CS1040, introduce `comments_seen'. This new flag is used
8663         to signify having seen comments on the current line, so it is
8664         unset after a newline.
8665
8666 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8667
8668         * doc.cs : When searching for a type, find nested type too.
8669           This fixes bug #71040.
8670
8671 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8672
8673         * doc.cs :
8674           - Warn missing member comment on those classes which also does not
8675             have doc comments. Fixed bug #71041.
8676           - Don't warn missing doc comment on default constructor.
8677             Fixed bug #71042.
8678
8679 2005-01-06  Duncan Mak  <duncan@ximian.com>
8680
8681         * cs-tokenizer.cs (xtoken): After handling traditional C-style
8682         comments, set `tokens_seen' to true. This allows us to detect
8683         misplaced preprocessor directives (i.e. not at the beginning of
8684         the a line, nor after whitespaces). In that case, report error
8685         CS1040. This fixes bug #56460.
8686
8687         * cs-parser.jay (interface_member_declaration): Add checks for
8688         IsExplicitImpl, and report CS0541 error if an interface member is
8689         defined as an explicit interface declaration.
8690
8691 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
8692
8693         Fix #70817
8694         * class.cs (PropertyMethod): Set Parent field in ctors.
8695         (SetMethod.InternalParameters): Add unsafe switch hack.
8696         
8697         * decl.cs (MemberCore.Parent): Cannot be readonly.
8698
8699 2005-01-06  Raja R Harinath  <rharinath@novell.com>
8700
8701         * decl.cs (DeclSpace.ResolveType): Remove.
8702         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8703         Merge in code from ...
8704         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
8705         * class.cs, enum.cs: Update to changes.
8706
8707 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
8708
8709         * anonymous.cs: Ensure that we init the scope of our parent if it
8710         has not been initialized yet.
8711
8712 2004-12-30  Duncan Mak  <duncan@ximian.com>
8713
8714         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8715         if field.FieldBuilder is null. Fixes #70758.
8716
8717         * convert.cs: Fixed some typos and updated some of the comments.
8718         (ImplicitStandardConversionExists):
8719         (TryImplicitIntConversion): If `target_type' is an interface and
8720         the type of `ic' implements this interface, return true or a new
8721         BoxedCast instead of null. This fixes #70468.
8722
8723 2004-12-29  Duncan Mak  <duncan@ximian.com>
8724
8725         * expression.cs (Argument.Emit): Check that Expr is
8726         IMemoryLocation before casting to it, and report CS1510 otherwise.
8727
8728         This fixes #70402.
8729
8730 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
8731
8732         * statement.cs (Block.ThisVariable): remove the recursion here, to
8733         make the --profile more sane.
8734
8735 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
8736
8737         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8738         assembly, by JB Evain.
8739
8740 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8741
8742         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
8743           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8744         "parent" refers to enclosing type/class.  "base" refers to superclass.
8745
8746 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8747
8748         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8749         Ensure that we only have GlobalAttributes.
8750         * attribute.cs (Attribute.Emit): Make non-virtual.
8751         (GlobalAttribute.Emit): Remove.
8752         (Attribute.Resolve): Make virtual.
8753         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
8754         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8755         the argument. Don't create one.
8756         (Attribute.GetObsoleteAttribute): Likewise.
8757         (Attribute.GetClsCompliantAttributeValue): Likewise.
8758         * class.cs, decl.cs: Update to changes.
8759
8760 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
8761
8762         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8763         
8764         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8765         
8766         * statement.cs (Foreach.Resolve): Add error 186 report.
8767
8768 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
8769
8770         * expression.cs (Conditional.DoResolve): Add warning 429.
8771         
8772         * statement.cs (If.Resolve): Add warning 665.
8773
8774 2004-12-16  Raja R Harinath  <rharinath@novell.com>
8775
8776         New invariant: RootContext.Tree.Types.NamespaceEntry == null
8777         except when in the parser, and in GlobalAttribute.
8778         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8779         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8780         RootContext.Tree.Types.NamespaceEntry once work is done.
8781         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
8782         and resets RootContext.Tree.Types.NamespaceEntry.
8783
8784 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
8785
8786         * cs-parser.jay: Don't create a block for every variable.
8787
8788 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
8789
8790         * location.cs: Provide extra information.
8791
8792         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8793         variables from the captured environment, it is the ldarg_0.
8794
8795 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8796
8797         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8798         find a conclusion.
8799         
8800         * class.cs: Changed warning level for 169 to avoid developer
8801         displeasure from warning flooding. It will be changed back when they
8802         fix most of current BCL warnings.
8803         
8804         * RootContext.cs: Pushed default WarningLevel to 3.
8805         
8806         * statement.cs: Removed unused variable.
8807
8808 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8809
8810         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8811         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8812         Add error 502 report.
8813         (StaticClass.DefineType): Add error 441 report.
8814         (Class.AllowedModifiersProp): New virtual property as temporary
8815         extension to AllowedModifiers.
8816         (Class.DefineType): Add error 418 report. Moved ModFlags check here
8817         to share implementation with StaticClass and don't call virtual
8818         methods from ctor.
8819         
8820         * driver.cs (MainDriver): Add error 1558 test.
8821
8822         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8823         report. Moved error 36 test here.
8824
8825         * statement.cs (Throw.Resolve): Add error 724 report.
8826
8827         * typemanager.cs: Add out_attribute_type core type.
8828         
8829 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
8830
8831         * class.cs (TypeContainer.VerifyClsCompliance): Add error
8832         3018 report.
8833         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8834
8835         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8836         3017 report.
8837         
8838         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8839
8840         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
8841         Add error 3023 report.
8842         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8843
8844         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8845         implementation.
8846
8847 2004-12-12  John Luke  <john.luke@gmail.com>
8848
8849         * driver.cs (AddArgs): take -- into account when
8850         adding arguments, fixes bug 65710 
8851
8852 2004-12-12  Martin Baulig  <martin@ximian.com>
8853
8854         * expression.cs (Unary.TryReduceNegative): Added support for
8855         SByteConstant and ByteConstant.
8856         (Unary.Reduce): Check error values from TryReduceNegative().
8857
8858 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
8859
8860         * attributes.cs (Attribute.Resolve): Avoid multiple error report
8861         and report exception as error 182.
8862
8863 2004-12-10  Raja R Harinath  <rharinath@novell.com>
8864
8865         * driver.cs (Main): Fix message when there are warnings.
8866
8867 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
8868
8869         * delegate.cs: Fixed my fix from yesterday, sorry about that.
8870
8871 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
8872
8873         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
8874         Reduced number of warnings.
8875         
8876         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8877
8878 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
8879
8880         * driver.cs: Removed message.
8881
8882         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8883
8884 2004-12-08    <vargaz@freemail.hu>
8885
8886         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8887
8888 2004-12-08  Martin Baulig  <martin@ximian.com>
8889
8890         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8891         instead of a CS3002 for properties and indexer.
8892
8893 2004-12-08  Martin Baulig  <martin@ximian.com>
8894
8895         * decl.cs (MemberName.ToString): Make this work again.
8896
8897 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
8898
8899         * attribute.cs (Resolve): Add error 591 detection.
8900
8901         * class.cs (FieldMember.Define): Add error 1547 detection.
8902         (Indexer.Define): Add error 620 detection.
8903         (Operator.Define): Add error 590 detection.
8904
8905         * ecore.cs: Missing argument for error 79.
8906
8907         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8908         detection.
8909
8910 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
8911
8912         Fix #70106
8913         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8914         only.
8915
8916 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8917
8918         * cs-parser.jay : handle doc comments on implicit/explicit operators.
8919           Some operator comments were suppressed.
8920         * doc.cs : Implicit/explicit operator name in doc comments are like
8921           "op_Explicit(type)~returnType", so added suffix handling.
8922
8923 2004-12-07  Martin Baulig  <martin@ximian.com>
8924
8925         * decl.cs
8926         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8927         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8928         (DeclSpace.ec): New protected field; store the EmitContext here.
8929         (DeclSpace.EmitContext): New public property; moved here from
8930         `TypeContainer'.
8931         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8932         EmitContext.
8933
8934         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8935         (Enum.Emit): Don't create a new EmitContext.
8936
8937         * delegate.cs (Delegate.DefineType): Always create the
8938         EmitContext.
8939
8940         * iterators.cs (Iterators.DefineIterator): Create a new
8941         EmitContext and store it in `ec'.
8942
8943 2004-08-24  Martin Baulig  <martin@ximian.com>
8944
8945         * typemanager.cs
8946         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8947         this for accessibility checks.
8948         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8949         IsNestedFamilyAccessible.
8950         (TypeManager.IsSubclassOf): New method, do what the name actually
8951         says.   
8952
8953 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8954
8955         Fix crash on cs0657-17.cs.
8956         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8957         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8958         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8959         the case where the NamespaceEntry gets overwritten.
8960
8961 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8962
8963         Fixed #69195, #56821
8964         * ecore.cs (ResolveBoolean): Tiny refactoring.
8965
8966         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8967         of right expression resolving when left is false constant and
8968         operator is LogicalAnd OR true constant and operator is LogicalOr.
8969
8970         * statement.cs (ResolveUnreachable): Always reports warning.
8971
8972 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8973
8974         * class.cs: Distinguish between 1721 and 1722 (just a little help
8975         for the programmer).
8976
8977 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
8978
8979         * delegate.cs: Only allow this on new versions of the language. 
8980
8981 2004-12-02  Duncan Mak  <duncan@ximian.com>
8982
8983         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8984         Expression class.
8985         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8986         here as a static method. Take an additional bool out parameter
8987         `must_do_cs1540_check' for signaling to InstanceResolve.
8988         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8989         member field from PropertyExpr class and made it an argument of
8990         the method instead.
8991         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8992         check for MarshalByRefObject, and report CS0122 instead of CS1540.
8993         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8994         and `remove_accessor' as well as InstanceResolve: report CS0122
8995         where applicable.
8996
8997         Fixes #70129.
8998
8999 2004-12-03  Raja R Harinath  <rharinath@novell.com>
9000
9001         Fix test-327.cs, test-328.cs, and put in early infrastructure
9002         for eventually fixing #52697.
9003         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
9004         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
9005         from other methods.
9006         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
9007         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
9008         (VerifyUsing, error246): Update.
9009         * rootcontext.cs (RootContext.NamespaceLookup): Just use
9010         'NamespaceEntry.LookupNamespaceOrType'.
9011
9012 2004-12-03  Martin Baulig  <martin@ximian.com>
9013
9014         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9015         method as our child, call AnonymousMethod.Compatible() on it.
9016
9017 2004-12-03  Raja R Harinath  <rharinath@novell.com>
9018
9019         Disable XML documentation support in 'basic' profile.
9020         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
9021         Redirect XmlElement to System.Object.
9022         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
9023         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
9024         * mcs.exe.sources: Add doc-bootstrap.cs.
9025         * doc-bootstrap.cs: New file.  Contains empty stub implementation
9026         of doc.cs.
9027
9028 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
9029
9030         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
9031           comments are allowed.
9032
9033 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9034
9035         * delegate.cs: Add checks for subtypes in paramaters and return values
9036         in VerifyMethod () to add support for Covariance/Contravariance
9037         in delegates.
9038         
9039 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
9040
9041         * report.cs: Remove extra closing parenthesis.
9042
9043         * convert.cs (Error_CannotImplicitConversion): If the name of the
9044         types are the same, provide some extra information.
9045
9046         * class.cs (FieldBase): Use an unused bit field from the field to
9047         encode the `has_offset' property from the FieldMember.  This saves
9048         a couple of Ks on bootstrap compilation.
9049
9050         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9051         method as our child, return the AnonymousMethod resolved
9052         expression.
9053
9054         * expression.cs (New.DoResolve): Allow return values from
9055         NewDelegate to also include AnonymousMethods.
9056
9057         Fixes #70150.
9058
9059 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
9060
9061         Fix bug #70102
9062         * attribute.cs (Resolve): Improved implementation of params
9063         attribute arguments.
9064
9065         * support.cs (ParameterData): Add HasParams to be faster.
9066
9067 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
9068
9069         all things are for /doc support:
9070
9071         * doc.cs: new file that supports XML documentation generation.
9072         * mcs.exe.sources: added doc.cs.
9073         * driver.cs:
9074           Handle /doc command line option.
9075           Report error 2006 instead of 5 for missing file name for /doc.
9076           Generate XML documentation when required, after type resolution.
9077         * cs-tokenizer.cs:
9078           Added support for picking up documentation (/// and /** ... */),
9079           including a new XmlCommentState enumeration.
9080         * cs-parser.jay:
9081           Added lines to fill Documentation element for field, constant,
9082           property, indexer, method, constructor, destructor, operator, event
9083           and class, struct, interface, delegate, enum.
9084           Added lines to warn incorrect comment.
9085         * rootcontext.cs :
9086           Added Documentation field (passed only when /doc was specified).
9087         * decl.cs:
9088           Added DocComment, DocCommentHeader, GenerateDocComment() and
9089           OnGenerateDocComment() and some supporting private members for
9090           /doc feature to MemberCore.
9091         * class.cs:
9092           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
9093         * delegate.cs:
9094           Added overriden DocCommentHeader.
9095         * enum.cs:
9096           Added overriden DocCommentHeader and GenerateDocComment().
9097
9098 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
9099
9100         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
9101         unwrapping the enumeration values, chain to
9102         DoConstantNumericPromotions again, so we can promote things to the
9103         fundamental types (takes care of enums that are bytes, sbytes).
9104
9105         Fixes bug #62054.
9106
9107 2004-12-01  Raja R Harinath  <rharinath@novell.com>
9108
9109         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
9110         Fix long-standing bug in type-lookup.  Use FindType instead of
9111         LookupType when ec.ResolvingTypeTree.
9112         (Attribute.ResolveType, Attribute.Resolve)
9113         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
9114         Update to changes.
9115         (Attributes.Search): Remove internal version.  Update.
9116         (Attributes.SearchMulti): Update.
9117         (Attributes.GetClsCompliantAttribute): Remove.
9118         (Attributes.GetIndexerNameAttribute): Remove.
9119         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
9120         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
9121         * class.cs (Indexer.Define): Likewise.
9122
9123 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
9124
9125         Fix bug #68790
9126         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
9127         MarshallByReference members access.
9128
9129         * expression.cs: Use CheckMarshallByRefAccess;
9130         Better error CS0197 message.
9131
9132         * report.cs: Print whole related error message.
9133
9134 2004-11-30  Raja R Harinath  <rharinath@novell.com>
9135
9136         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
9137         the current directory to help debugging.
9138
9139 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9140
9141         * class (GetClassBases): Better error 60 report.
9142         (EventProperty): Disabled warning 67 detection.
9143
9144 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9145
9146         Fix bug #60324
9147         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
9148
9149         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
9150         precise values.
9151
9152 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9153
9154         Fix bug #49488
9155         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
9156
9157         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
9158
9159 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
9160
9161         * attribute.cs (Attribute.Resolve): Refine error reporting and
9162         report a cs0117 if the identifier does not exist, to distinguish
9163         from 0617 which is a miss-use of the actual identifier.
9164
9165         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
9166         between cs0070 and cs0079.
9167
9168         * class.cs (MemberBase.DoDefine): When reporting a wrong
9169         accessibility level, we use MethodCore to compare instead of
9170         Method (this was a regression in some refactoring effort).
9171
9172         So now we correctly report cs0056 again.
9173
9174         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
9175         testing the target_type (which was known to be object_type) and
9176         not the source type (which is anonymous_method).
9177
9178         Fixed reporting of error cs1660.
9179
9180         * expression.cs (UserCast.Source): Expose the underlying cast.
9181
9182         * statement.cs (Switch.SwitchGoverningType): Sort the list of
9183         allowed types to find a match to int32 first (most common).
9184
9185         In addition, it ignores any ImplicitUserConversions that did an
9186         internal implicit conversion (as the switch statement allows only
9187         one integral conversion to exist).
9188
9189         * class.cs (PartialContainer.Create): rename `name' to
9190         `member_name' for clarity.  Then replace the string calls with a
9191         call to MemberName.GetPartialName, as now using
9192         MemberName.ToString is an error (this is due to the side effects
9193         it had, that were fixed in the past).
9194
9195         This will restore the error reporting on a number of partial class
9196         errors that were missusing this (and getting an exception as a
9197         results, which is now just a plain textual warning, because
9198         yyparse debug output would crash otherwise).
9199
9200 2004-11-26  Raja R Harinath  <rharinath@novell.com>
9201
9202         * Makefile (PROGRAM_INSTALL_DIR): Remove.
9203
9204 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
9205
9206         * rootcontext.cs (LookupType): Make sure to cache lookups that
9207         don't give us a negative result. This saves about 5% of corlib
9208         compilation time.
9209
9210 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
9211
9212         * report.cs (AbstractMessage.Print): messages are sent to stderr
9213
9214         * class.cs (TypeContainer.GetClassBases): It is an error to have a
9215         non-interface in the list of interfaces (at this point, either
9216         parent was properly set, or a base class is being listed in the
9217         interfaces section).
9218
9219         This flags error 1722, and resolves the crash from bug 69259.
9220
9221 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
9222
9223         * statement.cs (Using.EmitExpressionFinally): make this work right
9224         for valuetypes. Fixes 69926.
9225
9226 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
9227
9228         * const.cs (Const.ChangeType): Cope with the "0 literal can be
9229         converted to an enum" here, before we try to change the underlying
9230         type.  This code exists, but it is a different code path than the
9231         one used while encoding constants.
9232
9233         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
9234         old bug: when converting from the null literal to a pointer,
9235         return an EmptyCast, not the NullLiteral.
9236
9237         This fixes #69921, the recent null_type changes probably made this
9238         bug more prominent.
9239
9240         (ImplicitReferenceConversionExists): In addition, resynchronized
9241         the code here, so it matches the same code in
9242         ImplicitReferenceConversionExists for the `from any class-type S
9243         to any interface-type T'.
9244         
9245
9246 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
9247
9248         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
9249
9250 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
9251
9252         * cs-parser.jay: Use verbosity accordingly. 
9253
9254 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9255
9256         * expression.cs (Unary.ResolveOperator): Do not report warning;
9257         AddressOf reads from variable.
9258         
9259         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
9260
9261 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9262
9263         Fix bug #69462
9264
9265         * attribute.cs (Attributable): Removed CheckTargets.
9266         (Attributes.Emit): Explicit attribute targets are tested here.
9267
9268         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
9269         not enabled for interfaces.
9270
9271         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
9272         (GetAssemblyName): Ouch next bug there.
9273
9274 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9275
9276         * expression.cs: Error 275 added.
9277         
9278 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
9279
9280         Fix bug #69177 (Implemented decimal constant support)
9281
9282         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
9283         (BinaryFold): Add DecimalConstant.
9284
9285         * const.cs (Define): Decimal constant 
9286         (is not constant.
9287         (ChangeType): Add decimal type handling.
9288         (LookupConstantValue): Don't set value for decimal type but
9289         emit DecimalConstantAttribute. Needed for constant optimization.
9290
9291         * constant.cs (ToDecimal): New method.
9292         (ConvertToDecimal): New method.
9293         (IntConstant): Implemented ConvertToDecimal.
9294         (DecimalConstant.Emit): Emit optimized version for decimals in
9295         int range.
9296
9297         * expression.cs (ResolveOperator): Changed order of constant
9298         reduction to work correctly with native types which have
9299         overloaded operators.
9300         (ResolveMemberAccess): Extract constant value from attribute
9301         for decimal type.
9302
9303         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
9304
9305         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
9306         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
9307         (ChangeType): Decimal is special.
9308         (TypeToCoreType): Add decimal type.
9309
9310 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9311
9312         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
9313         decimal types.
9314
9315 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9316
9317         * class.cs (EventField.ApplyAttributeBuilder): Fix error
9318         test cs1667-5.cs.
9319
9320 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9321
9322         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
9323
9324         * pending.cs (PendingImplementation): Grab only interfaces.
9325
9326 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9327
9328         * statement.cs (ForeachHelperMethods): Add location member and
9329         error 202 detection.
9330
9331 2004-11-19  Raja R Harinath  <rharinath@novell.com>
9332
9333         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
9334         automatically handled by executable.make.
9335         (PROGRAM): Make profile-specific.
9336
9337 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
9338
9339         * expression.cs (DoResolveBase): Fixed wrong warning for out
9340         variables.
9341
9342 2004-11-18  Martin Baulig  <martin@ximian.com>
9343
9344         Merged latest changes into gmcs.  Please keep this comment in
9345         here, it makes it easier for me to see what changed in MCS since
9346         the last time I merged.
9347
9348 2004-11-17  Raja R Harinath  <rharinath@novell.com>
9349
9350         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
9351         (TypeHandle.GetMemberCache): New.
9352         (TypeHandle.TypeHandle): Update.
9353         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
9354         (TypeManager.LookupParentInterfacesCache):
9355         Rename from LookupInterfaceCache.  Optimize slightly.
9356         (TypeManager.MemberLookup_FindMembers): Update.
9357         * decl.cs (MemberCache.MemberCache): Set Container to null in the
9358         multi-type variant.
9359         (AddCacheContents): Rename from AddHashtable.
9360         * class.cs (TypeContainer.parent_container): Remove.
9361         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
9362         (TypeContainer.DoDefineMembers): Don't initialize it.
9363         Update to name changes.
9364         
9365 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
9366
9367         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
9368         that factors the code to check access modifiers on override.  
9369
9370         (PropertyBase): Use the code here.
9371
9372         Patch from Lluis S'anchez, fixes bug #69361.
9373
9374 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
9375
9376         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
9377         routine that is used to report the use of a captured variable
9378         whose address has been taken.
9379
9380         There are two checks: one when variables are being captured and
9381         the other check is when the address of a variable is taken. 
9382         
9383         (because an anonymous methods might be resolved before *or* after
9384         the address has been taken) and 
9385
9386         * expression.cs (Conditional.DoResolve): Remove the special
9387         casing that Martin added to trueExpr and falseExpr being both
9388         NullLiteral.  We get the right behavior now just by introducing
9389         the null_type into the compiler. 
9390
9391         * convert.cs (ExplicitConversion): Change the code to use
9392         null_type instead of testing `expr is NullLiteral'.
9393         (ImplicitConversionStandard): use null_type too.
9394         (ImplicitReferenceConversionExists): use null_type too.
9395         (ImplicitReferenceConversion): use null_type too.
9396
9397         * literal.cs: The type of `NullLiteral' is now null_type instead
9398         of object_type. 
9399         (Resolve): Set the type here.
9400
9401         * typemanager.cs: Introduce null_type.
9402
9403 2004-11-17  Martin Baulig  <martin@ximian.com>
9404
9405         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
9406         direction, like FindMembers() does.  Fixes #69546, testcase is in
9407         test-315.cs.    
9408
9409 2004-11-16  Martin Baulig  <martin@ximian.com>
9410
9411         This is based on a patch from Marek Safar, see bug #69082.
9412         Fixes bugs #63705 and #67130.
9413
9414         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
9415         method; create a MemberCache for an interface type and cache the
9416         result.
9417
9418         * decl.cs (IMemberContainer.ParentContainer): Removed.
9419         (IMemberContainer.ParentCache): New property.
9420         (MemberCache.SetupCacheForInterface): Removed.
9421         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
9422         to create a cache for an interface's "parent".
9423
9424         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9425         interfaces too.
9426
9427 2004-11-16  Martin Baulig  <martin@ximian.com>
9428
9429         Merged back from gmcs; these changes already went into gmcs a
9430         couple of weeks ago.
9431
9432         * typemanager.cs
9433         (TypeManager.AddUserType): Removed the `ifaces' argument.
9434         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
9435         `TypeExpr []'.
9436         (TypeManager.AddUserInterface): Removed.
9437         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
9438         `TypeExpr []'.
9439         (TypeManager.GetInterfaces): Likewise.
9440         (TypeManager.GetExplicitInterfaces): Likewise.
9441
9442         * ecore.cs (TypeExpr.GetInterfaces): Removed.
9443
9444         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
9445         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
9446
9447 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
9448
9449         * statement.cs: Avoid adding bools to a hashtable.
9450
9451 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
9452
9453         * expression.cs (Invocation.OverloadResolve): Flag error if we are
9454         calling an unsafe method from a safe location.
9455
9456 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
9457
9458         Fix #69167
9459         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
9460
9461 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
9462
9463         * namespace.cs (VerifyUsing): use GetPartialName instead of
9464         ToString. 
9465
9466 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
9467
9468         * statement.cs (Return.Resolve): Fix regression in typo: if
9469         `in_exc', we have to request a NeedReturnLabel, this was a typo
9470         introduced in the anonymous method check-in.  Fixes #69131.
9471
9472         * Indexers were using the ShortName when defining themselves,
9473         causing a regression in the compiler bootstrap when applying the
9474         patch from 2004-11-02 (first part), now they use their full name
9475         and the bug is gone.
9476
9477 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
9478
9479         * driver.cs: Strip the path from the names of embedded resources. Fixes
9480         #68519.
9481
9482 2004-11-04  Raja R Harinath  <rharinath@novell.com>
9483
9484         Fix error message regression: cs0104-2.cs.
9485         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
9486         (AliasEntry.Resolve): Update.
9487         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
9488         'silent' flag.
9489         (RootContext.LookupType): Update.
9490
9491 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
9492
9493         * cs-parser.jay: Add support for handling accessor modifiers
9494         * class: Add support port accessor modifiers and error checking,
9495         define PropertyMethod.Define as virtual (not abstract anymore)
9496         * ecore.cs: Add checking for proeprties access with access modifiers
9497         * iterators.cs: Modify Accessor constructor call based in the modified
9498         constructor
9499 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
9500
9501         * expression.cs (StringConcat): Handle being called twice,
9502         as when we have a concat in a field init with more than two
9503         ctors in the class
9504
9505 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
9506
9507         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
9508         special case explicit implementations, we should always produce
9509         the .property or .event declaration.
9510         
9511         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
9512         since it will not return correct data if people use this
9513         unresolved in the presence of using statements (see test-313).
9514
9515         * class.cs (MethodData.Define): If we are an explicit interface
9516         implementation, set the method name to the full name of the
9517         interface plus the name of the method.  
9518
9519         Notice that using the method.MethodName.GetFullName() does not
9520         work, as it will only contain the name as declared on the source
9521         file (it can be a shorthand in the presence of using statements)
9522         and not the fully qualifed type name, for example:
9523
9524         using System;
9525
9526         class D : ICloneable {
9527                 object ICloneable.Clone ()  {
9528                 }
9529         }
9530
9531         Would produce a method called `ICloneable.Clone' instead of
9532         `System.ICloneable.Clone'.
9533
9534         * namespace.cs (Alias.Resolve): Use GetPartialName.
9535         
9536 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9537
9538         * cs-parser.jay: Add error 1055 report.
9539
9540 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
9541
9542         * assign.cs (Assign.DoResolve): Only do the transform of
9543         assignment into a New if the types are compatible, if not, fall
9544         through and let the implicit code deal with the errors and with
9545         the necessary conversions. 
9546
9547 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9548
9549         * cs-parser.jay: Add error 1031 report.
9550
9551         * cs-tokenizer.cs: Add location for error 1038.
9552
9553 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9554
9555         * cs-parser.jay: Add error 1016 report.
9556
9557 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9558
9559         * cs-parser.jay: Add errors 1575,1611 report.
9560
9561 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9562
9563         * cs-parser.jay: Add error 1001 report.
9564
9565 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9566
9567         Fix #68850
9568         * attribute.cs (GetMarshal): Add method argument for
9569         caller identification.
9570
9571         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
9572         agument for GetMarshal and RuntimeMissingSupport.
9573
9574 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9575
9576         * attribute.cs (ExtractSecurityPermissionSet): Removed
9577         TypeManager.code_access_permission_type.
9578
9579         * typemanager.cs: Removed TypeManager.code_access_permission_type.
9580
9581 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
9582
9583         * expression.cs (LocalVariableReference.DoResolveLValue): Check
9584         for obsolete use of a variable here.   Fixes regression on errors
9585         cs0619-25 and cs0619-26.
9586
9587 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
9588
9589         Fix #62358, implemented security attribute encoding.
9590
9591         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
9592         Tests permitted SecurityAction for assembly or other types.
9593         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
9594         data from SecurityPermissionAttribute to PermisionSet class.
9595
9596         * class.cs (ApplyAttributeBuilder): Added special handling
9597         for System.Security.Permissions.SecurityAttribute based types.
9598
9599         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
9600         special handling for System.Security.Permissions.SecurityAttribute
9601         based types.
9602
9603         * enum.cs (ApplyAttributeBuilder): Added special handling
9604         for System.Security.Permissions.SecurityAttribute based types.
9605
9606         * parameter.cs (ApplyAttributeBuilder): Added special handling
9607         for System.Security.Permissions.SecurityAttribute based types.
9608
9609         * rootcontext.cs: Next 2 core types.
9610
9611         * typemanager.cs (TypeManager.security_permission_attr_type):
9612         Built in type for the SecurityPermission Attribute.
9613         (code_access_permission_type): Build in type.
9614
9615 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
9616
9617         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9618         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9619         all of this information into
9620         EmitContext.EmitCapturedVariableInstance.
9621         
9622         * codegen.cs (EmitCapturedVariableInstance): move here the
9623         funcionality of emitting an ldarg.0 in the presence of a
9624         remapping.   This centralizes the instance emit code.
9625
9626         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9627         then emit a load of this: it means that we have reached the
9628         topmost ScopeInfo: the one that contains the pointer to the
9629         instance of the class hosting the anonymous method.
9630
9631         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9632         captures to the topmost CaptureContext.
9633
9634 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
9635
9636         * expression.cs (LocalVariableReference): Move the knowledge about
9637         the iterators into codegen's EmitCapturedVariableInstance.
9638
9639 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
9640
9641         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9642         all code paths return a value from an anonymous method (it is the
9643         same as the 161 error, but for anonymous methods).
9644
9645 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
9646
9647         The introduction of anonymous methods in the compiler changed
9648         various ways of doing things in the compiler.  The most
9649         significant one is the hard split between the resolution phase
9650         and the emission phases of the compiler.
9651
9652         For instance, routines that referenced local variables no
9653         longer can safely create temporary variables during the
9654         resolution phase: they must do so from the emission phase,
9655         since the variable might have been "captured", hence access to
9656         it can not be done with the local-variable operations from the runtime.
9657         
9658         * statement.cs 
9659
9660         (Block.Flags): New flag `IsTopLevel' to indicate that this block
9661         is a toplevel block.
9662
9663         (ToplevelBlock): A new kind of Block, these are the blocks that
9664         are created by the parser for all toplevel method bodies.  These
9665         include methods, accessors and anonymous methods.
9666
9667         These contain some extra information not found in regular blocks:
9668         A pointer to an optional CaptureContext (for tracking captured
9669         local variables and parameters).  A pointer to the parent
9670         ToplevelBlock.
9671         
9672         (Return.Resolve): Catch missmatches when returning a value from an
9673         anonymous method (error 1662).
9674         Invoke NeedReturnLabel from the Resolve phase instead of the emit
9675         phase.
9676
9677         (Break.Resolve): ditto.
9678
9679         (SwitchLabel): instead of defining the labels during the
9680         resolution phase, we now turned the public ILLabel and ILLabelCode
9681         labels into methods called GetILLabelCode() and GetILLabel() that
9682         only define the label during the Emit phase.
9683
9684         (GotoCase): Track the SwitchLabel instead of the computed label
9685         (its contained therein).  Emit the code by using
9686         SwitchLabel.GetILLabelCode ().
9687
9688         (LocalInfo.Flags.Captured): A new flag has been introduce to track
9689         whether the Local has been captured or not.
9690
9691         (LocalInfo.IsCaptured): New property, used to tell whether the
9692         local has been captured.
9693         
9694         * anonymous.cs: Vastly updated to contain the anonymous method
9695         support.
9696
9697         The main classes here are: CaptureContext which tracks any
9698         captured information for a toplevel block and ScopeInfo used to
9699         track the activation frames for various local variables.   
9700
9701         Each toplevel block has an optional capture context associated
9702         with it.  When a method contains an anonymous method both the
9703         toplevel method and the anonymous method will create a capture
9704         context.   When variables or parameters are captured, they are
9705         recorded on the CaptureContext that owns them, for example:
9706
9707         void Demo () {
9708              int a;
9709              MyDelegate d = delegate {
9710                  a = 1;
9711              }
9712         }
9713
9714         Here `a' will be recorded as captured on the toplevel
9715         CapturedContext, the inner captured context will not have anything
9716         (it will only have data if local variables or parameters from it
9717         are captured in a nested anonymous method.
9718
9719         The ScopeInfo is used to track the activation frames for local
9720         variables, for example:
9721
9722         for (int i = 0; i < 10; i++)
9723                 for (int j = 0; j < 10; j++){
9724                    MyDelegate d = delegate {
9725                         call (i, j);
9726                    }
9727                 }
9728
9729         At runtime this captures a single captured variable `i', but it
9730         captures 10 different versions of the variable `j'.  The variable
9731         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9732         recorded on a child.  
9733
9734         The toplevel ScopeInfo will also track information like the `this'
9735         pointer if instance variables were referenced (this is necessary
9736         as the anonymous method lives inside a nested class in the host
9737         type of the method). 
9738
9739         (AnonymousMethod): Expanded to track the Toplevel, implement
9740         `AnonymousMethod.Compatible' to tell whether an anonymous method
9741         can be converted to a target delegate type. 
9742
9743         The routine now also produces the anonymous method content
9744
9745         (AnonymousDelegate): A helper class that derives from
9746         DelegateCreation, this is used to generate the code necessary to
9747         produce the delegate for the anonymous method that was created. 
9748
9749         * assign.cs: API adjustments for new changes in
9750         Convert.ImplicitStandardConversionExists.
9751
9752         * class.cs: Adjustments to cope with the fact that now toplevel
9753         blocks are of type `ToplevelBlock'. 
9754
9755         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9756         insteda of standard blocks.
9757
9758         Flag errors if params arguments are passed to anonymous methods.
9759
9760         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9761         `CurrentAnonymousMethod' which points to the current Anonymous
9762         Method.  The variable points to the AnonymousMethod class that
9763         holds the code being compiled.  It is set in the new EmitContext
9764         created for the anonymous method.
9765
9766         (EmitContext.Phase): Introduce a variable and an enumeration to
9767         assist in enforcing some rules about when and where we are allowed
9768         to invoke certain methods (EmitContext.NeedsReturnLabel is the
9769         only one that enfonces this right now).
9770
9771         (EmitContext.HaveCaptureInfo): new helper method that returns
9772         whether we have a CapturedContext initialized.
9773
9774         (EmitContext.CaptureVariable): New method used to register that a
9775         LocalInfo must be flagged for capturing. 
9776
9777         (EmitContext.CapturedParameter): New method used to register that a
9778         parameters must be flagged for capturing. 
9779         
9780         (EmitContext.CapturedField): New method used to register that a
9781         field must be flagged for capturing. 
9782
9783         (EmitContext.HaveCapturedVariables,
9784         EmitContext.HaveCapturedFields): Return whether there are captured
9785         variables or fields. 
9786
9787         (EmitContext.EmitMethodHostInstance): This is used to emit the
9788         instance for the anonymous method.  The instance might be null
9789         (static methods), this (for anonymous methods that capture nothing
9790         and happen to live side-by-side with the current method body) or a
9791         more complicated expression if the method has a CaptureContext.
9792
9793         (EmitContext.EmitTopBlock): Routine that drives the emission of
9794         code: it will first resolve the top block, then emit any metadata
9795         and then emit the code.  The split is done so that we can extract
9796         any anonymous methods and flag any captured variables/parameters.
9797         
9798         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9799         during this phase, the ILGenerator should not be used as labels
9800         and local variables declared here might not be accessible to any
9801         code that is part of an anonymous method.  
9802
9803         Exceptions to this include the temporary variables that are
9804         created by some statements internally for holding temporary
9805         variables. 
9806         
9807         (EmitContext.EmitMeta): New routine, in charge of emitting all the
9808         metadata for a cb
9809
9810         (EmitContext.TemporaryReturn): This method is typically called
9811         from the Emit phase, and its the only place where we allow the
9812         ReturnLabel to be defined other than the EmitMeta.  The reason is
9813         that otherwise we would have to duplicate a lot of logic in the
9814         Resolve phases of various methods that today is on the Emit
9815         phase. 
9816
9817         (EmitContext.NeedReturnLabel): This no longer creates the label,
9818         as the ILGenerator is not valid during the resolve phase.
9819
9820         (EmitContext.EmitThis): Extended the knowledge in this class to
9821         work in anonymous methods in addition to iterators. 
9822
9823         (EmitContext.EmitCapturedVariableInstance): This emits whatever
9824         code is necessary on the stack to access the instance to a local
9825         variable (the variable will be accessed as a field).
9826
9827         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9828         EmitContext.EmitAddressOfParameter): Routines to support
9829         parameters (not completed at this point). 
9830         
9831         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9832         will also remove the parameters.
9833
9834         * convert.cs (Convert): Define a `ConstantEC' which points to a
9835         null.  This is just to prefity some code that uses
9836         ImplicitStandardConversion code and do not have an EmitContext
9837         handy.
9838
9839         The idea is to flag explicitly that at that point in time, it is
9840         known that the conversion will not trigger the delegate checking
9841         code in implicit conversions (which requires a valid
9842         EmitContext). 
9843
9844         Everywhere: pass new EmitContext parameter since
9845         ImplicitStandardConversionExists now requires it to check for
9846         anonymous method conversions. 
9847
9848         (Convert.ImplicitStandardConversionExists): If the type of an
9849         expression is the anonymous_method_type, and the type is a
9850         delegate, we invoke the AnonymousMethod.Compatible method to check
9851         whether an implicit conversion is possible. 
9852
9853         (Convert.ImplicitConversionStandard): Only do implicit method
9854         group conversions if the language level is not ISO_1.
9855
9856         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9857         MethodInfo for the Invoke method.  used by Delegate and
9858         AnonymousDelegate.
9859
9860         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9861         method conversions if the target type is a delegate.
9862
9863         Removed extra debugging nops.
9864
9865         (LocalVariableReference): Turn the `local_info' into a public
9866         field. 
9867
9868         Add `prepared' field, the same hack used for FieldExprs to cope
9869         with composed assignments, as Local variables do not necessarily
9870         operate purely on the stack as they used to: they can be captured
9871         fields. 
9872
9873         Add `temp' for a temporary result, like fields.
9874
9875         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9876
9877         It now copes with Local variables that are captured and emits the
9878         proper instance variable to load it from a field in the captured
9879         case. 
9880
9881         (ParameterReference.DoResolveBase): During the resolve phase,
9882         capture parameters if we are in an anonymous method.
9883
9884         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9885         anonymous method, use the EmitContext helper routines to emit the
9886         parameter reference.
9887
9888         * iterators.cs: Set RemapToProxy to true/false during the
9889         EmitDispose class.
9890
9891         * parameters.cs (GetParameterByName): New helper method. 
9892
9893         * typemanager.cs (anonymous_method_type) a new type that
9894         represents an anonyous method.  This is always an internal type,
9895         used as a fencepost to test against the anonymous-methodness of an
9896         expression. 
9897         
9898 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9899
9900         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9901         561 report.
9902         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9903
9904 2004-10-18  Martin Baulig  <martin@ximian.com>
9905
9906         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9907         `Type' directly, but call ResolveType() on it.
9908         (Catch.Resolve): Likewise.
9909         (Foreach.Resolve): Likewise.
9910
9911 2004-10-18  Martin Baulig  <martin@ximian.com>
9912
9913         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9914         `Type' directly, but call ResolveType() on it.
9915         (Probe.DoResolve): Likewise.
9916         (ArrayCreation.LookupType): Likewise.
9917         (TypeOf.DoResolve): Likewise.
9918         (SizeOf.DoResolve): Likewise.
9919
9920 2004-10-18  Martin Baulig  <martin@ximian.com>
9921
9922         * expression.cs (Invocation.BetterFunction): Put back
9923         TypeManager.TypeToCoreType().
9924
9925 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9926
9927         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9928         the ResolveType.
9929
9930 2004-10-18  Martin Baulig  <martin@ximian.com>
9931
9932         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
9933         `Type' directly, but call ResolveType() on it.
9934
9935 2004-10-18  Martin Baulig  <martin@ximian.com>
9936
9937         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9938         `Type' directly, but call ResolveType() on it.
9939         (MemberBase.DoDefine): Likewise.
9940
9941         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9942         `Type' directly, but call ResolveType() on it.
9943         (ComposedCast.DoResolveAsTypeStep): Likewise.
9944
9945         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9946         `Type' directly, but call ResolveType() on it.
9947
9948 2004-10-17  John Luke  <john.luke@gmail.com>
9949
9950         * class.cs (Operator.GetSignatureForError): use CSharpName
9951
9952         * parameter.cs (Parameter.GetSignatureForError): Returns
9953         correct name even if was not defined.
9954
9955 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9956
9957         Fix #65816.
9958         * class.cs (TypeContainer.EmitContext): New property.
9959         (DefineNestedTypes): Create an emitcontext for each part.
9960         (MethodCore.DoDefineParameters): Use container's emitcontext.
9961         Pass type array to InternalParameters.
9962         (MemberBase.DoDefine): Use container's emitcontext.
9963         (FieldMember.Define): Likewise.
9964         (Event.Define): Likewise.
9965         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9966         Pass type array to InternalParameters.
9967         (SetIndexerMethod.GetParameterInfo): Likewise.
9968         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9969         * delegate.cs (Define): Pass emitcontext to
9970         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9971         array to InternalParameters.
9972         * expression.cs (ParameterReference.DoResolveBase): Pass
9973         emitcontext to GetParameterInfo.
9974         (ComposedCast.DoResolveAsTypeStep): Remove check on
9975         ec.ResolvingTypeTree.
9976         * parameter.cs (Parameter.Resolve): Change argument to
9977         EmitContext.  Use ResolveAsTypeTerminal.
9978         (Parameter.GetSignature): Change argument to EmitContext.
9979         (Parameters.ComputeSignature): Likewise.
9980         (Parameters.ComputeParameterTypes): Likewise.
9981         (Parameters.GetParameterInfo): Likewise.
9982         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9983         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9984         * support.cs (InternalParameters..ctor): Remove variant that takes
9985         a DeclSpace.
9986         * typemanager.cs (system_intptr_expr): New.
9987         (InitExpressionTypes): Initialize it.
9988
9989 2004-10-12  Chris Toshok  <toshok@ximian.com>
9990
9991         * cs-parser.jay: fix location for try_statement and catch_clause.
9992
9993 2004-10-11  Martin Baulig  <martin@ximian.com>
9994
9995         * report.cs: Don't make --fatal abort on warnings, we have
9996         -warnaserror for that.
9997
9998 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9999
10000         More DeclSpace.ResolveType avoidance.
10001         * decl.cs (MemberCore.InUnsafe): New property.
10002         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
10003         with newly created EmitContext.
10004         (FieldMember.Define): Likewise.
10005         * delegate.cs (Delegate.Define): Likewise.
10006         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
10007         only if normal name-lookup fails.
10008         (TypeExpr.DoResolve): Enable error-checking.
10009         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
10010         (SizeOf.DoResolve): Likewise.
10011         (ComposedCast.DoResolveAsTypeStep): Likewise.
10012         (StackAlloc.DoResolve): Likewise.
10013         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
10014         (Block.Unsafe): New property.
10015         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
10016         (Unsafe): Set 'unsafe' flag of contained block.
10017         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
10018         (Fixed.Resolve): Likewise.
10019         (Catch.Resolve): Likewise.
10020         (Using.ResolveLocalVariableDecls): Likewise.
10021         (Foreach.Resolve): Likewise.
10022
10023 2004-10-05  John Luke <john.luke@gmail.com>
10024
10025         * cs-parser.jay: add location to error CS0175
10026
10027 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
10028
10029         * ecore.cs (Expression.Constantity): Add support for turning null
10030         into a constant.
10031
10032         * const.cs (Const.Define): Allow constants to be reference types
10033         as long as the value is Null.
10034
10035 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
10036
10037         * namespace.cs (NamespaceEntry.Using): No matter which warning
10038         level is set, check if this namespace name has already been added.
10039
10040 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
10041
10042         * expression.cs: reftype [!=]= null should always use br[true,false].
10043         # 67410
10044
10045 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
10046
10047         Fix #67108
10048         * attribute.cs: Enum conversion moved to 
10049         GetAttributeArgumentExpression to be applied to the all
10050         expressions.
10051
10052 2004-10-01  Raja R Harinath  <rharinath@novell.com>
10053
10054         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
10055         * class.c (TypeContainer.DefineType): Flag error if
10056         base types aren't accessible due to access permissions.
10057         * decl.cs (DeclSpace.ResolveType): Move logic to
10058         Expression.ResolveAsTypeTerminal.
10059         (DeclSpace.ResolveTypeExpr): Thin layer over
10060         Expression.ResolveAsTypeTerminal.
10061         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
10062         Refactor code into NestedAccess.  Use it.
10063         (DeclSpace.NestedAccess): New.
10064         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
10065         argument to silence errors.  Check access permissions.
10066         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
10067         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
10068         (Cast.DoResolve): Likewise.
10069         (New.DoResolve): Likewise.
10070         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
10071         (TypeOf.DoResolve): Likewise.
10072
10073         * expression.cs (Invocation.BetterConversion): Return the Type of
10074         the better conversion.  Implement section 14.4.2.3 more faithfully.
10075         (Invocation.BetterFunction): Make boolean.  Make correspondence to
10076         section 14.4.2.2 explicit.
10077         (Invocation.OverloadResolve): Update.
10078         (Invocation): Remove is_base field.
10079         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
10080         (Invocation.Emit): Likewise.
10081
10082 2004-09-27  Raja R Harinath  <rharinath@novell.com>
10083
10084         * README: Update to changes.
10085
10086 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
10087
10088         * cs-parser.jay: Reverted 642 warning fix.
10089
10090 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10091
10092         Fix bug #66615
10093         * decl.cs (FindMemberWithSameName): Indexer can have more than
10094         1 argument.
10095
10096 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10097
10098         * expression.cs (LocalVariableReference.DoResolveLValue):
10099         Do not report warning 219 for out values.
10100         (EmptyExpression.Null): New member to avoid extra allocations.
10101
10102 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10103
10104         * cs-parser.jay: Fix wrong warning 642 report.
10105
10106         * cs-tokenizer.cs (CheckNextToken): New helper;
10107         Inspect next character if is same as expected.
10108
10109 2004-09-23  Martin Baulig  <martin@ximian.com>
10110
10111         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
10112         (Convert.ImplicitReferenceConversionExists): Likewise.
10113
10114 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10115
10116         * class.cs (Operator.Define): Add error 448 and 559 report.
10117
10118 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10119
10120         * class.cs (MemberBase.IsTypePermitted): New protected
10121         method for checking error CS0610.
10122
10123 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10124
10125         * class.cs (TypeContainer.HasExplicitLayout): New property
10126         Returns whether container has StructLayout attribute set Explicit.
10127         (FieldMember): New abstract class for consts and fields.
10128         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
10129         (Field): Reuse FieldMember.
10130
10131         * const.cs (Const): Reuse FieldMember.
10132
10133         * rootcontext.cs: EmitConstants call moved to class.
10134
10135 2004-09-22  Martin Baulig  <martin@ximian.com>
10136
10137         Thanks to Peter Sestoft for this bug report.
10138
10139         * expression.cs (Conditional): If both the `trueExpr' and the
10140         `falseExpr' is a NullLiteral, return a NullLiteral.
10141
10142 2004-09-22  Martin Baulig  <martin@ximian.com>
10143
10144         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
10145         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
10146         for the "get_Current" call.
10147
10148 2004-09-22  Martin Baulig  <martin@ximian.com>
10149
10150         Marek and me just fixed one of our oldest bugs: #28562 :-)
10151
10152         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
10153
10154         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
10155         we're an EnumConstant, just return that.
10156         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
10157         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
10158         to get the value which'll actually be written into the attribute.
10159         However, we have to use GetValue() to access the attribute's value
10160         in the compiler.        
10161
10162 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10163
10164         * constant.cs (Constant.IsNegative): New abstract property
10165         IsNegative.
10166
10167         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
10168         (StackAlloc.DoResolve): Reused IsNegative.
10169
10170 2004-09-21  Martin Baulig  <martin@ximian.com>
10171
10172         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
10173         if we're used in an iterator, we may be called from different
10174         methods.
10175
10176         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
10177         we actually have an exception block.
10178
10179 2004-09-20  John Luke <jluke@cfl.rr.com>
10180
10181         * class.cs, cs-parser.jay: Improve the error report for 1520:
10182         report the actual line where the error happens, not where the
10183         class was declared.
10184
10185         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
10186         Pass location information that was available elsewhere.
10187
10188 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
10189
10190         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
10191         runtime to delay sign assemblies.
10192
10193 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
10194
10195         * cs-parser.jay: Do not report the stack trace, this is barely
10196         used nowadays.
10197
10198 2004-08-22  John Luke  <john.luke@gmail.com>
10199  
10200         * driver.cs : check that a resource id is not already used
10201         before adding it, report CS1508 if it is, bug #63637
10202
10203 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
10204
10205         * ecore.cs: Removed dead code.
10206
10207 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
10208
10209         * class.cs: Do not report warning CS0067 on the interfaces.
10210
10211 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10212
10213         * cs-parser.jay: Add error 504 report.
10214
10215 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10216
10217         * rootcontext.cs: WarningLevel is 4 by default now.
10218
10219         * statement.cs (Fixed.Resolve): Do not null
10220         VariableInfo.
10221
10222 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10223
10224         Fixed bug #55780
10225         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
10226         deep search when property is not virtual.
10227         (PropertyExpr.ResolveAccessors): Make one call for both
10228         accessors.
10229
10230 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10231
10232         Fixed bug #65766
10233         * statement.cs: Error 152 report constains also location.
10234
10235 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10236
10237         Fixed bug #65766
10238         * const.cs: Explicitly set constant as static.
10239
10240 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10241
10242         Fixed bug #64226
10243         * cs-parser.jay: Add error 1017 report.
10244
10245 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10246
10247         Fixed bug #59980, #64224
10248         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
10249
10250         * typemanager.cs (IsSpecialMethod): Simplified
10251
10252 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10253
10254         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
10255         condition with better params.
10256
10257 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10258
10259         Fixed bug #65238
10260         * attribute.cs (Resolve): Property has to have both
10261         accessors.
10262
10263 2004-09-14  Martin Baulig  <martin@ximian.com>
10264
10265         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
10266
10267 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10268
10269         Fixed bug #61902
10270         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
10271         called and is obsolete then this member suppress message
10272         when call is inside next [Obsolete] method or type.
10273
10274         * expression.cs: Use TestObsoleteMethodUsage member.
10275
10276 2004-09-14  Martin Baulig  <martin@ximian.com>
10277
10278         * cs-parser.jay: Sync a bit with the GMCS version.
10279
10280 2004-09-14  Martin Baulig  <martin@ximian.com>
10281
10282         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
10283         (CSharpParser.yacc_verbose_flag): New public field.
10284
10285         * genericparser.cs: Removed.
10286
10287 2004-09-14  Raja R Harinath  <rharinath@novell.com>
10288
10289         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
10290
10291 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
10292
10293         * class.cs (MethodCore.CheckBase): Fix bug #65757.
10294
10295 2004-09-10  Martin Baulig  <martin@ximian.com>
10296
10297         Backported my MemberName changes from GMCS into MCS.
10298
10299         - we are now using a special `MemberName' class instead of using
10300         strings; in GMCS, the `MemberName' also contains the type
10301         arguments.
10302
10303         - changed the grammar rules a bit:
10304           * the old `member_name' is now a `namespace_or_type_name':
10305             The rule is that we use `namespace_or_type_name' everywhere
10306             where we expect either a "member name" (GetEnumerator) or a
10307             "member name" with an explicit interface name
10308             (IEnumerable.GetEnumerator).
10309             In GMCS, the explicit interface name may include type arguments
10310             (IEnumerable<T>.GetEnumerator).
10311           * we use `member_name' instead of just `IDENTIFIER' for
10312             "member names":
10313             The rule is that we use `member_name' wherever a member may
10314             have type parameters in GMCS.       
10315
10316         * decl.cs (MemberName): New public class.
10317         (MemberCore.MemberName): New public readonly field.
10318         (MemberCore.ctor): Take a `MemberName' argument, not a string.
10319         (DeclSpace): Likewise.
10320
10321         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
10322         * enum.cs (Enum.ctor): Likewise.
10323
10324         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
10325         MemberName.     
10326         (AliasEntry.ctor): Take a MemberName, not an Expression.
10327         (AliasEntry.UsingAlias): Likewise.
10328
10329         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
10330         (IMethodData.MemberName): Changed type from string to MemberName.
10331         (MemberBase.ExplicitInterfaceName): Likewise.
10332         (AbstractPropertyEventMethod.SetupName): Make this private.
10333         (AbstractPropertyEventMethod.ctor): Added `string prefix'
10334         argument; compute the member name here.
10335         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
10336         on the `member.MemberName' and the `prefix'.
10337
10338         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
10339         not `type_name'.
10340         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
10341         thus, we get a `MemberName' instead of a `string'.  These
10342         declarations may have type parameters in GMCS.
10343         (interface_method_declaration, delegate_declaration): Likewise.
10344         (class_declaration, interface_declaration): Likewise.
10345         (method_header): Use `namespace_or_type_name' instead of
10346         `member_name'.  We may be an explicit interface implementation.
10347         (property_declaration, event_declaration): Likewise.
10348         (member_name): This is now just an `IDENTIFIER', not a
10349         `namespace_or_type_name'.
10350         (type_name, interface_type): Removed.
10351         (namespace_or_type_name): Return a MemberName, not an Expression.
10352         (primary_expression): Use `member_name' instead of `IDENTIFIER';
10353         call GetTypeExpression() on the MemberName to get an expression.
10354         (IndexerDeclaration.interface_type): Changed type from string to
10355         MemberName.
10356         (MakeName): Operate on MemberName's instead of string's.
10357
10358 2004-09-13  Raja R Harinath  <rharinath@novell.com>
10359
10360         Fix bug #55770.
10361         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
10362         (NamespaceEntry.Lookup): Add new argument to flag if we want the
10363         lookup to avoid symbols introduced by 'using'.
10364         * rootcontext.cs (NamespaceLookup): Update.
10365
10366 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10367
10368         * class.cs (TypeContainer.DoDefineMembers): Do not call
10369         DefineDefaultConstructor for static classes.
10370
10371 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10372
10373         * attribute.cs (Attribute.Resolve): Add error 653 report.
10374
10375         * class.cs (Class.ApplyAttributeBuilder): Add error 641
10376         report.
10377         (Method.ApplyAttributeBuilder): Add error 685 report.
10378         (Operator.Define): Add error 564 report.
10379
10380         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
10381
10382         * expression.cs (Invocation.DoResolve): Add error
10383         245 and 250 report.
10384
10385         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
10386         error 674 report.
10387
10388 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10389
10390         * class.cs (ConstructorInitializer.Resolve):
10391         Wrong error number (515->516).
10392
10393 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10394
10395         * class.cs (Indexer.Define): Add error 631 report.
10396
10397 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10398
10399         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
10400
10401 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10402
10403         * expression.cs (Probe.DoResolve): Add error CS0241 report.
10404
10405 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
10406
10407         * cs-parser.jay: Added error CS0241 report.
10408
10409 2004-09-10  Raja R Harinath  <rharinath@novell.com>
10410
10411         * cs-parser.jay (fixed_statement): Introduce a scope for the
10412         declaration in the 'fixed' statement.
10413
10414 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10415
10416         * cs-parser.jay: Added CS0230 error report.
10417
10418 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10419
10420         * cs-parser.jay: Added errors CS0231 and CS0257 report.
10421
10422 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10423
10424         * expression.cs (Argument.Resolve): Added error CS0192 and
10425         CS0199 report.
10426
10427 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10428
10429         C# 2.0 #pragma warning feature
10430
10431         * cs-tokenizer.cs (PreProcessPragma): New method; 
10432         Handles #pragma directive.
10433
10434         * report.cs (WarningRegions): New class; Support
10435         class for #pragma warning directive. It tests whether
10436         warning is enabled for a given line.
10437
10438 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
10439
10440         * const.cs: Add more descriptive error report, tahnks to
10441         Sebastien. 
10442
10443 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
10444
10445         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
10446
10447 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
10448
10449         * expression.cs: Apply patch from Ben: Remove dead code from
10450         ArrayCreation, and remove the TurnintoConstant call in const.cs,
10451         as that code just threw an exception anwyays.
10452
10453         * const.cs: Remove the call to the turnintoconstant, for details
10454         see bug: #63144
10455         
10456         * literal.cs: The type of the null-literal is the null type;  So
10457         we use a placeholder type (literal.cs:System.Null, defined here)
10458         for it.
10459
10460         * expression.cs (Conditional.DoResolve): Remove some old code that
10461         is no longer needed, conversions have been fixed.
10462
10463         (ArrayCreationExpression.DoResolve): Return false if we fail to
10464         resolve the inner expression.
10465
10466 2004-09-07  Raja R Harinath  <rharinath@novell.com>
10467
10468         Fix test-290.cs.
10469         * cs-parser.jay (delegate_declaration): Record a delegate
10470         declaration as a type declaration.
10471         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
10472
10473 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
10474
10475         * parameter.cs: Do not crash if the type can not be resolved. 
10476
10477         * expression.cs: Report errors with unsafe pointers, fixes #64896
10478
10479 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10480
10481         * expression.cs: Pointer arith always needs to do a conv.i
10482         if the operand is a long. fix 65320
10483
10484 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10485
10486         Fixed cs0619-37.cs, cs0619-38.cs
10487
10488         * enum.cs (GetObsoleteAttribute): Removed.
10489
10490         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
10491         on Enum member is double staged. The first is tested member
10492         and then enum.
10493
10494 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10495
10496         Fixed #56986, #63631, #65231
10497
10498         * class.cs: (TypeContainer.AddToMemberContainer): New method,
10499         adds member to name container.
10500         (TypeContainer.AddToTypeContainer): New method, adds type to
10501         name container.
10502         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
10503         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
10504         AddOperator): Simplified by reusing AddToMemberContainer.
10505         (TypeContainer.UserDefinedStaticConstructor): Changed to property
10506         instead of field.
10507         (Method.CheckForDuplications): Fixed implementation to test all
10508         possibilities.
10509         (MemberBase): Detection whether member is explicit interface
10510         implementation is now in constructor.
10511         (MemberBase.UpdateMemberName): Handles IndexerName.
10512         (Accessor): Changed to keep also location information.
10513         (AbstractPropertyEventMethod): Is derived from MemberCore.
10514         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
10515         will be emited or not.
10516         (PropertyBase.AreAccessorsDuplicateImplementation):
10517         Tests whether accessors are not in collision with some method.
10518         (Operator): Is derived from MethodCore to simplify common
10519         operations.
10520
10521         * decl.cs (Flags.TestMethodDuplication): Test for duplication
10522         must be performed.
10523         (DeclSpace.AddToContainer): Adds the member to defined_names
10524         table. It tests for duplications and enclosing name conflicts.
10525
10526         * enum.cs (EnumMember): Clean up to reuse the base structures
10527
10528 2004-09-03  Martin Baulig  <martin@ximian.com>
10529
10530         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
10531         into TypeContainer, to make partial classes work again.
10532
10533 2004-09-03  Martin Baulig  <martin@ximian.com>
10534
10535         * rootcontext.cs (RootContext.V2): Removed.
10536
10537 2004-03-23  Martin Baulig  <martin@ximian.com>
10538
10539         * expression.cs (Invocation.OverloadResolve): Added `bool
10540         may_fail' argument and use it instead of the Location.IsNull() hack.
10541
10542 2004-09-03  Martin Baulig  <martin@ximian.com>
10543
10544         Merged latest changes into gmcs.  Please keep this comment in
10545         here, it makes it easier for me to see what changed in MCS since
10546         the last time I merged.
10547
10548 2004-09-03  Raja R Harinath  <rharinath@novell.com>
10549
10550         Fix #61128.
10551         * expression.cs (BetterConversion): Don't allow either conversion 
10552         to be null.  Remove redundant implicit conversion test when 'q ==
10553         null' -- when this function is invoked, we already know that the
10554         implicit conversion exists.
10555         (BetterFunction): Assume that 'best' is non-null.  Remove
10556         redundant reimplementation of IsApplicable when 'best' is null.
10557         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
10558         number of arguments.
10559         (IsAncestralType): Extract from OverloadResolve.
10560         (OverloadResolve): Make robust to the MethodGroupExpr being
10561         unsorted.  Implement all the logic of Section 14.5.5.1, and
10562         support overloading of methods from multiple applicable types.
10563         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
10564
10565         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
10566         (RealError, Warning): Append type of report to related symbol.
10567
10568 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
10569
10570         * enum.cs: Fixed CLS-Compliance checks for enum members.
10571         Error tests cs3008-8.cs, cs3014-8.cs
10572
10573 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10574
10575         Fixed bug #62342, #63102
10576         * class.cs: ImplementIndexer uses member.IsExplicitImpl
10577         like ImplementMethod.
10578
10579 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10580
10581         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10582         Fixed bug #65170.
10583
10584 2004-09-02  Martin Baulig  <martin@ximian.com>
10585
10586         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
10587         TypeManager.GetArgumentTypes() rather than calling GetParameters()
10588         on the MethodBase.
10589
10590 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
10591
10592         C# 2.0 Static classes implemented
10593
10594         * class.cs (TypeContainer): instance_constructors,
10595         initialized_fields, initialized_static_fields,
10596         default_constructor, base_inteface_types are protected to be
10597         accessible from StaticClass.
10598         (TypeContainer.DefineDefaultConstructor): New virtual method
10599         for custom default constructor generating
10600         (StaticClass): New class to handle "Static classes" feature.
10601
10602         * cs-parser.jay: Handle static keyword on class like instance
10603         of StaticClass.
10604
10605         * driver.cs: Added "/langversion" command line switch with two
10606         options (iso-1, default).
10607
10608 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
10609
10610         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
10611
10612 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
10613
10614         * delegate.cs: Style.
10615
10616 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10617
10618         * delegate.cs: Add seperate instance expr field for miguel.
10619
10620 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10621
10622         * PointerArithmetic (Resolve): make sure we are not doing
10623         pointer arith on void*. Also, make sure we are resolved
10624         by not setting eclass until resolve.
10625
10626         All callers: Make sure that PointerArithmetic gets resolved.
10627
10628 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10629
10630         * ArrayCreation (LookupType): If the type does not resolve 
10631         to an array, give an error.
10632
10633 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
10634
10635         * statement.cs (Try.Resolve): Fixed bug #64222
10636
10637 2004-08-27  Martin Baulig  <martin@ximian.com>
10638
10639         * class.cs
10640         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10641         crash here.     
10642
10643 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10644
10645         * ecore.cs (Constantify): Get underlying type via
10646         System.Enum.GetUnderlyingType to avoid StackOverflow on the
10647         Windows in special cases.
10648
10649 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10650
10651         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10652         for obtaining also private methods.
10653         (GetRemoveMethod): Used GetRemoveMethod (true)
10654         for obtaining also private methods.
10655
10656 2004-08-24  Martin Baulig  <martin@ximian.com>
10657
10658         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10659         MethodAttributes.HideBySig for operators.
10660
10661 2004-08-23  Martin Baulig  <martin@ximian.com>
10662
10663         Back to the old error reporting system :-)
10664
10665         * report.cs (Message): Removed.
10666         (Report.MessageData, ErrorData, WarningData): Removed.
10667         (Report.Error, Warning): Back to the old system.
10668
10669 2004-08-23  Martin Baulig  <martin@ximian.com>
10670
10671         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10672
10673         * class.cs (TypeContainer.ParentContainer): New public virtual
10674         method; replaces the explicit interface implementation.
10675         (ClassPart.ParentContainer): Override.
10676
10677 2004-08-23  Martin Baulig  <martin@ximian.com>
10678
10679         * statement.cs (Switch): Added support for constant switches; see
10680         #59428 or test-285.cs.
10681
10682 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10683
10684         Fixed bug #62740.
10685         * statement.cs (GetEnumeratorFilter): Removed useless
10686         logic because C# specs is strict. GetEnumerator must be
10687         public.
10688
10689 2004-08-22  Martin Baulig  <martin@ximian.com>
10690
10691         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10692         a switch and may break, reset the barrier.  Fixes #59867.
10693
10694 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10695
10696         CLS-Compliance speed up (~5% for corlib)
10697
10698         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10699         New method. Tests container for CLS-Compliant names
10700
10701         * class.cs (TypeContainer.VerifyClsName): New method.
10702         Checks whether container name is CLS Compliant.
10703         (Constructor): Implements IMethodData.
10704
10705         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10706         low-case table for CLS Compliance test.
10707         (MemberCache.VerifyClsParameterConflict): New method.
10708         Checks method parameters for CS3006 error.
10709
10710         * enum.cs (EnumMember): Is derived from MemberCore.
10711         (Enum.VerifyClsName): Optimized for better performance.
10712
10713 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10714
10715         * report.cs: Renamed Error_T to Error and changed all
10716         references.
10717
10718 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10719
10720         * class.cs (TypeContainer.IndexerArrayList): New inner class
10721         container for indexers.
10722         (TypeContainer.DefaultIndexerName): New constant for default
10723         indexer name. Replaced all "Item" with this constant.
10724         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10725
10726         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10727         DefaultMemberAttribute constructor.
10728
10729 2004-08-05  Martin Baulig  <martin@ximian.com>
10730
10731         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10732         Fix bug #59429.
10733
10734 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10735
10736         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10737         multi platforms problem.
10738
10739         * compiler.csproj: Included shared files.
10740
10741 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10742
10743         Fix bug 60333, 55971 in the more general way
10744         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10745         Added arg_type argument for constant conversion.
10746         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10747
10748 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10749
10750         Fix bug #59760
10751         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10752         OperatorArrayList, MethodCoreArrayList for typecontainer
10753         containers. Changed class member types to these new types.
10754         (MethodArrayList.DefineMembers): Added test for CS0659.
10755
10756 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10757
10758         * cfold.cs: Synchronize the folding with the code in expression.cs
10759         Binary.DoNumericPromotions for uint operands.
10760
10761         * attribute.cs: Revert patch from Raja, it introduced a regression
10762         while building Blam-1.2.1 (hard to isolate a test case).
10763
10764 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10765
10766         Fix for #55382
10767         * class.cs:
10768         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10769         name collision.
10770         (MethodCore.parent_method): New member. The method we're overriding
10771         if this is an override method.
10772         (MethodCore.CheckBase): Moved from Method class and made common.
10773         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10774         private.
10775         (MethodCore.CheckForDuplications): New abstract method. For custom
10776         member duplication search in a container
10777         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10778         method and its return type.
10779         (Event.conflict_symbol): New member. Symbol with same name in the
10780         parent class.
10781
10782         * decl.cs:
10783         (MemberCache.FindMemberWithSameName): New method. The method
10784         is looking for conflict with inherited symbols.
10785
10786 2004-08-04  Martin Baulig  <martin@ximian.com>
10787
10788         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10789
10790         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10791
10792 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10793
10794         * report.cs (Message): New enum for better error, warning reference in
10795         the code.
10796         (MessageData): New inner abstract class. It generally handles printing of
10797         error and warning messages.
10798         Removed unused Error, Warning, Message methods.
10799
10800 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10801
10802         Fix for cs0592-8.cs test
10803         * attribute.cs
10804         (Attributable.ValidAttributeTargets): Made public.
10805         (Attribute.ExplicitTarget): New member for explicit target value.
10806         (Attribute.CheckTargets): Now we translate explicit attribute
10807         target to Target here.
10808
10809 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10810
10811         * ecore.cs (MethodGroupExpr): new IsBase property.
10812
10813         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10814
10815         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10816         rather than an instance expr.
10817
10818         (DelegateCreation.Emit): Use the method group rather than
10819         the instance expression. Also, if you have base.Foo as the
10820         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10821
10822         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10823
10824         (NewDelegate.DoResolve): Only check for the existance of Invoke
10825         if the method is going to be needed. Use MethodGroupExpr.
10826
10827         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10828
10829         * expression.cs: For pointer arith., make sure to use
10830         the size of the type, not the size of the pointer to
10831         the type.
10832
10833 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10834
10835         Fix for #60722
10836         * class.cs (Class): Added error CS0502 test.
10837
10838 2004-08-03  John Luke  <jluke@cfl.rr.com>
10839             Raja R Harinath  <rharinath@novell.com>
10840
10841         Fix for #60997.
10842         * attribute.cs (Attribute.complained_before): New flag.
10843         (Attribute.ResolveType, Attribute.Resolve),
10844         (Attribute.DefinePInvokeMethod): Set it.
10845         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10846         
10847 2004-08-03  Martin Baulig  <martin@ximian.com>
10848
10849         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10850         use a user-defined operator; we still need to do numeric
10851         promotions in case one argument is a builtin type and the other
10852         one has an implicit conversion to that type.  Fixes #62322.
10853
10854 2004-08-02  Martin Baulig  <martin@ximian.com>
10855
10856         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10857         (LocalInfo.IsThis): New public property.
10858         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10859
10860 2004-08-01  Martin Baulig  <martin@ximian.com>
10861
10862         * class.cs (TypeContainer.GetClassBases): Don't set the default
10863         here since we may get called from GetPartialBases().
10864         (TypeContainer.DefineType): If GetClassBases() didn't return a
10865         parent, use the default one.
10866
10867 2004-07-30  Duncan Mak  <duncan@ximian.com>
10868
10869         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10870
10871 2004-07-30  Martin Baulig  <martin@ximian.com>
10872
10873         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10874
10875         * class.cs (SourceMethod): New public class, derive from the
10876         symbol writer's ISourceMethod.
10877         (Method): Use the new symbol writer API.
10878
10879         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10880         as argument and use the new symbol writer.
10881
10882         * location.cs
10883         (SourceFile): Implement the symbol writer's ISourceFile.
10884         (Location.SymbolDocument): Removed.
10885         (Location.SourceFile): New public property.
10886
10887         * symbolwriter.cs: Use the new symbol writer API.
10888
10889 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10890
10891         * Makefile (install-local): Remove.  Functionality moved to
10892         executable.make.
10893
10894 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10895
10896         * Makefile: Install mcs.exe.config file together with mcs.exe.
10897         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10898         correct runtime version.
10899         
10900 2004-07-25  Martin Baulig  <martin@ximian.com>
10901
10902         * class.cs
10903         (TypeContainer.RegisterOrder): Removed, this was unused.
10904         (TypeContainer, interface_order): Removed.
10905         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10906         TypeContainer as argument since we can also be called with a
10907         `PartialContainer' for a partial class/struct/interface.
10908         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10909         of checking whether we're an `Interface' - we could be a
10910         `PartialContainer'.
10911         (PartialContainer.Register): Override; call
10912         AddClass()/AddStruct()/AddInterface() on our parent.
10913
10914         * cs-parser.jay (interface_member_declaration): Add things to the
10915         `current_container', not the `current_class'.
10916
10917         * rootcontext.cs (RegisterOrder): The overloaded version which
10918         takes an `Interface' was unused, removed.
10919
10920         * typemanager.cs (TypeManager.LookupInterface): Return a
10921         `TypeContainer', not an `Interface'.
10922         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10923         contain a `PartialContainer' for an interface, so check it's
10924         `Kind' to figure out what it is.
10925
10926 2004-07-25  Martin Baulig  <martin@ximian.com>
10927
10928         * class.cs (Class.DefaultTypeAttributes): New public constant.
10929         (Struct.DefaultTypeAttributes): Likewise.
10930         (Interface.DefaultTypeAttributes): Likewise.
10931         (PartialContainer.TypeAttr): Override this and add the
10932         DefaultTypeAttributes.
10933
10934 2004-07-25  Martin Baulig  <martin@ximian.com>
10935
10936         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10937         we can just use the `Parent' field instead.
10938
10939 2004-07-25  Martin Baulig  <martin@ximian.com>
10940
10941         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10942
10943 2004-07-25  Martin Baulig  <martin@ximian.com>
10944
10945         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10946         our parts before defining any methods.
10947         (TypeContainer.VerifyImplements): Make this virtual.
10948         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10949         on our PartialContainer.
10950
10951 2004-07-25  Martin Baulig  <martin@ximian.com>
10952
10953         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10954
10955         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10956         argument, we can just use the `Parent' field instead.
10957
10958         * class.cs
10959         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10960         (MemberBase.DoDefine): Likewise.
10961
10962 2004-07-24  Martin Baulig  <martin@ximian.com>
10963
10964         * decl.cs (MemberCore.Parent): New public field.
10965         (DeclSpace.Parent): Moved to MemberCore.
10966
10967         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10968         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10969         parent's .ctor.
10970         (FieldBase, Field, Operator): Likewise.
10971         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10972         (EventField, Event): Likewise.
10973
10974 2004-07-23  Martin Baulig  <martin@ximian.com>
10975
10976         * class.cs (PartialContainer): New public class.
10977         (ClassPart): New public class.
10978         (TypeContainer): Added support for partial classes.
10979         (TypeContainer.GetClassBases): Splitted some of the functionality
10980         out into GetNormalBases() and GetPartialBases().
10981
10982         * cs-tokenizer.cs (Token.PARTIAL): New token.
10983         (Tokenizer.consume_identifier): Added some hacks to recognize
10984         `partial', but only if it's immediately followed by `class',
10985         `struct' or `interface'.
10986
10987         * cs-parser.jay: Added support for partial clases.
10988
10989 2004-07-23  Martin Baulig  <martin@ximian.com>
10990
10991         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10992         a `DeclSpace' and also made it readonly.
10993         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10994         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10995         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10996
10997         * cs-parser.jay: Pass the `current_class', not the
10998         `current_container' (at the moment, this is still the same thing)
10999         to a new Method, Property, Event, Indexer or Constructor.
11000
11001 2004-07-23  Martin Baulig  <martin@ximian.com>
11002
11003         * cs-parser.jay (CSharpParser): Added a new `current_class' field
11004         and removed the `current_interface' one.
11005         (struct_declaration, class_declaration, interface_declaration):
11006         Set `current_class' to the newly created class/struct/interface;
11007         set their `Bases' and call Register() before parsing their body.
11008
11009 2004-07-23  Martin Baulig  <martin@ximian.com>
11010
11011         * class.cs (Kind): New public enum.
11012         (TypeContainer): Made this class abstract.
11013         (TypeContainer.Kind): New public readonly field.
11014         (TypeContainer.CheckDef): New public method; moved here from
11015         cs-parser.jay.
11016         (TypeContainer.Register): New public abstract method.
11017         (TypeContainer.GetPendingImplementations): New public abstract
11018         method.
11019         (TypeContainer.GetClassBases): Removed the `is_class' and
11020         `is_iface' parameters.
11021         (TypeContainer.DefineNestedTypes): Formerly known as
11022         DoDefineType().
11023         (ClassOrStruct): Made this class abstract.
11024
11025         * tree.cs (RootTypes): New public type. 
11026
11027 2004-07-20  Martin Baulig  <martin@ximian.com>
11028
11029         * tree.cs (Tree.RecordNamespace): Removed.
11030         (Tree.Namespaces): Removed.
11031
11032         * rootcontext.cs (RootContext.IsNamespace): Removed.
11033
11034         * cs-parser.jay (namespace_declaration): Just create a new
11035         NamespaceEntry here.
11036
11037 2004-07-20  Martin Baulig  <martin@ximian.com>
11038
11039         * statement.cs (ExceptionStatement): New abstract class.  This is
11040         now used as a base class for everyone who's using `finally'.
11041         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
11042         our local variables before using them.
11043
11044         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
11045         virtual method.  This is used by Yield.Resolve() to "steal" an
11046         outer block's `finally' clauses.
11047         (FlowBranchingException): The .ctor now takes an ExceptionStatement
11048         argument.
11049
11050         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
11051         version which takes an ExceptionStatement.  This version must be
11052         used to create exception branchings.
11053
11054         * iterator.cs
11055         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
11056         (Iterator.EmitMoveNext): Added exception support; protect the
11057         block with a `fault' clause, properly handle 'finally' clauses.
11058         (Iterator.EmitDispose): Run all the `finally' clauses here.
11059
11060 2004-07-20  Martin Baulig  <martin@ximian.com>
11061
11062         * iterator.cs: This is the first of a set of changes in the
11063         iterator code.  Match the spec more closely: if we're an
11064         IEnumerable, then GetEnumerator() must be called.  The first time
11065         GetEnumerator() is called, it returns the current instance; all
11066         subsequent invocations (if any) must create a copy.
11067
11068 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
11069
11070         * expression.cs: Resolve the constant expression before returning
11071         it. 
11072
11073 2004-07-19  Martin Baulig  <martin@ximian.com>
11074
11075         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
11076         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
11077         the return type of the new EmitContext.
11078
11079 2004-07-18  Martin Baulig  <martin@ximian.com>
11080
11081         * class.cs (Property.Define): Fix iterators.
11082
11083         * iterators.cs (Iterator.Define): Moved the
11084         `container.AddInterator (this)' call here from the .ctor; only do
11085         it if we resolved successfully.
11086
11087 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
11088
11089         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
11090         `true' for preprocessing directives that we parse.  The return
11091         value indicates whether we should return to regular tokenizing or
11092         not, not whether it was parsed successfully.
11093
11094         In the past if we were in: #if false ... #line #endif, we would
11095         resume parsing after `#line'.  See bug 61604.
11096
11097         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
11098         building: IsEnumType should return true only for enums, not for
11099         enums or System.Enum itself.  This fixes #61593.
11100
11101         Likely what happened is that corlib was wrong: mcs depended on
11102         this bug in some places.  The bug got fixed, we had to add the
11103         hack, which caused bug 61593.
11104
11105         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
11106         that was a workaround for the older conditions.
11107
11108 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
11109
11110         * assign.cs: IAssignMethod has a new interface, as documented
11111         inline. All assignment code now uses this new api.
11112
11113         * ecore.cs, expression.cs: All classes which implement
11114         IAssignMethod now use the new interface.
11115
11116         * expression.cs (Invocation): add a hack to EmitCall so that
11117         IndexerAccess can be the target of a compound assignment without
11118         evaluating its arguments twice.
11119
11120         * statement.cs: Handle changes in Invocation api.
11121
11122 2004-07-16  Martin Baulig  <martin@ximian.com>
11123
11124         * iterators.cs: Rewrote this.  We're now using one single Proxy
11125         class for both the IEnumerable and the IEnumerator interface and
11126         `Iterator' derives from Class so we can use the high-level API.
11127
11128         * class.cs (TypeContainer.AddIterator): New method.
11129         (TypeContainer.DoDefineType): New protected virtual method, which
11130         is called from DefineType().
11131         (TypeContainer.DoDefineMembers): Call DefineType() and
11132         DefineMembers() on all our iterators.
11133         (TypeContainer.Emit): Call Emit() on all our iterators.
11134         (TypeContainer.CloseType): Call CloseType() on all our iterators.
11135
11136         * codegen.cs (EmitContext.CurrentIterator): New public field.
11137
11138 2004-07-15  Martin Baulig  <martin@ximian.com>
11139
11140         * typemanager.cs
11141         (TypeManager.not_supported_exception_type): New type.   
11142
11143 2004-07-14  Martin Baulig  <martin@ximian.com>
11144
11145         * iterators.cs: Use real error numbers.
11146
11147 2004-07-14  Martin Baulig  <martin@ximian.com>
11148
11149         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
11150         requires this to be a System.Collection.IEnumerable and not a
11151         class implementing that interface.
11152         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
11153
11154 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
11155
11156         * class.cs: Fixed previous fix, it broke some error tests.
11157
11158 2004-07-12  Martin Baulig  <martin@ximian.com>
11159
11160         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
11161         Fixes #61293.
11162
11163 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
11164
11165         * assign.cs (LocalTemporary): Add new argument: is_address,If
11166         `is_address' is true, then the value that we store is the address
11167         to the real value, and not the value itself.
11168         
11169         * ecore.cs (PropertyExpr): use the new local temporary
11170         stuff to allow us to handle X.Y += z (where X is a struct)
11171
11172 2004-07-08  Martin Baulig  <martin@ximian.com>
11173
11174         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
11175         not always return, just like we're doing in Using.Resolve().
11176
11177 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
11178
11179         * cs-parser.jay (fixed_statement): flag this as Pinned.
11180
11181 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
11182
11183         * typemanager.cs (TypeManager): Removed MakePinned method, this
11184         mechanism is replaced with the .NET 2.x compatible mechanism of
11185         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
11186
11187         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
11188         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
11189         `IsFixed' property which has a different meaning.
11190
11191 2004-07-02  Raja R Harinath  <rharinath@novell.com>
11192
11193         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
11194         visible from inside a nested class, not just the names of the
11195         immediately enclosing class.
11196         Fix for bug #60730.
11197
11198 2004-06-24  Raja R Harinath  <rharinath@novell.com>
11199
11200         * expression.cs (BetterConversion): Remove buggy special-case
11201         handling of "implicit constant expression conversions".  At this
11202         point, we already know that the conversion is possible -- we're
11203         only checking to see which is better.
11204
11205 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11206
11207         * cs-parser.jay: Added error CS0210 test.
11208
11209 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11210
11211         * cs-parser.jay: Added error CS0134 test.
11212
11213 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11214
11215         Fix bug #52507
11216         * cs-parser.jay: Added error CS0145 test.
11217
11218 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11219
11220         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
11221
11222 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
11223         
11224         * expression.cs (StackAlloc.Resolve): The argument may not
11225         be a constant; deal with this case.
11226         
11227 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
11228
11229         * attribute.cs (IndexerName_GetIndexerName): Renamed to
11230         GetIndexerAttributeValue.
11231         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
11232
11233         * class.cs (Indexer.Define): Added error tests for CS0415,
11234         CS0609.
11235
11236 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
11237
11238         * attribute.cs (Attribute.Resolve): Keep field code in sync with
11239         property code.
11240
11241 2004-06-23  Martin Baulig  <martin@ximian.com>
11242
11243         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
11244         neither return nor throw, reset the barrier as well.  Fixes #60457.
11245
11246 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
11247
11248         * class.cs : EventAttributes is now set to None by default.
11249           This fixes bug #60459.
11250
11251 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11252
11253         Fix bug #60219
11254         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11255         Don't throw exception but return null (it's sufficient now).
11256
11257 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11258
11259         * typemanager.cs (GetArgumentTypes): Faster implementation.
11260
11261 2004-06-18  Martin Baulig  <martin@ximian.com>
11262
11263         * attribute.cs (Attribute.Resolve): Check whether we're an
11264         EmptyCast which a Constant child.  Fixes #60333.
11265
11266 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
11267
11268         * statement.cs (EmitCollectionForeach): Account for the fact that
11269         not all valuetypes are in areas which we can take the address of.
11270         For these variables, we store to a temporary variable. Also, make
11271         sure that we dont emit a `callvirt' on a valuetype method.
11272
11273 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11274
11275         * expression.cs (StackAlloc.DoReSolve): Added test for
11276         negative parameter (CS0247).
11277
11278 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11279
11280         Fix bug #59792
11281         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
11282
11283 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11284
11285         Fix bug #59781
11286         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
11287         ulong.
11288
11289 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11290
11291         Fix bug #58254 & cs1555.cs, cs1556.cs
11292         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
11293
11294 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11295
11296         * cs-parser.jay: Added error CS1669 test for indexers.
11297
11298 2004-06-11  Martin Baulig  <martin@ximian.com>
11299
11300         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
11301         call this twice: for params and varargs methods.
11302
11303 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11304
11305         * class.cs:
11306         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
11307
11308 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11309
11310         * attribute.cs (Attribute.GetValidTargets): Made public.
11311
11312         * class.cs: 
11313         (AbstractPropertyEventMethod): New class for better code sharing.
11314         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
11315         CS1667 report.
11316         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
11317
11318 2004-06-11  Raja R Harinath  <rharinath@novell.com>
11319
11320         Fix bug #59477.
11321         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
11322         that the call to Resolve is part of a MemberAccess.
11323         (Expression.Resolve): Use it for SimpleName resolution.
11324         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
11325         Add 'intermediate' boolean argument.
11326         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
11327         error message when the SimpleName can be resolved ambiguously
11328         between an expression and a type.
11329         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
11330         public.
11331         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
11332         call on the left-side.
11333
11334 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11335
11336         * class.cs:
11337         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
11338
11339 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11340
11341         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
11342
11343 2004-06-11  Martin Baulig  <martin@ximian.com>
11344
11345         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
11346         varargs methods if applicable.
11347
11348 2004-06-11  Martin Baulig  <martin@ximian.com>
11349
11350         * expression.cs (Invocation.EmitCall): Don't use
11351         `method.CallingConvention == CallingConventions.VarArgs' since the
11352         method could also have `CallingConventions.HasThis'.
11353
11354 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11355
11356         * class.cs (Event.GetSignatureForError): Implemented.
11357         Fixed crash in error test cs3010.cs
11358
11359 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
11360
11361         * cs-tokenizer.cs: Change the way we track __arglist to be
11362         consistent with the other keywords.
11363
11364 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
11365
11366         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
11367         tomorrow.
11368
11369 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
11370
11371         * codegen.cs: Check that all referenced assemblies have a strongname
11372         before strongnaming the compiled assembly. If not report error CS1577.
11373         Fix bug #56563. Patch by Jackson Harper.
11374         * typemanager.cs: Added a method to return all referenced assemblies.
11375         Fix bug #56563. Patch by Jackson Harper.
11376
11377 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11378
11379         * class.cs:
11380         (Method.ApplyAttributeBuilder): Moved and added conditional
11381         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
11382
11383         * delegate.cs:
11384         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
11385
11386 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11387
11388         Fixed #59640
11389         * class.cs: (EventField.attribute_targets): Changed default target.
11390
11391 2004-06-08  Martin Baulig  <martin@ximian.com>
11392
11393         * expression.cs (Invocation.EmitCall): Enable varargs methods.
11394
11395 2004-06-08  Martin Baulig  <martin@ximian.com>
11396
11397         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
11398
11399 2004-06-07  Martin Baulig  <martin@ximian.com>
11400
11401         Added support for varargs methods.
11402
11403         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
11404         keyword.
11405
11406         * cs-parser.jay: Added support for `__arglist'.
11407
11408         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
11409
11410         * expression.cs (Argument.AType): Added `ArgList'.
11411         (Invocation): Added support for varargs methods.
11412         (ArglistAccess): New public class.
11413         (Arglist): New public class.
11414
11415         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
11416
11417         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
11418         a method's top-level block if the method has varargs.
11419
11420         * support.cs (ReflectionParameters, InternalParameters): Added
11421         support for varargs methods.    
11422
11423 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
11424
11425         * class.cs: Provide location in indexer error report.
11426
11427         * driver.cs: Use standard names.
11428
11429         * namespace.cs: Catch the use of using after a namespace has been
11430         declared also on using aliases.
11431
11432 2004-06-03  Raja R Harinath  <rharinath@novell.com>
11433
11434         Bug #50820.
11435         * typemanager.cs (closure_private_ok, closure_invocation_type)
11436         (closure_qualifier_type, closure_invocation_assembly)
11437         (FilterWithClosure): Move to ...
11438         (Closure): New internal nested class.
11439         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
11440         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
11441         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
11442         (MemberLookup, MemberLookupFailed): Use it.
11443         * expression.cs (New.DoResolve): Treat the lookup for the
11444         constructor as being qualified by the 'new'ed type.
11445         (Indexers.GetIndexersForTypeOrInterface): Update.
11446
11447 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
11448
11449         * attribute.cs
11450         (GetConditionalAttributeValue): New method. Returns
11451         condition of ConditionalAttribute.
11452         (SearchMulti): New method.  Returns all attributes of type 't'.
11453         Use it when attribute is AllowMultiple = true.
11454         (IsConditionalMethodExcluded): New method.
11455
11456         * class.cs
11457         (Method.IsExcluded): Implemented. Returns true if method has conditional
11458         attribute and the conditions is not defined (method is excluded).
11459         (IMethodData): Extended interface for ConditionalAttribute support.
11460         (PropertyMethod.IsExcluded): Implemented.
11461
11462         * decl.cs
11463         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
11464
11465         * expression.cs
11466         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
11467         on the method.
11468
11469 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11470
11471         * expression.cs (ArrayCreationExpression): Make this just an
11472         `expression'. It can't be a statement, so the code here was
11473         dead.
11474
11475 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11476
11477         Fixed #59072
11478         * typemanager.cs (GetFullNameSignature): New method for
11479         MethodBase types.
11480
11481 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11482
11483         Fixed #56452
11484         * class.cs (MemberBase.GetSignatureForError): New virtual method.
11485         Use this method when MethodBuilder is null.
11486         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
11487         Added test for error CS0626 (MONO reports error for this situation).
11488         (IMethodData.GetSignatureForError): Extended interface.
11489
11490 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11491
11492         * attribute.cs
11493         (AttributeTester.GetObsoleteAttribute): Returns instance of
11494         ObsoleteAttribute when type is obsolete.
11495
11496         * class.cs
11497         (TypeContainer.VerifyObsoleteAttribute): Override.
11498         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
11499         (MethodCode.VerifyObsoleteAttribute): Override.
11500         (MemberBase.VerifyObsoleteAttribute): Override.
11501
11502         * decl.cs
11503         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
11504         and report proper error.
11505
11506         *delegate.cs
11507         Delegate.VerifyObsoleteAttribute): Override.
11508
11509         * ecore.cs
11510         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
11511         and report proper error.
11512         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
11513
11514         * enum.cs
11515         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
11516         and enum member.
11517
11518         * expression.cs
11519         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
11520         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
11521         Added test for ObsoleteAttribute.
11522
11523         * statement.cs
11524         (Catch): Derived from Statement.
11525
11526 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11527  
11528         Fixed bug #59071 & cs0160.cs
11529  
11530         * statement.cs (Try.Resolve): Check here whether order of catch
11531         clauses matches their dependencies.
11532
11533 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
11534
11535         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
11536         caused a regression: #59343.  Referencing nested classes from an
11537         assembly stopped working.
11538
11539 2004-05-31  Martin Baulig  <martin@ximian.com>
11540
11541         MCS is now frozen for beta 2.
11542
11543 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11544
11545         * convert.cs: add a trivial cache for overload operator resolution.
11546
11547 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11548
11549         * decl.cs: If possible, use lookuptypedirect here. We can only do
11550         this if there is no `.' after the namespace. Avoids using
11551         LookupType, which does lots of slow processing.
11552         (FindNestedType) New method, does what it says :-).
11553         * namespace.cs: use LookupTypeDirect.
11554         * rootcontext.cs: use membercache, if possible.
11555         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
11556
11557 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11558
11559         * expression.cs:
11560         According to the spec, 
11561
11562         In a member access of the form E.I, if E is a single identifier,
11563         and if the meaning of E as a simple-name (§7.5.2) is a constant,
11564         field, property, localvariable, or parameter with the same type as
11565         the meaning of E as a type-name (§3.8), then both possible
11566         meanings of E are permitted.
11567
11568         We did not check that E as a simple-name had the same type as E as
11569         a type name.
11570
11571         This trivial check gives us 5-7% on bootstrap time.
11572
11573 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11574
11575         * expression.cs (Invocation.OverloadResolve): Avoid the
11576         use of hashtables and boxing here by allocating on demand.
11577
11578 2004-05-30  Martin Baulig  <martin@ximian.com>
11579
11580         * rootcontext.cs (RootContext.LookupType): Don't cache things if
11581         we're doing a silent lookup.  Don't try to lookup nested types in
11582         TypeManager.object_type (thanks to Ben Maurer).
11583
11584 2004-05-30  Martin Baulig  <martin@ximian.com>
11585
11586         Committing a patch from Ben Maurer.
11587
11588         * rootcontext.cs (RootContext.LookupType): Cache negative results.
11589
11590 2004-05-29  Martin Baulig  <martin@ximian.com>
11591
11592         * class.cs (IMethodData.ShouldIgnore): New method.
11593
11594         * typemanager.cs (TypeManager.MethodFlags): Don't take a
11595         `Location' argument, we don't need it anywhere.  Use
11596         `IMethodData.ShouldIgnore ()' instead of
11597         `MethodData.GetMethodFlags ()'.
11598         (TypeManager.AddMethod): Removed.
11599         (TypeManager.AddMethod2): Renamed to AddMethod.
11600
11601 2004-05-29  Martin Baulig  <martin@ximian.com>
11602
11603         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
11604
11605         * convert.cs (Convert.ImplicitReferenceConversion): If we're
11606         converting from a class type S to an interface type and we already
11607         have an object on the stack, don't box it again.  Fixes #52578.
11608
11609 2004-05-29  Martin Baulig  <martin@ximian.com>
11610
11611         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11612         Added support for `params' parameters.  Fixes #59267.
11613
11614 2004-05-29  Martin Baulig  <martin@ximian.com>
11615
11616         * literal.cs (NullPointer): Provide a private .ctor which sets
11617         `type' to TypeManager.object_type.  Fixes #59048.
11618
11619 2004-05-29  Martin Baulig  <martin@ximian.com>
11620
11621         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11622         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
11623
11624         * ecore.cs (EventExpr.instance_expr): Make the field private.
11625
11626 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
11627
11628         Fixed bug #50080 & cs0214-2.cs
11629         * expression.cs (Cast.DoResolve): Check unsafe context here.
11630         
11631         * statement.cs (Resolve.DoResolve): Likewise.
11632
11633 2004-05-26  Martin Baulig  <martin@ximian.com>
11634
11635         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11636
11637         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11638         (RootContext.LookupType): Pass down the `silent' flag.
11639
11640 2004-05-25  Martin Baulig  <martin@ximian.com>
11641
11642         * expression.cs
11643         (MethodGroupExpr.IdenticalTypeName): New public property.
11644         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11645         expression actually refers to a type.
11646
11647 2004-05-25  Martin Baulig  <martin@ximian.com>
11648
11649         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11650         for #56176 and made it actually work.
11651
11652 2004-05-25  Martin Baulig  <martin@ximian.com>
11653
11654         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11655         (FieldExpr, PropertyExpr): Override and implement
11656         CacheTemporaries.  Fixes #52279.
11657
11658 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
11659
11660         * location.cs: In the new compiler listing a file twice is a
11661         warning, not an error.
11662
11663 2004-05-24  Martin Baulig  <martin@ximian.com>
11664
11665         * enum.cs (Enum.DefineType): For the `BaseType' to be a
11666         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
11667
11668 2004-05-24  Martin Baulig  <martin@ximian.com>
11669
11670         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11671         walking the `using' list.  Fixes #53921.
11672
11673 2004-05-24  Martin Baulig  <martin@ximian.com>
11674
11675         * const.cs (Const.LookupConstantValue): Added support for
11676         EmptyCast's; fixes #55251.
11677
11678 2004-05-24  Martin Baulig  <martin@ximian.com>
11679
11680         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11681         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11682         which does the CS0135 check.  The reason is that we first need to
11683         check whether the variable actually exists.
11684
11685 2004-05-24  Martin Baulig  <martin@ximian.com>
11686
11687         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11688         than RootContext.LookupType() to find the explicit interface
11689         type.  Fixes #58584.
11690
11691 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11692
11693         * Makefile: Simplify.  Use executable.make.
11694         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11695
11696 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11697
11698         * decl.cs:
11699         * enum.cs:
11700         Use the invariant culture when doing String.Compare for CLS case
11701         sensitivity.
11702         
11703 2004-05-23  Martin Baulig  <martin@ximian.com>
11704
11705         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11706         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11707
11708         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11709         
11710 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11711
11712         * class.cs (MemberBase.Define): Reuse MemberType member for 
11713         resolved type. Other methods can use it too.
11714
11715 2004-05-23  Martin Baulig  <martin@ximian.com>
11716
11717         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11718         the variable also exists in the current block (otherwise, we need
11719         to report a CS0103).  Fixes #58670.
11720
11721 2004-05-23  Martin Baulig  <martin@ximian.com>
11722
11723         * flowanalysis.cs (Reachability.Reachable): Compute this
11724         on-the-fly rather than storing it as a field.
11725
11726 2004-05-23  Martin Baulig  <martin@ximian.com>
11727
11728         * flowanalysis.cs (Reachability.And): Manually compute the
11729         resulting `barrier' from the reachability.      
11730        
11731 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11732
11733         Fix bug #57835
11734         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11735         instance of ObsoleteAttribute when symbol is obsolete.
11736
11737         * class.cs
11738         (IMethodData): Extended interface for ObsoleteAttribute support.
11739
11740 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11741
11742         * attribute.cs: Fix bug #55970
11743
11744 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11745
11746         Fix bug #52705
11747         * attribute.cs
11748         (GetObsoleteAttribute): New method. Creates the instance of
11749         ObsoleteAttribute.
11750         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11751         ObsoleteAttribute when member is obsolete.
11752         (AttributeTester.Report_ObsoleteMessage): Common method for
11753         Obsolete error/warning reporting.
11754
11755         * class.cs
11756         (TypeContainer.base_classs_type): New member for storing parent type.
11757
11758         * decl.cs
11759         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11760         for this MemberCore.
11761
11762 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11763
11764         * attribute.cs, const.cs: Fix bug #58590
11765
11766 2004-05-21  Martin Baulig  <martin@ximian.com>
11767
11768         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11769         out parameters if the end of the method is unreachable.  Fixes
11770         #58098. 
11771
11772 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11773
11774         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11775         Hari was right, why extra method.
11776
11777 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11778
11779         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11780
11781 2004-05-20  Martin Baulig  <martin@ximian.com>
11782
11783         Merged this back from gmcs to keep the differences to a minumum.
11784
11785         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11786         instead of a Declspace.
11787         (Attribute.ResolveType): Likewise.
11788         (Attributes.Search): Likewise.
11789         (Attributes.Contains): Likewise.
11790         (Attributes.GetClsCompliantAttribute): Likewise.
11791
11792         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11793         argument.
11794         (MethodData.ApplyAttributes): Take an EmitContext instead of a
11795         DeclSpace.
11796
11797 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11798
11799         Fix bug #58688 (MCS does not report error when the same attribute
11800         is assigned twice)
11801
11802         * attribute.cs (Attribute.Emit): Distinction between null and default.
11803
11804 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11805
11806         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11807         of a top-level attribute without an attribute target.
11808         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11809         Make non-static.
11810         (Attribute.Conditional_GetConditionName), 
11811         (Attribute.Obsolete_GetObsoleteMessage): Update.
11812         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11813         part of ScanForIndexerName.
11814         (Attribute.CanIgnoreInvalidAttribute): New function.
11815         (Attribute.ScanForIndexerName): Move to ...
11816         (Attributes.ScanForIndexerName): ... here.
11817         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11818         (Attributes.Search): New internal variant that can choose not to
11819         complain if types aren't resolved.  The original signature now
11820         complains.
11821         (Attributes.GetClsCompliantAttribute): Use internal variant, with
11822         complaints suppressed.
11823         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11824         only if it not useful.
11825         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11826         top-level for attributes that are shared between the assembly
11827         and a top-level class.
11828         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11829         * class.cs: Update to reflect changes.
11830         (DefineIndexers): Fuse loops.
11831         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11832         a couple more variants of attribute names.
11833
11834 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11835
11836         Fix bug #52585 (Implemented explicit attribute declaration)
11837
11838         * attribute.cs:
11839         (Attributable.ValidAttributeTargets): New abstract method. It gets
11840         list of valid attribute targets for explicit target declaration.
11841         (Attribute.Target): It holds target itself.
11842         (AttributeSection): Removed.
11843         (Attribute.CheckTargets): New method. It checks whether attribute
11844         target is valid for the current element.
11845
11846         * class.cs:
11847         (EventProperty): New class. For events that are declared like
11848         property (with add and remove accessors).
11849         (EventField): New class. For events that are declared like field.
11850         class.cs
11851
11852         * cs-parser.jay: Implemented explicit attribute target declaration.
11853
11854         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11855         Override ValidAttributeTargets.
11856
11857         * parameter.cs:
11858         (ReturnParameter): Class for applying custom attributes on 
11859         the return type.
11860         (ParameterAtribute): New class. Class for applying custom
11861         attributes on the parameter type.
11862
11863 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11864
11865         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11866         definitions. 
11867
11868         (Method): Allow UNSAFE here.
11869
11870         * modifiers.cs: Support unsafe reporting.
11871
11872 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11873
11874         * decl.cs: Fix bug #58478.
11875
11876 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11877
11878         * statement.cs: When checking for unreachable code on an EmptyStatement,
11879         set the location. Fixes bug #58488.
11880
11881 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11882
11883         * driver.cs: Add -pkg handling.
11884
11885         From Gonzalo: UseShelLExecute=false
11886
11887 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11888
11889         * attribute.cs:
11890         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11891         for attribute.
11892         (Attribute.IsClsCompliaceRequired): Moved to base for better
11893         accesibility.
11894         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11895         when attribute is AttributeUsageAttribute.
11896         (Attribute.GetValidTargets): Simplified.
11897         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11898         attribute for this type.
11899         (Attribute.ApplyAttributes): Method renamed to Emit and make
11900         non-static.
11901         (GlobalAttributeSection): New class for special handling of global
11902         attributes (assembly, module).
11903         (AttributeSection.Emit): New method.
11904
11905         * class.cs: Implemented Attributable abstract methods.
11906         (MethodCore.LabelParameters): Moved to Parameter class.
11907         (Accessor): Is back simple class.
11908         (PropertyMethod): Implemented Attributable abstract class.
11909         (DelegateMethod): Implemented Attributable abstract class.
11910         (Event): New constructor for disctintion between normal Event
11911         and Event with accessors.
11912
11913         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11914
11915         * codegen.cs, const.cs, decl.cs, delegate.cs:
11916         (CommonAssemblyModulClass): Implemented Attributable abstract class
11917         and simplified.
11918
11919         * enum.cs: Implement IAttributeSupport interface.
11920         (EnumMember): New class for emum members. Implemented Attributable
11921         abstract class
11922
11923         * parameter.cs:
11924         (ParameterBase): Is abstract.
11925         (ReturnParameter): New class for easier [return:] attribute handling.
11926
11927         * typemanager.cs: Removed builder_to_attr.
11928
11929 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11930
11931         Fix bug #57151.
11932         * attribute.cs (Attribute.GetPositionalValue): New function.
11933         * class.cs (TypeContainer.VerifyMembers): New function.
11934         (TypeContainer.Emit): Use it.
11935         (ClassOrStruct): New base class for Class and Struct.
11936         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11937         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11938         class.
11939         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11940         then each non-static field should have a FieldOffset attribute.
11941         Otherwise, none of the fields should have a FieldOffset attribute.
11942         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11943         and FieldOffset attributes.
11944         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11945         (TypeManager.field_offset_attribute_type): New core types.
11946         (TypeManager.InitCoreTypes): Initialize them.
11947
11948 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11949
11950         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11951         Return correct type.
11952         From bug #58270.
11953
11954 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11955
11956         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11957         be implicitly converted to ulong.
11958         
11959         * expression.cs: The logic for allowing operator &, | and ^ worked
11960         was wrong, it worked before because we did not report an error in
11961         an else branch.  Fixes 57895.
11962
11963         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11964         allow volatile fields to be reference types.
11965
11966 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11967
11968         * driver.cs: Add support for /debug-
11969
11970 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11971
11972         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11973         Add a 'complain' parameter to silence errors.
11974         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11975         silently overlooked type-resolutions.
11976         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11977         to reflect changes.
11978         (Attributes.Search): New function.
11979         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11980         (Attributes.GetAttributeFullName): Remove hack.
11981         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11982         Update to reflect changes.
11983         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11984         Use Attributes.Search instead of nested loops.
11985
11986 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11987
11988         * decl.cs:
11989         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11990         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11991         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11992
11993         * report.cs: (Report.Warning): Renamed to Warning_T because of
11994         parameter collision.
11995
11996 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11997
11998         * expression.cs (MemberAccess.ResolveMemberAccess):
11999         Exit with non-zero status after Report.Error.
12000         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
12001         Likewise.
12002         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
12003
12004 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
12005
12006         * support.cs: Don't hang when the file is empty.
12007
12008 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
12009
12010         * support.cs: In SeekableStreamReader, compute the preamble size of the
12011           underlying stream. Position changes should take into account that initial
12012           count of bytes.
12013
12014 2004-05-03  Todd Berman  <tberman@sevenl.net>
12015
12016         * driver.cs: remove unused GetSysVersion function.
12017
12018 2004-05-03  Todd Berman  <tberman@sevenl.net>
12019
12020         * driver.cs: Remove the hack from saturday, as well as the hack
12021         from jackson (LoadAssemblyFromGac), also adds the CWD to the
12022         link_paths to get that bit proper.
12023
12024 2004-05-01  Todd Berman  <tberman@sevenl.net>
12025
12026         * driver.cs: Try a LoadFrom before a Load, this checks the current
12027         path. This is currently a bug in mono that is be fixed, however, this
12028         provides a workaround for now. This will be removed when the bug
12029         is fixed.
12030
12031 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
12032
12033         * CryptoConvert.cs: Updated to latest version. Fix issue with 
12034         incomplete key pairs (#57941).
12035
12036 2004-05-01  Todd Berman  <tberman@sevenl.net>
12037
12038         * driver.cs: Remove '.' from path_chars, now System.* loads properly
12039         from the GAC
12040
12041 2004-04-30  Jackson Harper  <jackson@ximian.com>
12042
12043         * codegen.cs: Open keys readonly.
12044         
12045 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12046
12047         * typemanager.cs: don't report cyclic struct layout when a struct
12048         contains 2 or more fields of the same type. Failed for Pango.AttrShape
12049         which has 2 Pango.Rectangle fields.
12050
12051 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12052
12053         * expression.cs: Handle IntPtr comparisons with IL code
12054         rather than a method call.
12055
12056 2004-04-29  Martin Baulig  <martin@ximian.com>
12057
12058         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
12059         the list of PropertyInfo's in class hierarchy and find the
12060         accessor.  Fixes #56013.
12061
12062 2004-04-29  Martin Baulig  <martin@ximian.com>
12063
12064         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
12065
12066 2004-04-29  Martin Baulig  <martin@ximian.com>
12067
12068         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12069
12070         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
12071
12072 2004-04-29  Martin Baulig  <martin@ximian.com>
12073
12074         * class.cs (ConstructorInitializer.Resolve): Check whether the
12075         parent .ctor is accessible.  Fixes #52146.
12076
12077 2004-04-29  Martin Baulig  <martin@ximian.com>
12078
12079         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12080
12081         * statement.cs (Using.EmitLocalVariableDecls): Use
12082         TypeManager.idisposable_type, not typeof (IDisposable).
12083         (Foreach.EmitCollectionForeach): Added support for valuetypes.
12084
12085 2004-04-29  Martin Baulig  <martin@ximian.com>
12086
12087         * class.cs (Event.Define): Don't emit the field and don't set
12088         RTSpecialName and SpecialName for events on interfaces.  Fixes
12089         #57703. 
12090
12091 2004-04-29  Raja R Harinath  <rharinath@novell.com>
12092
12093         Refactor Attribute.ApplyAttributes.
12094         * attribute.cs (Attributable): New base class for objects that can
12095         have Attributes applied on them.
12096         (Attribute): Make AttributeUsage fields public.
12097         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
12098         (Attribute.IsInternalCall): New property.
12099         (Attribute.UsageAttr): Convert to a public read-only property.
12100         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
12101         (Attribute.ResolveType, Attribute.Resolve)
12102         (Attribute.ScanForIndexerName): Update to reflect changes.
12103         (Attribute.CheckAttributeTarget): Re-format.
12104         (Attribute.ApplyAttributes): Refactor, to various
12105         Attributable.ApplyAttributeBuilder methods.
12106         * decl.cs (MemberCore): Make Attributable.
12107         * class.cs (Accessor): Make Attributable.
12108         (MethodData.ApplyAttributes): Use proper attribute types, not
12109         attribute names.
12110         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
12111         (TypeContainer.ApplyAttributeBuilder)
12112         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
12113         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
12114         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
12115         (Operator.ApplyAttributeBuilder): New factored-out methods.
12116         * const.cs (Const.ApplyAttributeBuilder): Likewise.
12117         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
12118         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
12119         * parameter.cs (ParameterBase): New Attributable base class
12120         that can also represent Return types.
12121         (Parameter): Update to the changes.
12122
12123 2004-04-29  Jackson Harper  <jackson@ximian.com>
12124
12125         * driver.cs: Prefer the corlib system version when looking for
12126         assemblies in the GAC. This is still a hack, but its a better hack
12127         now.
12128         
12129 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
12130
12131         * decl.cs, enum.cs: Improved error 3005 reporting.
12132   
12133         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
12134         (related_symbols): New private member for list of symbols
12135         related to reported error/warning.
12136         
12137         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
12138
12139 2004-04-29  Martin Baulig  <martin@ximian.com>
12140
12141         * ecore.cs (Expression.Constantify): If we're an enum and
12142         TypeManager.TypeToCoreType() doesn't give us another type, use
12143         t.UnderlyingSystemType.  Fixes #56178.  
12144
12145 2004-04-29  Martin Baulig  <martin@ximian.com>
12146
12147         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
12148         interfaces and for each interface, only add members directly
12149         declared in that interface.  Fixes #53255.
12150
12151 2004-04-28  Martin Baulig  <martin@ximian.com>
12152
12153         * expression.cs (ConditionalLogicalOperator): Use a temporary
12154         variable for `left' to avoid that we evaluate it more than once;
12155         bug #52588.
12156
12157 2004-04-28  Martin Baulig  <martin@ximian.com>
12158
12159         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
12160         `void[]' (CS1547).
12161
12162 2004-04-28  Martin Baulig  <martin@ximian.com>
12163
12164         * statement.cs (LocalInfo.Resolve): Check whether the type is not
12165         void (CS1547).
12166
12167         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
12168         whether the type is not void (CS1547).
12169
12170 2004-04-28  Martin Baulig  <martin@ximian.com>
12171
12172         * expression.cs (Unary.DoResolveLValue): Override this and report
12173         CS0131 for anything but Operator.Indirection.
12174
12175 2004-04-28  Martin Baulig  <martin@ximian.com>
12176
12177         Committing a patch from Ben Maurer; see bug #50820.
12178
12179         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12180         check for classes.
12181
12182         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12183         classes.        
12184
12185 2004-04-28  Martin Baulig  <martin@ximian.com>
12186
12187         Committing a patch from Ben Maurer; see bug #50820.
12188
12189         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12190         check for classes.
12191
12192         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12193         classes.        
12194
12195 2004-04-28  Martin Baulig  <martin@ximian.com>
12196
12197         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
12198         (Block.AddLabel): Call DoLookupLabel() to only search in the
12199         current block.
12200
12201 2004-04-28  Martin Baulig  <martin@ximian.com>
12202
12203         * cfold.cs (ConstantFold.BinaryFold): Added special support for
12204         comparing StringConstants and NullLiterals in Equality and Inequality.
12205
12206 2004-04-28  Jackson Harper  <jackson@ximian.com>
12207
12208         * driver.cs: Attempt to load referenced assemblies from the
12209         GAC. This is the quick and dirty version of this method that
12210         doesnt take into account versions and just takes the first
12211         canidate found. Will be good enough for now as we will not have more
12212         then one version installed into the GAC until I update this method.
12213
12214 2004-04-28  Martin Baulig  <martin@ximian.com>
12215
12216         * typemanager.cs (TypeManager.CheckStructCycles): New public
12217         static method to check for cycles in the struct layout.
12218
12219         * rootcontext.cs (RootContext.PopulateTypes): Call
12220         TypeManager.CheckStructCycles() for each TypeContainer.
12221         [Note: We only need to visit each type once.]
12222
12223 2004-04-28  Martin Baulig  <martin@ximian.com>
12224
12225         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
12226
12227         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
12228         success and added `out object value'.  Use a `bool resolved' field
12229         to check whether we've already been called rather than
12230         `ConstantValue != null' since this breaks for NullLiterals.
12231
12232 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12233
12234         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
12235         setting of this flag, since the 'set' method may be non-public.
12236
12237 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12238
12239         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
12240         check on current_vector.Block.
12241
12242 2004-04-27  Martin Baulig  <martin@ximian.com>
12243
12244         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
12245         a field initializer.  Fixes #56459.
12246
12247 2004-04-27  Martin Baulig  <martin@ximian.com>
12248
12249         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
12250         we're not attempting to use an indexer.  Fixes #52154.
12251
12252 2004-04-27  Martin Baulig  <martin@ximian.com>
12253
12254         * statement.cs (Return): Don't create a return label if we don't
12255         need it; reverts my change from January 20th.  Thanks to Ben
12256         Maurer for this.
12257
12258 2004-04-27  Martin Baulig  <martin@ximian.com>
12259
12260         According to the spec, `goto' can only leave a nested scope, but
12261         never enter it.
12262
12263         * statement.cs (Block.LookupLabel): Only lookup in the current
12264         block, don't recurse into parent or child blocks.
12265         (Block.AddLabel): Check in parent and child blocks, report
12266         CS0140/CS0158 if we find a duplicate.
12267         (Block): Removed this indexer for label lookups.
12268         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
12269         this already does the error reporting for us.
12270
12271         * flowanalysis.cs
12272         (FlowBranching.UsageVector.Block): New public variable; may be null.
12273         (FlowBranching.CreateSibling): Added `Block' argument.
12274         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
12275         label for the target of a `goto' and check whether we're not
12276         leaving a `finally'.
12277
12278 2004-04-27  Martin Baulig  <martin@ximian.com>
12279
12280         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12281         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
12282         just for returns).
12283
12284 2004-04-27  Martin Baulig  <martin@ximian.com>
12285
12286         * statement.cs (Block.AddLabel): Also check for implicit blocks
12287         and added a CS0158 check.
12288
12289 2004-04-27  Martin Baulig  <martin@ximian.com>
12290
12291         * flowanalysis.cs (FlowBranchingLoop): New class.
12292         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
12293         UsageVector's instead of an ArrayList.
12294         (FlowBranching.Label): Likewise.
12295         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
12296         (FlowBranching.AddBreakVector): New method.
12297
12298 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
12299
12300         * attribute.cs: Small regression fix: only convert the type if we
12301         the type is different, fixes System.Drawing build.
12302
12303 2004-04-27  Martin Baulig  <martin@ximian.com>
12304
12305         * attribute.cs (Attribute.Resolve): If we have a constant value
12306         for a named field or property, implicity convert it to the correct
12307         type.
12308
12309 2004-04-27  Raja R Harinath  <rharinath@novell.com>
12310
12311         * statement.cs (Block.Block): Implicit blocks share
12312         'child_variable_names' fields with parent blocks.
12313         (Block.AddChildVariableNames): Remove.
12314         (Block.AddVariable): Mark variable as "used by a child block" in
12315         every surrounding block.
12316         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
12317         been used in a child block, complain about violation of "Invariant
12318         meaning in blocks" rule.
12319         * cs-parser.jay (declare_local_variables): Don't use
12320         AddChildVariableNames.
12321         (foreach_statement): Don't create an implicit block: 'foreach'
12322         introduces a scope.
12323
12324 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
12325
12326         * convert.cs (ImplicitNumericConversion): 0 is also positive when
12327         converting from 0L to ulong.  Fixes 57522.
12328
12329 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12330
12331         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
12332         derived class hides via 'new' keyword field from base class (test-242.cs).
12333         TODO: Handle this in the more general way.
12334         
12335         * class.cs (CheckBase): Ditto.
12336
12337 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12338
12339         * decl.cs (caching_flags): New member for storing cached values
12340         as bit flags.
12341         (MemberCore.Flags): New enum where bit flags for caching_flags
12342         are defined.
12343         (MemberCore.cls_compliance): Moved to caching_flags.
12344         (DeclSpace.Created): Moved to caching_flags.
12345
12346         * class.cs: Use caching_flags instead of DeclSpace.Created
12347         
12348 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
12349
12350         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
12351         if we are only a derived class, not a nested class.
12352
12353         * typemanager.cs: Same as above, but do this at the MemberLookup
12354         level (used by field and methods, properties are handled in
12355         PropertyExpr).   Allow for the qualified access if we are a nested
12356         method. 
12357
12358 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
12359
12360         * class.cs: Refactoring.
12361         (IMethodData): New inteface; Holds links to parent members
12362         to avoid member duplication (reduced memory allocation).
12363         (Method): Implemented IMethodData interface.
12364         (PropertyBase): New inner classes for get/set methods.
12365         (PropertyBase.PropertyMethod): Implemented IMethodData interface
12366         (Event): New inner classes for add/remove methods.
12367         (Event.DelegateMethod): Implemented IMethodData interface.
12368
12369         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
12370         EmitContext (related to class.cs refactoring).
12371
12372 2004-04-21  Raja R Harinath  <rharinath@novell.com>
12373
12374         * delegate.cs (Delegate.VerifyApplicability): If the number of
12375         arguments are the same as the number of parameters, first try to
12376         verify applicability ignoring  any 'params' modifier on the last
12377         parameter.
12378         Fixes #56442.
12379
12380 2004-04-16  Raja R Harinath  <rharinath@novell.com>
12381
12382         * class.cs (TypeContainer.AddIndexer): Use
12383         'ExplicitInterfaceName' to determine if interface name was
12384         explicitly specified.  'InterfaceType' is not initialized at this time.
12385         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
12386         Indexers array is already in the required order.  Initialize
12387         'IndexerName' only if there are normal indexers.
12388         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
12389         (TypeContainer.Emit): Emit DefaultMember attribute only if
12390         IndexerName is initialized.
12391         Fixes #56300.
12392
12393 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
12394
12395         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
12396         Fixes #57007
12397
12398 2004-04-15  Raja R Harinath  <rharinath@novell.com>
12399
12400         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
12401         attributes.
12402         Fix for #56456.
12403
12404         * attribute.cs (Attribute.Resolve): Check for duplicate named
12405         attributes.
12406         Fix for #56463.
12407
12408 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
12409
12410         * iterators.cs (MarkYield): track whether we are in an exception,
12411         and generate code accordingly.  Use a temporary value to store the
12412         result for our state.
12413
12414         I had ignored a bit the interaction of try/catch with iterators
12415         since their behavior was not entirely obvious, but now it is
12416         possible to verify that our behavior is the same as MS .NET 2.0
12417
12418         Fixes 54814
12419
12420 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
12421
12422         * iterators.cs: Avoid creating temporaries if there is no work to
12423         do. 
12424
12425         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
12426         Enumerations, use TypeManager.EnumToUnderlying and call
12427         recursively. 
12428
12429         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
12430         bug #57013
12431
12432         (This.Emit): Use EmitContext.EmitThis to emit our
12433         instance variable.
12434
12435         (This.EmitAssign): Ditto.
12436
12437         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
12438         codepaths, we will move all the functionality into
12439         Mono.CSharp.This 
12440
12441         (FieldExpr.EmitAssign): Ditto.
12442
12443         This fixes several hidden bugs that I uncovered while doing a code
12444         review of this today.
12445
12446         * codegen.cs (EmitThis): reworked so the semantics are more clear
12447         and also support value types "this" instances.
12448
12449         * iterators.cs: Changed so that for iterators in value types, we
12450         do not pass the value type as a parameter.  
12451
12452         Initialization of the enumerator helpers is now done in the caller
12453         instead of passing the parameters to the constructors and having
12454         the constructor set the fields.
12455
12456         The fields have now `assembly' visibility instead of private.
12457
12458 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
12459
12460         * expression.cs (Argument.Resolve): Check if fields passed as ref
12461         or out are contained in a MarshalByRefObject.
12462
12463         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
12464         another compiler type.
12465
12466 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12467
12468         * class.cs (Indexer.Define): use the new name checking method.
12469         Also, return false on an error.
12470         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
12471         (is_identifier_[start/part]_character): make static.
12472
12473 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
12474
12475         * expression.cs (Binary.ResolveOperator): Do no append strings
12476         twice: since we can be invoked more than once (array evaluation)
12477         on the same concatenation, take care of this here.  Based on a fix
12478         from Ben (bug #56454)
12479
12480 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
12481
12482         * codegen.cs: Fix another case where CS1548 must be reported (when 
12483         delay-sign isn't specified and no private is available #56564). Fix
12484         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
12485         error when MCS is used on the MS runtime and we need to delay-sign 
12486         (which seems unsupported by AssemblyBuilder - see #56621).
12487
12488 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
12489
12490         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
12491         (TypeManager.ComputeNamespaces): Faster implementation for
12492         Microsoft runtime.
12493
12494         * compiler.csproj: Updated AssemblyName to mcs.
12495
12496 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12497
12498         * rootcontext.cs: Add new types to the boot resolution.
12499
12500         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12501         MulticastDelegate is not allowed.
12502
12503         * typemanager.cs: Add new types to lookup: System.TypedReference
12504         and ArgIterator.
12505
12506         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12507         check for TypedReference or ArgIterator, they are not allowed. 
12508
12509         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12510         makes us properly catch 1510 in some conditions (see bug 56016 for
12511         details). 
12512
12513 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12514
12515         * CryptoConvert.cs: update from corlib version
12516         with endian fixes.
12517
12518 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12519
12520         * class.cs (Indexer.Define): Check indexername declaration
12521
12522 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12523
12524         * attribute.cs (IsClsCompliant): Fixed problem with handling
12525         all three states (compliant, not-compliant, undetected).
12526
12527 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12528
12529         * attribute.cs (Attribute): Location is now public.
12530         (Resolve): Store resolved arguments (pos_values) in attribute class.
12531         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12532         (GetClsCompliantAttributeValue): New method that gets
12533         CLSCompliantAttribute value.
12534         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12535         if exists else null.
12536         (AttributeTester): New class for CLS-Compliant verification routines.
12537
12538         * class.cs (Emit): Add CLS-Compliant verification.
12539         (Method.GetSignatureForError): Implemented.
12540         (Constructor.GetSignatureForError): Implemented
12541         (Constructor.HasCompliantArgs): Returns if constructor has
12542         CLS-Compliant arguments.
12543         (Constructor.Emit): Override.
12544         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12545         is needed to test only parameters.
12546         (FieldBase.GetSignatureForError): Implemented.
12547         (TypeContainer): New member for storing base interfaces.
12548         (TypeContainer.FindMembers): Search in base interfaces too.
12549
12550         * codegen.cs (GetClsComplianceAttribute): New method that gets
12551         assembly or module CLSCompliantAttribute value.
12552         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12553         for assembly.
12554         (ModuleClass.Emit): Add error 3012 test.
12555
12556         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12557
12558         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12559         state for all decl types.
12560         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12561         if CLS-Compliant tests are required.
12562         (IsClsCompliaceRequired): New method. Analyze whether code
12563         must be CLS-Compliant.
12564         (IsExposedFromAssembly): New method. Returns true when MemberCore
12565         is exposed from assembly.
12566         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12567         value or gets cached value.
12568         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12569         is explicitly marked with CLSCompliantAttribute.
12570         (IsIdentifierClsCompliant): New abstract method. This method is
12571         used to testing error 3005.
12572         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12573         for identifier and parameters CLS-Compliant testing.
12574         (VerifyClsCompliance): New method. The main virtual method for
12575         CLS-Compliant verifications.
12576         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12577         null. I don't know why is null (too many public members !).
12578         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12579         and get value of first CLSCompliantAttribute that found.
12580
12581         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12582         (VerifyClsCompliance): Override and add extra tests.
12583
12584         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12585         clscheck- disable CLS-Compliant verification event if assembly is has
12586         CLSCompliantAttribute(true).
12587
12588         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12589         ApllyAttribute is now called in emit section as in the other cases.
12590         Possible future Emit integration.
12591         (IsIdentifierClsCompliant): New override.
12592         (VerifyClsCompliance): New override.
12593         (GetEnumeratorName): Returns full enum name.
12594
12595         * parameter.cs (GetSignatureForError): Implemented.
12596
12597         * report.cs (WarningData): New struct for Warning message information.
12598         (LocationOfPreviousError): New method.
12599         (Warning): New method. Reports warning based on the warning table.
12600         (Error_T): New method. Reports error based on the error table.
12601
12602         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12603         verifications are done here.
12604
12605         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12606
12607         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12608         CLSCompliantAttribute.
12609         (all_imported_types): New member holds all imported types from other
12610         assemblies.
12611         (LoadAllImportedTypes): New method fills static table with exported types
12612         from all referenced assemblies.
12613         (Modules): New property returns all assembly modules.
12614
12615 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12616
12617         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12618         throwing a parser error.
12619
12620         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12621         which removes the hardcoded get_/set_ prefixes for properties, as
12622         IL allows for the properties to be named something else.  
12623
12624         Bug #56013
12625
12626         * expression.cs: Do not override operand before we know if it is
12627         non-null.  Fix 56207
12628
12629 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12630
12631         * typemanager.cs: support for pinned variables.
12632
12633 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12634
12635         * decl.cs, typemanager.cs: Avoid using an arraylist
12636         as a buffer if there is only one result set.
12637
12638 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12639
12640         * expression.cs: Make sure you cant call a static method
12641         with an instance expression, bug #56174.
12642
12643 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12644
12645         * class.cs (IsDuplicateImplementation): Improve error reporting to
12646         flag 663 (method only differs in parameter modifier).
12647
12648         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12649         in preprocessor directives.
12650
12651         * location.cs (LookupFile): Allow for the empty path.
12652
12653         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12654         better approach for some of that patch, but its failing with the
12655         CharSet enumeration.  For now try/catch will do.
12656
12657         * typemanager.cs: Do not crash if a struct does not have fields.
12658         Fixes 56150.
12659
12660 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12661
12662         * expression.cs: cs0213, cant fix a fixed expression.
12663         fixes 50231.
12664
12665 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12666
12667         * cs-parser.jay: detect invalid embeded statements gracefully.
12668         bug #51113.
12669
12670 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12671
12672         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12673         As a regex:
12674         s/
12675         the invocation type may not be a subclass of the tye of the item/
12676         The type of the item must be a subclass of the invocation item.
12677         /g
12678
12679         Fixes bug #50820.
12680
12681 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12682
12683         * attribute.cs: Added methods to get a string and a bool from an
12684         attribute. Required to information from AssemblyKeyFileAttribute,
12685         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12686         * codegen.cs: Modified AssemblyName creation to include support for
12687         strongnames. Catch additional exceptions to report them as CS1548.
12688         * compiler.csproj: Updated include CryptoConvert.cs.
12689         * compiler.csproj.user: Removed file - user specific configuration.
12690         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12691         Mono.Security assembly. The original class is maintained and tested in
12692         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12693         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12694         like CSC 8.0 (C# v2) supports.
12695         * Makefile: Added CryptoConvert.cs to mcs sources.
12696         * rootcontext.cs: Added new options for strongnames.
12697
12698 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12699
12700         * driver.cs: For --expect-error, report error code `2'
12701         if the program compiled with no errors, error code `1' if
12702         it compiled with an error other than the one expected.
12703
12704 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12705
12706         * compiler.csproj: Updated for Visual Studio .NET 2003.
12707         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12708         * compiler.sln: Updated for Visual Studio .NET 2003.
12709
12710 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12711
12712         * expression.cs: Fix bug #47234. We basically need to apply the
12713         rule that we prefer the conversion of null to a reference type
12714         when faced with a conversion to 'object' (csc behaviour).
12715
12716 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12717
12718         * statement.cs: Shorter form for foreach, eliminates
12719         a local variable. r=Martin.
12720
12721 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12722
12723         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12724         checks if we can use brtrue/brfalse to test for 0.
12725         * expression.cs: use the above in the test for using brtrue/brfalse.
12726         cleanup code a bit.
12727
12728 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12729
12730         * expression.cs: Rewrite string concat stuff. Benefits:
12731
12732         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12733         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12734         rather than a concat chain.
12735
12736         * typemanager.cs: Add lookups for more concat overloads.
12737
12738 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12739
12740         * expression.cs: Emit shorter il code for array init.
12741
12742         newarr
12743         dup
12744         // set 1
12745
12746         // set 2
12747
12748         newarr
12749         stloc.x
12750
12751         ldloc.x
12752         // set 1
12753
12754         ldloc.x
12755         // set 2
12756
12757 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12758
12759         * statement.cs: Before, two switch blocks would be merged if the
12760         total size of the blocks (end_item - begin_item + 1) was less than
12761         two times the combined sizes of the blocks.
12762
12763         Now, it will only merge if after the merge at least half of the
12764         slots are filled.
12765
12766         fixes 55885.
12767
12768 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12769
12770         * class.cs : csc build fix for GetMethods(). See bug #52503.
12771
12772 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12773
12774         * expression.cs: Make sure fp comparisons work with NaN.
12775         This fixes bug #54303. Mig approved this patch a long
12776         time ago, but we were not able to test b/c the runtime
12777         had a related bug.
12778
12779 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12780
12781         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12782
12783 2004-03-19  Martin Baulig  <martin@ximian.com>
12784
12785         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12786         error here and not in our caller.
12787
12788 2004-03-19  Martin Baulig  <martin@ximian.com>
12789
12790         * interface.cs: Completely killed this file.
12791         (Interface): We're now a TypeContainer and live in class.cs.
12792
12793         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12794         argument; we're now also called for interfaces.
12795         (TypeContainer.DefineMembers): Allow this method being called
12796         multiple times.
12797         (TypeContainer.GetMethods): New public method; formerly known as
12798         Interface.GetMethod().  This is used by PendingImplementation.
12799         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12800         it's now private and non-static.
12801         (Interface): Moved this here; it's now implemented similar to
12802         Class and Struct.
12803         (Method, Property, Event, Indexer): Added `bool is_interface'
12804         argument to their .ctor's.
12805         (MemberBase.IsInterface): New public field.
12806
12807         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12808         instances instead of InterfaceMethod, InterfaceProperty, etc.
12809         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12810         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12811
12812 2004-03-19  Martin Baulig  <martin@ximian.com>
12813
12814         * class.cs (MethodCore.IsDuplicateImplementation): New private
12815         method which does the CS0111 checking.
12816         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12817         Use IsDuplicateImplementation().
12818
12819 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12820
12821         * decl.cs (FindMemberToOverride): New method to find the correct
12822         method or property to override in the base class.
12823         * class.cs
12824             - Make Method/Property use the above method to find the
12825               version in the base class.
12826             - Remove the InheritableMemberSignatureCompare as it is now
12827               dead code.
12828
12829         This patch makes large code bases much faster to compile, as it is
12830         O(n) rather than O(n^2) to do this validation.
12831
12832         Also, it fixes bug 52458 which is that nested classes are not
12833         taken into account when finding the base class member.
12834
12835         Reviewed/Approved by Martin.
12836
12837 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12838
12839         * interface.cs: In all interface classes removed redundant
12840         member initialization.
12841
12842 2004-03-16  Martin Baulig  <martin@ximian.com>
12843
12844         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12845
12846 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12847
12848         * decl.cs (DefineTypeAndParents): New helper method to define a
12849         type's containers before the type itself is defined;  This is a
12850         bug exposed by the recent changes to Windows.Forms when an
12851         implemented interface was defined inside a class that had not been
12852         built yet.   
12853
12854         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12855
12856         (Check): Loop correctly to report errors modifiers
12857         (UNSAFE was not in the loop, since it was the same as TOP).
12858
12859         * interface.cs: Every interface member now takes a ModFlags,
12860         instead of a "is_new" bool, which we set on the base MemberCore. 
12861
12862         Every place where we called "UnsafeOk" in the interface, now we
12863         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12864         the unsafe settings from the member declaration instead of the
12865         container interface. 
12866
12867         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12868
12869         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12870         `set_indexer_name' to the pending bits (one per type).
12871
12872         We fixed a bug today that was picking the wrong method to
12873         override, since for properties the existing InterfaceMethod code
12874         basically ignored the method name.  Now we make sure that the
12875         method name is one of the valid indexer names.
12876
12877 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12878  
12879         * support.cs (SeekableStreamReader): Keep track of stream byte
12880         positions and don't mix them with character offsets to the buffer.
12881
12882         Patch from Gustavo Giráldez
12883
12884 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12885
12886         * interface.cs (InterfaceSetGetBase): Removed double member
12887         initialization, base class does it as well.
12888
12889 2004-03-13  Martin Baulig  <martin@ximian.com>
12890
12891         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12892         when compiling corlib.
12893
12894 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12895
12896         * convert.cs (ExplicitConversion): We were reporting an error on
12897         certain conversions (object_type source to a value type, when the
12898         expression was `null') before we had a chance to pass it through
12899         the user defined conversions.
12900
12901         * driver.cs: Replace / and \ in resource specifications to dots.
12902         Fixes 50752
12903
12904         * class.cs: Add check for duplicate operators.  Fixes 52477
12905
12906 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12907
12908         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12909         that are in the middle of the statements, not only at the end.
12910         Fixes #54987
12911
12912         * class.cs (TypeContainer.AddField): No longer set the
12913         `HaveStaticConstructor' flag, now we call it
12914         `UserDefineStaticConstructor' to diferentiate the slightly
12915         semantic difference.
12916
12917         The situation is that we were not adding BeforeFieldInit (from
12918         Modifiers.TypeAttr) to classes that could have it.
12919         BeforeFieldInit should be set to classes that have no static
12920         constructor. 
12921
12922         See:
12923
12924         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12925
12926         And most importantly Zoltan's comment:
12927
12928         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12929
12930         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12931          before its static fields are used', i.e. initialization does not need
12932          to be triggered by the first access to the type. Setting this flag
12933          helps the JIT to compile better code, since it can run the static
12934          constructor at JIT time, and does not need to generate code to call it
12935          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12936          this flag for lots of classes like String. 
12937          
12938          csc sets this flag if the type does not have an explicit static 
12939          constructor. The reasoning seems to be that if there are only static
12940          initalizers for a type, and no static constructor, then the programmer
12941          does not care when this initialization happens, so beforefieldinit
12942          can be used.
12943          
12944          This bug prevents the AOT compiler from being usable, since it 
12945          generates so many calls to mono_runtime_class_init that the AOT code
12946          is much slower than the JITted code. The JITted code is faster, 
12947          because it does not generate these calls if the vtable is type is
12948          already initialized, which is true in the majority of cases. But the
12949          AOT compiler can't do this."
12950
12951 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12952
12953         * class.cs (MethodData.Emit): Refactor the code so symbolic
12954         information is generated for destructors;  For some reasons we
12955         were taking a code path that did not generate symbolic information
12956         before. 
12957
12958 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12959
12960         * class.cs: Create a Constructor.CheckBase method that
12961         takes care of all validation type code. The method
12962         contains some code that was moved from Define.
12963
12964         It also includes new code that checks for duplicate ctors.
12965         This fixes bug #55148.
12966
12967 2004-03-09  Joshua Tauberer <tauberer@for.net>
12968
12969         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12970         a { ... }-style array creation invokes EmitStaticInitializers
12971         which is not good for reference-type arrays.  String, decimal
12972         and now null constants (NullCast) are not counted toward
12973         static initializers.
12974
12975 2004-03-05  Martin Baulig  <martin@ximian.com>
12976
12977         * location.cs (SourceFile.HasLineDirective): New public field;
12978         specifies whether the file contains or is referenced by a "#line"
12979         directive.
12980         (Location.DefineSymbolDocuments): Ignore source files which
12981         either contain or are referenced by a "#line" directive.        
12982
12983 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12984
12985         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12986         direct access to our parent, so check the method inline there.
12987
12988 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12989
12990         * expression.cs (Invocation.EmitCall): Miguel's last commit
12991         caused a regression. If you had:
12992
12993             T t = null;
12994             t.Foo ();
12995
12996         In Foo the implict this would be null.
12997
12998 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12999
13000         * expression.cs (Invocation.EmitCall): If the method is not
13001         virtual, do not emit a CallVirt to it, use Call.
13002
13003         * typemanager.cs (GetFullNameSignature): Improve the method to
13004         cope with ".ctor" and replace it with the type name.
13005
13006         * class.cs (ConstructorInitializer.Resolve): Now the method takes
13007         as an argument the ConstructorBuilder where it is being defined,
13008         to catch the recursive constructor invocations.
13009
13010 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
13011
13012         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
13013         routines to check if a type is an enumerable/enumerator allow
13014         classes that implement the IEnumerable or IEnumerator interfaces.
13015
13016         * class.cs (Property, Operator): Implement IIteratorContainer, and
13017         implement SetYields.
13018
13019         (Property.Define): Do the block swapping for get_methods in the
13020         context of iterators.   We need to check if Properties also
13021         include indexers or not.
13022
13023         (Operator): Assign the Block before invoking the
13024         OperatorMethod.Define, so we can trigger the Iterator code
13025         replacement. 
13026
13027         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
13028         Property and Operator classes are not created when we parse the
13029         declarator but until we have the block completed, so we use a
13030         singleton SimpleIteratorContainer.Simple to flag whether the
13031         SetYields has been invoked.
13032
13033         We propagate this setting then to the Property or the Operator to
13034         allow the `yield' to function.
13035
13036 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
13037
13038         * codegen.cs: Implemented attribute support for modules.
13039         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
13040         Assembly/Module functionality.
13041
13042         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
13043         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
13044         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
13045
13046 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
13047
13048         * interface.cs (FindMembers): The operation is performed on all base
13049         interfaces and not only on the first. It is required for future CLS Compliance patch.
13050
13051 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13052
13053         * statement.cs, codegen.cs:
13054         This patch deals with patterns such as:
13055
13056         public class List : IEnumerable {
13057
13058                 public MyEnumerator GetEnumerator () {
13059                         return new MyEnumerator(this);
13060                 }
13061
13062                 IEnumerator IEnumerable.GetEnumerator () {
13063                         ...
13064                 }
13065                 
13066                 public struct MyEnumerator : IEnumerator {
13067                         ...
13068                 }
13069         }
13070
13071         Before, there were a few things we did wrong:
13072         1) we would emit callvirt on a struct, which is illegal
13073         2) we emited ldarg when we needed to emit ldarga
13074         3) we would mistakenly call the interface methods on an enumerator
13075         type that derived from IEnumerator and was in another assembly. For example:
13076
13077         public class MyEnumerator : IEnumerator
13078
13079         Would have the interface methods called, even if there were public impls of the
13080         method. In a struct, this lead to invalid IL code.
13081
13082 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
13083
13084         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
13085           renamed to Emit.
13086
13087         * delegate.cs (Define): Fixed crash when delegate type is undefined.
13088
13089 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
13090
13091         * cs-parser.jay: Fix small regression: we were not testing V2
13092         compiler features correctly.
13093
13094         * interface.cs: If the emit context is null, then create one
13095
13096 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
13097
13098         * decl.cs (GetSignatureForError): New virtual method to get full name
13099           for error messages.
13100
13101         * attribute.cs (IAttributeSupport): New interface for attribute setting.
13102           Now it is possible to rewrite ApplyAttributes method to be less if/else.
13103
13104         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
13105           Duplicated members and code in these classes has been removed.
13106           Better encapsulation in these classes.
13107
13108 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
13109
13110         * assign.cs (Assign.DoResolve): When dealing with compound
13111         assignments, there is a new rule in ECMA C# 2.4 (might have been
13112         there before, but it is documented here) that states that in:
13113
13114         a op= b;
13115
13116         If b is of type int, and the `op' is a shift-operator, then the
13117         above is evaluated as:
13118
13119         a = (int) a op b 
13120
13121         * expression.cs (Binary.ResolveOperator): Instead of testing for
13122         int/uint/long/ulong, try to implicitly convert to any of those
13123         types and use that in pointer arithmetic.
13124
13125         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
13126         method to print information for from the type, not from the
13127         null-method we were given.
13128
13129 2004-02-01  Duncan Mak  <duncan@ximian.com>
13130
13131         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
13132         parsing for cmd, fixes bug #53694.
13133
13134 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
13135
13136         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
13137         in the member name duplication tests. Property and operator name duplication
13138         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
13139
13140 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
13141
13142         * interface.cs (PopulateMethod): Fixed crash when interface method
13143         returns not existing type (error test cs0246-3.cs).
13144
13145 2004-02-02  Ravi Pratap M <ravi@ximian.com>
13146
13147         * cs-parser.jay (interface_accessors): Re-write actions to also
13148         store attributes attached to get and set methods. Fix spelling
13149         while at it.
13150
13151         (inteface_property_declaration): Modify accordingly.
13152
13153         (InterfaceAccessorInfo): New helper class to store information to pass
13154         around between rules that use interface_accessors.
13155
13156         * interface.cs (Emit): Apply attributes on the get and set
13157         accessors of properties and indexers too.
13158
13159         * attribute.cs (ApplyAttributes): Modify accordingly to use the
13160         right MethodBuilder when applying attributes to the get and set accessors.
13161
13162 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
13163
13164         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
13165
13166 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
13167
13168         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13169
13170 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
13171
13172         * cs-parser.jay: Remove YIELD token, instead use the new grammar
13173         changes that treat `yield' specially when present before `break'
13174         or `return' tokens.
13175
13176         * cs-tokenizer.cs: yield is no longer a keyword.
13177
13178 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
13179
13180         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13181         setting for default constructors.
13182         For default constructors are almost every time set wrong Modifier. The
13183         generated IL code has been alright. But inside mcs this values was
13184         wrong and this was reason why several of my CLS Compliance tests
13185         failed.
13186
13187 2004-01-22  Martin Baulig  <martin@ximian.com>
13188
13189         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13190         not a QualifiedIdentifier.  This is what `type_name_expression'
13191         was previously doing.
13192         (type_name_expression): Removed; the code is now in
13193         `namespace_or_type_name'.
13194         (qualified_identifier): Removed, use `namespace_or_type_name'
13195         instead.
13196         (QualifiedIdentifier): Removed this class.      
13197
13198 2004-01-22  Martin Baulig  <martin@ximian.com>
13199
13200         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13201         not a string as alias name.
13202
13203 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13204
13205         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13206         #52730 bug, and instead compute correctly the need to use a
13207         temporary variable when requesting an address based on the
13208         static/instace modified of the field and the constructor.
13209  
13210 2004-01-21  Martin Baulig  <martin@ximian.com>
13211
13212         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13213         class and namespace before looking up aliases.  Fixes #52517.
13214
13215 2004-01-21  Martin Baulig  <martin@ximian.com>
13216
13217         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13218         assinged in a 'try'; fixes exception4.cs.
13219
13220 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13221         * class.cs : Implemented parameter-less constructor for TypeContainer
13222
13223         * decl.cs: Attributes are now stored here. New property OptAttributes
13224
13225         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13226
13227         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13228
13229 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13230
13231         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13232           (CSharpSignature): New method for indexer and property signature.
13233
13234 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13235
13236         * pending.cs (IsVirtualFilter): Faster implementation.
13237
13238 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13239
13240         * typemanager.cs: Avoid inclusion of same assembly more than once.
13241
13242 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13243
13244         * cs-parser.jay: Fixed problem where the last assembly attribute
13245           has been applied also to following declaration (class, struct, etc.)
13246           
13247 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13248
13249         * class.cs: Added error CS0538, CS0539 reporting.
13250         Fixed crash on Microsoft runtime when field type is void.
13251
13252         * cs-parser.jay: Added error CS0537 reporting.
13253
13254         * pending.cs: Added error CS0535 reporting.
13255         Improved error report for errors CS0536, CS0534.
13256
13257 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13258
13259         Merge a few bits from the Anonymous Method MCS tree.
13260
13261         * statement.cs (ToplevelBlock): New class for toplevel methods,
13262         will hold anonymous methods, lifted variables.
13263
13264         * cs-parser.jay: Create toplevel blocks for delegates and for
13265         regular blocks of code. 
13266
13267 2004-01-20  Martin Baulig  <martin@ximian.com>
13268
13269         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13270         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13271         and `NeedExplicitReturn'; added `IsLastStatement'.
13272         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13273         have a `ReturnLabel' or we're not unreachable.
13274
13275         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13276         child's reachability; don't just override ours with it.  Fixes
13277         #58058 (lluis's example).
13278         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13279         InFinally(), InLoop(), InSwitch() and
13280         BreakCrossesTryCatchBoundary() methods.
13281
13282         * statement.cs (Return): Do all error checking in Resolve().
13283         Unless we are the last statement in a top-level block, always
13284         create a return label and jump to it.
13285         (Break, Continue): Do all error checking in Resolve(); also make
13286         sure we aren't leaving a `finally'.
13287         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13288         statement in a top-level block.
13289         (Block.Flags): Added `IsDestructor'.
13290         (Block.IsDestructor): New public property.
13291
13292 2004-01-20  Martin Baulig  <martin@ximian.com>
13293
13294         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13295
13296 2004-01-20  Martin Baulig  <martin@ximian.com>
13297
13298         * statement.cs (Statement.ResolveUnreachable): New public method.
13299         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13300         (Block.Resolve): Resolve unreachable statements.
13301
13302 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13303
13304         * expression.cs: We need to fix the case where we do
13305         not have a temp variable here.
13306
13307         * assign.cs: Only expression compound assignments need
13308         temporary variables.
13309
13310 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13311
13312         * flowanalysis.cs: Reduce memory allocation in a few ways:
13313           - A block with no variables should not allocate a bit
13314             vector for itself.
13315           - A method with no out parameters does not need any tracking
13316             for assignment of the parameters, so we need not allocate
13317             any data for it.
13318           - The arrays:
13319                 public readonly Type[] VariableTypes;
13320                 public readonly string[] VariableNames;
13321             Are redundant. The data is already stored in the variable
13322             map, so we need not allocate another array for it.
13323           - We need to add alot of checks for if (params | locals) == null
13324             due to the first two changes.
13325
13326 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13327
13328         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13329         implement IMemoryLocation, we store a copy on a local variable and
13330         take the address of it.  Patch from Benjamin Jemlich
13331
13332         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13333         to use a special "type_name_expression" rule which reduces the
13334         number of "QualifiedIdentifier" classes created, and instead
13335         directly creates MemberAccess expressions.
13336
13337 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13338
13339         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13340         that fixes #52853.  Null literal assignment to ValueType
13341
13342         * class.cs (MethodData.Emit): Instead of checking the name of the
13343         method to determine if its a destructor, create a new derived
13344         class from Method called Destructor, and test for that.  
13345
13346         * cs-parser.jay: Create a Destructor object instead of a Method.  
13347
13348         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13349
13350         Fixes: 52933
13351
13352 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * expression.cs (Binary.ResolveOperator): Perform an implicit
13355         conversion from MethodGroups to their delegate types on the
13356         Addition operation.
13357
13358         * delegate.cs: Introduce a new class DelegateCreation that is the
13359         base class for `NewDelegate' and `ImplicitDelegateCreation',
13360         factor some code in here.
13361
13362         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13363         conversion from MethodGroups to compatible delegate types. 
13364
13365         * ecore.cs (Expression.Resolve): Do not flag error 654
13366         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13367         we allow conversions from MethodGroups to delegate types now.
13368
13369         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13370         assignments in v2 either.
13371
13372 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13373
13374         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13375         static read-only fields in ctors.
13376
13377         Applied patch from Benjamin Jemlich 
13378
13379         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13380
13381 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13382
13383         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13384         here to return true, as they can be used like this:
13385
13386                 (XXX) int.MEMBER ()
13387
13388         Fixed 49836 and all the other dups
13389
13390 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13391
13392         * driver.cs: Implement /win32res and /win32icon.
13393
13394 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13395
13396         * cs-parser.jay: Add a rule to improve error handling for the
13397         common mistake of placing modifiers after the type.
13398
13399 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13400
13401         * cs-parser.jay (interface_event_declaration): Catch
13402         initialization of events on interfaces, and report cs0068
13403
13404         * cs-parser.jay (interface_event_declaration): Catch
13405         initialization of events. 
13406
13407         * ecore.cs: Better report missing constructors.
13408
13409         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13410         the error reporting done in the wrong place.  Fix.
13411
13412         * expression.cs (Binary.ResolveOperator): Catch the 
13413         operator + (E x, E y) error earlier, and later allow for implicit
13414         conversions in operator +/- (E e, U x) from U to the underlying
13415         type of E.
13416
13417         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13418         52596, if the container class is abstract, the default constructor
13419         is protected otherwise its public (before, we were always public).
13420
13421         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13422         fixed statement.
13423
13424         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13425         Jemlich that fixes bug #52597, MCS was generating invalid code for
13426         idisposable structs.   Thanks to Ben for following up with this
13427         bug as well.
13428
13429 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13430
13431         * driver.cs: Allow assemblies without code to be generated, fixes
13432         52230.
13433
13434 2004-01-07  Nick Drochak <ndrochak@gol.com>
13435
13436         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13437
13438 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13439
13440         * cs-parser.jay: Add rules to improve error reporting if fields or
13441         methods are declared at the namespace level (error 116)
13442
13443         * Add rules to catch event add/remove
13444
13445 2004-01-04  David Sheldon <dave-mono@earth.li>
13446
13447   * expression.cs: Added matching ")" to error message for 
13448   CS0077
13449
13450 2004-01-03 Todd Berman <tberman@gentoo.org>
13451
13452         * ecore.cs, attribute.cs:
13453         Applying fix from #52429.
13454
13455 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13456
13457         * ecore.cs, expression.cs, statement.cs:
13458         Total rewrite of how we handle branching. We
13459         now handle complex boolean expressions with fewer
13460         jumps. As well if (x == 0) no longer emits a ceq.
13461
13462         if (x is Foo) is much faster now, because we generate
13463         better code.
13464
13465         Overall, we get a pretty big improvement on our benchmark
13466         tests. The code we generate is smaller and more readable.
13467
13468         I did a full two-stage bootstrap. The patch was reviewed
13469         by Martin and Miguel.
13470
13471 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13472
13473         * cs-parser.jay: Make primary_expression not take a QI.
13474         we dont need this because the member_access rule covers
13475         us here. So we replace the rule with just IDENTIFIER.
13476
13477         This has two good effects. First, we remove a s/r conflict.
13478         Second, we allocate many fewer QualifiedIdentifier objects.
13479
13480 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13481
13482         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13483         set the correct information via SRE. This prevents
13484         hanging on the MS runtime. Fixes #29374.
13485
13486 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13487
13488         * convert.cs: correctly handle conversions to value types
13489         from Enum and ValueType as unboxing conversions.
13490
13491         Fixes bug #52569. Patch by Benjamin Jemlich.
13492
13493 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13494
13495         * expression.cs (BetterConversion): Prefer int -> uint
13496         over int -> ulong (csc's behaviour). This fixed bug #52046.
13497
13498 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13499
13500         * decl.cs (MemberCache.FindMembers): now returns a
13501         MemberInfo [].
13502
13503         * typemanager.cs: In general, go with with ^^.
13504         (CopyNewMethods): take an IList.
13505         (RealMemberLookup): Only allocate an arraylist
13506         if we copy from two sets of methods.
13507
13508         This change basically does two things:
13509         1) Fewer array lists allocated due to CopyNewMethods.
13510         2) the explicit cast in MemberList costed ALOT.
13511
13512 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13513
13514         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13515         a hashtable to avoid needless string allocations when an identifier is
13516         used more than once (the common case).
13517
13518 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13519
13520         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13521         is broken, it will not return anything. So, we
13522         have to use the information we have in mcs to
13523         do the task.
13524
13525         * typemanager.cs: Add a cache for GetInterfaces,
13526         since this will now be used more often (due to ^^)
13527
13528         (GetExplicitInterfaces) New method that gets the
13529         declared, not effective, interfaces on a type
13530         builder (eg, if you have interface IFoo, interface
13531         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13532         { IBar }.
13533
13534         This patch makes MCS able to bootstrap itself on
13535         Windows again.
13536
13537 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13538
13539         * expression.cs: Remove the Nop's that Miguel put
13540         in by mistake.
13541
13542 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13543
13544         * report.cs, codegen.cs: Give the real stack trace to
13545         the error when an exception is thrown.
13546
13547 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13548
13549         * decl.cs: only allocate hashtables for ifaces if 
13550         it is an iface!
13551
13552 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13553
13554         * expression.cs: fix the error from cs0121-2.cs
13555         (a parent interface has two child interfaces that
13556         have a function with the same name and 0 params
13557         and the function is called through the parent).
13558
13559 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13560
13561         * class.cs, rootcontext.cs, typmanager.cs: do not
13562         leak pointers.
13563
13564 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13565
13566         * codegen.cs: remove stack for the ec flow branching.
13567         It is already a linked list, so no need.
13568
13569 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13570
13571         * Makefile: Allow custom profiler here.
13572
13573 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13574
13575         * typemanager.cs (LookupType):
13576           - Use a static char [], because split takes
13577             a param array for args, so it was allocating
13578             every time.
13579           - Do not store true in a hashtable, it boxes.
13580
13581 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13582
13583         * flowanalysis.cs: bytify common enums.
13584
13585 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13586
13587         * modifiers.cs: Add a new set of flags for the
13588         flags allowed on explicit interface impls.
13589         * cs-parser.jay: catch the use of modifiers in
13590         interfaces correctly.
13591         * class.cs: catch private void IFoo.Blah ().
13592
13593         All related to bug #50572.
13594
13595 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13596
13597         * decl.cs: Rewrite the consistant accessability checking.
13598         Accessability is not linear, it must be implemented in
13599         a tableish way. Fixes #49704.
13600
13601 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13602
13603         * expression.cs: Handle negation in a checked context.
13604         We must use subtraction from zero. Fixes #38674.
13605
13606 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13607
13608         * class.cs: Ignore static void main in DLLs.
13609         * rootcontext.cs: Handle the target type here,
13610         since we are have to access it from class.cs
13611         * driver.cs: account for the above.
13612
13613 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13614
13615         * report.cs: Give line numbers and files if available.
13616
13617 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13618
13619         * driver.cs: Implement /addmodule.
13620
13621         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13622         ModuleBuilders.
13623
13624 2003-12-20  Martin Baulig  <martin@ximian.com>
13625
13626         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13627         (FieldBase.IsAssigned): Removed this field.
13628         (FieldBase.SetAssigned): New public method.
13629         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13630
13631 2003-12-20  Martin Baulig  <martin@ximian.com>
13632
13633         * expression.cs (LocalVariableReference.DoResolve): Don't set
13634         `vi.Used' if we're called from DoResolveLValue().
13635
13636         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13637         returns the usage vector it just merged into the current one -
13638         pass this one to UsageWarning().
13639         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13640         of the `EmitContext', don't call this recursively on our children.
13641
13642 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13643
13644         * driver.cs: Implement /target:module.
13645
13646 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13647
13648         * support.cs (CharArrayHashtable): New helper class.
13649
13650         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13651         char arrays, not strings, so we can avoid creating a string in
13652         consume_identifier if the identifier is a keyword.
13653
13654 2003-12-16  Martin Baulig  <martin@ximian.com>
13655
13656         * statement.cs (LocalInfo.Assigned): Removed this property.
13657         (LocalInfo.Flags): Removed `Assigned'.
13658         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13659         and uses flow analysis.
13660         (Block.UsageWarning): Made this method private.
13661         (Block.Resolve): Call UsageWarning() if appropriate.
13662
13663         * expression.cs (LocalVariableReference.DoResolve): Always set
13664         LocalInfo.Used here.
13665
13666 2003-12-13  Martin Baulig  <martin@ximian.com>
13667
13668         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13669         any value here; we're now using flow analysis to figure out
13670         whether a statement/block returns a value.
13671
13672 2003-12-13  Martin Baulig  <martin@ximian.com>
13673
13674         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13675         working again.
13676         (FlowBranching.MergeFinally): Don't call
13677         `branching.CheckOutParameters()' here, this is called in
13678         MergeTopBlock().
13679         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13680         when adding the `finally' vector.       
13681
13682 2003-12-13  Martin Baulig  <martin@ximian.com>
13683
13684         * flowanalysis.cs
13685         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13686         actually work and also fix #48962.
13687
13688 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13689
13690         * decl.cs: Do not check System.Object for nested types,
13691         since we know it does not have any. Big bang for buck:
13692
13693         BEFORE:
13694            Run 1:   8.35 seconds
13695            Run 2:   8.32 seconds
13696            corlib:  17.99 seconds
13697         AFTER:
13698            Run 1:   8.17 seconds
13699            Run 2:   8.17 seconds
13700            corlib:  17.39 seconds
13701
13702 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13703
13704         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13705         time we are returning 0 members, so we save alot here.
13706
13707 2003-12-11  Martin Baulig  <martin@ximian.com>
13708
13709         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13710         `MergeChild()', also just take the `FlowBranching' as argument;
13711         call Merge() on it and return the result.
13712         (FlowBranching.Merge): We don't need to do anything if we just
13713         have one sibling.
13714
13715 2003-12-11  Martin Baulig  <martin@ximian.com>
13716
13717         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13718         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13719         Maurer for this idea.
13720
13721 2003-12-11  Martin Baulig  <martin@ximian.com>
13722
13723         * flowanalysis.cs (MergeResult): This class is now gone; we now
13724         use the `UsageVector' for this.  The reason for this is that if a
13725         branching just has one sibling, we don't need to "merge" them at
13726         all - that's the next step to do.
13727         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13728         `MergeResult'.
13729
13730 2003-12-11  Martin Baulig  <martin@ximian.com>
13731
13732         Reworked flow analyis and made it more precise and bug-free.  The
13733         most important change is that we're now using a special `Reachability'
13734         class instead of having "magic" meanings of `FlowReturns'.  I'll
13735         do some more cleanups and optimizations and also add some more
13736         documentation this week.
13737
13738         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13739         largely reworked this class.
13740         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13741         the new `Reachability' class instead of having "magic" values here.
13742         (FlowBranching): We're now using an instance of `Reachability'
13743         instead of having separate `Returns', `Breaks' etc. fields.
13744
13745         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13746         based on flow analysis; ignore the return value of block.Emit ().
13747
13748 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13749
13750         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13751         if they are private.
13752
13753 2003-12-09  Martin Baulig  <martin@ximian.com>
13754
13755         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13756         call them directly on the UsageVector.
13757
13758 2003-12-09  Martin Baulig  <martin@ximian.com>
13759
13760         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13761         Changed return type from `FlowReturns' to `Reachability'.
13762
13763 2003-12-09  Martin Baulig  <martin@ximian.com>
13764
13765         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13766         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13767         `Reachable' fields with a single `Reachability' one.
13768
13769 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13770
13771         * class.cs (FindMembers): Remove foreach's.
13772
13773         Bootstrap times:
13774
13775         BEFORE
13776                 Run 1:   8.74 seconds
13777                 Run 2:   8.71 seconds
13778
13779         AFTER
13780                 Run 1:   8.64 seconds
13781                 Run 2:   8.58 seconds
13782
13783
13784 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13785
13786         * cs-parser.jay:
13787         * gen-treedump.cs:
13788         * statement.cs:
13789         This patch does a few things:
13790                 1. EmptyStatement is now a singleton, so it is never reallocated.
13791                 2. All blah is EmptyStatement constructs have been changed to
13792                    blah == EmptyStatement.Value, which is much faster and valid
13793                    now that EmptyStatement is a singleton.
13794                 3. When resolving a block, rather than allocating a new array for
13795                    the non-empty statements, empty statements are replaced with
13796                    EmptyStatement.Value
13797                 4. Some recursive functions have been made non-recursive.
13798         Mainly the performance impact is from (3), however (1) and (2) are needed for
13799         this to work. (4) does not make a big difference in normal situations, however
13800         it makes the profile look saner.
13801
13802         Bootstrap times:
13803
13804         BEFORE
13805         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13806         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13807         Total memory allocated: 56397 KB
13808
13809         AFTER
13810         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13811         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13812         Total memory allocated: 55666 KB
13813
13814 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13815
13816         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13817         than the hashtable in a hashtable version
13818
13819         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13820         we always end up concating a string. This results in a huge perf
13821         loss, because many strings have to be tracked by the GC. In this
13822         patch, we first use a hashtable that works with two keys, so that
13823         the strings do not need to be concat'ed.
13824
13825         Bootstrap times:
13826         BEFORE
13827                 Run 1:   8.74 seconds
13828                 Run 2:   8.71 seconds
13829
13830         AFTER
13831                 Run 1:   8.65 seconds
13832                 Run 2:   8.56 seconds
13833
13834 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13835
13836         * Makefile: Add a new target `do-time' that does a quick and simple
13837         profile, leaving easy to parse output.
13838
13839 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13840
13841         * codegen.cs (Init): Create the dynamic assembly with 
13842         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13843
13844 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13845
13846         * support.cs: Make the PtrHashtable use only one
13847         instance of its comparer.
13848
13849 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13850
13851         * typemanager.cs: Fix lookup of GetNamespaces.
13852
13853 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13854
13855         * expression.cs: Removed redundant line.
13856
13857         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13858         ArrayLists, use for loops with bounds.  
13859
13860         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13861         arraylist.
13862
13863         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13864         arraylists, use for loop with bounds.
13865
13866         The above three changes give us a 0.071 second performance
13867         improvement out of 3.294 seconds down to 3.223.  On my machine
13868         the above changes reduced the memory usage by 1,387 KB during
13869         compiler bootstrap.
13870
13871         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13872         QualifiedIdentifiers.  Before we created a new string through
13873         concatenation, and mostly later on, the result would be
13874         manipulated by DecomposeQI through string manipulation.
13875
13876         This reduced the compiler memory usage for bootstrapping from
13877         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13878         compile times in 0.05 seconds.
13879
13880 2003-11-28  Dick Porter  <dick@ximian.com>
13881
13882         * support.cs: Do string compares with the Invariant culture.
13883
13884         * rootcontext.cs: 
13885         * gen-treedump.cs: 
13886         * expression.cs: 
13887         * driver.cs: 
13888         * decl.cs: 
13889         * codegen.cs: 
13890         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13891         the comparison is done with the Invariant culture.
13892
13893 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13894
13895         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13896         GetEnumerator method.
13897
13898         (ProbeCollectionType): Iterate starting at the most specific type
13899         upwards looking for a GetEnumerator
13900
13901         * expression.cs: Shift count can be up to 31 for int/uint and 63
13902         for long/ulong.
13903
13904 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13905
13906         * statement.cs (Block.LookupLabel): Also look for the label on the
13907         children blocks.  Use a hash table to keep track of visited
13908         nodes. 
13909
13910         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13911         we actually did transform the other operand, otherwise fall back
13912         to the common codepath that casts to long.
13913
13914         * cs-tokenizer.cs: Use the same code pattern as the int case.
13915         Maybe I should do the parsing myself, and avoid depending on the
13916         Parse routines to get this done.
13917
13918 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13919
13920         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13921         which fixes bug 51347.  This time test it.
13922
13923         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13924         attributes for example can not tell the difference between these.
13925         The difference was only a syntax feature of the language. 
13926
13927         * attribute.cs: Apply attributes to delegates.
13928
13929         * delegate.cs: Call the apply attributes method.
13930
13931 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13932
13933         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13934         comparing 0 vs Byte.MinValue, not the value
13935
13936         (ImplicitConversionRequired): When reporting a conversion error,
13937         use error 31 to print out the constant error instead of the
13938         simpler 29.
13939
13940         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13941         which fixes bug 51347.
13942
13943 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13944
13945         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13946         which fixes the -warnaserror command line option.
13947
13948 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13949
13950         * cfold.cs (DoNumericPromotions): During constant folding of
13951         additions on UIntConstant, special case intconstants with
13952         IntConstants like we do on the expression binary operator. 
13953
13954 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13955
13956         * convert.cs (ImplicitReferenceConversion): We were missing a case
13957         (System.Enum are not value types or class types, so we need to
13958         classify them separatedly).
13959
13960         * driver.cs: We do not support error 2007.
13961
13962 2003-11-12 Jackson Harper <jackson@ximian.com>
13963
13964         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13965         system directory. Also use the full file name so users can
13966         libraries names mscorlib-o-tron.dll in a non system dir.
13967
13968 2003-11-10  Martin Baulig  <martin@ximian.com>
13969
13970         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13971         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13972         calling `ResolveType()' on them, directly assign their `Type'.
13973
13974 2003-11-08  Martin Baulig  <martin@ximian.com>
13975
13976         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13977         return value and the `out parent' parameter.
13978         (TypeContainer.DefineType): Moved the CS0644 check into
13979         GetClassBases().  Don't pass the interface types to the
13980         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13981         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13982
13983         * ecore.cs (TypeExpr.IsAttribute): New property.
13984         (TypeExpr.GetInterfaces): New method.
13985
13986         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13987         TypeExpr instead of a Type.
13988         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13989         (Interface.DefineType): Don't pass the interface types to the
13990         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13991         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13992
13993         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13994         instead of a `Type[]'.
13995         (TypeManager.RegisterBuilder): Likewise.
13996         (TypeManager.AddUserInterface): Likewise.
13997         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13998         `Type[]' and also return a `TypeExpr[]'.
13999         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14000
14001 2003-11-08  Martin Baulig  <martin@ximian.com>
14002
14003         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14004         Expression.     
14005
14006 2003-11-08  Martin Baulig  <martin@ximian.com>
14007
14008         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14009         TypeManager.ResolveExpressionTypes().
14010
14011         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14012         instead of an Expression.
14013         (TypeExpr): This is now an abstract base class for `TypeExpression'.
14014         (TypeExpression): New public class; formerly known as `TypeExpr'.
14015
14016         * expression.cs (ComposedCast): Derive from TypeExpr.
14017
14018         * typemanager.cs (TypeManager.system_*_expr): These are now
14019         TypExpr's instead of Expression's.
14020         (TypeManager.ResolveExpressionTypes): New public static function;
14021         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14022         of them.        
14023
14024 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
14025
14026         * expression.cs (New.DoResolve): Do not dereference value that
14027         might be a null return.
14028
14029         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14030         sure that the constant value has the right type.  Fixes an
14031         unreported bug, similar to 50425.
14032
14033         * const.cs (Const.LookupConstantValue): Call
14034         ImplicitStandardConversionExists before doing a conversion to
14035         avoid havng the TypeManager.ChangeType do conversions.
14036
14037         Reduced the number of casts used
14038
14039         (Const.ChangeType): New routine to enable reuse of the constant
14040         type changing code from statement.
14041
14042         * typemanager.cs (ChangeType): Move common initialization to
14043         static global variables.
14044
14045         Fixes #50425.
14046
14047         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14048         every value type to go through, even if it was void.  Fix that. 
14049
14050         * cs-tokenizer.cs: Use is_identifier_start_character on the start
14051         character of the define, and the is_identifier_part_character for
14052         the rest of the string.
14053
14054 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
14055
14056         * expression.cs (UnaryMutator.EmitCode): When I updated
14057         LocalVariableReference.DoResolve, I overdid it, and dropped an
14058         optimization done on local variable references.
14059
14060 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
14061
14062         * ecore.cs: Convert the return from Ldlen into an int.
14063
14064 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
14065
14066         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14067         the accessibility, this is a special case for toplevel non-public
14068         classes (internal for instance).
14069
14070 2003-10-20  Nick Drochak <ndrochak@gol.com>
14071
14072         * ecore.cs: Fix typo and build.  Needed another right paren.
14073
14074 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
14075
14076         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
14077         `internal' case regular and protected, but not allowing protected
14078         to be evaluated later.  Bug 49840
14079
14080 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
14081
14082         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14083         to kb.Nlast, and not the kb.nFirst to isolate the switch
14084         statement.
14085
14086         Extract the underlying type, so enumerations of long/ulong are
14087         treated like long/ulong.
14088
14089 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14090
14091         * expression.cs (New): Overload the meaning of RequestedType to
14092         track the possible creation of the NewDelegate type, since
14093         DoResolve is invoked more than once for new constructors on field
14094         initialization.
14095
14096         See bugs: #48800 and #37014
14097
14098         * cs-parser.jay (declare_local_constants): Take an arraylist
14099         instead of a single constant.
14100
14101         (local_constant_declaration): It should take a
14102         constant_declarators, not a constant_declarator.  Fixes 49487
14103
14104         * convert.cs: Fix error report.
14105
14106 2003-10-13 Jackson Harper <jackson@ximian.com>
14107
14108         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14109         bug #49611
14110
14111 2003-10-09  Martin Baulig  <martin@ximian.com>
14112
14113         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14114         to the .ctor.
14115         (MethodCore.DoDefineParameters): Removed the TypeContainer
14116         argument; use the DeclSpace which was passed to the .ctor instead.
14117         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14118         TypeContainer; we only need a DeclSpace here.
14119
14120 2003-10-09  Martin Baulig  <martin@ximian.com>
14121
14122         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14123         to the .ctor.
14124         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14125         EmitContext's .ctor.    
14126
14127 2003-10-09  Martin Baulig  <martin@ximian.com>
14128
14129         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14130         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14131         AsAccessible(), moved them as well.
14132
14133         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14134
14135 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14136
14137         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14138
14139 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14140
14141         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14142         generation for >=, as spotted by Paolo, bug 48679.  
14143         Patch from David Waite.
14144
14145         * cs-tokenizer.cs: Add handling for #pragma.
14146
14147         * cs-parser.jay: Allow for both yield and yield return in the
14148         syntax.  The anti-cobolization of C# fight will go on!
14149
14150         * class.cs (TypeBuilder.DefineType): Catch error condition here
14151         (Parent.DefineType erroring out and returning null).
14152
14153         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14154         coping with enumerations variables, we were mistakenly processing
14155         them as a regular value type instead of built-in types.  Fixes the
14156         bug #48063
14157
14158         * typemanager.cs (IsBuiltinOrEnum): New method.
14159
14160 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14161
14162         * cs-parser.jay: Upgrade: yield now needs the return clause.
14163
14164 2003-09-19  Martin Baulig  <martin@ximian.com>
14165
14166         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14167         `MemberCache parent' argument.  Normally, an interface doesn't
14168         have a parent type except System.Object, but we use this in gmcs
14169         for generic type parameters.
14170
14171 2003-09-18  Martin Baulig  <martin@ximian.com>
14172
14173         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14174         on `type.IsInterface'; don't check whether the type has a parent
14175         to determine whether it's an interface.
14176
14177 2003-09-15  Martin Baulig  <martin@ximian.com>
14178
14179         * class.cs (TypeContainer.DefineType): Added an error flag to
14180         avoid reporting duplicate CS0146's ("class definition is
14181         circular.").
14182
14183         * driver.cs (Driver.MainDriver): Abort if
14184         RootContext.ResolveTree() reported any errors.
14185
14186 2003-09-07  Martin Baulig  <martin@ximian.com>
14187
14188         * report.cs (Error, Warning): Added overloaded versions which take
14189         a `params object[] args' and call String.Format().
14190
14191 2003-09-07  Martin Baulig  <martin@ximian.com>
14192
14193         * decl.cs (DeclSpace..ctor): Don't call
14194         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14195         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14196         (DeclSpace.RecordDecl): New method.
14197
14198         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14199
14200 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14201
14202         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14203         value attributes to be applied to ParameterBuilders.
14204
14205         * class.cs (MethodCore.LabelParameters): Make static and more
14206         generic so that it can be used from other places - like interface
14207         methods, for instance.
14208
14209         * interface.cs (Interface.Emit): Call LabelParameters before
14210         emitting attributes on the InterfaceMethod.
14211
14212 2003-08-26  Martin Baulig  <martin@ximian.com>
14213
14214         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14215         resolving aliases; fixes #47927.
14216
14217 2003-08-26  Martin Baulig  <martin@ximian.com>
14218
14219         * statement.cs (Using.DoResolve): This is internally emitting a
14220         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14221         do not always return.  Fixes #47681.
14222
14223 2003-08-26  Martin Baulig  <martin@ximian.com>
14224
14225         * decl.cs (MemberCore): Moved WarningNotHiding(),
14226         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14227         into MemberBase.
14228         (AdditionResult): Make this nested in DeclSpace.
14229         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14230         argument; call NamespaceEntry.Define() unless we're nested in a
14231         class or struct.
14232
14233         * namespace.cs (Namespace.DefineName): New public function.  This
14234         is called from DeclSpace's .ctor to add 
14235         (Namespace.Lookup): Include DeclSpaces in the lookup.
14236
14237         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14238
14239         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14240
14241 2003-08-25  Martin Baulig  <martin@ximian.com>
14242
14243         * convert.cs (Convert.ExplicitReferenceConversion): When
14244         converting from an interface type to a class, unbox if the target
14245         type is a struct type.  Fixes #47822.
14246
14247 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14248
14249         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14250         #47854.
14251
14252 2003-08-22  Martin Baulig  <martin@ximian.com>
14253
14254         * class.cs (TypeManager.DefineType): When defining a nested type,
14255         call DefineType() on our parent; fixes #47801.
14256
14257 2003-08-22  Martin Baulig  <martin@ximian.com>
14258
14259         * class.cs (MethodData.Define): While checking if a method is an
14260         interface implementation, improve the test a bit more to fix #47654.
14261
14262 2003-08-22  Martin Baulig  <martin@ximian.com>
14263
14264         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14265         correctly; fixes #47722.
14266
14267 2003-08-22  Martin Baulig  <martin@ximian.com>
14268
14269         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14270         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14271
14272         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14273
14274 2003-08-22  Martin Baulig  <martin@ximian.com>
14275
14276         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14277         can only be assigned in static constructors.  Fixes #47161.
14278
14279 2003-08-22  Martin Baulig  <martin@ximian.com>
14280
14281         Rewrote and improved the flow analysis code.
14282
14283         * flowbranching.cs (FlowBranching): Make this class abstract.
14284         (FlowBranching.CreateBranching): New static function to create a
14285         new flow branching.
14286         (FlowBranchingBlock, FlowBranchingException): New classes.
14287         (FlowBranching.UsageVector.Type): New public readonly field.
14288         (FlowBranching.UsageVector.Breaks): Removed the setter.
14289         (FlowBranching.UsageVector.Returns): Removed the setter.
14290         (FlowBranching.UsageVector): Added Break(), Return(),
14291         NeverReachable() and Throw() methods to modify the reachability.
14292         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14293         done by FlowBranching.Merge().
14294         (FlowBranching.UsageVector.MergeChild): New method; merges the
14295         merge result into the current vector.
14296         (FlowBranching.Merge): New abstract method to merge a branching.
14297
14298 2003-08-12  Martin Baulig  <martin@ximian.com>
14299
14300         * expression.cs (Indirection.CacheTemporaries): Create the
14301         LocalTemporary with the pointer type, not its element type.
14302
14303 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14304
14305         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14306         token was a keyword or not.
14307
14308         Add `error' options where an IDENTIFIER was expected;  Provide
14309         CheckToken and CheckIdentifierToken convenience error reporting
14310         functions. 
14311
14312         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14313
14314         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14315         NameSpaceEntry NameSpaceEntry.
14316
14317         (LookupInterfaceOrClass): Avoid creating a full qualified name
14318         from namespace and name: avoid doing lookups when we know the
14319         namespace is non-existant.   Use new Tree.LookupByNamespace which
14320         looks up DeclSpaces based on their namespace, name pair.
14321
14322         * driver.cs: Provide a new `parser verbose' to display the
14323         exception thrown during parsing.  This is turned off by default
14324         now, so the output of a failure from mcs is more graceful.
14325
14326         * namespace.cs: Track all the namespaces defined in a hashtable
14327         for quick lookup.
14328
14329         (IsNamespace): New method
14330
14331 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14332
14333         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14334         we know that we need to concatenate (full typename can never be
14335         null). 
14336
14337         * class.cs: ditto.
14338
14339         * statement.cs: Use a bitfield;  Do not initialize to null things
14340         which are done by the constructor by default.
14341
14342         * cs-parser.jay: bug fix, parameter was 4, not 3.
14343
14344         * expression.cs: Just use the property;
14345
14346         * statement.cs: No need for GetVariableInfo method.
14347
14348 2003-08-08  Martin Baulig  <martin@ximian.com>
14349
14350         * flowanalysis.cs (FlowReturns): This is now nested in the
14351         `FlowBranching' class.
14352         (MyBitVector): Moved this here from statement.cs.
14353         (FlowBranching.SiblingType): New enum type.
14354         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14355
14356 2003-08-07  Martin Baulig  <martin@ximian.com>
14357
14358         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14359         `FlowBranching' class and called `BranchingType'.
14360
14361 2003-08-07  Martin Baulig  <martin@ximian.com>
14362
14363         * flowanalysis.cs: Moved all the control flow analysis code into
14364         its own file.
14365
14366 2003-08-07  Martin Baulig  <martin@ximian.com>
14367
14368         * assign.cs (Assign.DoResolve): `target' must either be an
14369         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14370         #37319.
14371
14372 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14373
14374         * expression.cs (BinaryMethod): This kind of expression is created by the
14375         Binary class if it determines that the operator has to be handled
14376         by a method.
14377
14378         (BinaryDelegate): This kind of expression is created if we are
14379         dealing with a + or - operator on delegates.
14380
14381         (Binary): remove method, argumetns, and DelegateOperator: when
14382         dealing with methods, 
14383
14384         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14385
14386         * statement.cs (Block): use bitfields for the three extra booleans
14387         we had in use.   Remove unused topblock parameter.
14388
14389         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14390
14391         * assign.cs: Drop extra unneeded tests.
14392
14393 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14394
14395         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14396
14397         * statement.cs (Foreach): Use VariableStorage instead of
14398         LocalBuilders.   
14399
14400         * codegen.cs (VariableStorage): New class used by clients that
14401         require a variable stored: locals or fields for variables that
14402         need to live across yield.
14403
14404         Maybe provide a convenience api for EmitThis+EmitLoad?
14405
14406         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14407         these bad boys.
14408
14409 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14410
14411         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14412         RemapParameterLValue): New methods that are used to turn a
14413         precomputed FieldInfo into an expression like this:
14414
14415                 instance.FieldInfo
14416
14417         The idea is to use this instead of making LocalVariableReference
14418         have more than one meaning.
14419
14420         * cs-parser.jay: Add error production to BASE.
14421
14422         * ecore.cs: Deal with TypeManager.GetField returning null, which
14423         is now a valid return value.
14424
14425         (FieldExprNoAddress): New expression for Fields whose address can
14426         not be taken.
14427
14428         * expression.cs (LocalVariableReference): During the resolve
14429         phases, create new expressions if we are in a remapping context.
14430         Remove code that dealt with remapping here.
14431
14432         (ParameterReference): same.
14433
14434         (ProxyInstance): New expression, like the `This' expression, but
14435         it is born fully resolved.  We know what we are doing, so remove
14436         the errors that are targeted to user-provided uses of `this'.
14437
14438         * statement.cs (Foreach): our variable is now stored as an
14439         Expression;  During resolution, follow the protocol, dont just
14440         assume it will return this.
14441
14442 2003-08-06  Martin Baulig  <martin@ximian.com>
14443
14444         * support.cs (SeekableStreamReader.cs): New public class.
14445
14446         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14447         SeekableStreamReader instead of the normal StreamReader.
14448
14449 2003-08-04  Martin Baulig  <martin@ximian.com>
14450
14451         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14452         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14453         deambiguate casts and delegate invocations.
14454         (parenthesized_expression): Use the new tokens to ensure this is
14455         not a cast of method invocation.
14456
14457         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14458         when reading a `)' and Deambiguate_CloseParens () was previously
14459         called.
14460
14461         * expression.cs (ParenthesizedExpression): New class.  This is
14462         just used for the CS0075 test.
14463         (Binary.DoResolve): Check for CS0075.   
14464
14465 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14466
14467         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14468         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14469         reference comparison.
14470
14471         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14472         examine the ReturnType for equality - this is necessary in the
14473         cases of implicit and explicit operators whose signature also
14474         includes the return type.
14475
14476 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14477
14478         * namespace.cs: Cache the result of the namespace computation,
14479         instead of computing it every time.
14480
14481 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14482
14483         * decl.cs: Use a global arraylist that we reuse over invocations
14484         to avoid excesive memory consumption.  Reduces memory usage on an
14485         mcs compile by one meg (45 average).
14486
14487         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14488         private, work around that.
14489
14490 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * literal.cs (IntLiteral): Define Zero and One static literals. 
14493
14494         * cs-parser.jay (integer_literal): use static literals to reduce
14495         memory usage for the most used literals (0, 1 and -1).  211kb
14496         reduced in memory usage.
14497
14498         Replace all calls to `new ArrayList' with `new
14499         ArrayList(4)' which is a good average number for most allocations,
14500         and also requires only 16 bytes of memory for its buffer by
14501         default. 
14502
14503         This reduced MCS memory usage in seven megabytes for the RSS after
14504         bootstrapping.
14505
14506 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14507
14508         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14509         handle params methods the correct way by forming only one
14510         applicable set with params and normal methods in them. Earlier we
14511         were looking at params methods only if we found no normal methods
14512         which was not the correct thing to do.
14513
14514         (Invocation.BetterFunction): Take separate arguments indicating
14515         when candidate and the best method are params methods in their
14516         expanded form.
14517
14518         This fixes bugs #43367 and #46199.
14519
14520         * attribute.cs: Documentation updates.
14521
14522         (CheckAttribute): Rename to CheckAttributeTarget.
14523         (GetValidPlaces): Rename to GetValidTargets.
14524
14525         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14526         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14527
14528         Fixes bug #44468.
14529
14530 2003-07-28  Martin Baulig  <martin@ximian.com>
14531
14532         * class.cs (TypeContainer.DefineMembers): Use the base type's full
14533         name when looking up the base class of a nested class.  Fixes #46977.
14534
14535 2003-07-26  Martin Baulig  <martin@ximian.com>
14536
14537         * expression.cs (Indexers.Indexer): New nested struct; contains
14538         getter, setter and the indexer's type.
14539         (Indexers.Properties): This is now an ArrayList of
14540         Indexers.Indexer's.
14541         (IndexerAccess.DoResolveLValue): Correctly set the type if the
14542         indexer doesn't have any getters.
14543
14544         * assign.cs (Assign.DoResolve): Also do the implicit conversions
14545         for embedded property and indexer assignments.
14546
14547 2003-07-26  Martin Baulig  <martin@ximian.com>
14548
14549         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
14550         preprocessor directive is not the first non-whitespace character
14551         on a line.
14552
14553 2003-07-26  Martin Baulig  <martin@ximian.com>
14554
14555         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
14556         namespace parsing, follow the spec more closely.
14557
14558         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
14559         NamespaceEntry.Lookup().
14560
14561 2003-07-25  Martin Baulig  <martin@ximian.com>
14562
14563         * MethodCore.cs (OverridesSomething): New public field; it's set
14564         from TypeContainer.DefineMembers if this method overrides
14565         something (which doesn't need to be a method).  Fix #39462.
14566
14567 2003-07-25  Ravi Pratap  <ravi@ximian.com>
14568
14569         * typemanager.cs (GetMembers): Ensure that the list of members is
14570         reversed. This keeps things in sync.
14571
14572         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
14573         find an AttributeUsage attribute.
14574
14575         * expression.cs (Invocation.OverloadResolve): Perform the check
14576         which disallows Invoke to be directly called on a Delegate.
14577
14578         (Error_InvokeOnDelegate): Report error cs1533.
14579
14580 2003-07-25  Martin Baulig  <martin@ximian.com>
14581
14582         * expression.cs (Indexers.GetIndexersForType): Only look in the
14583         interface hierarchy if the requested type is already an
14584         interface.  Fixes #46788 while keeping #46502 fixed.
14585
14586 2003-07-25  Martin Baulig  <martin@ximian.com>
14587
14588         * class.cs (TypeContainer.DefineMembers): Check whether all
14589         readonly fields have been assigned and report warning CS0649 if
14590         not.
14591
14592         * statement.cs (LocalInfo.IsFixed): Always return true if this is
14593         a valuetype.
14594
14595 2003-07-24  Ravi Pratap  <ravi@ximian.com>
14596
14597         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
14598         returned from GetMethods to make things consistent with the
14599         assumptions MCS makes about ordering of methods.
14600
14601         This should comprehensively fix bug #45127 and it does :-)
14602
14603         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
14604         ordering is actually reverse.
14605
14606         * Clean up some debug messages I left lying around.
14607
14608         * interface.cs (Populate*): Get rid of code which emits attributes
14609         since the stage in which we emit attributes is the 'Emit' stage,
14610         not the define stage.
14611
14612         (Emit): Move attribute emission for interface members here.
14613
14614 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14615
14616         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14617         closely: we eliminate methods in base types when we have an
14618         applicable method in a top-level type.
14619
14620         Please see section 14.5.5.1 for an exact description of what goes
14621         on. 
14622
14623         This fixes bug #45127 and a host of other related to corlib compilation.
14624
14625         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14626         array is the method corresponding to the top-level type (this is
14627         because of the changes made to icall.c) so we change this
14628         accordingly.
14629
14630         (MethodGroupExpr.Name): This too.
14631
14632         * typemanager.cs (GetElementType): New method which does the right
14633         thing when compiling corlib. 
14634
14635         * everywhere: Make use of the above in the relevant places.
14636
14637 2003-07-22  Martin Baulig  <martin@ximian.com>
14638
14639         * cs-parser.jay (invocation_expression): Moved
14640         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14641         `cast_expression', but create a InvocationOrCast which later
14642         resolves to either an Invocation or a Cast.
14643
14644         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14645         method; call this before EmitStatement() to make sure that this
14646         expression can be used as a statement.
14647
14648         * expression.cs (InvocationOrCast): New class; resolves to either
14649         an Invocation or a Cast.
14650
14651         * statement.cs (StatementExpression): Call ResolveStatement() on
14652         the ExpressionStatement before emitting it.
14653
14654 2003-07-21  Martin Baulig  <martin@ximian.com>
14655
14656         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14657         `ref' and `out' attributes match; fixes #46220.
14658         (MemberAccess.ResolveMemberAccess): You can't reference a type
14659         through an expression; fixes #33180.
14660         (Indexers.GetIndexersForType): Don't return the indexers from
14661         interfaces the class implements; fixes #46502.
14662
14663 2003-07-21  Martin Baulig  <martin@ximian.com>
14664
14665         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14666         CS0661 checks; fixes bug #30442.
14667
14668 2003-07-21  Martin Baulig  <martin@ximian.com>
14669
14670         * decl.cs (AdditionResult): Added `Error'.
14671
14672         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14673
14674         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14675         makes cs0031.cs actually work.
14676
14677 2003-07-20  Martin Baulig  <martin@ximian.com>
14678
14679         * namespace.cs: Fixed that bug which caused a crash when compiling
14680         the debugger's GUI.
14681
14682 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14683
14684         * typemanager.cs (LookupTypeReflection): Never expose types which
14685         are NotPublic, NestedPrivate, NestedAssembly, or
14686         NestedFamANDAssem.  We used to return these, and later do a check
14687         that would report a meaningful error, but the problem is that we
14688         would not get the real match, if there was a name override.
14689
14690 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14691
14692         * namespace.cs (Namespace, Name): Do not compute the namespace
14693         name dynamically, compute it in the constructor.  This reduced
14694         memory usage by 1697 KB.
14695
14696         * driver.cs: Use --pause to pause at the end.
14697
14698 2003-07-17  Peter Williams  <peter@newton.cx>
14699
14700         * Makefile: Change the name of the test target so that it doesn't
14701         conflict with the recursive test target.
14702
14703 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14704
14705         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14706         AddressOf): Do not use EmitThis, that was wrong, use the actual
14707         this pointer.
14708
14709 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14710
14711         * class.cs (MethodData.Define): While checking if a method is an
14712         interface implementation, improve the test: If we are not public
14713         (use new test here: use the computed MethodAttributes directly,
14714         instead of the parsed modifier flags) check if the `implementing'
14715         method comes from an interface or not.
14716
14717         * pending.cs (VerifyPendingMethods): Slightly better error
14718         message.
14719
14720         * makefile: add test target that does the mcs bootstrap.
14721
14722 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14723
14724         * interface.cs (Define): Do nothing here since there are no
14725         members to populate etc. Move the attribute emission out of here
14726         since this was just totally the wrong place to put it. Attribute
14727         application happens during the 'Emit' phase, not in the 'Define'
14728         phase.
14729
14730         (Emit): Add this method and move the attribute emission here
14731
14732         * rootcontext.cs (EmitCode): Call the Emit method on interface
14733         types too.
14734
14735 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14736
14737         * expression.cs (OverloadResolve): Report error only if Location
14738         is not 'Null' which means that there was a probe going on.
14739
14740 2003-07-14  Martin Baulig  <martin@ximian.com>
14741
14742         * expression.cs (ConditionalLogicalOperator): New public class to
14743         implement user defined conditional logical operators.
14744         This is section 14.11.2 in the spec and bug #40505.
14745
14746 2003-07-14  Martin Baulig  <martin@ximian.com>
14747
14748         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14749
14750 2003-07-14  Martin Baulig  <martin@ximian.com>
14751
14752         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14753
14754         * ecore.cs (IVariable.VerifyFixed): New interface method.
14755
14756         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14757         operator, check whether the variable is actually fixed.  Fixes bug
14758         #36055.  Set a variable definitely assigned when taking its
14759         address as required by the spec.
14760
14761         * statement.cs (LocalInfo.IsFixed): New field.
14762         (LocalInfo.MakePinned): Set `IsFixed' to true.
14763
14764 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14765
14766         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14767         for .ctors, ensure that we only ask for members declared in the
14768         attribute type (BindingFlags.DeclaredOnly).
14769
14770         Fixes bug #43632.
14771
14772         * expression.cs (Error_WrongNumArguments): Report error 1501
14773         correctly the way CSC does.
14774
14775 2003-07-13  Martin Baulig  <martin@ximian.com>
14776
14777         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14778         lookup on the fully qualified name, to make things like "X.X" work
14779         where "X.X" is a fully qualified type name, but we also have a
14780         namespace "X" in the using list.  Fixes #41975.
14781
14782 2003-07-13  Martin Baulig  <martin@ximian.com>
14783
14784         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14785         function. If we're a CompoundAssign, we need to create an embedded
14786         CompoundAssign, not an embedded Assign.
14787         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14788         Fixes #45854.
14789
14790 2003-07-13  Martin Baulig  <martin@ximian.com>
14791
14792         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14793         work to fix bug #46088.
14794
14795 2003-07-13  Ravi Pratap <ravi@ximian.com>
14796
14797         * class.cs (Operator.Emit): Do not emit attributes here - it is
14798         taken care of by the Method class that we delegate too. This takes
14799         care of bug #45876.
14800
14801 2003-07-10  Martin Baulig  <martin@ximian.com>
14802
14803         * expression.cs (TypeOfVoid): New class.
14804         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14805
14806 2003-07-10  Martin Baulig  <martin@ximian.com>
14807
14808         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14809         bug #35957.
14810
14811 2003-07-10  Martin Baulig  <martin@ximian.com>
14812
14813         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14814         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14815
14816         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14817
14818         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14819
14820 2003-07-10  Martin Baulig  <martin@ximian.com>
14821
14822         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14823         of decimal.  Fixes #42850.
14824
14825         NOTE: I also fixed the created byte blob, but this doesn't work on
14826         the MS runtime and csc never produces any byte blobs for decimal
14827         arrays.
14828
14829 2003-07-10  Martin Baulig  <martin@ximian.com>
14830
14831         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14832         structs; fixes #32068.
14833         (Block.AddChildVariableNames): Fixed #44302.
14834
14835 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14836
14837         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14838
14839 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14840
14841         * attribute.cs: And this test is onger needed.
14842
14843 2003-07-08  Martin Baulig  <martin@ximian.com>
14844
14845         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14846         inaccessible types.  Fixes #36313.
14847
14848         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14849
14850         * namespace.cs (NamespaceEntry): Create implicit entries for all
14851         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14852         implicit entries for N1.N2 and N1.
14853
14854 2003-07-08  Martin Baulig  <martin@ximian.com>
14855
14856         Rewrote the handling of namespaces to fix a lot of the issues
14857         wrt. `using' aliases etc.
14858
14859         * namespace.cs (Namespace): Splitted this class into a
14860         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14861
14862         * typemanager.cs (TypeManager.IsNamespace): Removed.
14863         (TypeManager.ComputeNamespaces): Only compute namespaces from
14864         loaded assemblies here, not the namespaces from the assembly we're
14865         currently compiling.
14866
14867 2003-07-08  Martin Baulig  <martin@ximian.com>
14868
14869         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14870
14871 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14872
14873         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14874         already fixed it.  
14875
14876         I thought about the memory savings here, but LookupTypeReflection
14877         is used under already very constrained scenarios.  Compiling
14878         corlib or mcs only exposes one hit, so it would not really reduce
14879         any memory consumption.
14880
14881 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14882
14883         * typemanager.cs: fixes bug #45889 by only adding public types from
14884         other assemblies to the list of known types.
14885
14886 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14887
14888         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14889         on the type we resolved.
14890
14891 2003-07-05  Martin Baulig  <martin@ximian.com>
14892
14893         * pending.cs (PendingImplementation.ParentImplements): Don't
14894         create the proxy if the parent is abstract.
14895
14896         * class.cs (TypeContainer.DefineIndexers): Process explicit
14897         interface implementations first.  Fixes #37714.
14898
14899 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14900
14901         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14902         defined recursively;  but since we modify the input parameters
14903         (left is set to `this' temporarily), we reset this value if the
14904         left_is_explicit is false, which gives the original semantics to
14905         the code.  
14906
14907         * literal.cs (NullPointer): new class used to represent a null
14908         literal in a pointer context.
14909
14910         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14911         type is a pointer, use a NullPointer object instead of a
14912         NullLiteral.   Closes 43687
14913
14914         (ExplicitConversion): Convert pointer values using
14915         the conv opcode to the proper type.
14916
14917         * ecore.cs (New): change ValueTypeVariable property into a method,
14918         that returns whether the valuetype is suitable for being used.
14919
14920         * expression.cs (Binary.DoNumericPromotions): Only return if we
14921         the int constant was a valid uint, and we can return both left and
14922         right as uints.  If not, we continue processing, to trigger the
14923         type conversion.  This fixes 39018.
14924
14925         * statement.cs (Block.EmitMeta): During constant resolution, set
14926         the CurrentBlock property on the emitcontext, so that we resolve
14927         constants propertly.
14928
14929 2003-07-02  Martin Baulig  <martin@ximian.com>
14930
14931         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14932         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14933
14934         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14935         than emitting it here.
14936
14937         * statement.cs: Fixed some more flow analysis bugs.
14938
14939 2003-07-02  Martin Baulig  <martin@ximian.com>
14940
14941         * class.cs (MethodData.Define): When implementing interface
14942         methods, set Final unless we're Virtual.
14943
14944         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14945         check work for interface methods.
14946
14947 2003-07-01  Martin Baulig  <martin@ximian.com>
14948
14949         * ecore.cs (EmitContext.This): Replaced this property with a
14950         GetThis() method which takes a Location argument.  This ensures
14951         that we get the correct error location for a CS0188.
14952
14953 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14954
14955         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14956         ImplicitStandardConversion.
14957
14958         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14959
14960 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14961
14962         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14963         optimization.
14964
14965 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14966
14967         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14968         constructors.
14969
14970         (MethodData.Define): Turn off initlocals for unsafe methods.
14971
14972 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14973
14974         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14975         complete;  Fixes #37521.
14976
14977         * delegate.cs: Use Modifiers.TypeAttr to compute the
14978         TypeAttributes, instead of rolling our own.  This makes the flags
14979         correct for the delegates.
14980
14981 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14982
14983         * class.cs (Constructor.Define): Set the private flag for static
14984         constructors as well.
14985
14986         * cs-parser.jay (statement_expression): Set the return value to
14987         null, to avoid a crash when we catch an error.
14988
14989 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14990
14991         * cs-parser.jay: Applied patch from Jackson that adds support for
14992         extern and unsafe modifiers to destructor declarations.
14993
14994         * expression.cs: Report error 21 if the user is trying to index a
14995         System.Array.
14996
14997         * driver.cs: Add an error message, suggested by the bug report.
14998
14999         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15000         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15001
15002 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15003
15004         * namespace.cs: Add some information to reduce FAQs.
15005
15006 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15007
15008         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15009         underlying enumeration types.  Fixes #43915.
15010
15011         * expression.cs: Treat ushort/short as legal values to be used in
15012         bitwise operations.
15013
15014 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15015
15016         * delegate.cs: transfer custom attributes for paramenters from
15017         the delegate declaration to Invoke and BeginInvoke.
15018
15019 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15020
15021         * attribute.cs: handle custom marshalers and emit marshal info
15022         for fields, too.
15023
15024 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15025
15026         * makefile.gnu: Added anonymous.cs to the compiler sources.
15027
15028 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15029
15030         * iterators.cs: Change the name of the proxy class to include two
15031         underscores.
15032
15033         * cs-parser.jay: Update grammar to include anonymous methods.
15034
15035         * anonymous.cs: new file.
15036
15037 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15038
15039         * class.cs (Field.Define): Add missing test for pointers and
15040         safety. 
15041
15042 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15043
15044         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15045         we use the stobj opcode.
15046
15047         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15048         since it wasn't the correct fix. 
15049
15050         It still is puzzling that we are required to use stobj for IntPtr
15051         which seems to be a ValueType.
15052
15053 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15056         during regular simple name resolution.   Now, the trick is that
15057         instead of returning for processing the simplename, we do a
15058         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15059         contextual lookup type).   If a match is found, return that, if
15060         not, return for further composition.
15061
15062         This fixes long-standing 30485.
15063
15064         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15065         using the address to initialize an object, do an Stobj instead of
15066         using the regular Stelem.
15067
15068         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15069         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15070         Because if we are a BaseIndexerAccess that value will be true.
15071         Fixes 43643.
15072
15073         * statement.cs (GotoCase.Resolve): Return after reporting an
15074         error, do not attempt to continue. 
15075
15076         * expression.cs (PointerArithmetic.Emit): If our operand is a
15077         long, convert our constants to match the operand before
15078         multiplying.  Convert to I type before adding.   Fixes 43670.
15079
15080 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15081
15082         * enum.cs (ImplicitConversionExists) : Rename to
15083         ImplicitEnumConversionExists to remove ambiguity. 
15084
15085         * ecore.cs (NullCast): New type of cast expression class which
15086         basically is very similar to EmptyCast with the difference being
15087         it still is a constant since it is used only to cast a null to
15088         something else
15089         (eg. (string) null)
15090
15091         * convert.cs (ImplicitReferenceConversion): When casting a null
15092         literal, we return a NullCast.
15093
15094         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15095         should be around anymore.
15096
15097         The renaming (reported was slightly wrong). Corrections:
15098
15099         ConvertImplicitStandard -> ImplicitConversionStandard
15100         ConvertExplicitStandard -> ExplicitConversionStandard
15101
15102         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15103         before passing them in !
15104
15105         * convert.cs (ImplicitConversionStandard): When comparing for
15106         equal expr and target types, ensure that expr is not a
15107         NullLiteral.
15108
15109         In general, we must not be checking (expr_type ==
15110         target_type) in the top level conversion methods
15111         (ImplicitConversion, ExplicitConversion etc). This checking is
15112         done in the methods that they delegate to.
15113
15114 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15115
15116         * convert.cs: Move Error_CannotConvertType,
15117         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15118         ImplicitNumericConversion, ImplicitConversionExists,
15119         ImplicitUserConversionExists, StandardConversionExists,
15120         FindMostEncompassedType, FindMostSpecificSource,
15121         FindMostSpecificTarget, ImplicitUserConversion,
15122         ExplicitUserConversion, GetConversionOperators,
15123         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15124         TryImplicitIntConversion, Error_CannotConvertImplicit,
15125         ConvertImplicitRequired, ConvertNumericExplicit,
15126         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15127         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15128         its own file.
15129
15130         Perform the following renames:
15131
15132         StandardConversionExists -> ImplicitStandardConversionExists
15133         ConvertImplicit -> ImplicitConversion
15134         ConvertImplicitStandard -> ImplicitStandardConversion
15135         TryImplicitIntConversion -> ImplicitIntConversion
15136         ConvertImplicitRequired -> ImplicitConversionRequired
15137         ConvertNumericExplicit -> ExplicitNumericConversion
15138         ConvertReferenceExplicit -> ExplicitReferenceConversion
15139         ConvertExplicit -> ExplicitConversion
15140         ConvertExplicitStandard -> ExplicitStandardConversion
15141
15142 2003-05-19  Martin Baulig  <martin@ximian.com>
15143
15144         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15145         (TypeInfo): Added support for structs having structs as fields.
15146
15147         * ecore.cs (FieldExpr): Implement IVariable.
15148         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15149         VariableInfo for the field.
15150
15151 2003-05-18  Martin Baulig  <martin@ximian.com>
15152
15153         * expression.cs (This.DoResolve): Report a CS0027 if we're
15154         emitting a field initializer.
15155
15156 2003-05-18  Martin Baulig  <martin@ximian.com>
15157
15158         * expression.cs (This.ResolveBase): New public function.
15159         (This.DoResolve): Check for CS0188.
15160
15161         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15162         This.Resolve().
15163
15164         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15165         `instance_expression' to null if we don't have any non-static
15166         methods.
15167
15168 2003-05-18  Martin Baulig  <martin@ximian.com>
15169
15170         Reworked the way how local variables and parameters are handled by
15171         the flow analysis code.
15172
15173         * statement.cs (TypeInfo, VariableMap): New public classes.
15174         (VariableInfo): New public class.  This is now responsible for
15175         checking whether a variable has been assigned.  It is used for
15176         parameters and local variables.
15177         (Block.EmitMeta): Take the InternalParameters as argument; compute
15178         the layout of the flow vectors here.
15179         (Block.LocalMap, Block.ParameterMap): New public properties.
15180         (FlowBranching): The .ctor doesn't get the InternalParameters
15181         anymore since Block.EmitMeta() now computes the layout of the flow
15182         vector.
15183         (MyStructInfo): This class is now known as `StructInfo' and nested
15184         in `TypeInfo'; we don't access this directly anymore.
15185
15186         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15187         property and removed IsAssigned(), IsFieldAssigned(),
15188         SetAssigned() and SetFieldAssigned(); we now call them on the
15189         VariableInfo so we don't need to duplicate this code everywhere.
15190
15191         * expression.cs (ParameterReference): Added `Block block' argument
15192         to the .ctor.
15193         (LocalVariableReference, ParameterReference, This): The new
15194         VariableInfo class is now responsible for all the definite
15195         assignment stuff.
15196
15197         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15198         IsParameterAssigned, SetParameterAssigned): Removed.
15199
15200 2003-05-18  Martin Baulig  <martin@ximian.com>
15201
15202         * typemanager.cs (InitCoreTypes): Try calling
15203         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15204         the 3-args-version.  Corlib now also needs our `void_type'.
15205         (GetMethod): Added overloaded version which takes an optional
15206         `bool report_errors' to allow lookups of optional methods.
15207
15208 2003-05-12  Martin Baulig  <martin@ximian.com>
15209
15210         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15211         only used for locals and not for parameters.
15212
15213 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * support.cs (InternalParameters.ParameterType): Return the
15216         ExternalType of the parameter.
15217
15218         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15219         they were unused.
15220
15221 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15222
15223         * class.cs (MethodData.Define): Do not set the `newslot' on
15224         interface members, if they are also flagged as "override".
15225
15226         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15227         better code for ++i and i++.  This only works for static fields
15228         and local variables.
15229
15230         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15231         want to pull the DeclSpace out of the builder_to_declspace instead
15232         of the TypeBuilder (like in TypeContainer.FindMembers).
15233
15234         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15235         instead of LookupTypeContainer.  Fixes the crash on .NET for
15236         looking up interface members.
15237
15238         * const.cs: Create our own emit context during the Definition
15239         stage, so that constants are evaluated in the proper context, when
15240         a recursive definition happens.
15241
15242 2003-05-11  Martin Baulig  <martin@ximian.com>
15243
15244         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15245         new block for a switch section.
15246         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15247         the adding/lookup in the switch block.  Fixes #39828.
15248
15249 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15250
15251         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15252         functionality: I needed to convert the data after I had performed
15253         the add/sub operation into the operands type size.
15254
15255         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15256         pass the type for the box operation, otherwise the resulting
15257         object would have been of type object.
15258
15259         (BoxedCast): Add constructor to specify the type to box as.
15260
15261 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15262
15263         * iterators.cs: I was reusing the `count' variable inadvertently,
15264         take steps to not allow this to happen.
15265
15266 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15267
15268         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15269         by creating an array at the point where the params starts and
15270         putting all those arguments there, then adjusting the size of the
15271         array.
15272
15273 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15274
15275         * expression.cs (New.AddressOf): Implement interface
15276         IMemoryLocation.  This is used when the `new' operator is used in
15277         the context of an invocation to a method on a value type.
15278
15279         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15280         example. 
15281
15282         * namespace.cs: Also check the using aliases here.
15283
15284         * driver.cs: Move the test for using validity after the types have
15285         been entered, so we do a single pass that also includes the using
15286         aliases. 
15287
15288         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15289         in the regular case.   CreateSiblingForFinally is doing extra
15290         error checking.
15291
15292         * attribute.cs (GetAttributeArgumentExpression): Store the result
15293         on an out value, and use the return value to indicate failure
15294         instead of using null (which is a valid return for Constant.GetValue).
15295
15296         * statement.cs: Perform the analysis flow for the increment
15297         portion after the statement, because this will be the real flow of
15298         execution.  Fixes #42385
15299
15300         * codegen.cs (EmitContext.EmitArgument,
15301         EmitContext.EmitStoreArgument): New helper functions when the
15302         RemapToProxy flag is set.
15303
15304         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15305         function.
15306
15307         Add support for remapping parameters. 
15308
15309         * iterators.cs: Propagate parameter values;  Store parameter
15310         values in the proxy classes.
15311
15312 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15313
15314         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15315         need a proxy reference;  I do not know what I was thinking
15316
15317         * cs-parser.jay (constructor_initializer): catch another error,
15318         and display nice message.
15319
15320         (field_declaration): catch void field declaration
15321         to flag a better error. 
15322
15323         * class.cs (MemberBase.CheckBase): Report an error instead of a
15324         warning if a new protected member is declared in a struct. 
15325         (Field.Define): catch the error of readonly/volatile.
15326
15327         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15328
15329         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15330         volatile variable is taken
15331
15332 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15333
15334         * statement.cs (Fixed.Resolve): Report an error if we are not in
15335         an unsafe context.
15336
15337 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * typemanager.cs: reuse the code that handles type clashes for
15340         delegates and enumerations.
15341
15342         * class.cs (Report28): Always report.
15343
15344         * expression.cs (EncodeAsAttribute): Allow nulls here.
15345
15346 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15347
15348         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15349         the functionality for testing whether an expression is valid for
15350         an attribute here.  Also handle the case of arrays of elements
15351         being stored. 
15352
15353         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15354         encoding a linear array into an array of objects that are suitable
15355         to be passed to an CustomAttributeBuilder.
15356
15357         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15358
15359         * ecore.cs: (FieldExpr): Handle field remapping here.
15360
15361         * iteratators.cs: Pass the instance variable (if the method is an
15362         instance method) to the constructors, so we can access the field
15363         variables on the class.
15364
15365         TODO: Test this with structs.  I think the THIS variable on
15366         structs might have to be a pointer, and not a refenrece
15367
15368 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15369
15370         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15371         local variables to fields in a proxy class.
15372
15373         * iterators.cs (PopulateProxy): Rename our internal fields to
15374         <XXX>.  
15375         Create a <THIS> field if we are an instance method, so we can
15376         reference our parent container variables.
15377         (MapVariable): Called back from the EmitContext code to enter a
15378         new variable to field mapping into the proxy class (we just create
15379         a FieldBuilder).
15380
15381         * expression.cs
15382         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15383         for using the remapped locals to fields.
15384
15385         I placed the code here, because that gives the same semantics to
15386         local variables, and only changes the Emit code.
15387
15388         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15389         statements inside iterators.
15390         (VariableInfo): Add a FieldBuilder for the cases when we are
15391         remapping local variables to fields in a proxy class
15392
15393         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15394         current_block != null.
15395
15396         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15397         not cope with strings, as it has been moved to the
15398         TableSwitchEmit.  Fixed bug in switch generation.
15399
15400         * expression.cs (New.DoResolve): Provide more context for the user
15401         when reporting an error.
15402
15403         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15404         pointers. 
15405
15406         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15407         check the permissions for it.  Note than in a type-resolution
15408         context the check was already present in DeclSpace.ResolveType,
15409         but was missing from the MemberAccess.
15410
15411         (ArrayCreation.CheckIndices): warn if the user has
15412         more nested levels of expressions, but there are no more
15413         dimensions specified.  Avoids crash on bug 41906.
15414
15415 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15416
15417         * statement.cs (Block): replace Implicit bool, for a generic
15418         flags.   
15419         New flag: `Unchecked'.  This is used during the EmitMeta phase
15420         (which is out-of-line with the regular Resolve/Emit process for a
15421         statement, as this is done ahead of time, but still gets a chance
15422         to call constant resolve).
15423
15424         (Block.Flags): new enum for adding a new flag.
15425
15426         (Block.EmitMeta): track the state of unchecked.
15427
15428         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15429         to enable constant resolution to work there as well.
15430
15431 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15432
15433         * typemanager.cs (ienumerable_type): Also look up
15434         System.Collections.IEnumerable. 
15435
15436 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15437
15438         TODO: Test more than one conditional per method.
15439
15440         * class.cs (Indexer.Define): Report the location where the user is
15441         referencing the unsupported feature.
15442
15443         (MethodData): Overload the use of `conditionals' to
15444         minimize the creation of needless ArrayLists.   This saves roughly
15445         212kb on my machine.
15446
15447         (Method): Implement the new IIteratorContainer interface.
15448         (Method.SetYields): Implement the method by setting the ModFlags
15449         to contain METHOD_YIELDS.
15450
15451         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15452         which just got set to null.
15453
15454         * iterators.cs: New file.
15455
15456         (Yield, YieldBreak): New statements.
15457
15458         * statement.cs (Return.Resolve): Flag an error if we are used in
15459         an iterator method.
15460
15461         * codegen.cs (InIterator): New flag set if the code is being
15462         compiled in an iterator method.
15463
15464         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15465         internal modifier, and we just use it to avoid adding extra
15466         fields, as this is seldom used.  
15467
15468         * cs-parser.jay: Add yield_statement (yield and yield break).
15469
15470         * driver.cs: New flag -v2 to turn on version 2 features. 
15471
15472         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15473         hashtable when v2 is enabled.
15474
15475 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15476
15477         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15478         there is already a namespace defined with this name.
15479
15480         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15481         people upgraded their corlibs.
15482
15483         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15484         always use fully qualified types, no need to use the compiler
15485         front end.
15486
15487         (TypeManager.IsNamespace): Use binarysearch.
15488
15489         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15490         AddDelegate): I did not quite use the new IsValid API properly: I
15491         have to pass the short-name and the fullname.  I was passing only
15492         the basename instead of the fullname sometimes. 
15493
15494         (TypeContainer.DefineType): call NamespaceClash.
15495
15496         * interface.cs (Interface.DefineType): use NamespaceClash before
15497         defining the type.
15498
15499         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15500         defining the type.
15501
15502         * enum.cs: (Enum.DefineType): use NamespaceClash before
15503         defining the type.
15504
15505         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15506         speed increase.  First, use the negative_hits cache when we get a
15507         negative.  Second, add the type with its full original name
15508         instead of the new . and + encoded name (reflection uses + to
15509         separate type from a nested type).  Use LookupTypeReflection
15510         directly which bypasses the type->name hashtable (that we already
15511         know does not contain the type.
15512
15513         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15514         location/container type. 
15515
15516         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15517
15518 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15519
15520         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15521
15522         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15523         method is being referenced in the method group from a static
15524         context, and report error 120 if so.
15525
15526         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15527         Error118. 
15528
15529         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15530         is created, we create the A namespace).
15531
15532         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15533         Fixes #41591
15534
15535 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15536
15537         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15538         invocation to ModuleBuilder.GetType with the same values will
15539         return a new type instance, so we need to cache its return
15540         values. 
15541
15542         * expression.cs (Binary.ResolveOperator): Only allow the compare
15543         operators on enums if they are of the same type.
15544
15545         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15546         types of ValueType on their own case.  Before we were giving them
15547         the same treatment as objects.
15548
15549         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15550         fullname.  Short name is used to compare against container name.
15551         Fullname is used to check against defined namespace names.
15552
15553         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15554         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15555
15556         (Method.CheckBase): Call parent.
15557         (MemberBase.CheckBase): Check for protected members on sealed
15558         classes.
15559         (PropertyBase.CheckBase): Call parent.
15560         (Field.Define): Call parent.
15561
15562         * report.cs: Negative error codes are now mapped to 8000 - code,
15563         so that the display is render more nicely.
15564
15565         * typemanager.cs: Do not use try/catch, instead report a regular
15566         error. 
15567
15568         (GetPointerType, GetReferenceType): These methods provide
15569         mechanisms to obtain the T* and T& from a T.  We had the code
15570         previously scattered around the code base, and it also used
15571         TypeManager.LookupType that would go through plenty of caches.
15572         This one goes directly to the type source.
15573
15574         In some places we did the Type.GetType followed by
15575         ModuleBuilder.GetType, but not in others, so this unifies the
15576         processing as well.
15577
15578         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15579         statements now that we have namespace information.
15580
15581         * typemanager.cs (IsNamespace): New method, returns whether the
15582         string presented is a namespace or not.
15583
15584         (ComputeNamespaces): New public entry point, computes the list of
15585         available namespaces, using the GetNamespaces API call in Mono, or
15586         the slower version in MS.NET.   
15587
15588         Now before we start the semantic analysis phase, we have a
15589         complete list of namespaces including everything that the user has
15590         provided.
15591
15592         Deleted old code to cache namespaces in .nsc files.
15593
15594 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15595
15596         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15597         class/struct location definition Location for the implicit
15598         constructor location.
15599
15600         (Operator.Define): Use the location of the operator for the
15601         implicit Method definition.
15602
15603         (Constructor.Emit): use the constructor location for the implicit
15604         base initializer constructor.
15605
15606         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15607         and the Expression class now contains two new methods:
15608
15609         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15610         isolate type lookup from the rest of the resolution process.
15611
15612         Since we use Expressions to hold type definitions due to the way
15613         we parse the input we have historically overloaded Resolve to
15614         perform the Type lookups if a special flag is passed.  Now this is
15615         eliminated and two methods take their place. 
15616
15617         The differences in the two methods between xStep and xTerminal is
15618         that xStep is involved in our current lookup system that uses
15619         SimpleNames to compose a name, while xTerminal is used just to
15620         catch the case where the simplename lookup failed.
15621
15622 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15623
15624         * expression.cs (ResolveMemberAccess): Remove redundant code.
15625         TypeExpr expressions are always born fully resolved.
15626
15627         * interface.cs (PopulateMethod): Do not lookup the types twice.
15628         We were doing it once during SemanticAnalysis and once during
15629         PopulateMethod.
15630
15631         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15632         in local variable type definitions, were being returned as a
15633         SimpleName (we decomposed everything into a string), that is
15634         because primary_expression was being used instead of a type in the
15635         grammar (reduce/reduce conflicts).
15636
15637         The part that was wrong is that we converted the expression into a
15638         string (an oversimplification in one hand, compounded with primary
15639         expressions doing string concatenation).
15640
15641         So things like:
15642
15643         A.B.C [] x;
15644
15645         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15646         using clauses from working on this particular context.  And a type
15647         was being matched directly against "A.B.C[]".
15648
15649         We now use the correct approach, and allow for ComposedCast to be
15650         part of the unary expression.  So the "A.B.C []" become a composed
15651         cast of "A.B.C" (as a nested group of MemberAccess with a
15652         SimpleName at the end) plus the rank composition "[]". 
15653
15654         Also fixes 35567
15655
15656 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15657
15658         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15659         for the access level checking.
15660
15661         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15662         `TypeContainer container', because I kept getting confused when I
15663         was debugging this code.
15664
15665         * expression.cs (Indexers): Instead of tracking getters/setters,
15666         we now track them in parallel.  We create one arraylist less, but
15667         most importantly it is possible now for the LValue code to find a
15668         matching get for a set.
15669
15670         (IndexerAccess.DoResolveLValue): Update the code.
15671         GetIndexersForType has been modified already to extract all the
15672         indexers from a type.  The code assumed it did not.
15673
15674         Also make the code set the correct return type for the indexer.
15675         This was fixed a long time ago for properties, but was missing for
15676         indexers.  It used to be void_type.
15677
15678         (Binary.Emit): Test first for doubles instead of
15679         floats, as they are more common.
15680
15681         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15682         when dealing with floats and the <=, >= operators.  This fixes bug
15683         #39314 
15684
15685         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15686         to load the array value by emitting a load on the foreach variable
15687         type.  This was incorrect.  
15688
15689         We now emit the code to load an element using the the array
15690         variable type, and then we emit the conversion operator.
15691
15692         Fixed #40176
15693
15694 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15695
15696         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15697
15698 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15699
15700         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15701         test for protection before we test for signatures. 
15702
15703         (MethodSignature.ToString): implement.
15704
15705         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15706         to the case where we reduced into a LongConstant.
15707
15708         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15709         depend on whether the information is acurrate, because the
15710         Microsoft runtime will always claim that the array type is public,
15711         regardless of the real state.
15712
15713         If the type is a pointer, another problem happens: the type is
15714         reported as non-public in Microsoft.  
15715
15716         In both cases we have to call CheckAccessLevel recursively with
15717         the underlying type as the argument to be tested.
15718
15719 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15720
15721         * assign.cs (Assign.Emit): If we are dealing with a compound
15722         assignment expression, we should use the code path that stores the
15723         intermediate result in a temporary value.  This fixes #40903.
15724
15725         *expression.cs (Indirection.ToString): Provide ToString method for
15726         debugging. 
15727
15728 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15729
15730         * class.cs: Null out fields holding references to Block objects so
15731         they can be garbage collected.
15732
15733         * expression.cs (OverloadResolve): Remove unused local.
15734
15735 2003-04-07  Martin Baulig  <martin@ximian.com>
15736
15737         * codegen.cs (EmitContext.CurrentFile): New public field.
15738         (EmitContext.Mark): Use the CurrentFile to check whether the
15739         location is in the correct file.
15740         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15741
15742 2003-04-07  Martin Baulig  <martin@ximian.com>
15743
15744         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15745
15746         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15747         location.  [FIXME: The location argument which gets passed to this
15748         method is sometimes wrong!]
15749
15750 2003-04-07  Nick Drochak <ndrochak@gol.com>
15751
15752         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15753
15754 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15755
15756         * expression.cs (Indirection.EmitAssign): We were using the
15757         temporary, but returning immediately instead of continuing the
15758         EmitAssing flow.
15759
15760 2003-04-06  Martin Baulig  <martin@ximian.com>
15761
15762         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15763         if it's a nested child, but also deriving from the outer class.
15764         See test 190.cs.
15765
15766         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15767         nested child, but also deriving from the outer class.  See
15768         test-190.cs.
15769         (FilterWithClosure): We may access private members of the outer
15770         class if we're a nested child and deriving from the outer class.
15771         (RealMemberLookup): Only set `closure_private_ok' if the
15772         `original_bf' contained BindingFlags.NonPublic.
15773
15774 2003-04-05  Martin Baulig  <martin@ximian.com>
15775
15776         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15777
15778 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15779
15780         * class.cs (Event.Define): Do not allow abstract events to have
15781         initializers. 
15782
15783 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15786         block in event declarations.
15787
15788         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15789         value type, get its address.
15790
15791         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15792         leaving a class on the stack instead of a boolean value (int
15793         0/1).  Change the code so we compare against null, and then the
15794         result against zero.
15795
15796         * class.cs (TypeContainer.GetClassBases): We were checking for the
15797         parent class being sealed too late.
15798
15799         * expression.cs (Binary.Emit): For <= and >= when dealing with
15800         floating point values, use cgt.un and clt.un instead of cgt and
15801         clt alone.
15802
15803 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15804
15805         * statement.cs: Apply the same optimization as MS: skip the 
15806         GetEnumerator returning an IEnumerator, and use the one returning a 
15807         CharEnumerator instead. This allows us to avoid the try-finally block 
15808         and the boxing.
15809
15810 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15811
15812         * cs-parser.jay: Attributes cannot be applied to
15813                          namespaces. Fixes #40473
15814
15815 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15816
15817         * class.cs:
15818         (Add*): check if the name is valid using the full name for constants,
15819         fields, properties and events.
15820
15821 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15822
15823         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15824         char constants to be part of the enumeration.
15825
15826         * expression.cs (Conditional.DoResolve): Add support for operator
15827         true. Implements the missing functionality from 14.12
15828
15829         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15830         operator true/false as required by the spec.
15831
15832         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15833         implicit conversion to boolean.
15834
15835         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15836         also one where the type implements `operator true'. 
15837
15838         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15839         get an expression that will invoke operator true based on an
15840         expression.  
15841
15842         (GetConversionOperators): Removed the hack that called op_True
15843         here.  
15844
15845         (Expression.ResolveBoolean): Move this from Statement.
15846
15847 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15848
15849         * ecore.cs (FieldExpr): do not allow initialization of initonly
15850         fields on derived classes
15851
15852 2003-03-13  Martin Baulig  <martin@ximian.com>
15853
15854         * statement.cs (Block.Emit): Call ig.BeginScope() and
15855         ig.EndScope() when compiling with debugging info; call
15856         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15857
15858 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15859
15860         * expression.cs (Indexers): Do not construct immediately, allow
15861         for new members to be appended as we go.  Fixes 38143
15862
15863 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15864
15865         * expression.cs: save/restore context when resolving an unchecked
15866         expression.
15867
15868 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15869
15870         * cfold.cs: Catch division by zero in modulus operator during
15871         constant folding.
15872
15873 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15874
15875         * interface.cs (Interface.DefineMembers): Avoid defining members
15876         twice. 
15877
15878 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15879
15880         * driver.cs: handle the +/- options for -noconfig
15881
15882         * statement.cs (Unckeched.Resolve): Also track the state of
15883         unchecked in the Resolve phase.
15884
15885 2003-02-27  Martin Baulig  <martin@ximian.com>
15886
15887         * ecore.cs (Expression.MemberLookup): Don't create a
15888         MethodGroupExpr for something which is not a method.  Fixes #38291.
15889
15890 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15891
15892         * class.cs (MemberBase.CheckParameters): Also check that the type
15893         is unmanaged if it is a pointer.
15894
15895         * expression.cs (SizeOf.Resolve): Add location information.
15896
15897         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15898         a managed type is declared.
15899
15900         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15901         parameter modifiers as well.  Fixes bug 38606
15902
15903         * class.cs: Very sad.  Am backing out the speed up changes
15904         introduced by the ArrayList -> Array in the TypeContainer, as they
15905         were not actually that much faster, and introduced a bug (no error
15906         reports on duplicated methods).
15907
15908         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15909         source first, this will guarantee that we have a valid expression
15910         before calling in lower levels functions that will require a
15911         resolved object.  Then use this original_source in the
15912         target.ResolveLValue instead of the original source that was
15913         passed to us.
15914
15915         Another change.  Use target.Resolve instead of LValueResolve.
15916         Although we are resolving for LValues, we will let the Assign code
15917         take care of that (it will be called again from Resolve).  This
15918         basically allows code like this:
15919
15920         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15921         class Y { void A (X x) { x [0] += o; }
15922
15923         The problem was that the indexer was trying to resolve for
15924         set_Item (idx, object o) and never finding one.  The real set_Item
15925         was set_Item (idx, X).  By delaying the process we get the right
15926         semantics. 
15927
15928         Fixes bug 36505
15929
15930 2003-02-23  Martin Baulig  <martin@ximian.com>
15931
15932         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15933         while calling DoEmit ().
15934
15935         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15936         source files; if you use the #line directive inside a method, the
15937         compiler stops emitting line numbers for the debugger until it
15938         reaches the end of the method or another #line directive which
15939         restores the original file.
15940
15941 2003-02-23  Martin Baulig  <martin@ximian.com>
15942
15943         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15944
15945 2003-02-23  Martin Baulig  <martin@ximian.com>
15946
15947         * statement.cs (Block.AddChildVariableNames): We need to call this
15948         recursively, not just for our immediate children.
15949
15950 2003-02-23  Martin Baulig  <martin@ximian.com>
15951
15952         * class.cs (Event.Define): Always make the field private, like csc does.
15953
15954         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15955         actually work, fixes bug #37521.
15956
15957 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15958
15959         * delegate.cs: When creating the various temporary "Parameters"
15960         classes, make sure that we call the ComputeAndDefineParameterTypes
15961         on those new parameters (just like we do with the formal ones), to
15962         allow them to be resolved in the context of the DeclSpace.
15963
15964         This fixes the bug that Dick observed in Bugzilla #38530.
15965
15966 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * expression.cs (ResolveMemberAccess): When resolving a constant,
15969         do not attempt to pull a constant if the value was not able to
15970         generate a valid constant.
15971
15972         * const.cs (LookupConstantValue): Do not report more errors than required.
15973
15974 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15975
15976         * expression.cs: fixes bug #38328.
15977
15978 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15979
15980         * class.cs: Changed all the various members that can be part of a
15981         class from being an ArrayList to be an Array of the right type.
15982         During the DefineType type_list, interface_list, delegate_list and
15983         enum_list are turned into types, interfaces, delegates and enums
15984         arrays.  
15985
15986         And during the member population, indexer_list, event_list,
15987         constant_list, field_list, instance_constructor_list, method_list,
15988         operator_list and property_list are turned into their real arrays.
15989
15990         Although we could probably perform this operation earlier, for
15991         good error reporting we need to keep the lists and remove the
15992         lists for longer than required.
15993
15994         This optimization was triggered by Paolo profiling the compiler
15995         speed on the output of `gen-sample-program.pl' perl script. 
15996
15997         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15998         not crash in methods like MemberLookupFailed that use this field.  
15999
16000         This problem arises when the compiler fails to resolve a type
16001         during interface type definition for example.
16002
16003 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16004
16005         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16006         inherit from System.Object, so we have to stop at null, not only
16007         when reaching System.Object.
16008
16009 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16010
16011         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16012         DeclaredOnly because the parent indexer might have had a different
16013         name, but did not loop until the top of the hierarchy was reached.
16014
16015         The problem this one fixes is 35492: when a class implemented an
16016         indexer from an interface, we were getting the interface method
16017         (which was abstract) and we were flagging an error (can not invoke
16018         abstract method).
16019
16020         This also keeps bug 33089 functioning, and test-148 functioning.
16021
16022         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16023         out if a method is special is to see if it is declared in a
16024         property or event, or whether it is one of the predefined operator
16025         names.   This should fix correctly #36804.
16026
16027 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16028
16029         The goal here is to remove the dependency on EmptyCast.Peel ().
16030         Killing it completely.
16031
16032         The problem is that currently in a number of places where
16033         constants are expected, we have to "probe" for an EmptyCast, and
16034         Peel, which is not the correct thing to do, as this will be
16035         repetitive and will likely lead to errors. 
16036
16037         The idea is to remove any EmptyCasts that are used in casts that
16038         can be reduced to constants, so we only have to cope with
16039         constants. 
16040
16041         This bug hunt was triggered by Bug 37363 and the desire to remove
16042         the duplicate pattern where we were "peeling" emptycasts to check
16043         whether they were constants.  Now constants will always be
16044         constants.
16045
16046         * ecore.cs: Use an enumconstant here instead of wrapping with
16047         EmptyCast.  
16048
16049         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16050         throwing me off.  By handling this we can get rid of a few hacks.
16051
16052         * statement.cs (Switch): Removed Peel() code.
16053
16054 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16055
16056         * class.cs: Location information for error 508
16057
16058         * expression.cs (New.DoResolve): Add a guard against double
16059         resolution of an expression.  
16060
16061         The New DoResolve might be called twice when initializing field
16062         expressions (see EmitFieldInitializers, the call to
16063         GetInitializerExpression will perform a resolve on the expression,
16064         and later the assign will trigger another resolution
16065
16066         This leads to bugs (#37014)
16067
16068         * delegate.cs: The signature for EndInvoke should contain any ref
16069         or out parameters as well.  We were not doing this in the past. 
16070
16071         * class.cs (Field.Define): Do not overwrite the type definition
16072         inside the `volatile' group.  Turns out that volatile enumerations
16073         were changing the type here to perform a validity test, which
16074         broke conversions. 
16075
16076 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16077
16078         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16079         and structs, we do not want to load the instance variable
16080
16081         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16082         enum_type has to be handled like an object reference (implicit
16083         conversions exists from this to object), but the regular IsClass
16084         and IsValueType tests will never return true for this one.
16085
16086         Also we use TypeManager.IsValueType instead of type.IsValueType,
16087         just for consistency with the rest of the code (this is only
16088         needed if we ever use the construct exposed by test-180.cs inside
16089         corlib, which we dont today).
16090
16091 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16092
16093         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16094         just InternalCall.
16095
16096 2003-02-09  Martin Baulig  <martin@ximian.com>
16097
16098         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16099         (Namespace.DefineNamespaces): New static public method; this is
16100         called when we're compiling with debugging to add all namespaces
16101         to the symbol file.
16102
16103         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16104         pass it to the Namespace's .ctor.
16105
16106         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16107         and MethodBase arguments; pass the namespace ID to the symwriter;
16108         pass the MethodBase instead of the token to the symwriter.
16109         (SymbolWriter.DefineNamespace): New method to add a namespace to
16110         the symbol file.
16111
16112 2003-02-09  Martin Baulig  <martin@ximian.com>
16113
16114         * symbolwriter.cs: New file.  This is a wrapper around
16115         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16116         methods here in near future.
16117
16118 2003-02-09  Martin Baulig  <martin@ximian.com>
16119
16120         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16121         ILGenerator.MarkSequencePoint() which are actually used by the
16122         symbol writer.
16123
16124 2003-02-09  Martin Baulig  <martin@ximian.com>
16125
16126         * location.cs (SourceFile): New public sealed class.  This
16127         contains the name and an index which is used in the location's token.
16128         (Location): Reserve an appropriate number of bits in the token for
16129         the source file instead of walking over that list, this gives us a
16130         really huge performance improvement when compiling with debugging.
16131
16132         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16133         `SourceFile' argument instead of a string.
16134         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16135         but don't parse/tokenize here, we need to generate the list of all
16136         source files before we do that.
16137         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16138         the files.
16139
16140         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16141         instead of a string.
16142
16143         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16144         of a string.
16145
16146 2003-02-09  Martin Baulig  <martin@ximian.com>
16147
16148         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16149         filename on `#line default'.
16150
16151 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16152
16153         * statement.cs: don't clear the pinned var when the fixed statement
16154         returns from the method (fixes bug#37752).
16155
16156 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16157
16158         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16159         to IsValueType.
16160
16161 2003-02-07  Martin Baulig  <martin@ximian.com>
16162
16163         * driver.cs: Removed the `--debug-args' command line argument.
16164
16165         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16166         automatically by the AsssemblyBuilder.
16167         (CodeGen.InitializeSymbolWriter): We don't need to call any
16168         initialization function on the symbol writer anymore.  This method
16169         doesn't take any arguments.
16170
16171 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16172
16173         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16174         from referenced assemblies as well.
16175
16176 2003-02-02  Martin Baulig  <martin@ximian.com>
16177
16178         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16179
16180 2003-02-02  Martin Baulig  <martin@ximian.com>
16181
16182         * class.cs (Constructor.Emit): Open the symbol writer before
16183         emitting the constructor initializer.
16184         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16185         single-stepping through constructor initializers.
16186
16187 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16188
16189         * class.cs: Handle error 549: do not allow virtual methods in
16190         sealed classes. 
16191
16192 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16193
16194         * decl.cs: Check access levels when resolving types
16195
16196 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16197
16198         * statement.cs: Add parameters and locals set in catch blocks that might 
16199         return to set vector
16200
16201 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16202
16203         * class.cs (Operator): Set the SpecialName flags for operators.
16204
16205         * expression.cs (Invocation.DoResolve): Only block calls to
16206         accessors and operators on SpecialName methods.
16207
16208         (Cast.TryReduce): Handle conversions from char constants.
16209
16210
16211 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16212
16213         * statement.cs: small memory and time optimization in FlowBranching.
16214
16215 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16216
16217         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16218         problem that the last fix but in the other sid (Set).
16219
16220         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16221         access when there is no indexer in the hierarchy.
16222
16223 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16224
16225         * class.cs: Combine some if statements.
16226
16227 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16228
16229         * driver.cs: fixed bug #37187.
16230
16231 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16232
16233         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16234         any indexer, it's needed to build a list with all the indexers in the
16235         hierarchy (AllGetters), else we have problems. Fixes #35653.
16236
16237 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16238
16239         * class.cs (MethodData.Define): It is wrong for an interface
16240         implementation to be static in both cases: explicit and implicit.
16241         We were only handling this in one case.
16242
16243         Improve the if situation there to not have negations.
16244
16245         * class.cs (Field.Define): Turns out that we do not need to check
16246         the unsafe bit on field definition, only on usage.  Remove the test.
16247
16248 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16249
16250         * driver.cs: use assembly.Location instead of Codebase (the latest
16251         patch made mcs fail when using MS assemblies).
16252
16253 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16254
16255         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16256         get the path to *corlib.dll.
16257
16258 2003-01-21  Nick Drochak <ndrochak@gol.com>
16259
16260         * cs-tokenizer.cs:
16261         * pending.cs:
16262         * typemanager.cs: Remove compiler warnings
16263
16264 2003-01-20  Duncan Mak  <duncan@ximian.com>
16265
16266         * AssemblyInfo.cs: Bump the version number to 0.19.
16267
16268 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16269
16270         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16271
16272 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16273
16274         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16275
16276 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16277
16278         * cs-parser.jay: Small fix: we were not comparing the constructor
16279         name correctly.   Thanks to Zoltan for the initial pointer.
16280
16281 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16282
16283         * cs-tokenizer.cs: Set file name when specified with #line
16284
16285 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16286
16287         * cs-parser.jay: Only perform the constructor checks here if we
16288         are named like the class;  This will help provider a better
16289         error.  The constructor path is taken when a type definition is
16290         not found, but most likely the user forgot to add the type, so
16291         report that rather than the constructor error.
16292
16293 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16294
16295         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16296         allocations.
16297
16298 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16299
16300         * cs-parser.jay: Add cleanup call.
16301
16302 2003-01-13  Duncan Mak  <duncan@ximian.com>
16303
16304         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16305         consistent with other methods.
16306
16307 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16308
16309         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16310
16311 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16312
16313         * attribute.cs: only set GuidAttr to true when we have a
16314         GuidAttribute.
16315
16316 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16317
16318         * ecore.cs:
16319         * expression.cs:
16320         * typemanager.cs: fixes to allow mcs compile corlib with the new
16321         Type.IsSubclassOf fix.
16322
16323 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16324
16325         * expression.cs (LocalVariableReference.DoResolve): Classify a
16326         constant as a value, not as a variable.   Also, set the type for
16327         the variable.
16328
16329         * cs-parser.jay (fixed_statement): take a type instead of a
16330         pointer_type, so we can produce a better error message later.
16331
16332         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16333         as an error.  
16334
16335         (For.DoEmit): Make inifinite loops have a
16336         non-conditional branch back.
16337
16338         (Fixed.DoEmit): First populate the pinned variables, then emit the
16339         statement, then clear the variables.  Before I was emitting the
16340         code once for each fixed piece.
16341
16342
16343 2003-01-08  Martin Baulig  <martin@ximian.com>
16344
16345         * statement.cs (FlowBranching.MergeChild): A break in a
16346         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16347
16348 2003-01-08  Martin Baulig  <martin@ximian.com>
16349
16350         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16351         lives in the same number space than `param_map'.  Fixes #36154.
16352
16353 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16354
16355         * cs-parser.jay (constructor_declaration): Set the
16356         Constructor.ModFlags before probing for it.  This makes the
16357         compiler report 514, 515 and 132 (the code was there, but got
16358         broken). 
16359
16360         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16361         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16362         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16363
16364 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16365
16366         * enum.cs: create the enum static fields using the enum type.
16367
16368 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16369
16370         * class.cs: don't try to create the ParamBuilder for the return
16371         type if it's not needed (and handle it breaking for the ms runtime
16372         anyway).
16373
16374 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16375
16376         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16377
16378 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16379
16380         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16381         the command.   This showed up while compiling the JANET source
16382         code, which used \r as its only newline separator.
16383
16384 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16385
16386         * class.cs (Method.Define): If we are an operator (because it
16387         reuses our code), then set the SpecialName and HideBySig.  #36128
16388
16389 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16390
16391         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16392         exception, report error 120 `object reference required'.
16393
16394         * driver.cs: Add --pause option, used during to measure the size
16395         of the process as it goes with --timestamp.
16396
16397         * expression.cs (Invocation.DoResolve): Do not allow methods with
16398         SpecialName to be invoked.
16399
16400 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16401
16402         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16403         number before adding it.
16404
16405 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16406
16407         * ecore.cs (StandardImplicitConversion): When in an unsafe
16408         context, we allow conversion between void * to any other pointer
16409         type. This fixes bug #35973.
16410
16411 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16412
16413         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16414         is not thrown when extensionless outputs are used 
16415
16416 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16417
16418         * rootcontext.cs: fixed compilation of corlib.
16419
16420 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16421
16422         * attribute.cs (Attributes.Contains): Add new method.
16423
16424         * class.cs (MethodCore.LabelParameters): if the parameter is an
16425         `out' parameter, check that no attribute `[In]' has been passed.
16426
16427         * enum.cs: Handle the `value__' name in an enumeration.
16428
16429 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16430
16431         * decl.cs: Added special case to allow overrides on "protected
16432         internal" methods
16433
16434 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16435
16436         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16437         since it makes much more sense.
16438
16439         (Attributes.ctor): Don't require a Location parameter.
16440
16441         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16442
16443         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16444         since we already have that information per attribute.
16445
16446         * everywhere : make appropriate changes.
16447
16448         * class.cs (LabelParameters): Write the code which actually
16449         applies attributes to the return type. We can't do this on the MS
16450         .NET runtime so we flag a warning in the case an exception is
16451         thrown.
16452
16453 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16454
16455         * const.cs: Handle implicit null conversions here too.
16456
16457 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16458
16459         * class.cs (MethodCore.LabelParameters): Remove the extra
16460         Type [] parameter since it is completely unnecessary. Instead
16461         pass in the method's attributes so that we can extract
16462         the "return" attribute.
16463
16464 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16465
16466         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16467         of ignoring it and letting the compile continue.
16468
16469         * typemanager.cs (ChangeType): use an extra argument to return an
16470         error condition instead of throwing an exception.
16471
16472 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16473
16474         * expression.cs (Unary.TryReduce): mimic the code for the regular
16475         code path.  Perform an implicit cast in the cases where we can
16476         implicitly convert to one of the integral types, and then reduce
16477         based on that constant.   This fixes bug #35483.
16478
16479 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16480
16481         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16482
16483 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16484
16485         * namespace.cs: fixed bug #35489.
16486
16487 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16488
16489         * class.cs: Remove some dead code.
16490
16491         * cs-parser.jay: Estimate the number of methods needed
16492         (RootContext.MethodCount);
16493
16494         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16495         numbers instead of StringBuilders.
16496
16497         * support.cs (PtrHashtable): Add constructor with initial size;
16498         We can now reduce reallocations of the method table.
16499
16500 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16501
16502         * attribute.cs (ApplyAttributes): Keep track of the emitted
16503         attributes on a per-target basis. This fixes bug #35413.
16504
16505 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16506
16507         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16508         default to the Windows 1252 encoding.
16509
16510         (UnixParseOption): Support version, thanks to Alp for the missing
16511         pointer. 
16512
16513         * AssemblyInfo.cs: Add nice assembly information.
16514
16515         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16516         (bug 35169).
16517
16518         * cs-parser.jay: Allow a trailing comma before the close bracked
16519         in the attribute_section production.
16520
16521         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16522         address of the instance was being taken, I will take this out,
16523         because we take the address of the object immediately here.
16524
16525 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16526
16527         * typemanager.cs (AreMultipleAllowed): Take care of the most
16528         obvious case where attribute type is not in the current assembly -
16529         stupid me ;-)
16530
16531 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16532
16533         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16534         definitions, instead of doing that afterwards.  
16535
16536         Also we use a nice little hack, depending on the constructor, we
16537         know if we are a "composed" name or a simple name.  Hence, we
16538         avoid the IndexOf test, and we avoid 
16539
16540         * codegen.cs: Add code to assist in a bug reporter to track down
16541         the source of a compiler crash. 
16542
16543 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16544
16545         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16546         types have been emitted for a given element and flag an error
16547         if something which does not have AllowMultiple set is used more
16548         than once.
16549
16550         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16551         attribute types and their corresponding AllowMultiple properties
16552
16553         (AreMultipleAllowed): Check the property for a given type.
16554
16555         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16556         property in the case we have a TypeContainer.
16557
16558         (Attributes.AddAttribute): Detect duplicates and just skip on
16559         adding them. This trivial fix catches a pretty gross error in our
16560         attribute emission - global attributes were being emitted twice!
16561
16562         Bugzilla bug #33187 is now fixed.
16563
16564 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16565
16566         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16567         instead of pp_and).
16568
16569         * expression.cs (Binary.ResolveOperator): I can only use the
16570         Concat (string, string, string) and Concat (string, string,
16571         string, string) if the child is actually a concatenation of
16572         strings. 
16573
16574 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16575
16576         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16577         context where we need a 2-character lookahead.
16578
16579         * pending.cs (PendingImplementation): Rework so we can keep track
16580         of interface types all the time, and flag those which were
16581         implemented by parents as optional.
16582
16583 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16584
16585         * expression.cs (Binary.ResolveOperator): Use
16586         String.Concat(string,string,string) or
16587         String.Concat(string,string,string,string) when possible. 
16588
16589         * typemanager: More helper methods.
16590
16591
16592 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16593
16594         * pending.cs: remove the bogus return from GetMissingInterfaces()
16595         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16596
16597 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16598
16599         * namespace.cs: avoid duplicated 'using xxx' being added to
16600         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16601         when we get more than one 'using' statement for the same namespace.
16602         Report a CS0105 warning for it.
16603
16604 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16605
16606         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16607         of calling getChar/putback, uses internal knowledge of it.    
16608
16609         (xtoken): Reorder tokenizer so most common patterns are checked
16610         first.  This reduces the compilation time in another 5% (from 8.11s
16611         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16612
16613         The parsing time is 22% of the compilation in mcs, and from that
16614         64% is spent on the tokenization process.  
16615
16616         I tried using a binary search for keywords, but this is slower
16617         than the hashtable.  Another option would be to do a couple of
16618         things:
16619
16620                 * Not use a StringBuilder, instead use an array of chars,
16621                   with a set value.  Notice that this way we could catch
16622                   the 645 error without having to do it *afterwards*.
16623
16624                 * We could write a hand-parser to avoid the hashtable
16625                   compares altogether.
16626
16627         The identifier consumption process takes 37% of the tokenization
16628         time.  Another 15% is spent on is_number.  56% of the time spent
16629         on is_number is spent on Int64.Parse:
16630
16631                 * We could probably choose based on the string length to
16632                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16633                   computations. 
16634
16635         Another 3% is spend on wrapping `xtoken' in the `token' function.
16636
16637         Handle 0xa0 as whitespace (#34752)
16638
16639 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16640
16641         * typemanager.cs (IsCLRType): New routine to tell whether a type
16642         is one of the builtin types.  
16643
16644         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16645         typecode in more places instead of doing pointer comparissions.
16646         We could leverage some knowledge about the way the typecodes are
16647         laid out.
16648
16649         New code to cache namespaces in assemblies, it is currently not
16650         invoked, to be used soon.
16651
16652         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16653
16654         * expression.cs (Binary.ResolveOperator): specially handle
16655         strings, and do not perform user-defined operator overloading for
16656         built-in types.
16657
16658 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16659
16660         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16661         internalcall as it is a pretty simple operation;  Avoid whenever
16662         possible to call Char.IsLetter.
16663
16664         (consume_identifier): Cut by half the number of
16665         hashtable calls by merging the is_keyword and GetKeyword behavior.
16666
16667         Do not short-circuit, because if we do, we
16668         report errors (ie, #if false && true would produce an invalid
16669         directive error);
16670
16671
16672 2002-11-24  Martin Baulig  <martin@ximian.com>
16673
16674         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16675         check constant ranges and report a CS0221.  Fixes #33186.
16676
16677 2002-11-24  Martin Baulig  <martin@ximian.com>
16678
16679         * cs-parser.jay: Make this work for uninitialized variable
16680         declarations in the `for' initializer.  Fixes #32416.
16681
16682 2002-11-24  Martin Baulig  <martin@ximian.com>
16683
16684         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16685         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16686
16687 2002-11-24  Martin Baulig  <martin@ximian.com>
16688
16689         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16690         argument; if true, we also check for user-defined conversions.
16691         This is only needed if both arguments are of a user-defined type.
16692         Fixes #30443, added test-175.cs.
16693         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16694
16695         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16696
16697 2002-11-24  Martin Baulig  <martin@ximian.com>
16698
16699         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16700         function to get the store opcode.
16701         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16702         only emit the Ldelema if the store opcode is Stobj.  You must run
16703         both test-34 and test-167 to test this.  Fixes #34529.
16704
16705 2002-11-23  Martin Baulig  <martin@ximian.com>
16706
16707         * ecore.cs (Expression.MemberLookup): Added additional
16708         `qualifier_type' argument which is used when we're being called
16709         from MemberAccess.DoResolve() and null if we're called from a
16710         SimpleName lookup.
16711         (Expression.MemberLookupFailed): New method to report errors; this
16712         does the CS1540 check and reports the correct error message.
16713
16714         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16715         argument for the CS1540 check and redone the way how we're dealing
16716         with private members.  See the comment in the source code for details.
16717         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16718         `closure_start_type' to `closure_qualifier_type' and check whether
16719         it's not null.  It was not this filter being broken, it was just
16720         being called with the wrong arguments.
16721
16722         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16723         and pass it the correct `qualifier_type'; this also does the error
16724         handling for us.
16725
16726 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16727
16728         * expression.cs (Invocation.EmitParams): If the we are dealing
16729         with a non-built-in value type, load its address as well.
16730
16731         (ArrayCreation): Use a a pretty constant instead
16732         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16733         static initializers.  
16734
16735         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16736         because they are not really value types, just glorified integers. 
16737
16738         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16739
16740         * ecore.cs: Remove redundant code for enumerations, make them use
16741         the same code path as everything else, fixes the casting issue
16742         with enumerations in Windows.Forms.
16743
16744         * attribute.cs: Do only cast to string if it is a string, the
16745         validation happens later.
16746
16747         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16748         people upgrade their corlibs.
16749
16750         * ecore.cs: Oops, enumerations were not following the entire code path
16751
16752 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16753
16754         * typemanager.cs (FilterWithClosure): Commented out the test for
16755         1540 in typemanager.cs, as it has problems when accessing
16756         protected methods from a parent class (see test-174.cs). 
16757
16758         * attribute.cs (Attribute.ValidateGuid): new method.
16759         (Attribute.Resolve): Use above.
16760
16761 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16762
16763         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16764
16765         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16766         handling for enumerations, as we only needed the TypeContainer
16767         functionality to begin with (this is required for the fix below to
16768         work for enums that reference constants in a container class for
16769         example). 
16770
16771         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16772
16773         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16774         a valid TypeBuilder to perform lookups on.o
16775
16776         * class.cs (InheritableMemberSignatureCompare): Use true in the
16777         call to GetGetMethod and GetSetMethod, because we are comparing
16778         the signature, and we need to get the methods *even* if they are
16779         private. 
16780
16781         (PropertyBase.CheckBase): ditto.
16782
16783         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16784         GotoCase.Resolve): Use Peel on EmpytCasts.
16785
16786         * ecore.cs (EmptyCast): drop child, add Peel method.
16787
16788 2002-11-17  Martin Baulig  <martin@ximian.com>
16789
16790         * ecore.cs (EmptyCast.Child): New public property.
16791
16792         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16793         label resolved to an EmptyCast.  Fixes #34162.
16794         (GotoCase.Resolve): Likewise.
16795         (Block.EmitMeta): Likewise.
16796
16797 2002-11-17  Martin Baulig  <martin@ximian.com>
16798
16799         * expression.cs (Invocation.BetterConversion): Prefer int over
16800         uint; short over ushort; long over ulong for integer literals.
16801         Use ImplicitConversionExists instead of StandardConversionExists
16802         since we also need to check for user-defined implicit conversions.
16803         Fixes #34165.  Added test-173.cs.
16804
16805 2002-11-16  Martin Baulig  <martin@ximian.com>
16806
16807         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16808         with the `true' and `false' literals.  Fixes #33151.
16809
16810 2002-11-16  Martin Baulig  <martin@ximian.com>
16811
16812         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16813         October 22nd; don't do the cs1540 check for static members.
16814
16815         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16816         now using our own filter here and doing the cs1540 check again.
16817
16818 2002-11-16  Martin Baulig  <martin@ximian.com>
16819
16820         * support.cs (InternalParameters): Don't crash if we don't have
16821         any fixed parameters.  Fixes #33532.
16822
16823 2002-11-16  Martin Baulig  <martin@ximian.com>
16824
16825         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16826         when looking up static methods to make this work on Windows.
16827         Fixes #33773.
16828
16829 2002-11-16  Martin Baulig  <martin@ximian.com>
16830
16831         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16832         a setter rather than using PropertyInfo.CanWrite.
16833
16834 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16835
16836         * class.cs: Allow acces to block member by subclasses. Fixes build
16837         breaker.
16838
16839 2002-11-14  Martin Baulig  <martin@ximian.com>
16840
16841         * class.cs (Constructor.Emit): Added the extern/block check.
16842         Fixes bug #33678.
16843
16844 2002-11-14  Martin Baulig  <martin@ximian.com>
16845
16846         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16847         iteration while looking for indexers, this is needed because the
16848         indexer may have a different name in our base classes.  Fixed the
16849         error reporting (no indexers at all, not get accessor, no
16850         overloaded match).  Fixes bug #33089.
16851         (IndexerAccess.DoResolveLValue): Likewise.
16852
16853 2002-11-14  Martin Baulig  <martin@ximian.com>
16854
16855         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16856         indexers.  Fixes the first part of bug #33089.
16857         (MethodSignature.InheritableMemberSignatureCompare): Added support
16858         for properties.
16859
16860 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16861
16862         * attribute.cs (Attribute.Resolve): Catch the
16863         NullReferenceException and report it since it isn't supposed to
16864         happen. 
16865
16866 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16867
16868         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16869         LogicalOr and LogicalAnd that can benefit from recursively
16870         handling EmitBranchable.  The code now should be nice for Paolo.
16871
16872 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16875         the Type lookups, as we perform quite a number of lookups on
16876         non-Types.  This can be removed once we can deterministically tell
16877         whether we have a type or a namespace in advance.
16878
16879         But this might require special hacks from our corlib.
16880
16881         * TODO: updated.
16882
16883         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16884         and double which avoids a conversion from an integer to a double.
16885
16886         * expression.cs: tiny optimization, avoid calling IsConstant,
16887         because it effectively performs the lookup twice.
16888
16889 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16890
16891         But a bogus return here to keep the semantics of the old code
16892         until the Mono runtime is fixed.
16893
16894         * pending.cs (GetMissingInterfaces): New method used to remove all
16895         the interfaces that are already implemented by our parent
16896         classes from the list of pending methods. 
16897
16898         * interface.cs: Add checks for calls after ResolveTypeExpr.
16899
16900 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * class.cs (Class.Emit): Report warning 67: event not used if the
16903         warning level is beyond 3.
16904
16905         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16906         being a NullLiteral.
16907
16908         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16909         specifiers. 
16910
16911         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16912         path that might fail if a type can not be resolved.
16913
16914         * expression.cs (Binary.Emit): Emit unsigned versions of the
16915         operators. 
16916
16917         * driver.cs: use error 5.
16918
16919 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16920
16921         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16922
16923 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16924
16925         * cs-parser.jay (switch_section): A beautiful patch from Martin
16926         Baulig that fixed 33094.
16927
16928 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16929
16930         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16931         Check whether the base is abstract and report an error if so.
16932
16933         * expression.cs (IndexerAccess.DoResolveLValue,
16934         IndexerAccess.DoResolve): ditto. 
16935
16936         (Invocation.DoResolve): ditto.
16937
16938         (Invocation.FullMethodDesc): Improve the report string.
16939
16940         * statement.cs (Block): Eliminate IsVariableDefined as it is
16941         basically just a wrapper for GetVariableInfo.
16942
16943         * ecore.cs (SimpleName): Use new 
16944
16945         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16946         type, as we return the actual parameter ref/unref state on a
16947         different call.
16948
16949 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16950
16951         * support.cs: Return proper flags REF/OUT fixing the previous
16952         commit.  
16953
16954         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16955         not used to mean `ref' but `ref or out' in ParameterReference
16956
16957         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16958         full type signature instead of calling TypeManger.CSharpName
16959         ourselves. 
16960
16961         * support.cs (InternalParameters.ParameterDesc): Do not compare
16962         directly to the modflags, because REF/OUT will actually be bitsets
16963         if set. 
16964
16965         * delegate.cs (VerifyMethod): Check also the modifiers.
16966
16967         * cs-tokenizer.cs: Fix bug where floating point values with an
16968         exponent where a sign was missing was ignored.
16969
16970         * driver.cs: Allow multiple assemblies to be specified in a single
16971         /r: argument
16972
16973 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16974
16975         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16976         because identifiers after a parenthesis would end up in this kind
16977         of production, and we needed to desamiguate it for having casts
16978         like:
16979
16980                 (UserDefinedType *) xxx
16981
16982 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16983
16984         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16985         we should set on the Bindingflags.NonPublic, but not turn on
16986         private_ok.  private_ok controls whether a Private member is
16987         returned (this is chekced on the filter routine), while the
16988         BindingFlags.NonPublic just controls whether private/protected
16989         will be allowed.   This fixes the problem part of the problem of
16990         private properties being allowed to be used in derived classes.
16991
16992         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16993         so we can call the children DoResolveLValue method (this will
16994         properly signal errors on lvalue assignments to base properties)
16995
16996         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16997         getter are null, and we have a property info, we know that this
16998         happened because the lookup failed, so we report an error 122 for
16999         protection level violation.
17000
17001         We also silently return if setter and getter are null in the
17002         resolve functions, this condition only happens if we have flagged
17003         the error before.  This is the other half of the problem. 
17004
17005         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17006         not have accessibility information, that is why we were returning
17007         true in the filter function in typemanager.cs.
17008
17009         To properly report 122 (property is inaccessible because of its
17010         protection level) correctly, we report this error in ResolveAccess
17011         by failing if both the setter and the getter are lacking (ie, the
17012         lookup failed). 
17013
17014         DoResolve and DoLResolve have been modified to check for both
17015         setter/getter being null and returning silently, the reason being
17016         that I did not want to put the knowledge about this error in upper
17017         layers, like:
17018
17019         int old = Report.Errors;
17020         x = new PropertyExpr (...);
17021         if (old != Report.Errors)
17022                 return null;
17023         else
17024                 return x;
17025
17026         So the property expr is returned, but it is invalid, so the error
17027         will be flagged during the resolve process. 
17028
17029         * class.cs: Remove InheritablePropertySignatureCompare from the
17030         class, as we no longer depend on the property signature to compute
17031         whether it is possible to implement a method or not.
17032
17033         The reason is that calling PropertyInfo.GetGetMethod will return
17034         null (in .NET, in Mono it works, and we should change this), in
17035         cases where the Get Method does not exist in that particular
17036         class.
17037
17038         So this code:
17039
17040         class X { public virtual int A { get { return 1; } } }
17041         class Y : X { }
17042         class Z : Y { public override int A { get { return 2; } } }
17043
17044         Would fail in Z because the parent (Y) would not have the property
17045         defined.  So we avoid this completely now (because the alternative
17046         fix was ugly and slow), and we now depend exclusively on the
17047         method names.
17048
17049         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17050         reference method, instead of using the property.
17051
17052         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17053         routines are gone now.
17054
17055         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17056         names, they were incorrectly named.
17057
17058         * cs-tokenizer.cs: Return are more gentle token on failure. 
17059
17060         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17061         had an out-of-sync index variable, which caused it to remove from
17062         the list of pending methods the wrong method sometimes.
17063
17064 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17065
17066         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17067         CanWrite, because those refer to this particular instance of the
17068         property, and do not take into account the fact that we can
17069         override single members of a property.
17070
17071         Constructor requires an EmitContext.  The resolution process does
17072         not happen here, but we need to compute the accessors before,
17073         because the resolution does not always happen for properties.
17074
17075         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17076         subclass, before we did not update this flag, but we did update
17077         bindingflags. 
17078
17079         (GetAccessors): Drop this routine, as it did not work in the
17080         presence of partially overwritten set/get methods. 
17081
17082         Notice that this broke the cs1540 detection, but that will require
17083         more thinking. 
17084
17085 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17086
17087         * class.cs:
17088         * codegen.cs:
17089         * driver.cs: issue a warning instead of an error if we don't support
17090         debugging for the platform. Also ignore a couple of errors that may
17091         arise when trying to write the symbols. Undo my previous patch.
17092
17093 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17094
17095         * driver.cs: ignore /debug switch except for Unix platforms.
17096
17097 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17098
17099         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17100
17101 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17102
17103         * driver.cs: Do not make mcs-debug conditional, so we do not break
17104         builds that use it.
17105
17106         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17107         review this patch.  But basically after all the children variables
17108         have been merged, the value of "Breaks" was not being set to
17109         new_breaks for Switch blocks.  I think that it should be set after
17110         it has executed.  Currently I set this to the value of new_breaks,
17111         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17112         conservative, but I do not understand this code very well.
17113
17114         I did not break anything in the build, so that is good ;-)
17115
17116         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17117
17118 2002-10-20  Mark Crichton  <crichton@gimp.org>
17119
17120         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17121
17122 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17123
17124         * cfold.cs: Fixed compile blocker.
17125
17126 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17127
17128         * driver.cs: I was chekcing the key, not the file.
17129
17130 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17131
17132         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17133         message that we were generating - we just need to silently return
17134         a null.
17135
17136 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17137
17138         * class.cs (Event.Define): Change my previous commit, as this
17139         breaks the debugger.  This is a temporary hack, as it seems like
17140         the compiler is generating events incorrectly to begin with.
17141
17142         * expression.cs (Binary.ResolveOperator): Added support for 
17143         "U operator - (E x, E y)"
17144
17145         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17146         y)".
17147
17148         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17149         init-only variables, but this path did not take into account that
17150         there might be also instance readonly variables.  Correct this
17151         problem. 
17152
17153         This fixes bug 32253
17154
17155         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17156         delegates as well.
17157
17158         * driver.cs: Change the extension for modules to `netmodule'
17159
17160         * cs-parser.jay: Improved slightly the location tracking for
17161         the debugger symbols.
17162
17163         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17164         modifiers that were specified instead of the hardcoded value
17165         (FamAndAssem).  This was basically ignoring the static modifier,
17166         and others.  Fixes 32429.
17167
17168         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17169         fixed a bug in the process (32476)
17170
17171         * expression.cs (ArrayAccess.EmitAssign): Patch from
17172         hwang_rob@yahoo.ca that fixes bug 31834.3
17173
17174 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17175
17176         * driver.cs: Make the module extension .netmodule.
17177
17178 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17179
17180         * driver.cs: Report an error if the resource file is not found
17181         instead of crashing.
17182
17183         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17184         false, like Emit does.
17185
17186 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17187
17188         * typemanager.cs: Remove unused private member.  Also reported mcs
17189         bug to report this as a warning like csc.
17190
17191 2002-10-15  Martin Baulig  <martin@gnome.org>
17192
17193         * statement.cs (Statement.Emit): Made this a virtual method; emits
17194         the line number info and calls DoEmit().
17195         (Statement.DoEmit): New protected abstract method, formerly knows
17196         as Statement.Emit().
17197
17198         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17199
17200 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17201
17202         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17203         have fixed a remaining problem: not every AddXXXX was adding a
17204         fully qualified name.  
17205
17206         Now everyone registers a fully qualified name in the DeclSpace as
17207         being defined instead of the partial name.  
17208
17209         Downsides: we are slower than we need to be due to the excess
17210         copies and the names being registered this way.  
17211
17212         The reason for this is that we currently depend (on the corlib
17213         bootstrap for instance) that types are fully qualified, because
17214         we dump all the types in the namespace, and we should really have
17215         types inserted into the proper namespace, so we can only store the
17216         basenames in the defined_names array.
17217
17218 2002-10-10  Martin Baulig  <martin@gnome.org>
17219
17220         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17221         from bug #31834, see the bug report for a testcase which is
17222         miscompiled.
17223
17224 2002-10-10  Martin Baulig  <martin@gnome.org>
17225
17226         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17227         flow analysis code for this.
17228
17229         * statement.cs (Do, While, For): Tell the flow analysis code about
17230         infinite loops.
17231         (FlowBranching.UsageVector): Added support for infinite loops.
17232         (Block.Resolve): Moved the dead code elimination here and use flow
17233         analysis to do it.
17234
17235 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17236
17237         * class.cs (Field.Define): Catch cycles on struct type
17238         definitions. 
17239
17240         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17241         fields if the fields are static.  We only need to check instance
17242         fields. 
17243
17244         * expression.cs (As.DoResolve): Test for reference type.
17245
17246         * statement.cs (Using.ResolveExpression): Use
17247         ConvertImplicitRequired, not ConvertImplicit which reports an
17248         error on failture
17249         (Using.ResolveLocalVariableDecls): ditto.
17250
17251         * expression.cs (Binary.ResolveOperator): Report errors in a few
17252         places where we had to.
17253
17254         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17255
17256 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17257
17258         * expression.cs: Use StoreFromPtr instead of extracting the type
17259         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17260
17261         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17262         an enumeration value to a System.Enum, but System.Enum is not a
17263         value type, but an class type, so we need to box.
17264
17265         (Expression.ConvertExplicit): One codepath could return
17266         errors but not flag them.  Fix this.  Fixes #31853
17267
17268         * parameter.cs (Resolve): Do not allow void as a parameter type.
17269
17270 2002-10-06  Martin Baulig  <martin@gnome.org>
17271
17272         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17273         if it's a class type and not a struct.  Fixes #31815.
17274
17275 2002-10-06  Martin Baulig  <martin@gnome.org>
17276
17277         * statement.cs: Reworked the flow analysis code a bit to make it
17278         usable for dead code elimination.
17279
17280 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17281
17282         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17283
17284 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17285
17286         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17287         to fix the test 165, will investigate deeper.
17288
17289 2002-10-04  Martin Baulig  <martin@gnome.org>
17290
17291         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17292         finally blocks actually work.
17293         (Try.Resolve): We don't need to create a sibling for `finally' if
17294         there is no finally block.
17295
17296 2002-10-04  Martin Baulig  <martin@gnome.org>
17297
17298         * class.cs (Constructor.Define): The default accessibility for a
17299         non-default constructor is private, not public.
17300
17301 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17302
17303         * class.cs (Constructor): Make AllowedModifiers public, add
17304         EXTERN.
17305
17306         * cs-parser.jay: Perform the modifiers test here, as the
17307         constructor for the Constructor class usually receives a zero
17308         because of the way we create it (first we create, later we
17309         customize, and we were never checking the modifiers).
17310
17311         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17312         is a version of LookupTypeReflection that includes the type-name
17313         cache.  This can be used as a fast path for functions that know
17314         the fully qualified name and are only calling into *.GetType() to
17315         obtain a composed type.
17316
17317         This is also used by TypeManager.LookupType during its type
17318         composition.
17319
17320         (LookupType): We now also track the real type name, as sometimes
17321         we can get a quey for the real type name from things like
17322         ComposedCast.  This fixes bug 31422.
17323
17324         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17325         complete type fullname, it does not have to go through the type
17326         resolution system to obtain the composed version of the type (for
17327         obtaining arrays or pointers).
17328
17329         (Conditional.Emit): Use the EmitBoolExpression to
17330         generate nicer code, as requested by Paolo.
17331
17332         (ArrayCreation.CheckIndices): Use the patch from
17333         hwang_rob@yahoo.ca to validate the array initializers. 
17334
17335 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17336
17337         * class.cs (ConstructorInitializer.Emit): simplify code by using
17338         Invocation.EmitCall, and at the same time, fix the bugs in calling
17339         parent constructors that took variable arguments. 
17340
17341         * ecore.cs (Expression.ConvertNumericExplicit,
17342         Expression.ImplicitNumericConversion): Remove the code that
17343         manually wrapped decimal (InternalTypeConstructor call is now gone
17344         as well).
17345
17346         * expression.cs (Cast.TryReduce): Also handle decimal types when
17347         trying to perform a constant fold on the type.
17348
17349         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17350
17351         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17352         that only turned off an error report, and did nothing else. 
17353
17354 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17355
17356         * driver.cs: Handle and ignore /fullpaths
17357
17358 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17359
17360         * expression.cs (Binary.ResolveOperator): Catch the case where
17361         DoNumericPromotions returns true, 
17362
17363         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17364
17365 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17366
17367         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17368         report error 70.
17369
17370 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17371
17372         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17373         conversion exists, but it is also required that the conversion be
17374         performed.  This manifested in "(Type64Enum) 2".  
17375
17376         * class.cs (TypeManager.AddMethod): The fix is not to change
17377         AddEnum, because that one was using a fully qualified name (every
17378         DeclSpace derivative does), but to change the AddMethod routine
17379         that was using an un-namespaced name.  This now correctly reports
17380         the duplicated name.
17381
17382         Revert patch until I can properly fix it.  The issue
17383         is that we have a shared Type space across all namespaces
17384         currently, which is wrong.
17385
17386         Options include making the Namespace a DeclSpace, and merge
17387         current_namespace/current_container in the parser.
17388
17389 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17390
17391         * cs-parser.jay: Improve error reporting when we get a different
17392         kind of expression in local_variable_type and
17393         local_variable_pointer_type. 
17394
17395         Propagate this to avoid missleading errors being reported.
17396
17397         * ecore.cs (ImplicitReferenceConversion): treat
17398         TypeManager.value_type as a target just like object_type.   As
17399         code like this:
17400
17401         ValueType v = 1;
17402
17403         Is valid, and needs to result in the int 1 being boxed before it
17404         is assigned to the value type v.
17405
17406         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17407         to validate the enumeration name.
17408
17409         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17410         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17411         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17412
17413         * ecore.cs (TryImplicitIntConversion): When doing an
17414         implicit-enumeration-conversion, check if the type is 64-bits and
17415         perform a conversion before passing to EnumConstant.
17416
17417 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17418
17419         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17420         report ambiguous type references.  Unlike the MS version, we
17421         report what the ambiguity is.   Innovation at work ;-)
17422
17423         (DeclSpace.FindType): Require a location argument to
17424         display when we display an ambiguous error.
17425
17426         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17427
17428         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17429
17430         * expression.cs (EmitDynamicInitializers): Apply patch from
17431         hwang_rob@yahoo.ca that fixes the order in which we emit our
17432         initializers. 
17433
17434 2002-09-21  Martin Baulig  <martin@gnome.org>
17435
17436         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17437         delegate takes no arguments.
17438
17439 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17440
17441         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17442         from integers.
17443
17444         * expression.cs: Extract the underlying type.
17445
17446         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17447
17448         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17449
17450 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17451
17452         * class.cs (TypeContainer.DefineType): We can not use the nice
17453         PackingSize with the size set to 1 DefineType method, because it
17454         will not allow us to define the interfaces that the struct
17455         implements.
17456
17457         This completes the fixing of bug 27287
17458
17459         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17460         means also structs.  This fixes part of the problem. 
17461         (Expresion.ImplicitReferenceConversionExists): ditto.
17462
17463         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17464         error if there were no errors reported during the type lookup
17465         process, to avoid duplicates or redundant errors.  Without this
17466         you would get an ambiguous errors plus a type not found.  We have
17467         beaten the user enough with the first error.  
17468
17469         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17470         reference. 
17471
17472         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17473         during the resolution process, stop the lookup, this avoids
17474         repeated error reports (same error twice).
17475
17476         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17477
17478         * typemanager.cs (LookupType): Redo the type lookup code to match
17479         the needs of System.Reflection.  
17480
17481         The issue is that System.Reflection requires references to nested
17482         types to begin with a "+" sign instead of a dot.  So toplevel
17483         types look like: "NameSpace.TopLevelClass", and nested ones look
17484         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17485         levels. 
17486
17487 2002-09-19  Martin Baulig  <martin@gnome.org>
17488
17489         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17490         says that a method always returns or always throws an exception,
17491         don't report the CS0161.
17492
17493         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17494         set `Returns = new_returns'.
17495
17496 2002-09-19  Martin Baulig  <martin@gnome.org>
17497
17498         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17499         to an enum constant, check for a CS0176.
17500
17501 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17502
17503         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17504         for operators that must be in pairs and report errors.
17505
17506         * ecore.cs (SimpleName.DoResolveType): During the initial type
17507         resolution process, when we define types recursively, we must
17508         check first for types in our current scope before we perform
17509         lookups in the enclosing scopes.
17510
17511         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17512
17513         (Invocation.VerifyArgumentsCompat): Call
17514         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17515         I thought we were supposed to always call this, but there are a
17516         few places in the code where we dont do it.
17517
17518 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * driver.cs: Add support in -linkres and -resource to specify the
17521         name of the identifier.
17522
17523 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17524
17525         * ecore.cs (StandardConversionExists): Sync with the conversion
17526         code: allow anything-* to void* conversions.
17527
17528         (FindMostSpecificSource): Use an Expression argument
17529         instead of a Type, because we might be handed over a Literal which
17530         gets a few more implicit conversions that plain types do not.  So
17531         this information was being lost.
17532
17533         Also, we drop the temporary type-holder expression when not
17534         required.
17535
17536 2002-09-17  Martin Baulig  <martin@gnome.org>
17537
17538         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17539         this is an explicit interface implementation.
17540
17541 2002-09-17  Martin Baulig  <martin@gnome.org>
17542
17543         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17544         different `IndexerName' attributes.
17545
17546         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17547         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17548         virtual CommonResolve().
17549
17550 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17551
17552         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17553         and convert that to the UnderlyingType.
17554
17555         * statement.cs (Foreach.Resolve): Indexers are just like variables
17556         or PropertyAccesses.
17557
17558         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17559         inside quoted strings, we were not doing this before.
17560
17561 2002-09-16  Martin Baulig  <martin@gnome.org>
17562
17563         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17564         resolve it.  This is needed for the definite assignment check of the
17565         instance expression, fixes bug #29846.
17566         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17567
17568 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17569
17570         * parameter.cs: Fix compile error.  Cannot reference static member
17571         from an instance object.  Is this an mcs bug?
17572
17573 2002-09-14  Martin Baulig  <martin@gnome.org>
17574
17575         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17576         multiple times.  Fixes bug #30295, added test-166.cs.
17577
17578 2002-09-14  Martin Baulig  <martin@gnome.org>
17579
17580         * statement.cs (Block.Emit): Don't emit unreachable code.
17581         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17582         `break' statements.
17583         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17584
17585 2002-09-14  Martin Baulig  <martin@gnome.org>
17586
17587         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17588         is set.
17589
17590 2002-09-14  Martin Baulig  <martin@gnome.org>
17591
17592         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17593         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17594         be false on the ms runtime.
17595
17596 2002-09-13  Martin Baulig  <martin@gnome.org>
17597
17598         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17599         the CS0038 error message.
17600
17601 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17602
17603         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17604         constant inside, return it.
17605
17606 2002-09-12  Martin Baulig  <martin@gnome.org>
17607
17608         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17609         implicit conversion can be done between enum types.
17610
17611         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17612         check whether an implicit conversion to the current enum's UnderlyingType
17613         exists and report an error if not.
17614
17615         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17616         without debugging support.
17617
17618         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17619         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17620
17621 2002-09-12  Martin Baulig  <martin@gnome.org>
17622
17623         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17624
17625         * ecore.cs (IMemberExpr.DeclaringType): New property.
17626         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17627         nonstatic member of an outer type (CS0038).
17628
17629 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17630
17631         * driver.cs: Activate the using-error detector at warning level
17632         4 (at least for MS-compatible APIs).
17633
17634         * namespace.cs (VerifyUsing): Small buglett fix.
17635
17636         * pending.cs (PendingImplementation): pass the container pointer. 
17637
17638         * interface.cs (GetMethods): Allow for recursive definition.  Long
17639         term, I would like to move every type to support recursive
17640         definitions, not the current ordering mechanism that we have right
17641         now.
17642
17643         The situation is this: Attributes are handled before interfaces,
17644         so we can apply attributes to interfaces.  But some attributes
17645         implement interfaces, we will now handle the simple cases
17646         (recursive definitions will just get an error).  
17647
17648         * parameter.cs: Only invalidate types at the end if we fail to
17649         lookup all types.  
17650
17651 2002-09-09  Martin Baulig  <martin@gnome.org>
17652
17653         * ecore.cs (PropertyExpr.Emit): Also check for
17654         TypeManager.system_int_array_get_length so this'll also work when
17655         compiling corlib.  Fixes #30003.
17656
17657 2002-09-09  Martin Baulig  <martin@gnome.org>
17658
17659         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17660         and throw an exception if we can't get the type's size.  Fixed #30040,
17661         added test-165.cs.
17662
17663 2002-09-09  Martin Baulig  <martin@gnome.org>
17664
17665         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17666
17667         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17668         context.  Fixes bug #30027.
17669
17670         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17671         virtual functions.  Fixes bug #30043, added test-164.cs.
17672
17673 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17674
17675         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17676
17677 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17678
17679         * driver.cs: Use an object to get the windows codepage since it's not a
17680         static property.
17681
17682 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17683
17684         * statement.cs (For.Emit): for infinite loops (test == null)
17685         return whether there is a break inside, not always "true".
17686
17687         * namespace.cs (UsingEntry): New struct to hold the name of the
17688         using definition, the location where it is defined, and whether it
17689         has been used in a successful type lookup.
17690
17691         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17692         strings.
17693
17694         * decl.cs: ditto.
17695
17696 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17697
17698         * attribute.cs : Fix incorrect code which relied on catching
17699         a NullReferenceException to detect a null being passed in
17700         where an object was expected.
17701
17702 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17703
17704         * statement.cs (Try): flag the catch variable as assigned
17705
17706         * expression.cs (Cast): Simplified by using ResolveType instead of
17707         manually resolving.
17708
17709         * statement.cs (Catch): Fix bug by using ResolveType.
17710
17711 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17712
17713         * expression.cs (BetterConversion): Special case for when we have
17714         a NullLiteral as the argument and we have to choose between string
17715         and object types - we choose string the way csc does.
17716
17717         * attribute.cs (Attribute.Resolve): Catch the
17718         NullReferenceException and report error #182 since the Mono
17719         runtime no more has the bug and having this exception raised means
17720         we tried to select a constructor which takes an object and is
17721         passed a null.
17722
17723 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17724
17725         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17726         message (1502, 1503) when we can't locate a method after overload
17727         resolution. This is much more informative and closes the bug
17728         Miguel reported.
17729
17730         * interface.cs (PopulateMethod): Return if there are no argument
17731         types. Fixes a NullReferenceException bug.
17732
17733         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17734         expressions too. Previously we were checking only in one place for
17735         positional arguments leaving out named arguments.
17736
17737         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17738         type to the enum type is not allowed. Remove code corresponding to
17739         that.
17740
17741         (ConvertNumericExplicit): Allow explicit conversions from
17742         the underlying type to enum type. This precisely follows the spec
17743         and closes a bug filed by Gonzalo.
17744
17745 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17746
17747         * compiler.csproj:
17748         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17749
17750 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17751
17752         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17753         it was important that we stored the right value after the
17754         reduction in `converted'.
17755
17756 2002-09-04  Martin Baulig  <martin@gnome.org>
17757
17758         * location.cs (Location.SymbolDocument): Use full pathnames for the
17759         source files.
17760
17761 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17764         of the expression resolve mechanism, because that will catch the
17765         SimpleName error failures.
17766
17767         (Conditional): If we can not resolve the
17768         expression, return, do not crash.
17769
17770 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17771
17772         * cs-tokenizer.cs:
17773         (location): display token name instead of its number.
17774
17775 2002-08-28  Martin Baulig  <martin@gnome.org>
17776
17777         * expression.cs (Binary.ResolveOperator): Don't silently return
17778         but return an error if an operator cannot be applied between two
17779         enum types.
17780
17781 2002-08-28  Martin Baulig  <martin@gnome.org>
17782
17783         * class.cs (Constructor.Define): Set the permission attributes
17784         correctly instead of making all constructors public.
17785
17786 2002-08-28  Martin Baulig  <martin@gnome.org>
17787
17788         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17789         for private members before reporting a CS0103; if we find anything,
17790         it's a CS0122.
17791
17792 2002-08-28  Martin Baulig  <martin@gnome.org>
17793
17794         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17795         to check whether `closure_start_type == closure_invocation_type',
17796         we also need to check whether `m.DeclaringType == closure_invocation_type'
17797         before bypassing the permission checks.  We might be accessing
17798         protected/private members from the base class.
17799         (TypeManager.RealMemberLookup): Only set private_ok if private
17800         members were requested via BindingFlags.NonPublic.
17801
17802         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17803
17804         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17805         MethodGroupExpr.IsExplicitImpl if appropriate.
17806         (Invocation.DoResolve): Don't report the CS0120 for explicit
17807         interface implementations.
17808
17809 2002-08-27  Martin Baulig  <martin@gnome.org>
17810
17811         * expression.cs (Invocation.DoResolve): If this is a static
17812         method and we don't have an InstanceExpression, we must report
17813         a CS0120.
17814
17815 2002-08-25  Martin Baulig  <martin@gnome.org>
17816
17817         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17818         `==' between a valuetype and an object.
17819
17820 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17821
17822         * ecore.cs (TypeExpr): Provide a ToString method.
17823
17824 2002-08-24  Martin Baulig  <martin@gnome.org>
17825
17826         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17827         now called proggie.dbg and it's a binary file.
17828
17829 2002-08-23  Martin Baulig  <martin@gnome.org>
17830
17831         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17832
17833 2002-08-23  Martin Baulig  <martin@gnome.org>
17834
17835         * struct.cs (MyStructInfo.ctor): Make this work with empty
17836         structs; it's not allowed to use foreach() on null.
17837
17838 2002-08-23  Martin Baulig  <martin@gnome.org>
17839
17840         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17841         writer the full pathname of the generated assembly.
17842
17843 2002-08-23  Martin Baulig  <martin@gnome.org>
17844
17845         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17846         A `finally' block never returns or breaks; improved handling of
17847         unreachable code.
17848
17849 2002-08-23  Martin Baulig  <martin@gnome.org>
17850
17851         * statement.cs (Throw.Resolve): Allow `throw null'.
17852
17853 2002-08-23  Martin Baulig  <martin@gnome.org>
17854
17855         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17856         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17857         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17858         MemberLookup would return a wrong event if this is an explicit
17859         interface implementation and the class has an event with the same
17860         name.
17861
17862 2002-08-23  Martin Baulig  <martin@gnome.org>
17863
17864         * statement.cs (Block.AddChildVariableNames): New public method.
17865         (Block.AddChildVariableName): Likewise.
17866         (Block.IsVariableNameUsedInChildBlock): Likewise.
17867         (Block.AddVariable): Check whether a variable name has already
17868         been used in a child block.
17869
17870         * cs-parser.jay (declare_local_variables): Mark all variable names
17871         from the current block as being used in a child block in the
17872         implicit block.
17873
17874 2002-08-23  Martin Baulig  <martin@gnome.org>
17875
17876         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17877         find the symbol writer.
17878
17879         * driver.cs: csc also allows the arguments to /define being
17880         separated by commas, not only by semicolons.
17881
17882 2002-08-23  Martin Baulig  <martin@gnome.org>
17883
17884         * interface.cs (Interface.GetMembers): Added static check for events.
17885
17886 2002-08-15  Martin Baulig  <martin@gnome.org>
17887
17888         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17889         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17890
17891         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17892         why the MethodData.EmitDestructor() change was necessary.
17893
17894 2002-08-20  Martin Baulig  <martin@gnome.org>
17895
17896         * class.cs (TypeContainer.FindMembers): Added static check for events.
17897
17898         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17899
17900         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17901         use Type.GetEvents(), not Type.FindMembers().
17902
17903 2002-08-20  Martin Baulig  <martin@gnome.org>
17904
17905         * decl.cs (MemberCache): Added a special method cache which will
17906         be used for method-only searched.  This ensures that a method
17907         search will return a MethodInfo with the correct ReflectedType for
17908         inherited methods.      
17909
17910 2002-08-20  Martin Baulig  <martin@gnome.org>
17911
17912         * decl.cs (DeclSpace.FindMembers): Made this public.
17913
17914 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17915
17916         * delegate.cs: fixed build on windows.
17917         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17918
17919 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17920
17921         * ecore.cs (StandardConversionExists): Return a false
17922         if we are trying to convert the void type to anything else
17923         since that is not allowed.
17924
17925         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17926         we flag error 70 in the event an event is trying to be accessed
17927         directly from outside the declaring type.
17928
17929 2002-08-20  Martin Baulig  <martin@gnome.org>
17930
17931         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17932         MemberCache from typemanager.cs to decl.cs.
17933
17934 2002-08-19  Martin Baulig  <martin@gnome.org>
17935
17936         * class.cs (TypeContainer): Implement IMemberContainer.
17937         (TypeContainer.DefineMembers): Create the MemberCache.
17938         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17939         return public members if BindingFlags.Public was given, check
17940         whether members are static.
17941
17942 2002-08-16  Martin Baulig  <martin@gnome.org>
17943
17944         * decl.cs (DeclSpace.Define): Splitted this in Define and
17945         DefineMembers.  DefineMembers is called first and initializes the
17946         MemberCache.
17947
17948         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17949         DefineMembers() on all our DeclSpaces.
17950
17951         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17952         but call DefineMembers() on all nested interfaces.  We call their
17953         Define() in our new Define() function.
17954
17955         * interface.cs (Interface): Implement IMemberContainer.
17956         (Interface.Define): Moved all code except the attribute stuf to
17957         DefineMembers().
17958         (Interface.DefineMembers): Initialize the member cache.
17959
17960         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17961         need this anymore since we can use MemberCache.FindMembers directly.
17962
17963 2002-08-19  Martin Baulig  <martin@gnome.org>
17964
17965         * typemanager.cs (MemberCache): When creating the cache for an
17966         interface type, add all inherited members.
17967         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17968         to `out bool used_cache' and documented it.
17969         (TypeManager.MemberLookup): If we already used the cache in the first
17970         iteration, we don't need to do the interfaces check.
17971
17972 2002-08-19  Martin Baulig  <martin@gnome.org>
17973
17974         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17975         here from IMemberFinder and don't implement this interface anymore.
17976         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17977
17978         * typemanager.cs (IMemberFinder): This interface is now only used by
17979         classes which actually support the member cache.
17980         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17981         since we only put DeclSpaces into this Hashtable.
17982         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17983         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17984
17985 2002-08-16  Martin Baulig  <martin@gnome.org>
17986
17987         * typemanager.cs (ICachingMemberFinder): Removed.
17988         (IMemberFinder.MemberCache): New property.
17989         (TypeManager.FindMembers): Merged this with RealFindMembers().
17990         This function will never be called from TypeManager.MemberLookup()
17991         so we can't use the cache here, just the IMemberFinder.
17992         (TypeManager.MemberLookup_FindMembers): Check whether the
17993         IMemberFinder has a MemberCache and call the cache's FindMembers
17994         function.
17995         (MemberCache): Rewrote larger parts of this yet another time and
17996         cleaned it up a bit.
17997
17998 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17999
18000         * driver.cs (LoadArgs): Support quoting.
18001
18002         (Usage): Show the CSC-like command line arguments.
18003
18004         Improved a few error messages.
18005
18006 2002-08-15  Martin Baulig  <martin@gnome.org>
18007
18008         * typemanager.cs (IMemberContainer.Type): New property.
18009         (IMemberContainer.IsInterface): New property.
18010
18011         The following changes are conditional to BROKEN_RUNTIME, which is
18012         defined at the top of the file.
18013
18014         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18015         class'es members, but add all members from TypeHandle.ObjectType
18016         if we're an interface.
18017         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18018         is the current type.
18019         (MemberCache.CacheEntry.Container): Removed this field.
18020         (TypeHandle.GetMembers): Include inherited members.
18021
18022 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18023
18024         * typemanager.cs: fixed compilation and added a comment on a field that
18025         is never used.
18026
18027 2002-08-15  Martin Baulig  <martin@gnome.org>
18028
18029         * class.cs (ConstructorInitializer.Resolve): In the
18030         Expression.MemberLookup call, use the queried_type as
18031         invocation_type.
18032
18033         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18034         declared' attribute, it's always true.
18035         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18036         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18037         temporary wrapper for FindMembers which tells MemberLookup whether
18038         members from the base classes are included in the return value.
18039         This will go away soon.
18040         (TypeManager.MemberLookup): Use this temporary hack here; once the
18041         new MemberCache is completed, we don't need to do the DeclaredOnly
18042         looping here anymore since the MemberCache will take care of this.
18043         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18044         (MemberCache): When creating the MemberCache for a class, get
18045         members from the current class and all its base classes.
18046         (MemberCache.CacheEntry.Container): New field.  This is a
18047         temporary hack until the Mono runtime is fixed to distinguish
18048         between ReflectedType and DeclaringType.  It allows us to use MCS
18049         with both the MS runtime and the unfixed Mono runtime without
18050         problems and without accecting performance.
18051         (MemberCache.SearchMembers): The DeclaredOnly looping from
18052         TypeManager.MemberLookup is now done here.      
18053
18054 2002-08-14  Martin Baulig  <martin@gnome.org>
18055
18056         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18057         Type.GetFields on dynamic types but get the fields from the
18058         corresponding TypeContainer.
18059         (MyStructInfo.GetStructInfo): Added check for enum types.
18060
18061         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18062         (MemberList.SyncRoot): Implemented.
18063         (TypeManager.FilterWithClosure): No need to check permissions if
18064         closure_start_type == closure_invocation_type, don't crash if
18065         closure_invocation_type is null.
18066
18067 2002-08-13  Martin Baulig  <martin@gnome.org>
18068
18069         Rewrote TypeContainer.FindMembers to use a member cache.  This
18070         gives us a speed increase of about 35% for the self-hosting MCS
18071         build and of about 15-20% for the class libs (both on GNU/Linux).
18072
18073         * report.cs (Timer): New class to get enhanced profiling.  This
18074         whole class is "TIMER" conditional since it remarkably slows down
18075         compilation speed.
18076
18077         * class.cs (MemberList): New class.  This is an IList wrapper
18078         which we're now using instead of passing MemberInfo[]'s around to
18079         avoid copying this array unnecessarily.
18080         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18081         (ICachingMemberFinder, IMemberContainer): New interface.
18082         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18083         has already been checked, otherwise use it for the name comparision.
18084         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18085         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18086         if possible.  Returns a MemberList, not a MemberInfo [].
18087         (TypeHandle): New class, implements IMemberContainer.  We create
18088         one instance of this class per type, it contains a MemberCache
18089         which is used to do the member lookups.
18090         (MemberCache): New class.  Each instance of this class contains
18091         all members of a type and a name-based hash table.
18092         (MemberCache.FindMembers): This is our new member lookup
18093         function.  First, it looks up all members of the requested name in
18094         the hash table.  Then, it walks this list and sorts out all
18095         applicable members and returns them.
18096
18097 2002-08-13  Martin Baulig  <martin@gnome.org>
18098
18099         In addition to a nice code cleanup, this gives us a performance
18100         increase of about 1.4% on GNU/Linux - not much, but it's already
18101         half a second for the self-hosting MCS compilation.
18102
18103         * typemanager.cs (IMemberFinder): New interface.  It is used by
18104         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18105         Enum, Delegate or Interface.
18106         (TypeManager.finder_to_member_finder): New PtrHashtable.
18107         (TypeManager.finder_to_container): Removed.
18108         (TypeManager.finder_to_delegate): Removed.
18109         (TypeManager.finder_to_interface): Removed.
18110         (TypeManager.finder_to_enum): Removed.
18111
18112         * interface.cs (Interface): Implement IMemberFinder.
18113
18114         * delegate.cs (Delegate): Implement IMemberFinder.
18115
18116         * enum.cs (Enum): Implement IMemberFinder.
18117
18118         * class.cs (TypeContainer): Implement IMemberFinder.
18119
18120 2002-08-12  Martin Baulig  <martin@gnome.org>
18121
18122         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18123
18124 2002-08-12  Martin Baulig  <martin@gnome.org>
18125
18126         * ecore.cs (ITypeExpression): New interface for expressions which
18127         resolve to a type.
18128         (TypeExpression): Renamed to TypeLookupExpression.
18129         (Expression.DoResolve): If we're doing a types-only lookup, the
18130         expression must implement the ITypeExpression interface and we
18131         call DoResolveType() on it.
18132         (SimpleName): Implement the new ITypeExpression interface.
18133         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18134         hack, the situation that we're only looking up types can't happen
18135         anymore when this method is called.  Moved the type lookup code to
18136         DoResolveType() and call it.
18137         (SimpleName.DoResolveType): This ITypeExpression interface method
18138         is now doing the types-only lookup.
18139         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18140         (ResolveFlags): Added MaskExprClass.
18141
18142         * expression.cs (MemberAccess): Implement the ITypeExpression
18143         interface.
18144         (MemberAccess.DoResolve): Added support for a types-only lookup
18145         when we're called via ITypeExpression.DoResolveType().
18146         (ComposedCast): Implement the ITypeExpression interface.
18147
18148         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18149         Expression.Resolve() with ResolveFlags.Type instead.
18150
18151 2002-08-12  Martin Baulig  <martin@gnome.org>
18152
18153         * interface.cs (Interface.Define): Apply attributes.
18154
18155         * attribute.cs (Attribute.ApplyAttributes): Added support for
18156         interface attributes.
18157
18158 2002-08-11  Martin Baulig  <martin@gnome.org>
18159
18160         * statement.cs (Block.Emit): Only check the "this" variable if we
18161         do not always throw an exception.
18162
18163         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18164         whether the property has a set accessor.
18165
18166 2002-08-11  Martin Baulig  <martin@gnome.org>
18167
18168         Added control flow analysis support for structs.
18169
18170         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18171         with control flow analysis turned off.
18172         (IVariable): New interface.
18173         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18174         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18175         (FieldExpr.DoResolve): Resolve the instance expression with flow
18176         analysis turned off and do the definite assignment check after the
18177         resolving when we know what the expression will resolve to.
18178
18179         * expression.cs (LocalVariableReference, ParameterReference):
18180         Implement the new IVariable interface, only call the flow analysis
18181         code if ec.DoFlowAnalysis is true.
18182         (This): Added constructor which takes a Block argument.  Implement
18183         the new IVariable interface.
18184         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18185         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18186         This does the definite assignment checks for struct members.
18187
18188         * class.cs (Constructor.Emit): If this is a non-static `struct'
18189         constructor which doesn't have any initializer, call
18190         Block.AddThisVariable() to tell the flow analysis code that all
18191         struct elements must be initialized before control returns from
18192         the constructor.
18193
18194         * statement.cs (MyStructInfo): New public class.
18195         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18196         argument to this indexer.  If non-zero, check an individual struct
18197         member, not the whole struct.
18198         (FlowBranching.CheckOutParameters): Check struct members.
18199         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18200         overloaded versions of these methods which take an additional
18201         `int field_idx' argument to check struct members.
18202         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18203         overloaded versions of these methods which take an additional
18204         `string field_name' argument to check struct member.s
18205         (VariableInfo): Implement the IVariable interface.
18206         (VariableInfo.StructInfo): New public property.  Returns the
18207         MyStructInfo instance of the variable if it's a struct or null.
18208         (Block.AddThisVariable): New public method.  This is called from
18209         Constructor.Emit() for non-static `struct' constructor which do
18210         not have any initializer.  It creates a special variable for the
18211         "this" instance variable which will be checked by the flow
18212         analysis code to ensure that all of the struct's fields are
18213         initialized before control returns from the constructor.
18214         (UsageVector): Added support for struct members.  If a
18215         variable/parameter is a struct with N members, we reserve a slot
18216         in the usage vector for each member.  A struct is considered fully
18217         initialized if either the struct itself (slot 0) or all its
18218         members are initialized.
18219
18220 2002-08-08  Martin Baulig  <martin@gnome.org>
18221
18222         * driver.cs (Driver.MainDriver): Only report an error CS5001
18223         if there were no compilation errors.
18224
18225         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18226         `UnsafeContext' property to determine whether the parent is in
18227         unsafe context rather than checking the parent's ModFlags:
18228         classes nested in an unsafe class are unsafe as well.
18229
18230 2002-08-08  Martin Baulig  <martin@gnome.org>
18231
18232         * statement.cs (UsageVector.MergeChildren): Distinguish between
18233         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18234         we return.  Added test17() and test18() to test-154.cs.
18235
18236 2002-08-08  Martin Baulig  <martin@gnome.org>
18237
18238         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18239         Family access, make sure the invoking type isn't a subclass of the
18240         queried type (that'd be a CS1540).
18241
18242         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18243         this method which takes an additional `Type invocation_type'.
18244
18245         * expression.cs (BaseAccess.DoResolve): Use the base type as
18246         invocation and query type.
18247         (MemberAccess.DoResolve): If the lookup failed and we're about to
18248         report a CS0122, try a lookup with the ec.ContainerType - if this
18249         succeeds, we must report a CS1540.
18250
18251 2002-08-08  Martin Baulig  <martin@gnome.org>
18252
18253         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18254         (MethodGroupExpr): Implement the IMemberExpr interface.
18255
18256         * expression (MemberAccess.ResolveMemberAccess): No need to have
18257         any special code for MethodGroupExprs anymore, they're now
18258         IMemberExprs.   
18259
18260 2002-08-08  Martin Baulig  <martin@gnome.org>
18261
18262         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18263         Family, FamANDAssem and FamORAssem permissions.
18264         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18265
18266 2002-08-08  Martin Baulig  <martin@gnome.org>
18267
18268         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18269         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18270         or loop block.
18271
18272 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18273
18274         * driver.cs: implemented /resource option to embed managed resources.
18275
18276 2002-08-07  Martin Baulig  <martin@gnome.org>
18277
18278         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18279         (FieldBase.HasFieldInitializer): New public property.
18280         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18281         returns the field initializer and makes sure it is only resolved once.
18282         (TypeContainer.EmitFieldInitializers): Call
18283         FieldBase.GetInitializerExpression to get the initializer, this ensures
18284         that it isn't resolved multiple times.
18285
18286         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18287         the resolving process (SimpleName/MemberLookup) that we're currently
18288         emitting a field initializer (which must not access any instance members,
18289         this is an error CS0236).
18290
18291         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18292         argument, if the `IsFieldInitializer' flag is set, we must report and
18293         error CS0236 and not an error CS0120.   
18294
18295 2002-08-07  Martin Baulig  <martin@gnome.org>
18296
18297         * ecore.cs (IMemberExpr): New public interface.
18298         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18299         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18300         if the expression is an IMemberExpr.
18301
18302         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18303         to be null, implicitly default to `this' if we're non-static in
18304         this case.  Simplified the code a lot by using the new IMemberExpr
18305         interface.  Also fixed bug #28176 here.
18306
18307 2002-08-06  Martin Baulig  <martin@gnome.org>
18308
18309         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18310         ParameterReferences during semantic analysis so that we can do a
18311         type-only search when resolving Cast, TypeOf and SizeOf.
18312         (block): Pass the `current_local_parameters' to the Block's
18313         constructor.
18314
18315         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18316         argument to the constructor.
18317         (ConstructorInitializer.Resolve): Create a temporary implicit
18318         block with the parameters.
18319
18320         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18321         references here if we aren't doing a type-only search.
18322
18323         * statement.cs (Block): Added constructor which takes a
18324         `Parameters parameters' argument.
18325         (Block.Parameters): New public property.
18326
18327         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18328         to `Parameters' and made it public readonly.
18329
18330 2002-08-06  Martin Baulig  <martin@gnome.org>
18331
18332         * ecore.cs (Expression.Warning): Made this public as well.
18333
18334         * report.cs (Report.Debug): Print the contents of collections.
18335
18336 2002-08-06  Martin Baulig  <martin@gnome.org>
18337
18338         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18339         used to tell Resolve() which kinds of expressions it may return.
18340         (Expression.Resolve): Added overloaded version of this method which
18341         takes a `ResolveFlags flags' argument.  This can be used to tell
18342         Resolve() which kinds of expressions it may return.  Reports a
18343         CS0118 on error.
18344         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18345         ResolveFlags.SimpleName.
18346         (Expression.Error118): Added overloaded version of this method which
18347         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18348         which kinds of expressions are allowed.
18349
18350         * expression.cs (Argument.ResolveMethodGroup): New public method.
18351         Resolves an argument, but allows a MethodGroup to be returned.
18352         This is used when invoking a delegate.
18353
18354         * TODO: Updated a bit.
18355
18356 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18357
18358         Fixed compilation with csc.
18359
18360         * ecore.cs: Expression.Error made public. Is this correct? Should
18361         Warning be made public too?
18362
18363         * expression.cs: use ea.Location instead of ea.loc.
18364         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18365
18366 2002-08-06  Martin Baulig  <martin@gnome.org>
18367
18368         * ecore.cs (Expression.loc): Moved the location here instead of
18369         duplicating it in all derived classes.
18370         (Expression.Location): New public property.
18371         (Expression.Error, Expression.Warning): Made them non-static and
18372         removed the location argument.
18373         (Expression.Warning): Added overloaded version which takes an
18374         `int level' argument.
18375         (Expression.Error118): Make this non-static and removed the
18376         expression and location arguments.
18377         (TypeExpr): Added location argument to the constructor.
18378
18379         * expression.cs (StaticCallExpr): Added location argument to
18380         the constructor.
18381         (Indirection, PointerArithmetic): Likewise.
18382         (CheckedExpr, UnCheckedExpr): Likewise.
18383         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18384         (StringPtr): Likewise.
18385
18386
18387 2002-08-05  Martin Baulig  <martin@gnome.org>
18388
18389         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18390
18391         * assign.cs (Assign.DoResolve): Check whether the source
18392         expression is a value or variable.
18393
18394         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18395         while resolving the corresponding blocks.
18396
18397         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18398         an error, don't silently return null.
18399
18400         * statement.cs (Block.AddVariable): Do the error reporting here
18401         and distinguish between CS0128 and CS0136.
18402         (Block.DoResolve): Report all unused labels (warning CS0164).
18403         (LabeledStatement): Pass the location to the constructor.
18404         (LabeledStatement.HasBeenReferenced): New property.
18405         (LabeledStatement.Resolve): Set it to true here.
18406
18407         * statement.cs (Return.Emit): Return success even after reporting
18408         a type mismatch error (CS0126 or CS0127), this is what csc does and
18409         it avoids confusing the users with any consecutive errors.
18410
18411 2002-08-05  Martin Baulig  <martin@gnome.org>
18412
18413         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18414
18415         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18416
18417         * expression.cs (MemberAccess.DoResolve): Silently return if an
18418         error has already been reported.
18419
18420         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18421         error has already been reported.
18422
18423 2002-08-05  Martin Baulig  <martin@gnome.org>
18424
18425         * statement.cs (UsageVector): Only initialize the `parameters'
18426         vector if we actually have any "out" parameters.
18427
18428 2002-08-05  Martin Baulig  <martin@gnome.org>
18429
18430         * expression.cs (Binary.ResolveOperator): When combining delegates,
18431         they must have the same type.
18432
18433 2002-08-05  Martin Baulig  <martin@gnome.org>
18434
18435         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18436         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18437         work with the ms runtime and we also don't need it: if we're a
18438         PropertyBuilder and not in the `indexer_arguments' hash, then we
18439         are a property and not an indexer.
18440
18441         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18442         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18443         since the latter one doesn't work with the ms runtime.
18444
18445 2002-08-03  Martin Baulig  <martin@gnome.org>
18446
18447         Fixed bugs #27998 and #22735.
18448
18449         * class.cs (Method.IsOperator): New public field.
18450         (Method.CheckBase): Report CS0111 if there's already a method
18451         with the same parameters in the current class.  Report CS0508 when
18452         attempting to change the return type of an inherited method.
18453         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18454         and it's not marked abstract or extern.
18455         (PropertyBase): New abstract base class for Property and Indexer.
18456         (PropertyBase.CheckBase): Moved here from Property and made it work
18457         for indexers.
18458         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18459         the same so we can reuse it there.
18460         (Property, Indexer): Derive from PropertyBase.
18461         (MethodSignature.inheritable_property_signature_filter): New delegate
18462         to find properties and indexers.
18463
18464         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18465         argument and improved error reporting.
18466
18467         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18468         EmptyReadOnlyParameters and made it a property.
18469
18470         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18471         version of this method which takes a `PropertyInfo indexer'.
18472         (TypeManager.RegisterIndexer): New method.
18473
18474         * class.cs: Added myself as author of this file :-)
18475
18476 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18477
18478         * class.cs: fixed compilation on windoze.
18479
18480 2002-08-03  Martin Baulig  <martin@gnome.org>
18481
18482         * interface.cs (Interface.GetInterfaceBases): Check whether all
18483         base interfaces are at least as accessible than the current one.
18484
18485         * class.cs (TypeContainer.GetClassBases): Check whether base types
18486         are at least as accessible than the current type.
18487         (TypeContainer.AsAccessible): Implemented and made non-static.
18488         (MemberBase.CheckParameters): Report errors if the accessibility
18489         checks fail.
18490
18491         * delegate.cs (Delegate.Delegate): The default visibility is
18492         internal for top-level types and private for nested types.
18493         (Delegate.Define): Report errors if the accessibility checks fail.
18494
18495         * enum.cs (Enum.Enum): The default visibility is internal for
18496         top-level types and private for nested types.
18497         (Enum.DefineType): Compute the correct visibility.
18498
18499         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18500         function which takes a `bool is_toplevel' instead of a TypeContainer.
18501
18502         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18503         builtin type.
18504
18505 2002-08-02  Martin Baulig  <martin@gnome.org>
18506
18507         * expression.cs (LocalVariableReferenc): Added constructor which
18508         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18509         (LocalVariableReference.IsReadOnly): New property.
18510         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18511         variable is readonly, use our own readonly flag to do this; you can
18512         use the new constructor to get a writable reference to a read-only
18513         variable.
18514
18515         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18516         reference to the local variable.
18517
18518 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18519
18520         * rootcontext.cs (ResolveCore): Also include System.Exception
18521
18522         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18523         we reach an EmptyStatement.
18524
18525         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18526         is also fine.
18527
18528         * expression.cs (Binary.ResolveOperator): Check error result in
18529         two places.
18530
18531         use brtrue/brfalse directly and avoid compares to null.
18532
18533 2002-08-02  Martin Baulig  <martin@gnome.org>
18534
18535         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18536         Fixes bug #28407, added test-155.cs.
18537
18538 2002-08-01  Martin Baulig  <martin@gnome.org>
18539
18540         * class.cs (Event.EmitDefaultMethod): Make this work with static
18541         events.  Fixes #28311, added verify-3.cs.
18542
18543 2002-08-01  Martin Baulig  <martin@gnome.org>
18544
18545         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18546         `is_disposable' fields.
18547         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18548         `hm.is_disposable' if we're using the collection pattern.
18549         (Foreach.EmitCollectionForeach): Use the correct type for the
18550         enumerator's local variable, only emit the try/finally block if
18551         necessary (fixes #27713).
18552
18553 2002-08-01  Martin Baulig  <martin@gnome.org>
18554
18555         * ecore.cs (Expression.report118): Renamed to Error118 and made
18556         it public static.
18557
18558         * statement.cs (Throw.Resolve): Check whether the expression is of
18559         the correct type (CS0118) and whether the type derives from
18560         System.Exception (CS0155).
18561         (Catch.Resolve): New method.  Do the type lookup here and check
18562         whether it derives from System.Exception (CS0155).
18563         (Catch.CatchType, Catch.IsGeneral): New public properties.
18564
18565         * typemanager.cs (TypeManager.exception_type): Added.
18566
18567 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18568
18569         * driver.cs: Updated About function.
18570
18571 2002-07-31  Martin Baulig  <martin@gnome.org>
18572
18573         Implemented Control Flow Analysis.
18574
18575         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18576         (EmitContext.CurrentBranching): Added.
18577         (EmitContext.StartFlowBranching): Added.
18578         (EmitContext.EndFlowBranching): Added.
18579         (EmitContext.KillFlowBranching): Added.
18580         (EmitContext.IsVariableAssigned): Added.
18581         (EmitContext.SetVariableAssigned): Added.
18582         (EmitContext.IsParameterAssigned): Added.
18583         (EmitContext.SetParameterAssigned): Added.
18584         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18585         Added control flow analysis stuff here.
18586
18587         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18588         resolve the expression as lvalue.
18589         (LocalVariableReference.DoResolve): Check whether the variable has
18590         already been assigned.
18591         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18592         the parameter as assigned here.
18593         (ParameterReference.DoResolve): Check whether the parameter has already
18594         been assigned.
18595         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18596         expression as lvalue.
18597
18598         * statement.cs (FlowBranching): New class for the flow analysis code.
18599         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18600         (LabeledStatement.IsDefined): New public property.
18601         (LabeledStatement.AddUsageVector): New public method to tell flow
18602         analyis that the label may be reached via a forward jump.
18603         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18604         flow analysis.
18605         (VariableInfo.Number): New public field.  This is used by flow analysis
18606         to number all locals of a block.
18607         (Block.CountVariables): New public property.  This is the number of
18608         local variables in this block (including the locals from all parent
18609         blocks).
18610         (Block.EmitMeta): Number all the variables.
18611
18612         * statement.cs: Added flow analysis support to all classes.
18613
18614 2002-07-31  Martin Baulig  <martin@gnome.org>
18615
18616         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18617         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18618         then use this argument.
18619
18620         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18621
18622         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18623         use this to specify /define options.
18624
18625 2002-07-29  Martin Baulig  <martin@gnome.org>
18626
18627         * statement.cs (Fixed): Moved all code that does variable lookups
18628         and resolvings from Emit to Resolve.
18629
18630         * statement.cs (For): Moved all code that does variable lookups
18631         and resolvings from Emit to Resolve.
18632
18633         * statement.cs (Using): Moved all code that does variable lookups
18634         and resolvings from Emit to Resolve.
18635
18636 2002-07-29  Martin Baulig  <martin@gnome.org>
18637
18638         * attribute.cs (Attribute.Resolve): Explicitly catch a
18639         System.NullReferenceException when creating the
18640         CustromAttributeBuilder and report a different warning message.
18641
18642 2002-07-29  Martin Baulig  <martin@gnome.org>
18643
18644         * support.cs (ParameterData.ParameterName): Added method to
18645         get the name of a parameter.
18646
18647         * typemanager.cs (TypeManager.IsValueType): New public method.
18648
18649 2002-07-29  Martin Baulig  <martin@gnome.org>
18650
18651         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18652         is a flag which specifies that it's either ref or out.
18653         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18654         the out parameter to `out Parameter.Modifier mod', also set the
18655         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18656
18657         * support.cs (InternalParameters.ParameterModifier): Distinguish
18658         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18659         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18660
18661         * expression.cs (Argument.GetParameterModifier): Distinguish
18662         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18663         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18664
18665 2002-07-29  Martin Baulig  <martin@gnome.org>
18666
18667         * expression.cs (ParameterReference.ParameterReference): Added
18668         `Location loc' argument to the constructor.
18669
18670         * cs-parser.jay: Pass location to ParameterReference.
18671
18672 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18673
18674         * statement.cs (Try): Initialize the location.
18675
18676         * cs-parser.jay: pass location to Try.
18677
18678         * expression.cs (Unary.Reduce): Change the prototype to return
18679         whether a constant fold could be performed or not.  The result is
18680         returned in an out parameters.  In the case of Indirection and
18681         AddressOf, we want to perform the full tests.
18682
18683 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18684
18685         * statement.cs (Statement.Emit): Flag dead code.
18686
18687 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18688
18689         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18690
18691 2002-07-27  Martin Baulig  <martin@gnome.org>
18692
18693         * class.cs (MethodData.Define): Put back call to
18694         TypeManager.AddMethod(), accidentally commented this out.
18695
18696         * report.cs (Debug): New public method to print debugging information,
18697         this is `[Conditional ("DEBUG")]'.
18698
18699 2002-07-26  Martin Baulig  <martin@gnome.org>
18700
18701         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18702         (switch_statement): Push the current_block to the switch_stack and
18703         pop it again when we're done with the switch.
18704         (switch_section): The new block is a child of the current_block.
18705         Fixes bug #24007, added test-152.cs.
18706
18707 2002-07-27  Martin Baulig  <martin@gnome.org>
18708
18709         * expression.cs (Invocation.EmitArguments): When calling a varargs
18710         function with only its fixed arguments, we need to pass an empty
18711         array.
18712
18713 2002-07-27  Martin Baulig  <martin@gnome.org>
18714
18715         Mono 0.13 has been released.
18716
18717 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18718
18719         * driver.cs: Rename --resource to --linkres, because that is what
18720         we do currently, we dont support --resource yet.
18721
18722         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18723
18724 2002-07-25  Martin Baulig  <martin@gnome.org>
18725
18726         * class.cs (MethodData): New public class.  This is a `method builder'
18727         class for a method or one accessor of a Property/Indexer/Event.
18728         (MethodData.GetMethodFlags): Moved here from MemberBase.
18729         (MethodData.ApplyAttributes): Likewise.
18730         (MethodData.ApplyObsoleteAttribute): Likewise.
18731         (MethodData.ApplyConditionalAttribute): Likewise.
18732         (MethodData.ApplyDllImportAttribute): Likewise.
18733         (MethodData.CheckAbstractAndExternal): Likewise.
18734         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18735         (MethodData.Emit): Formerly known as Method.Emit().
18736         (MemberBase): Moved everything which was specific to a single
18737         accessor/method to MethodData.
18738         (Method): Create a new MethodData and call Define() and Emit() on it.
18739         (Property, Indexer, Event): Create a new MethodData objects for each
18740         accessor and call Define() and Emit() on them.
18741
18742 2002-07-25  Martin Baulig  <martin@gnome.org>
18743
18744         Made MethodCore derive from MemberBase to reuse the code from there.
18745         MemberBase now also checks for attributes.
18746
18747         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18748         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18749         as virtual.
18750         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18751         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18752         (MemberBase.ApplyAttributes): New virtual method; applies the
18753         attributes to a method or accessor.
18754         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18755         (MemberBase.ApplyConditionalAttribute): Likewise.
18756         (MemberBase.ApplyDllImportAttribute): Likewise.
18757         (MemberBase.CheckAbstractAndExternal): Likewise.
18758         (MethodCore.ParameterTypes): This is now a property instead of a
18759         method, it's initialized from DoDefineParameters().
18760         (MethodCore.ParameterInfo): Removed the set accessor.
18761         (MethodCore.DoDefineParameters): New protected virtual method to
18762         initialize ParameterTypes and ParameterInfo.
18763         (Method.GetReturnType): We can now simply return the MemberType.
18764         (Method.GetMethodFlags): Override the MemberBase version and add
18765         the conditional flags.
18766         (Method.CheckBase): Moved some code from Define() here, call
18767         DoDefineParameters() here.
18768         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18769         here to avoid some larger code duplication.
18770         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18771         ensure that abstract and external accessors don't declare a body.
18772
18773         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18774         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18775         lookup in the attribute's parent classes, so we need to abort as soon
18776         as we found the first match.
18777         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18778         the attribute has no arguments.
18779
18780         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18781         of a Method.
18782
18783 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18784
18785         * cs-parser.jay: reverted previous patch.
18786
18787 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18788
18789         * cs-parser.jay: fixed bug #22119.
18790
18791 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18792
18793         * attribute.cs: fixed compilation. The error was:
18794         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18795         be assigned to before control leaves the current method."
18796         [FIXME:  Filed as bug #28186: MCS must report this error.]
18797
18798 2002-07-25  Martin Baulig  <martin@gnome.org>
18799
18800         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18801         method to pull the condition name ouf of a Conditional attribute.
18802         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18803         the obsolete message and error flag out of an Obsolete attribute.
18804
18805         * class.cs (Method.GetMethodFlags): New public method to get the
18806         TypeManager.MethodFlags for this method.
18807         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18808         private methods.
18809         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18810         if we're overriding a virtual function, set the new private variable
18811         `parent_method'; call the new TypeManager.AddMethod().
18812
18813         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18814         the MethodBuilder and the Method in a PtrHashtable.
18815         (TypeManager.builder_to_method): Added for this purpose.
18816         (TypeManager.MethodFlags): Added IsObsoleteError.
18817         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18818         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18819         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18820         the message from the attribute.
18821
18822 2002-07-24  Martin Baulig  <martin@gnome.org>
18823
18824         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18825         preprocessor directives, ensure that the argument to #define/#undef is
18826         exactly one identifier and that it's actually an identifier.
18827
18828         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18829         did not work ....
18830
18831 2002-07-24  Martin Baulig  <martin@gnome.org>
18832
18833         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18834         initialize it to TypeManager.object_type in the constructor.
18835         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18836         of the `hm.get_current' method if we're using the collection pattern.
18837         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18838         for the explicit conversion to make it work when we're using the collection
18839         pattern and the `Current' property has a different return type than `object'.
18840         Fixes #27713.
18841
18842 2002-07-24  Martin Baulig  <martin@gnome.org>
18843
18844         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18845         does not match, but don't report any errors.  This method is called in
18846         order for all methods in a MethodGroupExpr until a matching method is
18847         found, so we don't want to bail out if the first method doesn't match.
18848         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18849         matches, report the 123.  Fixes #28070.
18850
18851 2002-07-24  Martin Baulig  <martin@gnome.org>
18852
18853         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18854         TypeManager.TypeToCoreType() to the top of the method so the
18855         following equality checks will work.  Fixes #28107.
18856
18857 2002-07-24  Martin Baulig  <martin@gnome.org>
18858
18859         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18860         operand is of type uint, and the other operand is of type sbyte,
18861         short or int, the operands are converted to type long." -
18862         Actually do what this comment already told us.  Fixes bug #28106,
18863         added test-150.cs.
18864
18865 2002-07-24  Martin Baulig  <martin@gnome.org>
18866
18867         * class.cs (MethodBase): New abstract class.  This is now a base
18868         class for Property, Indexer and Event to avoid some code duplication
18869         in their Define() and DefineMethods() methods.
18870         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18871         generic methods for Define() and DefineMethods().
18872         (FieldBase): Derive from MemberBase, not MemberCore.
18873         (Property): Derive from MemberBase, not MemberCore.
18874         (Property.DefineMethod): Moved all the code from this method to the
18875         new MethodBase.DefineAccessor(), just call it with appropriate
18876         argumetnts.
18877         (Property.Define): Call the new Property.DoDefine(), this does some
18878         sanity checks and we don't need to duplicate the code everywhere.
18879         (Event): Derive from MemberBase, not MemberCore.
18880         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18881         accessors, this will also make them work with interface events.
18882         (Indexer): Derive from MemberBase, not MemberCore.
18883         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18884         (Indexer.Define): Use the new MethodBase functions.
18885
18886         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18887         argument to the constructor.
18888         (Interface.FindMembers): Added support for interface events.
18889         (Interface.PopluateEvent): Implemented.
18890
18891         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18892
18893 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18894
18895         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18896         but this is required to check for a method name being the same as
18897         the containing class.  
18898
18899         Handle this now.
18900
18901 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18902
18903         * interface.cs: initialize variable.
18904
18905 2002-07-23  Martin Baulig  <martin@gnome.org>
18906
18907         Implemented the IndexerName attribute in interfaces.
18908
18909         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18910         name if this is an explicit interface implementation.
18911         (Indexer.InterfaceIndexerName): New public variable.  If we're
18912         implementing an interface indexer, this is the IndexerName in that
18913         interface.  Otherwise, it's the IndexerName.
18914         (Indexer.DefineMethod): If we're implementing interface indexer,
18915         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18916         and Pending.ImplementIndexer methods.
18917         (Indexer.Define): Also define the PropertyBuilder if we're
18918         implementing an interface indexer and this is neither an explicit
18919         interface implementation nor do the IndexerName match the one in
18920         the interface.
18921
18922         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18923         If a method is defined here, then we always need to create a proxy
18924         for it.  This is used when implementing interface indexers.
18925         (Pending.IsInterfaceIndexer): New public method.
18926         (Pending.ImplementIndexer): New public method.
18927         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18928         This is used when implementing interface indexers to define a proxy
18929         if necessary.
18930         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18931         define a proxy if necessary.
18932
18933         * interface.cs (Interface.IndexerName): New public variable.
18934         (Interface.PopulateIndexer): Set the IndexerName.
18935         (Interface.DefineIndexers): New private method.  Populate all the
18936         indexers and make sure their IndexerNames match.
18937
18938         * typemanager.cs (IndexerPropertyName): Added support for interface
18939         indexers.
18940
18941 2002-07-22  Martin Baulig  <martin@gnome.org>
18942
18943         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18944         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18945         ret if HasReturnLabel.
18946         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18947         variables.
18948
18949         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18950         and set the ec.LoopBeginTryCatchLevel.
18951         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18952         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18953         the current ec.TryCatchLevel, the branch goes out of an exception
18954         block.  In this case, we need to use Leave and not Br.
18955
18956 2002-07-22  Martin Baulig  <martin@gnome.org>
18957
18958         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18959         block unless the block does not always return or it is contained in
18960         another try { ... } catch { ... } block.  Fixes bug #26506.
18961         Added verify-1.cs to the test suite.
18962
18963 2002-07-22  Martin Baulig  <martin@gnome.org>
18964
18965         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18966         then we do not always return.  Fixes bug #24985.
18967
18968 2002-07-22  Martin Baulig  <martin@gnome.org>
18969
18970         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18971         lookup on a per-class level; ie. walk up the class hierarchy until we
18972         found at least one applicable method, then choose the best among them.
18973         Fixes bug #24463 and test-29.cs.
18974
18975 2002-07-22  Martin Baulig  <martin@gnome.org>
18976
18977         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18978         return types of the methods.  The return type is not part of the
18979         signature and we must not check it to make the `new' modifier work.
18980         Fixes bug #27999, also added test-147.cs.
18981         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18982
18983         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18984         on the method's return type.
18985
18986 2002-07-21  Martin Baulig  <martin@gnome.org>
18987
18988         * assign.cs: Make this work if the rightmost source is a constant and
18989         we need to do an implicit type conversion.  Also adding a few more tests
18990         to test-38.cs which should have caught this.
18991
18992         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18993         target in the makefile for this.  The makefile.gnu is primarily intended
18994         for end-users who don't want to debug the compiler.
18995
18996 2002-07-21  Martin Baulig  <martin@gnome.org>
18997
18998         * assign.cs: Improved the Assign class so it can now handle embedded
18999         assignments (X = Y = Z = something).  As a side-effect this'll now also
19000         consume less local variables.  test-38.cs now passes with MCS, added
19001         a few new test cases to that test.
19002
19003 2002-07-20  Martin Baulig  <martin@gnome.org>
19004
19005         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19006         instructions.  Fixes bug #27977, also added test-146.cs.
19007
19008 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19009
19010         * cs-tokenizer.cs: fixed getHex ().
19011
19012 2002-07-19  Martin Baulig  <martin@gnome.org>
19013
19014         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19015         not Type.GetType() to lookup the array type.  This is needed when
19016         we're constructing an array of a user-defined type.
19017         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19018         single-dimensional arrays, but also for single-dimensial arrays of
19019         type decimal.
19020
19021 2002-07-19  Martin Baulig  <martin@gnome.org>
19022
19023         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19024         this function is called, it's not allowed to share LocalBuilders
19025         among ILGenerators.
19026
19027 2002-07-19  Martin Baulig  <martin@gnome.org>
19028
19029         * expression.cs (Argument.Resolve): Report an error 118 when trying
19030         to pass a type as argument.
19031
19032 2002-07-18  Martin Baulig  <martin@gnome.org>
19033
19034         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19035         Conv_R_Un for the signed `long' type.
19036
19037 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19038
19039         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19040         `expr' for the temporary result, as that will fail if we do
19041         multiple resolves on the same expression.
19042
19043 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19044
19045         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19046         ec.TypeContainer for looking up aliases. 
19047
19048         * class.cs (TypeContainer): Remove LookupAlias from here.
19049
19050         * decl.cs (DeclSpace); Move here.
19051
19052 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19053
19054         * class.cs (FindMembers): Only call filter if the constructor
19055         bulider is not null.
19056
19057         Also handle delegates in `NestedTypes' now.  Now we will perform
19058         type lookups using the standard resolution process.  This also
19059         fixes a bug.
19060
19061         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19062         This uses Expressions (the limited kind that can be parsed by the
19063         tree) instead of strings.
19064
19065         * expression.cs (ComposedCast.ToString): Implement, used to flag
19066         errors since now we have to render expressions.
19067
19068         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19069         FormArrayType. 
19070
19071         * ecore.cs (SimpleName.ToString): ditto.
19072
19073         * cs-parser.jay: Instead of using strings to assemble types, use
19074         Expressions to assemble the type (using SimpleName, ComposedCast,
19075         MemberAccess).  This should fix the type lookups in declarations,
19076         because we were using a different code path for this.
19077
19078         * statement.cs (Block.Resolve): Continue processing statements
19079         even when there is an error.
19080
19081 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19082
19083         * class.cs (Event.Define): Also remove the `remove' method from
19084         the list of pending items.
19085
19086         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19087         generate more compact code. 
19088
19089 2002-07-17  Martin Baulig  <martin@gnome.org>
19090
19091         * const.cs (Const.LookupConstantValue): Add support for constant
19092         `unchecked' and `checked' expressions.
19093         Also adding test case test-140.cs for this.
19094
19095 2002-07-17  Martin Baulig  <martin@gnome.org>
19096
19097         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19098         check whether mi.ReturnType implements the IEnumerator interface; the
19099         `==' and the IsAssignableFrom() will fail in this situation.
19100
19101 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19102
19103         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19104         here too.
19105
19106 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19107
19108         * expression.cs: fixed bug #27811.
19109
19110 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19111
19112         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19113         Molaro: when we are a ref, the value already contains a pointer
19114         value, do not take the address of it.
19115
19116 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19117         * removed mb-parser.jay and mb-tokenizer.cs
19118
19119 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19120
19121         * expression.cs: check against the building corlib void type.
19122
19123 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19124
19125         * ecore.cs: fix for valuetype static readonly fields: when 
19126         initializing them, we need their address, not the address of a copy.
19127
19128 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19129
19130         * typemanager.cs: register also enum_type in corlib.
19131
19132 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19133
19134         * class.cs: allow calling this (but not base) initializers in structs.
19135
19136 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19137
19138         * ecore.cs: make sure we compare against the building base types
19139         in GetTypeSize ().
19140
19141 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19142
19143         * typemanager.cs: fix TypeToCoreType() to handle void and object
19144         (corlib gets no more typerefs after this change).
19145
19146 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19147
19148         * expression.cs (ArrayCreation.EmitArrayArguments): use
19149         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19150
19151         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19152         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19153         array indexes, the runtime actually forbids them.
19154
19155         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19156         for array arguments here.
19157
19158         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19159         instead of the default for ValueTypes.
19160
19161         (New.DoEmit): Use IsValueType instead of
19162         IsSubclassOf (value_type)
19163         (New.DoResolve): ditto.
19164         (Invocation.EmitCall): ditto.
19165
19166         * assign.cs (Assign): ditto.
19167
19168         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19169         Statements *are* currently doing part of their resolution during
19170         Emit.  
19171
19172         Expressions do always resolve during resolve, but statements are
19173         only required to propagate resolution to their children.
19174
19175 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19176
19177         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19178
19179         (LoadAssembly): Do not add the dll if it is already specified
19180
19181         (MainDriver): Add the System directory to the link path at the end,
19182         after all the other -L arguments. 
19183
19184         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19185         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19186         ldelem.u1) and using the opposite for sbytes.
19187
19188         This fixes Digger, and we can finally run it.
19189
19190         * driver.cs (UnixParseOption): Move the option parsing here.  
19191         (CSCParseOption): Implement CSC-like parsing of options.
19192
19193         We now support both modes of operation, the old Unix way, and the
19194         new CSC-like way.  This should help those who wanted to make cross
19195         platform makefiles.
19196
19197         The only thing broken is that /r:, /reference: and /lib: are not
19198         implemented, because I want to make those have the same semantics
19199         as the CSC compiler has, and kill once and for all the confussion
19200         around this.   Will be doing this tomorrow.
19201
19202         * statement.cs (Unsafe.Resolve): The state is checked during
19203         resolve, not emit, so we have to set the flags for IsUnsfe here.
19204
19205 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19206
19207         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19208         not catch the Error_ObjectRefRequired in SimpleName (as it is
19209         possible to have a class/instance variable name that later gets
19210         deambiguated), we have to check this here.      
19211
19212 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19213
19214         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19215         make static and put into Expression.
19216
19217         (Event.Define): Register the private field of the event with the 
19218         TypeManager so that GetFieldFromEvent can get at it.
19219
19220         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19221         keep track of the private field associated with an event which
19222         has no accessors.
19223
19224         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19225         private field.
19226
19227         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19228
19229 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19230
19231         * expression.cs (Binary.EmitBranchable): this routine emits the
19232         Binary expression in a branchable context.  This basically means:
19233         we need to branch somewhere, not just get the value on the stack.
19234
19235         This works together with Statement.EmitBoolExpression.
19236
19237         * statement.cs (Statement.EmitBoolExpression): Use
19238         EmitBranchable. 
19239
19240 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19241
19242         * statement.cs (For): Reduce the number of jumps in loops.
19243
19244         (For): Implement loop inversion for the For statement.
19245
19246         (Break): We can be breaking out of a Try/Catch controlled section
19247         (foreach might have an implicit try/catch clause), so we need to
19248         use Leave instead of Br.
19249
19250         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19251         now).  If the instace expression supports IMemoryLocation, we use
19252         the AddressOf method from the IMemoryLocation to extract the
19253         address instead of emitting the instance.
19254
19255         This showed up with `This', as we were emitting the instance
19256         always (Emit) instead of the Address of This.  Particularly
19257         interesting when This is a value type, as we dont want the Emit
19258         effect (which was to load the object).
19259
19260 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19261
19262         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19263
19264         * statement.cs (Checked): Set the CheckedState during the resolve
19265         process too, as the ConvCast operations track the checked state on
19266         the resolve process, and not emit.
19267
19268         * cs-parser.jay (namespace_member_declaration): Flag that we have
19269         found a declaration when we do.  This is used to flag error 1529
19270
19271         * driver.cs: Report ok when we display the help only.
19272
19273 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19274
19275         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19276
19277 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19278
19279         * cs-tokenizer.cs (define): We also have to track locally the
19280         defines.  AllDefines is just used for the Conditional Attribute,
19281         but we also need the local defines for the current source code. 
19282
19283 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19284
19285         * statement.cs (While, For, Do): These loops can exit through a
19286         Break statement, use this information to tell whether the
19287         statement is the last piece of code.
19288
19289         (Break): Flag that we break.
19290
19291         * codegen.cs (EmitContexts): New `Breaks' state variable.
19292
19293 2002-07-03  Martin Baulig  <martin@gnome.org>
19294
19295         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19296         modifiers in method declarations in structs.  Otherwise, you won't
19297         be able to override things like Object.Equals().
19298
19299 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19300
19301         * class.cs (Method, Property, Indexer): Do not allow the public
19302         modifier to be used in explicit interface implementations.
19303
19304         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19305         override modifiers in method declarations in structs
19306
19307 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19308
19309         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19310         integer or real overflow, report an error
19311
19312 2002-07-02  Martin Baulig  <martin@gnome.org>
19313
19314         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19315         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19316         to tell the runtime about our newly created System.Object and
19317         System.ValueType types.
19318
19319 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19320
19321         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19322         struct instead of Ldarg/Starg.
19323
19324 2002-07-02  Martin Baulig  <martin@gnome.org>
19325
19326         * expression.cs (Indirection.Indirection): Call
19327         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19328
19329 2002-07-02  Martin Baulig  <martin@gnome.org>
19330
19331         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19332         ValueType, call TypeManager.TypeToCoreType() on it.
19333         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19334         the OpCodes.Newarr argument.
19335
19336 2002-07-02  Martin Baulig  <martin@gnome.org>
19337
19338         * expression.cs (Invocation.EmitCall): When compiling corlib,
19339         replace all calls to the system's System.Array type to calls to
19340         the newly created one.
19341
19342         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19343         System.Array methods.
19344         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19345         from the system's System.Array type which must be replaced.
19346
19347 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19348
19349         * typemanager.cs: load unverifiable_code_ctor so we can build
19350         corlib using the correct type. Avoid using GetTypeCode() with
19351         TypeBuilders.
19352         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19353         TypeManager.object_type to allow building corlib.
19354
19355 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19356
19357         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19358
19359 2002-07-01  Martin Baulig  <martin@gnome.org>
19360
19361         * class.cs: Make the last change actually work, we need to check
19362         whether `ifaces != null' to avoid a crash.
19363
19364 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19365
19366         * class.cs: when we build structs without fields that implement
19367         interfaces, we need to add the interfaces separately, since there is
19368         no API to both set the size and add the interfaces at type creation
19369         time.
19370
19371 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19372
19373         * expression.cs: the dimension arguments to the array constructors
19374         need to be converted if they are a long.
19375
19376 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19377
19378         * class.cs: don't emit ldarg.0 if there is no parent constructor
19379         (fixes showstopper for corlib).
19380
19381 2002-06-29  Martin Baulig  <martin@gnome.org>
19382
19383         MCS now compiles corlib on GNU/Linux :-)
19384
19385         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19386         ie. check for MethodImplOptions.InternalCall.
19387
19388         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19389         and TypeManager.attribute_type are null, so we must explicitly check
19390         whether parent is not null to find out whether it's an attribute type.
19391         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19392         and SetBuilder, not only if the property is neither abstract nor external.
19393         This is necessary to set the MethodImplOptions on the accessor methods.
19394         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19395         SetBuilder, see Property.Emit().
19396
19397         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19398         populate "System.Object", "System.ValueType" and "System.Attribute" since
19399         they've already been populated from BootCorlib_PopulateCoreTypes().
19400
19401 2002-06-29  Martin Baulig  <martin@gnome.org>
19402
19403         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19404         is the NullLiteral, we also need to make sure that target_type is not
19405         an enum type.   
19406
19407 2002-06-29  Martin Baulig  <martin@gnome.org>
19408
19409         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19410         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19411         before calling BootstrapCorlib_ResolveDelegate ().
19412
19413 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19414
19415         * statement.cs: fixed build-breaker. All tests passed ok.
19416
19417 2002-06-27  Martin Baulig  <martin@gnome.org>
19418
19419         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19420         for System.Decimal when compiling corlib.
19421
19422 2002-06-27  Martin Baulig  <martin@gnome.org>
19423
19424         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19425         switch blocks which contain nothing but a default clause.
19426
19427 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19428
19429        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19430
19431 2002-06-27  Martin Baulig  <martin@gnome.org>
19432
19433         * ecore.cs (PropertyExpr.PropertyExpr): Call
19434         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19435
19436         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19437         is already a TypeBuilder.
19438
19439 2002-06-27  Martin Baulig  <martin@gnome.org>
19440
19441         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19442         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19443         the "from an array-type to System.Array" case.  This makes it work
19444         when compiling corlib.
19445
19446 2002-06-27  Martin Baulig  <martin@gnome.org>
19447
19448         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19449         non-static PropertyExpr, set its InstanceExpression.  This makes
19450         the `ICollection.Count' property work in System/Array.cs.
19451
19452 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19453
19454         * driver.cs: Made error handling more consistent.  Errors now
19455         tracked by Report class, so many methods which used to return int
19456         now return void.  Main() now prints success/failure and 
19457         errors/warnings message.
19458
19459         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19460         the magic number return values (123 and 124).  Now, if the
19461         expected error occurs, the compiler exits with success (exit value
19462         0).  If the compilation completes without seeing that particular
19463         error, the compiler exits with failure (exit value 1).  The
19464         makefile in mcs/errors has been changed to handle the new behaviour.
19465
19466         * report.cs: Made 'expected error' number a property and renamed
19467         it from 'Probe' to 'ExpectedError'.
19468
19469         * genericparser.cs: Removed error handling support, since it is
19470         now all done by Report class.
19471
19472         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19473         class, so parse() no longer returns an int.
19474
19475         * namespace.cs: Use Report.Error instead of GenericParser.error
19476
19477 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19478
19479         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19480         TypeContainer.AddOperator): At the front of the list put the
19481         explicit implementations, so they get resolved/defined first. 
19482
19483 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19484
19485         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19486         interface type is implemented by this TypeContainer.  Used during
19487         explicit interface implementation.
19488
19489         (Property.Define, Indexer.Define, Method.Define): Validate that
19490         the given interface in the explicit implementation is one of the
19491         base classes for the containing type.
19492
19493         Also if we are explicitly implementing an interface, but there is
19494         no match in the pending implementation table, report an error.
19495
19496         (Property.Define): Only define the property if we are
19497         not explicitly implementing a property from an interface.  Use the
19498         correct name also for those properties (the same CSC uses,
19499         although that is really not needed).
19500
19501         (Property.Emit): Do not emit attributes for explicitly implemented
19502         properties, as there is no TypeBuilder.
19503
19504         (Indexer.Emit): ditto.
19505
19506         Hiding then means that we do not really *implement* a pending
19507         implementation, which makes code fail.
19508
19509 2002-06-22  Martin Baulig  <martin@gnome.org>
19510
19511         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19512         the return value of Object.GetType().  [FIXME: we need to do this whenever
19513         we get a type back from the reflection library].
19514
19515 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19516
19517         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19518
19519 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19520
19521         * attribute.cs: Return null if we can not look up the type.
19522
19523         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19524         the interface types found.
19525
19526         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19527         interface types found.
19528
19529         * typemanager.cs (GetInterfaces): Make this routine returns alll
19530         the interfaces and work around the lame differences between
19531         System.Type and System.Reflection.Emit.TypeBuilder in the results
19532         result for GetInterfaces.
19533
19534         (ExpandInterfaces): Given an array of interface types, expand and
19535         eliminate repeated ocurrences of an interface.  This expands in
19536         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19537         be IA, IB, IC.
19538
19539 2002-06-21  Martin Baulig  <martin@gnome.org>
19540
19541         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19542         on System.Enum.
19543
19544 2002-06-21  Martin Baulig  <martin@gnome.org>
19545
19546         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19547         and called with one of the core types, return the corresponding typebuilder for
19548         that type.
19549
19550         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19551         element type.
19552
19553 2002-06-21  Martin Baulig  <martin@gnome.org>
19554
19555         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19556         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19557         (Expression.ConvertReferenceExplicit): Likewise.
19558
19559         * expression.cs (ElementAccess.DoResolve): Likewise.
19560         (ElementAccess.DoResolveLValue): Likewise.
19561
19562 2002-06-10  Martin Baulig  <martin@gnome.org>
19563
19564         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19565         add the "value" parameter to the parameter list.
19566
19567         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19568         to our caller.
19569
19570 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19573         the argument to an int, uint, long or ulong, per the spec.  Also
19574         catch negative constants in array creation.
19575
19576 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19577
19578         * class.cs: do not allow the same interface to appear twice in
19579         the definition list.
19580
19581 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19582
19583         * ecore.cs: don't use ldlen with System.Array.
19584
19585 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19586
19587         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19588
19589 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19590
19591         * modifiers.cs: produce correct field attributes for protected
19592         internal. Easy fix so miguel can work on ther harder stuff:-)
19593
19594 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19595
19596         * pending.cs: New file.  Move the code from class.cs here.
19597         Support clearning the pending flag for all methods (when not doing
19598         explicit interface implementation).
19599
19600 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19601
19602         * rootcontext.cs: added a couple more types needed to bootstrap.
19603
19604 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19607         constructor in the type, instead of any constructor in the type
19608         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19609         a bug in the Mono runtime when applying the params attribute). 
19610
19611 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19612         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19613
19614 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19615
19616         * expression.cs (Unary.ResolveOperator): Use TypeManager
19617         to resolve the type.
19618
19619 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19620
19621         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19622         attached.
19623
19624         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19625         with each member too.
19626
19627         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19628         field builders too - this takes care of the enum member case.
19629
19630 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19631
19632         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19633         address-of operator on both value types and pointers.
19634
19635 2002-06-10  Martin Baulig  <martin@gnome.org>
19636
19637         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19638         PropertyBuilder to the `property_builders' list.
19639
19640         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19641         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19642         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19643         find any indexers which are inherited from an interface.
19644
19645 2002-06-09  Martin Baulig  <martin@gnome.org>
19646
19647         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19648         the same type as the constant if necessary.  There's also a test-130.cs
19649         for this.
19650
19651         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19652
19653         * typemanager.cs (TypeManager.ChangeType): Previously known as
19654         Enum.ChangeEnumType().
19655
19656 2002-06-09  Martin Baulig  <martin@gnome.org>
19657
19658         * expression.cs (Cast.TryReduce): Added support for consts.
19659
19660 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19661
19662         * class.cs (Accessor): Hold attributes information so we can pass
19663         it along.
19664
19665         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19666         Modify to pass in attributes attached to the methods.
19667
19668         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19669
19670         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19671         to handle the Accessor kind :-)
19672
19673         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19674
19675 2002-06-08  Martin Baulig  <martin@gnome.org>
19676
19677         * expression.cs (Unary.TryReduceNegative): Added support for
19678         ULongConstants.
19679
19680 2002-06-08  Martin Baulig  <martin@gnome.org>
19681
19682         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19683         name can't be found in the `defined_names' - the caller will do a
19684         MemberLookup in this case and thus find methods in System.Enum
19685         such as Enum.IsDefined().
19686
19687 2002-06-08  Martin Baulig  <martin@gnome.org>
19688
19689         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19690         Convert.ChangeType() which works with TypeBuilder created types.
19691         (Enum.LookupEnumValue, Enum.Define): Use it here.
19692
19693         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19694         `TypeBuilder.BaseType != null' check.
19695         (TypeContainer.FindMembers): Only lookup parent members if we
19696         actually have a parent.
19697         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19698         (ConstructorInitializer.Resolve): Likewise.
19699
19700         * interface.cs (Interface.FindMembers): Added
19701         `TypeBuilder.BaseType != null' check.
19702
19703         * rootcontext.cs (RootContext.ResolveCore): Added
19704         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19705         classes_second_stage.
19706
19707         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19708         debug_type and trace_type when compiling with --nostdlib.       
19709
19710 2002-06-07  Martin Baulig  <martin@gnome.org>
19711
19712         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19713         (AddField): Set it to true when adding a non-static field.
19714         (DefineType): Use `have_nonstatic_fields' to find out whether we
19715         have non-static fields, not `Fields != null'.
19716
19717 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19718
19719         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19720         dereferencing a null on the static-field code path)
19721
19722 2002-05-30  Martin Baulig  <martin@gnome.org>
19723
19724         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19725         to take command line arguments.  Use reflection to call the new
19726         custom `Initialize' function on the symbol writer and pass it the
19727         command line arguments.
19728
19729         * driver.cs (--debug-args): New command line argument to pass command
19730         line arguments to the symbol writer.
19731
19732 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19733
19734         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19735         the target type for indexers and properties.  Thanks to Joe for
19736         catching this.
19737
19738 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19739
19740         * typemanager.cs (MethodFlags): returns the method flags
19741         (Obsolete/ShouldIgnore) that control warning emission and whether
19742         the invocation should be made, or ignored. 
19743
19744         * expression.cs (Invocation.Emit): Remove previous hack, we should
19745         not do this on matching a base type, we should do this based on an attribute
19746
19747         Only emit calls to System.Diagnostics.Debug and
19748         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19749         on the command line.
19750
19751         * rootcontext.cs: Global settings for tracing and debugging.
19752
19753         * cs-tokenizer.cs (define): New utility function to track
19754         defines.   Set the global settings for TRACE and DEBUG if found.
19755
19756 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19757
19758         * interface.cs (Populate*): Pass in the TypeContainer as well as
19759         the DeclSpace as parameters so that we can create EmitContexts and
19760         then use that to apply attributes etc.
19761
19762         (PopulateMethod, PopulateEvent, PopulateProperty)
19763         (PopulateIndexer): Apply attributes everywhere.
19764
19765         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19766         etc.
19767
19768         (ApplyAttributes): Update accordingly.
19769
19770         We now apply interface attributes for all members too.
19771
19772 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19773
19774         * class.cs (Indexer.Define); Correctly check if we are explicit
19775         implementation (instead of checking the Name for a ".", we
19776         directly look up if the InterfaceType was specified).
19777
19778         Delay the creation of the PropertyBuilder.
19779
19780         Only create the PropertyBuilder if we are not an explicit
19781         interface implementation.   This means that explicit interface
19782         implementation members do not participate in regular function
19783         lookups, and hence fixes another major ambiguity problem in
19784         overload resolution (that was the visible effect).
19785
19786         (DefineMethod): Return whether we are doing an interface
19787         implementation. 
19788
19789         * typemanager.cs: Temporary hack until we get attributes in
19790         interfaces (Ravi is working on that) and we get IndexerName
19791         support in interfaces.
19792
19793         * interface.cs: Register the indexers as properties.
19794
19795         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19796         warning, I have verified that this is a bug in the .NET runtime
19797         (JavaScript suffers of the same problem).
19798
19799         * typemanager.cs (MemberLookup): When looking up members for
19800         interfaces, the parent of an interface is the implicit
19801         System.Object (so we succeed in searches of Object methods in an
19802         interface method invocation.  Example:  IEnumerable x;  x.ToString
19803         ()) 
19804
19805 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19806
19807         * class.cs (Event): Events should also register if they do
19808         implement the methods that an interface requires.
19809
19810         * typemanager.cs (MemberLookup); use the new GetInterfaces
19811         method. 
19812
19813         (GetInterfaces): The code used to lookup interfaces for a type is
19814         used in more than one place, factor it here. 
19815
19816         * driver.cs: Track the errors at the bottom of the file, we kept
19817         on going.
19818
19819         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19820         instance if the method we are calling is static!
19821
19822 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * attribute.cs (ApplyAttributes): Make this function filter out
19825         the IndexerName attribute (as that attribute in reality is never
19826         applied) and return the string constant for the IndexerName
19827         attribute. 
19828
19829         * class.cs (TypeContainer.Emit): Validate that all the indexers
19830         have the same IndexerName attribute, and if so, set the
19831         DefaultName attribute on the class. 
19832
19833         * typemanager.cs: The return value might contain other stuff (not
19834         only methods).  For instance, consider a method with an "Item"
19835         property and an Item method.
19836
19837         * class.cs: If there is a problem with the parameter types,
19838         return. 
19839
19840 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19841
19842         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19843         looks at user defined conversion after making a call to 
19844         StandardConversionExists - we need this for overload resolution.
19845
19846         * expression.cs : Update accordingly the various method calls.
19847
19848         This fixes 2 bugs filed against implicit user defined conversions 
19849
19850 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19851
19852         * statement.cs: Track the result of the assignment.
19853
19854 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19855
19856         * expression.cs (MemberAccess): Improved error reporting for
19857         inaccessible members.
19858
19859 2002-05-22  Martin Baulig  <martin@gnome.org>
19860
19861         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19862         itself with debugging support.
19863
19864 2002-05-22  Martin Baulig  <martin@gnome.org>
19865
19866         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19867         Removed, this isn't needed anymore.
19868
19869 2002-05-20  Martin Baulig  <martin@gnome.org>
19870
19871         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19872         be underlying type for an enum.
19873
19874 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19877         that splits out the loading of just the core types.
19878
19879         * rootcontext.cs (ResolveCore): Split the struct resolution in
19880         two, so we can load the enumeration underlying types before any
19881         enums are used.
19882
19883         * expression.cs (Is): Bandaid until we fix properly Switch (see
19884         bug #24985 for details).
19885
19886         * typemanager.cs (ImplementsInterface): The hashtable will contain
19887         a null if there are no interfaces implemented.
19888
19889 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19890
19891         * cs-parser.jay (indexer_declarator): It is fine to have array
19892         parameters
19893
19894 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19895
19896         * typemanager.cs: (RegisterBuilder): New function used to register
19897         TypeBuilders that implement interfaces.  Since
19898         TypeBuilder.GetInterfaces (as usual) does not work with lame
19899         Reflection.Emit. 
19900         (AddUserType): register interfaces.
19901
19902         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19903         dealing with TypeBuilder.  Also, arrays are showing up as
19904         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19905         methods can not be invoked on them!
19906
19907         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19908         (ImplicitReferenceConversionExists): Split out from
19909         StandardConversionExists. 
19910
19911         * expression.cs (As): We were only implementing one of the three
19912         cases for the as operator.  We now implement them all.
19913         (Is): Implement the various other cases for Is as well.
19914
19915         * typemanager.cs (CACHE): New define used to control if we want or
19916         not the FindMembers cache.  Seems to have a negative impact on
19917         performance currently
19918
19919         (MemberLookup): Nested types have full acess to
19920         enclosing type members
19921
19922         Remove code that coped with instance/static returns for events, we
19923         now catch this in RealFindMembers.
19924
19925         (RealFindMembers): only perform static lookup if the instance
19926         lookup did not return a type or an event.  
19927
19928 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19929
19930         * assign.cs (CompoundAssign): We pass more semantic information
19931         now to Compound Assignments than we did before: now we have all
19932         the information at hand, and now we resolve the target *before* we
19933         do the expression expansion, which allows the "CacheValue" method
19934         to have the effect we intended (before, a [x] += 1 would generate
19935         two differen ArrayAccess expressions from the ElementAccess,
19936         during the resolution process).
19937
19938         (CompoundAssign.DoResolve): Resolve target and original_source here.
19939
19940 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19941
19942         * expression.cs (ArrayAccess): dropped debugging information. 
19943
19944         * typemanager.cs: Small bug fix: I was always returning i_members,
19945         instead of one of i_members or s_members (depending on which had
19946         the content).
19947
19948         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19949         method is invoked before any code generation takes place, and it
19950         is a mechanism to inform that the expression will be invoked more
19951         than once, and that the method should use temporary values to
19952         avoid having side effects
19953
19954         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19955
19956         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19957         implementation.
19958
19959         * expression.cs (Indirection, ArrayAccess): Add support for
19960         CacheTemporaries in these two bad boys. 
19961
19962         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19963         ldobj or ldind_ref.  
19964         (StoreFromPtr): Handle stobj as well.
19965
19966         * expression.cs (UnaryMutator): Share more code.
19967
19968         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19969         down: I was not tracking the Filter function as well, which
19970         was affecting the results of the cache.
19971
19972 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19973
19974         * attribute.cs: Remove the hack to handle the CharSet property on
19975         StructLayouts. 
19976
19977 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19978
19979         * attribute.cs (DoResolve): More uglyness, we now only try to
19980         resolve the attribute partially, to extract the CharSet
19981         information (only if we are a StructLayout attribute).  Otherwise 
19982
19983         (GetExtraTypeInfo): Add some code to conditionally kill in the
19984         future this.   I am more and more convinced that the .NET
19985         framework has special code to handle the attribute setting on
19986         certain elements.
19987
19988         * expression.cs (IsParamsMethodApplicable): Revert my previous
19989         foreach change here, it was wrong.
19990
19991 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19992
19993         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19994         (pp_expr): do not abort on unknown input, just return.
19995         (eval): abort if there are pending chars.
19996
19997         * attribute.cs (Attribute.Resolve): Positional parameters are
19998         optional.  Deal with that case.
19999
20000         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20001         the Ansi/Unicode/Auto information for the type.
20002
20003         (TypeContainer.DefineType): instantiate the EmitContext here, as
20004         we will be using it during the type definition (to resolve
20005         attributes) and during the emit phase.
20006
20007         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20008         to pull type information out of the attributes
20009
20010         (Attribute.Resolve): track the constructor builder, and allow for
20011         multiple invocations (structs and classes will use this).
20012
20013         * ecore.cs (MemberLookupFinal): new version with all the
20014         parameters customizable.
20015
20016         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20017         constructors.  Return if the result value is null (as the error
20018         would have been flagged already by MemberLookupFinal)
20019
20020         Do not allow instances of abstract classes or interfaces to be
20021         created.
20022
20023         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20024         We have to compare the assembly property here when dealing with
20025         FamANDAssem and Assembly access modifiers, because we might be
20026         creating an assembly from *modules* (that means that we are not
20027         getting TypeBuilders for types defined in other modules that are
20028         part of this assembly).
20029
20030         (Method.Emit): If the method is marked abstract and has a body,
20031         emit an error. 
20032
20033         (TypeContainer.DefineMembers): If both the defined member and the
20034         parent name match are methods, then do not emit any warnings: let
20035         the Method.Define routine take care of flagging warnings.  But if
20036         there is a mismatch (method overrides something else, or method is
20037         overriwritten by something, then emit warning).
20038
20039         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20040         set to null, this means `do not check for the return type on the
20041         signature'. 
20042
20043         (Method.Define): set the return type for the method signature to
20044         null, so that we get methods with the same name and parameters and
20045         different return types.  This is used to flag warning 114 (you are
20046         hiding a method, and you probably want to use the new/override
20047         keywords instead).
20048
20049         * typemanager.cs (MemberLookup): Implemented proper access
20050         control, closing a long standing set of bug reports.  The problem
20051         was that the Framework only has two bits: Public and NonPublic,
20052         and NonPublic includes private and protected methods, but we need
20053         to enforce the FamANDAssem, FamOrAssem and Family. 
20054
20055 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20056
20057         * statement.cs (GotoCase): Return true: Ammounts to giving up
20058         knowledge on whether we return or not, and letting the other case
20059         be responsible for it.
20060
20061 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20062
20063         * driver.cs: Do not load directories for each file processed, only
20064         do it if there is a pattern.
20065
20066         * ecore.cs: Report readonly assigns here as well, as we might have
20067         been resolved only by MemberAccess.
20068
20069         (SimpleName.SimpleNameResolve): Also be useful for LValue
20070         resolution.   We need this to propagate assign to local readonly variables
20071
20072         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20073         do not want to reuse potential criteria memory.
20074
20075         * class.cs (MyEventBuilder): Set reflected_type;
20076
20077         * ecore.cs (Constantify): Added support for constifying bools.
20078
20079         (RootContext.LookupType): Added a cache for values looked up in
20080         the declaration space.
20081
20082         * typemanager.cs (FindMembers): Now is a front-end to
20083         RealFindMembers, and provides a two-level hashtable-based cache to
20084         the request.  
20085
20086         15% performance improvement: from 22.5 to 19.2 seconds.
20087
20088         * expression.cs (IsParamsMethodApplicable): use foreach.
20089         (Invocation.DoResolve): ditto.
20090         (New.DoResolve): ditto.
20091         (ArrayCreation.DoResolve): ditto.
20092
20093         * ecore.cs (FindMostEncompassingType): use foreach.
20094
20095         * delegate.cs (NewDelegate.DoResolve): Use foreach
20096
20097         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20098         (RemoveMethods): use foreach.
20099
20100         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20101         nested foreach statements instead of for, and also break out of
20102         the inner loop once a match is found.
20103
20104         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20105
20106 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20107
20108         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20109         we actually unwrap the expression to allow for extra information
20110         to be extracted. 
20111
20112         * expression.cs: Use Shr_Un on unsigned operations. 
20113
20114 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20115
20116         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20117         applicable operators was not being considered correctly. This closes
20118         the bug Miguel reported.
20119
20120 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20121
20122         * attribute.cs: check that the type derives from System.Attribute
20123         and report the correct error in that case (moved the duplicate code to
20124         its own method, too).
20125
20126 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20127
20128         * attribute.cs: lookup attribute type name as the spec says: first the
20129         bare attribute name and then name + "Attribute" (nant compiles with
20130         mcs after this fix).
20131
20132 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20133
20134         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20135         Because of the way we parse things, we should try to see if a
20136         UIntConstant can fit in an integer.
20137
20138 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20139
20140         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20141         when we are in an explicit context.
20142
20143         (ConvertReferenceExplicit): When converting from Iface type S to Class
20144         T make sure the rules are implemented as an OR.
20145
20146         * parameter.cs (ParameterType): Make it a property for now although the
20147         purpose really isn't anything immediate.
20148
20149         * expression.cs (Is*Applicable): Do better checking on the parameter type
20150         of a ref/out parameter. The ones from the system assemblies are already 
20151         marked with the correct type so we don't need to do any correction.
20152
20153         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20154         the object type is standard too so include that.
20155
20156 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20157
20158         * ecore.cs (StandardConversionExists): Augment with missing code:
20159         deal with IntConstant, LongConstants and Enumerations.
20160
20161         * assign.cs: Report the error, instead of failing silently
20162
20163         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20164         typecontainer that they are declared, because the
20165         typecontainer/namespace will have the list of using clauses that
20166         need to be applied.
20167
20168         Assembly Attributes were escaping the normal registration
20169         mechanism. 
20170
20171         (EmitCode): Apply attributes within an EmitContext that represents
20172         the container they were declared on.
20173
20174         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20175
20176 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20177
20178         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20179         Revamp completely - make much cleaner as we now operate only
20180         on a set of Types.
20181
20182         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20183         to implement the logic detailed in the spec more correctly.
20184
20185         (UserDefinedConversion): Update accordingly.
20186
20187 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20188
20189         * statement.cs: Return flow analysis information up.
20190
20191         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20192         and the default.
20193
20194         (token): Do not consume an extra character before calling
20195         decimal_digits.
20196
20197 2002-05-06  Piers Haken <piersh@friskit.com>
20198
20199         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20200
20201 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20202
20203         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20204         EmitContext during the instance constructor initializer
20205         resolution, to stop access to instance variables.
20206
20207         This is mandated by the spec, last paragraph of the `constructor
20208         initializers' section. 
20209
20210 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * cs-parser.jay, class.cs (Accessor): new class used to represent
20213         an accessor (get or set).  In the past we used `null' to represent
20214         a missing accessor.  But this is ambiguous because there was no
20215         way to tell in abstract indexers/properties if one of them was
20216         specified.
20217
20218         Now there is a way of addressing that.
20219
20220         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20221         instead of FindMembers.
20222
20223         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20224         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20225
20226         * attribute.cs: Treat indexers and properties as the same in terms
20227         of applying attributes
20228
20229         * ecore.cs (FindMostEncompassedType): Use statically initialized
20230         EmptyExpressions()s like we do elsewhere to avoid creating useless
20231         objects (and we take this out of the tight loop).
20232
20233         (GetConversionOperators): Move the code to extract the actual
20234         operators to a separate routine to clean things up.
20235
20236 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20237
20238         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20239         events are always registered FieldBuilders.
20240
20241         * class.cs (FieldBase): New class shared by Fields 
20242
20243         * delegate.cs: If we are a toplevel delegate, use our full name.
20244         If we are a nested delegate, then only use our tail name.
20245
20246 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20247
20248         * expression.cs (IsApplicable): Ensure that we add the "&" to
20249         ref/out types before comparing it with the type of the argument.
20250
20251         (IsParamsMethodApplicable): Ditto.
20252
20253         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20254         silly me ;-)
20255
20256         * delegate.cs : Handle the case when we have more than one applicable
20257         method. Flag an error only when we finish checking all.
20258
20259 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * expression.cs: Add support for boolean static initializers.
20262
20263 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20264
20265         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20266
20267         * parameter.cs (ComputeParameterTypes,
20268         ComputeAndDefineParameterTypes): Better error handling: now we
20269         clear the `types' cache if we fail during any of the type lookups.
20270         We also return the status code correctly to our caller
20271
20272         * delegate.cs: If we fail to define a delegate, abort the extra
20273         steps. 
20274
20275         * expression.cs (Binary.ResolveOperator): for
20276         operator==(object,object) and operator !=(object, object) we also
20277         have to verify that there is an implicit conversion from one to
20278         the other.
20279
20280         (ArrayAccess.DoResolve): Array Access can operate on
20281         non-variables. 
20282
20283 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20284
20285         * assign.cs (CompoundAssign): A new class used as a "flag" that
20286         the assignment actually is happening as part of a compound
20287         assignment operator.
20288
20289         During compound assignment, a few new rules exist to enable things
20290         like:
20291
20292         byte b |= 1 + 2
20293
20294         From the spec:
20295
20296         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20297         to the type of x) if y is implicitly convertible to the type of x,
20298         and the operator is a builtin operator and the return type of the
20299         operator is explicitly convertible to the type of x. 
20300
20301         * rootcontext.cs: Reset warning level to 2.  4 catches various
20302         "interesting" features in mcs, we must clean this up at some
20303         point, but currently am trying to kill other bugs ;-)
20304
20305         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20306         in container classes as well.  
20307
20308         * expression.cs (Binary.ResolveOperator): Handle string case
20309         before anything else (as operator overloading does emit an error
20310         before doing anything else).
20311
20312         This code could go away when we move to a table driven model, but
20313         i could not come up with a good plan last night.
20314
20315 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20316
20317         * typemanager.cs (CSharpName): reimplementation using regex.
20318         * class.cs: added null check for fields in Emit
20319         * rootcontext.cs: set warninglevel to 4
20320
20321 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20322
20323         * typemanager.cs (CSharpName): reimplemented with Lupus
20324         suggestion.
20325
20326 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20327
20328         * statement.cs (If): correclty implement Resolve, because we were
20329         not catching sem errors in there.  The same process is needed
20330         everywhere else. 
20331         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20332
20333
20334         (Statement.Warning_DeadCodeFound): Factorize code.
20335         (While): Report dead code here too.
20336
20337         (Statement): Added Resolve virtual method to allow
20338         for resolution split from the emit code.
20339
20340 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20341
20342         * statement.cs (EmitBoolExpression): No longer try to resolve the
20343         expression here.    
20344         (MakeBoolean): New utility function that resolve, implicitly
20345         converts to boolean and tags the expression. 
20346
20347
20348         (If, Do): Implement dead code elimination.
20349         (While): Implement loop inversion
20350
20351         (Do, While, For, If): Resolve the expression prior to calling our
20352         code generation.
20353
20354 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20355
20356         * class.cs:
20357           - added method Report28 (warning: program has more than one entry point)
20358           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20359           - modified method Method.Define, the part at the end of the method
20360
20361         * rootcontext.cs: added static public Location EntryPointLocation;
20362           
20363         * ../errors/cs0028.cs : Add test case for the above warning.              
20364
20365         * typemanager.cs:
20366           - modified method CSharpName to allow arrays of primitive type to
20367             be printed nicely (e.g. instead of System.Int32[][] it now prints
20368             int[][])
20369           - added method CSharpSignature: returns the signature of a method
20370             in string format to be used in reporting errors, warnings, etc.
20371
20372         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20373         with String.Empty.
20374
20375 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20376
20377         * delegate.cs (Define): Fix extremely silly bug where I was
20378         setting the type of the 'object' parameter of the BeginInvoke
20379         method to System.IAsyncResult instead of System.Object ;-)
20380
20381 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20382
20383         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20384         here. 
20385
20386         (Constructor.Emit): return if we fail to initialize the
20387         constructor.  Another door closed!  
20388
20389         * expression.cs (New.DoResolve): Improve error message (from -6 to
20390         1501).  Use DeclaredOnly lookup to find the exact constructor.
20391
20392         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20393         loop.  This is useful.
20394
20395         * cs-parser.jay: Adjust the default parameters so that destructors
20396         have the proper signature.
20397
20398 2002-04-26  Martin Baulig  <martin@gnome.org>
20399
20400         * driver.cs (LoadAssembly): If `assembly' contains any characters
20401         which are only valid in path names and not in assembly names
20402         (currently slash, backslash and point), use Assembly.LoadFrom ()
20403         instead of Assembly.Load () on the `assembly' (before iteration
20404         over the link_paths).
20405
20406 2002-04-26  Martin Baulig  <martin@gnome.org>
20407
20408         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20409
20410 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20411
20412         * class.cs (Property): use the new typemanager.MemberLookup
20413
20414         (TypeContainer.MemberLookup): Implement using the
20415         TypeManager.MemberLookup now. 
20416
20417         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20418         and return MemberInfos, so that these can be used without an
20419         EmitContext (what we had before).
20420
20421 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20422
20423         * expression.cs: Fix the case where the argument to params if the
20424         type of the params.  I omitted handling this before.   Fixed
20425
20426 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20427
20428         * driver.cs: Call BootCorlib_PopulateCoreType
20429
20430         * class.cs (Property.CheckBase): Check for properties only, not
20431         for all members. 
20432
20433         * interface.cs: Temporary hack: try/catch around the
20434         CustomAttributeBuilder, because I am getting an exception that I
20435         do not understand.
20436
20437         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20438         types whose definitions are required to be there (attributes are
20439         defined before standard types).
20440
20441         Compute definitions as we boot the various types, as they are used
20442         immediately (value_type class will need object_type, but if we do
20443         not initialize object_type, we will pass a null, which will let
20444         the runtime pick the System.Object from the existing corlib, which
20445         is not what we want).
20446
20447 2002-04-22  Patrik Torstensson <totte@labs2.com>
20448
20449         * cs-tokenizer.cs: fixed a number of trim() issues.
20450
20451 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20452
20453         * expression.cs (Argument.Type): Ensure that we return the correct
20454         type when we have out or ref parameters [in which case we 
20455         append a "&"].
20456
20457 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20458
20459         * class.cs (Property, Indexer): Allow extern modifier in there. 
20460
20461         * typemanager.cs (InitBaseTypes): Initializes object_type and
20462         value_type, since those will be used early on during the bootstrap
20463         process to compile corlib.
20464
20465         (InitCoreTypes): Move code from here to InitBaseTypes.
20466
20467 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20470         single-dimension arrays as using the ldlen opcode.  
20471
20472         Daniel Lewis discovered this optimization.  
20473
20474         * typemanager.cs: Add signature for System.Array::get_Length
20475
20476 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20477
20478         * statement.cs: report the error when the foreach does not apply to an
20479         array nor a collection.
20480
20481 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20482
20483         * expression.cs: Add implicit conversions to the operator ~.
20484
20485         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20486
20487         * typemanager.cs: Locate the decimal constructor.
20488
20489 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20490
20491         * attribute.cs: use the new property of TypeOf.
20492         * expression.cs: added 'get' property around typearg.
20493
20494         These changes fix a build breaker reported by NickD. Is this the
20495         correct way to fix?  If not, please, revert my changes and make it
20496         work :-).
20497
20498 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20499
20500         * attribute.cs: Add support for typeof in attribute invocations.
20501         I am not sure that this is right though.
20502
20503 2002-04-14  Duncan Mak  <duncan@ximian.com>
20504
20505         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20506         Binary.Operator.Division case.
20507
20508 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20509
20510         * class.cs (DefineType): Ensure that we do a proper check on
20511         attribute types and also register it with the TypeManager.
20512
20513         (TypeContainer.Targets): The default for attribute types is
20514         AttributeTargets.All.
20515
20516         * attribute.cs (ApplyAttributes): Registering the attribute type
20517         is done elsewhere, not when we discover we have a Usage attribute.
20518
20519 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20520
20521         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20522         and get rid of is_delegate parameter.
20523
20524         * everywhere : update.
20525
20526 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20527
20528         * cs-parser.jay (compilation_unit): Revamp completely to use
20529         some new ideas that I got from Rhys' grammar to solve the problems
20530         with assembly level attributes.
20531
20532         (outer_declaration): New grammar production.
20533
20534         (attribute_sections): Add.
20535
20536         (opt_attributes): Base on attribute_sections
20537
20538         (namespace_declaration): Allow opt_attributes to tackle the case
20539         when we have assembly level attributes - we are clever in this
20540         regard now ;-)
20541
20542         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20543         attributes in the non-global context.
20544
20545         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20546         instead of SetGlobalAttributes.
20547
20548         * class.cs, rootcontext.cs : Ensure we define and generate 
20549         attribute types before anything else.
20550
20551         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20552         and flag the new error -20 for the case when the attribute type
20553         does not have valid targets specified. csc does not catch this.
20554
20555         * ../errors/errors.txt : update for error # -20
20556
20557 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20558
20559         * support.cs (InternalParameters.ParameterModifier): Do some null
20560         checking and return sane values.
20561
20562         * class.cs (Method.Define): If we are a PInvoke method, ensure
20563         that we are static and extern. Report error # 601
20564
20565         * ../errors/cs0601.cs : Add test case for the above error.
20566
20567 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20568
20569         * rootcontext.cs (attribute_types): We need to keep type of
20570         all attribute types separately and emit code for them first.
20571
20572         (RegisterAttribute) : Implement.
20573
20574         * class.cs (DefineType): Check if the current Type is a custom
20575         attribute type and register it accordingly.
20576
20577         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20578         adding the first attribute twice and rename to
20579
20580         (SetGlobalAttributes): this.
20581
20582         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20583         lookups.
20584
20585         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20586         if we are processing global arguments. Hmm, I am unsure of this.
20587
20588 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20589
20590         * expression.cs: added static array of strings to avoid calling
20591         Enum.ToString () for Operator in Binary. Significant recover of
20592         performance.
20593
20594 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20595
20596         * class.cs (FindMembers): Allow the Builders of the various
20597         members to be null.  If they are skip them.  This only happens
20598         during the PInvoke declaration.
20599
20600 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20601
20602         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20603         failure, so we do not keep going afterwards.
20604
20605         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20606         wanted to pass `false' as the `is_delegate' argument.  If this is
20607         the case, why not use delegate_type == null to mean `is_delegate =
20608         false' and anything else as is_delegate = true.
20609
20610 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20611
20612         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20613         code for the section, not the beginning of the tests.
20614
20615 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20616
20617         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20618
20619         * expression.cs (Binary): same.  Warn about errors where we have
20620         Enum/Enum in operator + as well.
20621
20622 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20623
20624         * statement.cs:
20625                 - added support for switch(bool)
20626                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20627                 - add TableSwitchEmit() to handle table-based switch statements
20628
20629 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20630
20631         * expression.cs (Invocation.OverloadResolve): Factor out code which
20632         does parameter compatibility checking with arguments so that we can 
20633         re-use the code even from Delegate.VerifyApplicability
20634
20635         (VerifyArgumentsCompat): Move above code here.
20636
20637         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20638         and instead make a call to the above method.
20639
20640 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20641
20642         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20643         We use it to keep track of classes which are attribute types.
20644
20645 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20646
20647         * delegate.cs (Delegate.Define): Correctly define the types in the
20648         presence of fixed and array parameters.
20649
20650         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20651         doing FindMembers.
20652
20653         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20654         include NonPublic after the first iteration.
20655
20656         * class.cs (Indexer.CheckBase): Only check if both parents are
20657         non-null. 
20658
20659         * cs-parser.jay (accessor_body): If empty, set to null.
20660
20661         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20662         same code path here to resolve constants names that we did have in
20663         MemberAccess.DoResolve.  There is too much code duplicated here.
20664
20665 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20666
20667         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20668
20669         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20670         to MakeUnionSet.
20671
20672         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20673         tokens, numbers and strings.
20674
20675         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20676         parenthesis.
20677
20678         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20679         asyncronous parameters and the regular parameters.  
20680
20681         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20682         specify the target directory.
20683
20684         * expression.cs: (This.DoResolve): Simplify
20685         (As.Emit): Optimize, do not generate IsInst if the expression is
20686         always of the given type.
20687
20688         (Is.DoResolve): Bug fix, we were reporting both always/never for
20689         the is expression.
20690
20691         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20692         creating too many unnecessary arrays.
20693
20694 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20695
20696         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20697         fields instead of rolling our own initializer.   Takes care of all
20698         implicit conversions, and drops unnecessary static checks/argument.
20699
20700 2002-03-31  Dick Porter  <dick@ximian.com>
20701
20702         * driver.cs: use the GetDirectories() return values properly, and
20703         use "/" as path separator.
20704
20705 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20706
20707         * expression.cs (Unary): Optimize - - expr into expr.
20708         (Binary): Optimize a + (-b) into a -b.
20709
20710         * codegen.cs (CodeGen): Made all methods static.
20711
20712 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20713
20714         * rootcontext.cs: 
20715
20716         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20717         TypeBuilder property.
20718
20719         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20720         instead. 
20721
20722         * tree.cs: Removed the various RecordXXXX, and replaced with a
20723         single RecordDecl.  Removed all the accessor methods, and just
20724         left a single access point Type 
20725
20726         * enum.cs: Rename DefineEnum to DefineType.
20727
20728         * decl.cs: New abstract method `DefineType' used to unify the
20729         Defines for Enumerations, Interfaces, TypeContainers and
20730         Delegates.
20731
20732         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20733         LookupBaseClasses method that used to live in class.cs and
20734         interface.cs here, and renamed to FindType.
20735
20736         * delegate.cs: Implement DefineType.  Take advantage of the
20737         refactored pattern for locating the parent builder without taking
20738         the parent_builder argument (which we know does not work if we are
20739         nested, and triggering a toplevel definition).
20740
20741 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20742
20743         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20744         accessibility of a member has changed during override and report
20745         an error if so.
20746
20747         * class.cs (Method.Define, Property.Define): Only complain on
20748         overrides if the method is private, any other accessibility is
20749         fine (and since we just checked the permission is the same, we are
20750         good to go).
20751
20752         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20753         and elif are processed always.  The other pre-processing
20754         directives are only processed if we are "taking" the path
20755
20756 2002-03-29  Martin Baulig  <martin@gnome.org>
20757
20758         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20759         current location is not Null.
20760
20761         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20762         a separate method so we can profile it.
20763
20764         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20765         `span.Seconds' are just seconds, but no minutes or hours.
20766         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20767
20768 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20769
20770         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20771         Remove the gratuitous set of Final:
20772
20773                                 // If an interface implementation, then we can set Final.
20774                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20775                                     implementing.DeclaringType.IsInterface)
20776                                         flags |= MethodAttributes.Final;
20777
20778         I do not know what I was smoking when I used that.
20779
20780
20781         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20782         step into fixing the name resolution issues for delegates and
20783         unifying the toplevel name resolution.
20784
20785 2002-03-28  Martin Baulig  <martin@gnome.org>
20786
20787         * class.cs (Method.Emit): If we have a symbol writer, call its
20788         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20789         tell it about the current method.
20790
20791         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20792         writer that we're going to emit the first byte of IL code for a new
20793         statement (a new source line).
20794         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20795         EmitContext.Mark() before emitting any code.
20796
20797         * location.cs (SymbolDocument): Return null when we're Null.
20798
20799         * statement.cs (Statement): Moved the `Location loc' variable here.
20800         (Statement.EmitBoolExpression): If we have a symbol writer, call
20801         ec.Mark() before emitting any code to tell it that we're at the
20802         beginning of a new statement.
20803         (StatementExpression): Added `Location' argument to the constructor.
20804         (Block): Added public readonly variable `StartLocation' and public
20805         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20806         (Block): Added constructor which takes a start and end location.
20807         (Block.SetEndLocation): New method. This sets the end location.
20808         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20809         local variables we create.
20810         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20811         each statement and do also mark the begin and end of the block.
20812
20813         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20814         tell it the current lexer.Location, use Location.Null for the end of the
20815         block.
20816         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20817         current block, set its end location using SetEndLocation().
20818         (statement_expression): StatementExpression constructor now takes the
20819         lexer.Location as additional argument.
20820         (for_statement, declare_local_variables): Likewise.
20821         (declare_local_variables): When creating a new implicit block, use the
20822         new Block constructor and pass it the lexer.Location.
20823
20824 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20825
20826         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20827         members also on the parent interfaces recursively.
20828
20829 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20830
20831         * report.cs: Use new formats, since Gonzalo finished the missing
20832         bits. 
20833
20834         * expression.cs (Binary.ResolveOperator): added missing operator|
20835         operator& and operator^ for bool/bool.
20836
20837         * cs-parser.jay: CheckDef now takes a Location argument that is
20838         used to report errors more precisly (instead of reporting the end
20839         of a definition, we try to track something which is a lot closer
20840         to the source of the problem).
20841
20842         * cs-tokenizer.cs: Track global token use, so we can properly flag
20843         the use of #define/#undef after the first token has been seen.
20844
20845         Also, rename the reportXXXX to Error_DescriptiveName
20846
20847         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20848         TypeContainer, so that Enum and Interface can use this too.
20849
20850         * class.cs (TypeContainer.LookupInterfaceOrClass,
20851         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20852         `builder' argument.  Typically this was used to pass the parent
20853         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20854         the definition).  
20855
20856         The problem is that a nested class could trigger the definition of
20857         a toplevel class, and the builder would be obviously wrong in that
20858         case. 
20859
20860         So we drop this argument, and we compute dynamically the
20861         TypeBuilder/ModuleBuilder (the correct information was available
20862         to us anyways from DeclSpace.Parent)
20863
20864         * interface.cs (Interface.DefineInterface): Drop builder
20865         parameter cleanup like class.cs
20866
20867         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20868         like class.cs
20869
20870         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20871         values. 
20872
20873         (Try.Emit): Propagate the returns value from the statement.
20874
20875         (Return.Emit): Even if we are leavning 
20876
20877         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20878
20879         * modifiers.cs: Fix the computation of MethodAttributes flags.
20880
20881 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20882
20883         * driver.cs: allow compilation of files that start with '/'.
20884         Add a default case when checking the argument of --target.
20885
20886 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20887
20888         * interface.cs: Implement the same search algorithm for types in
20889         the interface code.
20890
20891         * delegate.cs: Do not allow multiple definition.
20892
20893         * Recovered ChangeLog that got accidentally amputated
20894
20895         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20896
20897         * rootcontext.cs: Load manually enum to allow core classes to
20898         contain enumerations.
20899
20900         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20901         Update to new static methods in TypeManager.
20902
20903         * typemanager.cs (GetMethod, GetConstructor): Use our
20904         implementation of FindMembers to find the members, since during
20905         corlib compilation, the types are TypeBuilders and GetMethod and
20906         GetConstructor do not work.
20907
20908         Make all methods in TypeManager static.
20909
20910         (InitCodeHelpers): Split the functionality from
20911         the InitCodeTypes function.
20912
20913         * driver.cs: Call InitCodeHelpers after we have populated the
20914         types. 
20915
20916         * cs-parser.jay (delegate_declaration): we did not used to compute
20917         the delegate name correctly for void delegates.
20918
20919 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20920
20921         * rootcontext.cs (RootContext): Init the interface_resolve_order
20922         and type_container_resolve_order always.
20923
20924         (ResolveCore, BootstrapCorlib_ResolveClass,
20925         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20926         compiler when compiling with --nostdlib
20927
20928         * class.cs (TypeContainer.DefineType): Check that our parent is
20929         not null.  This test is most important when we are bootstraping
20930         the core types.
20931
20932         * codegen.cs: Split out the symbol writing code.
20933
20934 2002-03-25  Martin Baulig  <martin@gnome.org>
20935
20936         * driver.cs (-g): Made -g an alias for --debug.
20937
20938 2002-03-24  Martin Baulig  <martin@gnome.org>
20939
20940         * codegen.cs (SymbolWriter): New public variable. Returns the
20941         current symbol writer.
20942         (CodeGen): Added `bool want_debugging_support' argument to the
20943          constructor. If true, tell the ModuleBuild that we want debugging
20944         support and ask it for the ISymbolWriter.
20945         (Save): If we have a symbol writer, call it's Close() method after
20946         saving the assembly.
20947
20948         * driver.c (--debug): New command line argument to create a
20949         debugger information file.
20950
20951         * location.cs (SymbolDocument): New public property. Returns an
20952         ISymbolDocumentWriter object for the current source file or null
20953         if we don't have a symbol writer.
20954
20955 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20956
20957         * driver.cs (LoadAssembly): Correctly return when all the paths
20958         have been tried and not before.
20959
20960         * statement.cs (Switch.Emit): return the actual coverage for this
20961         statement (returns/not-returns)
20962
20963         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20964         switch of the statement if we are the last switch section.  That
20965         kills two problems: try/catch problems (we used to emit an empty
20966         nop at the end) and switch statements where all branches would
20967         return. 
20968
20969 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20970
20971         * driver.cs: Add default assemblies (the equivalent to the
20972         Microsoft CSC.RSP file)
20973
20974         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20975         also update tokens_seen and set it to false.
20976
20977         * driver.cs: Implement --recurse for Mike.
20978
20979         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20980         correctly splitting out the paths.
20981
20982 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20983
20984         * interface.cs (Interface.PopulateProperty): Instead of using
20985         `parent' as the declaration space for the set parameters, use
20986         `this' 
20987
20988         * support.cs (InternalParameters): InternalParameters constructor
20989         takes a DeclSpace instead of a TypeContainer.
20990
20991         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20992         types are being initialized, load the address of it before calling
20993         the function.  
20994
20995         (New): Provide a mechanism to disable the generation of local
20996         value type temporaries when the caller will be providing us with
20997         an address to store it.
20998
20999         (ArrayCreation.EmitDynamicInitializers): Use it.
21000
21001 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21002
21003         * expression.cs (Invocation.EmitArguments): Only probe for array
21004         property if there is more than one argument.  Sorry about that.
21005
21006         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21007         empty param arrays.
21008
21009         * class.cs (Method.LabelParameters): Fix incorrect code path that
21010         prevented the `ParamArrayAttribute' from being applied to the
21011         params attribute.
21012
21013 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21014
21015         * support.cs (ReflectionParameters): Correctly compute whether the
21016         last argument is a params array.  Fixes the problem with
21017         string.Split ('a')
21018
21019         * typemanager.cs: Make the assemblies array always be non-null
21020         (empty, but non-null)
21021
21022         * tree.cs (RecordDecl): New function that abstracts the recording
21023         of names.  This reports error 101, and provides a pointer to the
21024         previous declaration.  Fixes a crash in the compiler.
21025
21026         * cs-parser.jay (constructor_declaration): Update to new grammar,
21027         and provide a constructor_body that can be empty.
21028
21029 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21030
21031         * driver.cs: Add support for --resources.
21032
21033         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21034         Make all types for the various array helper methods be integer.
21035
21036         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21037         CheckState to ConvCast.
21038
21039         (ConvCast): Now it takes a `checked' state argument, to avoid
21040         depending on the emit context for the conversion, and just using
21041         the resolve time setting.
21042
21043         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21044         instead of Invocation.EmitArguments.  We do not emit the original
21045         arguments, instead we emit those which have been converted to
21046         unsigned int expressions.
21047
21048         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21049
21050         * codegen.cs: ditto.
21051
21052         * expression.cs (LocalVariableReference): Drop the use of the
21053         Store function that depended on the variable index.
21054
21055         * statement.cs (VariableInfo): Drop the `Idx' property from this
21056         class, as this is not taking into account the indexes for
21057         temporaries tat we generate during the execution, getting the
21058         indexes wrong.
21059
21060         * class.cs: First emit class initializers, then call the parent
21061         constructor. 
21062
21063         * expression.cs (Binary): Fix opcode emision.
21064         (UnaryMutator.EmitCode): Support checked code generation
21065
21066         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21067         matches for events for both the Static and Instance scans,
21068         pointing to the same element.   Fix that.
21069
21070 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21071
21072         * rootcontext.cs (ResolveTree): Always set the
21073         interface_resolve_order, because nested interfaces will be calling
21074         into us.
21075
21076         * class.cs (GetInterfaceOrClass): Track the same resolution
21077         process used by TypeManager.LookupType.  This fixes the nested
21078         type lookups in class declarations (separate path from
21079         LookupType). 
21080
21081         (TypeContainer.DefineType): Also define nested interfaces.
21082         (TypeContainer.RegisterOrder): New public function used to
21083         register the order in which child interfaces need to be closed.
21084
21085         Nested interfaces need to be closed after their parents have been
21086         created. 
21087
21088         * interface.cs (InterfaceAttr): Put all the logic for computing
21089         the interface attribute here. 
21090
21091         (DefineInterface): Register our interface order with the
21092         RootContext or with the TypeContainer depending on the case.
21093
21094 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21095
21096         * cs-parser.jay: rework foreach statement to work with the new
21097         changes to the policy on SimpleNames.
21098
21099         * report.cs: support Stacktrace on warnings as well.
21100
21101         * makefile: drop --unsafe and /unsafe from the compile.
21102
21103 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21104
21105         * ecore.cs (StandardConversionExists): Modify to take an Expression
21106         as the first parameter. Ensure we do null -> reference type conversion
21107         checking.
21108
21109         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21110         temporary Expression objects.
21111
21112 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21113
21114         * interface.cs: workaround bug in method overloading resolution
21115         (there is already a bugzilla bug for it).
21116
21117 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21118
21119         We could also solve this problem by having a separate path for
21120         performing type lookups, instead of DoResolve, we could have a
21121         ResolveType entry point, and only participating pieces of the
21122         production (simplename, deref, array) would implement this. 
21123
21124         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21125         signal SimpleName to only resolve type names and not attempt to
21126         resolve anything else.
21127
21128         * expression.cs (Cast): Set the flag.
21129
21130         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21131
21132         * class.cs: Only report 108 if there is no `new' modifier.
21133
21134         * cs-parser.jay: rework foreach statement to work with the new
21135         changes to the policy on SimpleNames.
21136
21137         * report.cs: support Stacktrace on warnings as well.
21138
21139         * makefile: drop --unsafe and /unsafe from the compile.
21140
21141 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21142
21143         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21144         lookups here, instead of doing that at parse time.  This means
21145         that our grammar will not introduce `LocalVariableReferences' as
21146         expressions at this point.  That solves the problem of code like
21147         this:
21148
21149         class X {
21150            static void Main ()
21151            { int X = 1;
21152             { X x = null }}}
21153
21154         This is only half the fix.  The full fix requires parameters to
21155         also be handled in this way.
21156
21157         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21158         makes the use more obvious of the DeclSpace.  The
21159         ec.TypeContainer.TypeBuilder is now only used to pull the
21160         TypeBuilder for it.
21161
21162         My theory is that I can get rid of the TypeBuilder completely from
21163         the EmitContext, and have typecasts where it is used (from
21164         DeclSpace to where it matters).  
21165
21166         The only pending problem is that the code that implements Aliases
21167         is on TypeContainer, and probably should go in DeclSpace.
21168
21169         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21170         lookups here, instead of doing that at parse time.  This means
21171         that our grammar will not introduce `LocalVariableReferences' as
21172         expressions at this point.  That solves the problem of code like
21173         this:
21174
21175         class X {
21176            static void Main ()
21177            { int X = 1;
21178             { X x = null }}}
21179
21180         This is only half the fix.  The full fix requires parameters to
21181         also be handled in this way.
21182
21183         * class.cs (Property.DefineMethod): When implementing an interface
21184         method, set newslot, when implementing an abstract method, do not
21185         set the flag (before we tried never setting it, or always setting
21186         it, which is the difference).
21187         (Indexer.DefineMethod): same.
21188         (Method.DefineMethod): same.
21189
21190         * ecore.cs: Only set the status used flag if we get back a Field.
21191
21192         * attribute.cs: Temporary hack, so Paolo can keep working.
21193
21194 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21195
21196         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21197         the unmanaged type in the case we have a MarshalAs attribute.
21198
21199         (Resolve): Handle the case when we are parsing the special MarshalAs
21200         attribute [we need to store the unmanaged type to use later]
21201
21202         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21203         MarshalAs Attribute.
21204
21205         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21206         on parameters and accordingly set the marshalling info.
21207
21208 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21209
21210         * class.cs: Optimizing slightly by removing redundant code after
21211         we switched to the `NoTypes' return value.
21212         (Property.DefineMethod): use NoTypes here too.
21213
21214         This fixes the bug I introduced in my last batch of changes.
21215
21216 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21217
21218         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21219
21220         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21221         Enums since those are types too. 
21222
21223         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21224
21225         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21226         thanks to a call during the lookup process.
21227
21228 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21229
21230         * statement.cs (Foreach): Lots of work to accomodate a particular
21231         kind of foreach statement that I had not kept in mind.  It is
21232         possible to have foreachs on classes that provide a GetEnumerator
21233         method that return objects that implement the "pattern" for using
21234         a foreach, there is no need to support GetEnumerator
21235         specifically. 
21236
21237         This is needed to compile nant.
21238
21239         * decl.cs: Only report 114 if the member is not `Finalize' and if
21240         the warning level is at least 2.
21241
21242         * class.cs: Moved the compare function from Method to
21243         MethodSignature. 
21244
21245         (MethodSignature.InheritableMemberSignatureCompare): Add new
21246         filter function that is used to extract inheritable methods from a
21247         class. 
21248
21249         (Method.Define): Use the new `inheritable_method_signature_filter'
21250         delegate
21251
21252         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21253         command. 
21254
21255 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21256
21257         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21258
21259         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21260
21261         * expression.cs: Pass location information to
21262         ConvertImplicitStandard. 
21263
21264         * class.cs: Added debugging code to track return values from
21265         interfaces. 
21266
21267 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21268
21269         * expression.cs (Is.DoResolve): If either side of the `is' is an
21270         interface, do not flag the warning.
21271
21272         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21273         for interfaces
21274
21275         * report.cs: Allow for --fatal to be used with --probe.
21276
21277         * typemanager.cs (NoTypes): Move the definition for the empty Type
21278         array here. 
21279
21280         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21281         properties. 
21282         (TypeContainer.DefineProxy): New function used to proxy to parent
21283         implementations when implementing interfaces.
21284         (TypeContainer.ParentImplements): used to lookup if our parent
21285         implements a public function that is required by an interface.
21286         (TypeContainer.VerifyPendingMethods): Hook this up.
21287
21288         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21289         `modules' and `assemblies' arraylists into arrays.  We only grow
21290         these are the very early start up of the program, so this improves
21291         the speedof LookupType (nicely measured).
21292
21293         * expression.cs (MakeByteBlob): Replaced unsafe code with
21294         BitConverter, as suggested by Paolo.
21295
21296         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21297         folding of string concatenation, but if either side is a string,
21298         and the other is not, then return null, and let the runtime use
21299         the concatenation on the string plus the object (using
21300         `Object.ToString'). 
21301
21302 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21303
21304         Constant Folding has been implemented now.
21305
21306         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21307         the error instead on types that are not supported in one's
21308         complement. 
21309
21310         * constant.cs (Constant and all children): New set of functions to
21311         perform implict and explicit conversions.
21312
21313         * ecore.cs (EnumConstant): Implement the new functions to perform
21314         conversion by proxying to the child expression.
21315
21316         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21317         own separate setting that can not be turned off from the command
21318         line using --unchecked or --checked and is only controlled using
21319         the checked/unchecked statements and expressions.  This setting is
21320         used by the constant folder to flag errors.
21321
21322         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21323         ConstantCheckState as well.   
21324
21325         During Resolve, they also have to flag the state, because the
21326         constant folder runs completely in the Resolve phase.
21327
21328         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21329         well.
21330
21331 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21332
21333         * cfold.cs: New file, this file contains the constant folder.
21334
21335         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21336         argument to track whether we are using the resulting address to
21337         load or store a value and provide better error messages. 
21338
21339         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21340         new AddressOf arguments.
21341
21342         * statement.cs (Foreach.EmitCollectionForeach): Update
21343
21344         * expression.cs (Argument.Emit): Call AddressOf with proper
21345         arguments to track usage.
21346
21347         (New.DoEmit): Call AddressOf with new arguments.
21348
21349         (Unary.Emit): Adjust AddressOf call.
21350
21351 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21352
21353         * cs-parser.jay (member_access): Change the case for pre-defined types
21354         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21355         this suggestion.
21356
21357         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21358         a method body.
21359
21360         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21361         essentially like methods and apply attributes like MethodImplOptions to them too.
21362
21363         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21364         not being null.
21365
21366         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21367         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21368         is the DeclSpace.
21369
21370         * Update code everywhere accordingly.
21371
21372         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21373
21374         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21375
21376 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21377
21378         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21379         try performing lookups against those instead of jumping straight into using
21380         the 'using' clauses.
21381
21382         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21383
21384         (LookupType): Perform lookups in implicit parents too.
21385
21386         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21387         sequence as RootContext.LookupType. 
21388
21389         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21390         the various cases of namespace lookups into this method.
21391
21392 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21393
21394         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21395         in positional arguments)
21396
21397         * class.cs (Operator): Update the AllowedModifiers to contain
21398         extern. 
21399
21400         * cs-parser.jay: Update operator declaration to allow for the
21401         operator body to be empty.
21402
21403         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21404         values. 
21405
21406 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21407
21408         * class.cs (Method.Emit): Label parameters.
21409
21410         * driver.cs: Return 1 or 0 as the program exit code.
21411
21412 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21413
21414         * expression.cs: Special case the `null' object when trying to
21415         auto-compute the type, as anything can be explicitly converted to
21416         that. 
21417
21418         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21419         spotting this Paolo.
21420
21421         (Expression.ImplicitNumericConversion): Perform comparissions of
21422         the type using the underlying type in the case of an enumeration
21423         rather than using the enumeration type for the compare.
21424
21425         Cope with the underlying == type case, which is not possible to
21426         catch before. 
21427
21428         (Expression.ConvertNumericExplicit): Perform comparissions of
21429         the type using the underlying type in the case of an enumeration
21430         rather than using the enumeration type for the compare.
21431
21432         * driver.cs: If the user does not supply an extension, assume .exe
21433
21434         * cs-parser.jay (if_statement): Rewrote so that we can track the
21435         location for the if statement.
21436
21437         * expression.cs (Binary.ConstantFold): Only concat strings when
21438         the operation is "+", not everything ;-)
21439
21440         * statement.cs (Statement.EmitBoolExpression): Take a location
21441         argument. 
21442         (If, While, Do): Track location.
21443
21444         * expression.cs (Binary.ResolveOperator): In the object + string
21445         case, I was missing a call to ConvertImplicit
21446
21447 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21448
21449         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21450         Location arguments. Ensure we use RootContext.LookupType to do our work
21451         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21452
21453         * interface.cs (PopulateMethod): Handle the type of the parameter being
21454         null gracefully.
21455
21456         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21457         have a params method with no fixed arguments and a call is made with no
21458         arguments.
21459
21460 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21461
21462         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21463         the verbatim-string-literal
21464
21465         * support.cs (InternalParameters.ParameterModifier): handle null
21466         fixed parameters.
21467         (InternalParameters.ParameterType): ditto.
21468
21469         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21470         duplicating the name of the variable parameter.
21471         (GetParameterByName): Fix bug where we were not looking up array
21472         paramters if they were the only present (thanks Paolo!).
21473         (GetParameterInfo): We only have an empty set of types if both
21474         fixed and array are set to null.
21475         (GetParameterInfo-idx): Handle FixedParameter == null
21476
21477         * cs-parser.jay: Handle the case where there is no catch
21478         statements (missing null test).
21479
21480 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21481
21482         * driver.cs (MainDriver): Be conservative on our command line
21483         handling.
21484
21485         Catch DirectoryNotFoundException when calling GetFiles.
21486
21487         (SplitPathAndPattern): Used to split the input specification into
21488         a path and a pattern that we can feed to Directory.GetFiles.
21489
21490 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21491
21492         * statement.cs (Fixed): Implement the last case of the Fixed
21493         statement (string handling).
21494
21495         * expression.cs (StringPtr): New class used to return a char * to
21496         a string;  Used by the Fixed statement.
21497
21498         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21499
21500         * expression.cs (Binary.ResolveOperator): Remove redundant
21501         MemberLookup pn parent type.
21502         Optimize union call, we do not need a union if the types are the same.
21503         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21504         type.
21505
21506         Specialize the use of MemberLookup everywhere, instead of using
21507         the default settings. 
21508
21509         (StackAlloc): Implement stackalloc keyword.
21510
21511         * cs-parser.jay: Add rule to parse stackalloc.
21512
21513         * driver.cs: Handle /h, /help, /?
21514
21515         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21516         before we supported unsafe code.
21517
21518         * makefile: add --unsafe to the self compilation of mcs.
21519
21520 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21521
21522         * expression.cs (PointerArithmetic): New class that is used to
21523         perform pointer arithmetic.
21524         (Binary.Resolve): Handle pointer arithmetic
21525         Handle pointer comparission.
21526         (ArrayPtr): Utility expression class that is used to take the
21527         address of an array.
21528
21529         (ElementAccess): Implement array access for pointers
21530
21531         * statement.cs (Fixed): Implement fixed statement for arrays, we
21532         are missing one more case before we are done.
21533
21534         * expression.cs (Indirection): Implement EmitAssign and set the
21535         ExprClass to Variable.  This allows pointer dereferences to be
21536         treated as variables, and to have values assigned to them.
21537
21538         * ecore.cs (Expression.StoreFromPtr): New utility function to
21539         store values dereferencing.
21540
21541 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21542
21543         * expression.cs (Binary.ResolveOperator): Ensure that we are
21544         not trying to operate on a void type - this fixes the reported
21545         bug.
21546
21547         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21548         the parent implementation is sealed.
21549
21550         * ../errors/cs0239.cs : Add.
21551
21552         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21553
21554         * typemanager.cs (unverifiable_code_type): Corresponds to 
21555         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21556         which have unsafe code in them.
21557
21558         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21559         unsafe context.
21560
21561 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21562
21563         * cs-tokenizer.cs: Add support for @"litreal strings"
21564
21565         Make tokenizer accept pre-processor directives
21566         on any column (remove the old C-like limitation). 
21567
21568         * rootcontext.cs (EmitCode): Emit any global attributes.
21569         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21570
21571         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21572
21573         * cs-parser.jay: Add support for global attributes.  
21574
21575 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21576
21577         * expression.cs (Indirection): New helper class.  Unary will
21578         create Indirection classes to be able to implement the
21579         IMemoryLocation interface on it.
21580
21581 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21582
21583         * cs-parser.jay (fixed_statement): reference the right statement.
21584
21585         * statement.cs (Fixed.Emit): Finish implementing the fixed
21586         statement for the &x case.
21587
21588 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21589
21590         * class.cs (Property.Define, Method.Define): Remove newslot when
21591         `implementing'.  
21592
21593         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21594         wrong.  NewSlot should only be used if the `new' keyword is present.
21595
21596         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21597         locating our system dir.  Sorry about this.
21598
21599 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21600
21601         * driver.cs (GetSystemDir): Compute correctly the location of our
21602         system assemblies.  I was using the compiler directory instead of
21603         the library directory.
21604
21605 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21606
21607         * expression.cs (BetterFunction): Put back in what Miguel commented out
21608         since it is the correct fix. The problem is elsewhere ;-)
21609
21610         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21611         parameters of the parms method are themselves compatible or not !
21612
21613         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21614         to check that a class implements an interface before saying that an implicit
21615         conversion was allowed. Use ImplementsInterface to do the checking.
21616
21617 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21618
21619         * class.cs (Method.Define): Track whether we are an explicit
21620         implementation or not.  And only call DefineMethodOverride if we
21621         are an explicit implementation.
21622
21623         (Property.DefineMethod): Ditto.
21624
21625 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21626
21627         * expression.cs (BetterFunction): Catch hideous bug which was
21628          preventing us from detecting ambiguous calls due to implicit casts i.e
21629         cs0121.
21630
21631 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21632
21633         * support.cs (Pair): Remove un-needed method.  I figured why I was
21634         getting the error in cs-parser.jay, the variable in a foreach loop
21635         is readonly, and the compiler does not really treat this as a variable.
21636
21637         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21638         instead of EQUALS in grammar.  
21639
21640         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21641
21642         * expression.cs (Unary.DoResolve): Check whether the argument is
21643         managed or not.
21644
21645 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21646
21647         * support.cs: Api for Pair to set a value.  Despite the fact that
21648         the variables are public the MS C# compiler refuses to compile
21649         code that accesses the field if the variable is part of a foreach
21650         statement. 
21651
21652         * statement.cs (Fixed): Begin implementation of the fixed
21653         statement.
21654
21655         (Block.AddVariable): Return the VariableInfo on success and null
21656         on failure instead of true/false. 
21657
21658         * cs-parser.jay (foreach): Catch errors on variables already
21659         defined (we were ignoring this value before) and properly unwind
21660         the block hierarchy
21661
21662         (fixed_statement): grammar for the fixed statement.
21663
21664 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21665
21666         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21667         pointer types to be incretemented.
21668
21669         (SizeOf): Implement.
21670
21671         * cs-parser.jay (pointer_member_access): Implement
21672         expr->IDENTIFIER production.
21673
21674         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21675         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21676         on safe contexts.
21677
21678         (Unary): Implement indirection.
21679
21680         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21681         use in non-unsafe context).
21682
21683         (SimpleName.DoResolve): Check for pointers in field access on safe
21684         contexts. 
21685
21686         (Expression.LoadFromPtr): Factor the load-indirect code in this
21687         function.  This was duplicated in UnboxCast and ParameterReference
21688
21689 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21690
21691         * expression.cs (ComposedCast): report an error if a pointer cast
21692         is used in a safe region.
21693
21694         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21695         pointer type casts in unsafe context.
21696
21697         * codegen.cs (EmitContext): Set up IsUnsafe.
21698
21699         * cs-parser.jay (non_expression_type): Add productions for pointer
21700         casts. 
21701
21702         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21703         code.  We should not use force into static mode if the method is
21704         not virtual.  Fixes bug in MIS
21705
21706         * statement.cs (Do.Emit, While.Emit, For.Emit,
21707         Statement.EmitBoolExpression): Add support to Do and While to
21708         propagate infinite loop as `I do return' semantics.
21709
21710         Improve the For case to also test for boolean constants.
21711
21712         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21713         to the list of attributes we can add.
21714
21715         Remove `EmitContext' argument.
21716
21717         * class.cs (Method.Define): Apply parameter attributes.
21718         (Constructor.Define): Apply parameter attributes.
21719         (MethodCore.LabelParameters): Move here the core of labeling
21720         parameters. 
21721
21722         * support.cs (ReflectionParameters.ParameterModifier,
21723         InternalParameters.ParameterModifier): Use IsByRef on the type and
21724         only return the OUT bit for these parameters instead of in/out/ref
21725         flags.
21726
21727         This is because I miss-understood things.  The ParameterInfo.IsIn
21728         and IsOut represent whether the parameter has the [In] and [Out]
21729         attributes set.  
21730
21731 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21732
21733         * ecore.cs (FieldExpr.Emit): Release temporaries.
21734
21735         * assign.cs (LocalTemporary.Release): new function.
21736
21737         * codegen.cs (EmitContext.GetTemporaryStorage,
21738         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21739         temporary storage.  Now we can "put back" localbuilders when we
21740         are done with them
21741
21742 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21743
21744         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21745         need to make a copy of the variable to generate verifiable code.
21746
21747 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * driver.cs: Compute dynamically the system directory.
21750
21751         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21752         Slower, but more generally useful.  Used by the abstract
21753         registering implementation. 
21754
21755         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21756         the rules for the special rule on Type/instances.  First check if
21757         we have the same name, and if so, try that special static path
21758         rather than the instance path.
21759
21760 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21761
21762         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21763         for, while and if.
21764
21765         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21766         Enum, ValueType, Delegate or Array for non-corlib compiles.
21767
21768         * cs-tokenizer.cs: Catch long identifiers (645)
21769
21770         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21771         piece of code.
21772
21773         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21774         fix, we were returning too early, so we were not registering
21775         pending methods from abstract classes.
21776
21777         Do not register pending methods if the class is abstract.
21778
21779         * expression.cs (Conditional.DoResolve): Report circular implicit
21780         conversions when we neecd to compute it for conditional
21781         expressions. 
21782
21783         (Is.DoResolve): If the expression is always of the provided type,
21784         flag warning 183.  If the expression can not ever be of the
21785         provided type flag warning 184.
21786
21787         * class.cs: Catch 169 as well.
21788
21789         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21790         read. 
21791
21792 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21793
21794         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21795
21796 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21797
21798         * interface.cs: (PopulateMethod): Check for pointers being defined
21799         only if the unsafe context is active.
21800         (PopulateProperty): ditto.
21801         (PopulateIndexer): ditto.
21802
21803         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21804         specified.  If pointers are present, make sure that they are
21805         present in an unsafe context.
21806         (Constructor, Constructor.Define): ditto.
21807         (Field, Field.Define): ditto.
21808         (Property, Property.Define): ditto.
21809         (Event, Event.Define): ditto.
21810
21811         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21812         hashtable if there are classes or structs defined.
21813
21814         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21815         code, as the constant resolution moved.
21816
21817         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21818         the metadata, so we can flag error 133. 
21819
21820         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21821         pointer is being declared in an unsafe context.
21822
21823 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21824
21825         * modifiers.cs (Modifiers.Check): Require a Location argument.
21826         Report error 227 for Unsafe use.
21827
21828         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21829
21830         * statement.cs (For.Emit): If the test is null, then report that
21831         we do `return', as we wont reach anything afterwards.
21832
21833         (Switch.SwitchGoverningType): Track the expression that matched
21834         the conversion.
21835
21836         * driver.cs: Allow negative numbers as an error code to flag.
21837
21838         * cs-parser.jay: Handle 1551.
21839
21840         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21841
21842 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21843
21844         * cs-parser.jay: Report 1518 (type declaration can only contain
21845         class, struct, interface, enum or delegate)
21846
21847         (switch_label): Report 1523 (keywords `case' or `default' must
21848         preced code)
21849
21850         (opt_switch_sections): Report 1522 (empty switch)
21851
21852         * driver.cs: Report 1515 (response file specified multiple times)
21853         Report 1516 (Source file specified multiple times).
21854
21855         * expression.cs (Argument.Resolve): Signal 1510
21856
21857         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21858         access not allowed in static code)
21859
21860 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21861
21862         * typemanager.cs (IsPointerType): Utility method which we are going
21863         to need a lot.
21864
21865         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21866         the object type, so we take care of that.
21867
21868         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21869
21870         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21871         added to non-params parameters :-)
21872
21873         * typemanager.cs (CSharpName): Include 'void' type too. 
21874
21875         (void_ptr_type): Include in the set of core types.
21876
21877         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21878         duplicating code.
21879
21880         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21881         an unsafe context.
21882
21883         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21884         completely forgotten about it.
21885
21886 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21887
21888         * cs-parser.jay (pointer_type): Add. This begins our implementation
21889         of parsing rules for unsafe code.
21890
21891         (unsafe_statement): Implement.
21892
21893         (embedded_statement): Modify to include the above.
21894
21895         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21896
21897         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21898         if the current context is an unsafe one.
21899
21900         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21901         are handled differently, we need separate rules for them.
21902
21903         (local_variable_declaration): Update to use local_variable_pointer_type
21904         to allow variable declarations of unmanaged pointer types.
21905
21906         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21907         in unsafe contexts.
21908
21909         * ../errors/cs0214.cs : Add.
21910
21911 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21912
21913         * makefile: remove 'response' file when cleaning.
21914
21915 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21916
21917         * cs-parser.jay: Report 1524.
21918
21919 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21920
21921         * typemanager.cs (RegisterMethod): drop checking if we have
21922         registered this from here
21923
21924 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21925
21926         * class.cs (Method.EmitDestructor): Implement calling our base
21927         destructor. 
21928
21929         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21930         value of InFinally.
21931
21932         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21933         this routine and will wrap the call in a try/catch block.  Deal
21934         with the case.
21935
21936 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21937
21938         * ecore.cs (Expression.MemberLookup): instead of taking a
21939         parameter `same_type' that was used to tell whether we could
21940         access private members we compute our containing type from the
21941         EmitContext.
21942
21943         (FieldExpr): Added partial support for volatile fields.  This does
21944         not work for volatile fields exposed from assemblies, as I can not
21945         figure out how to extract the modreq from it.
21946
21947         Updated all the source files to use this.
21948
21949         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21950         because it is referenced by MemberLookup very often. 
21951
21952 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21953
21954         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21955         TypeBuilder.GetCustomAttributes to retrieve what we need.
21956
21957         Get rid of redundant default_member_attr_type as this is the same as
21958         default_member_type which already exists.
21959
21960         * interface.cs, attribute.cs : Update accordingly.
21961
21962 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21963
21964         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21965         work for TYpeBuilders though.  Ravi, can you please fix this?
21966
21967         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21968
21969         * expression.cs (Argument.Emit): Handle the case of ref objects
21970         being passed to ref functions;  
21971
21972         (ParameterReference.EmitLoad): Loads the content of the pointer
21973         without dereferencing.
21974
21975 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21976
21977         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21978
21979 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21980
21981         * class.cs (Indexer.DefineMethod): Incorporate the interface
21982         type in the name of the method if we are doing explicit interface
21983         implementation.
21984
21985         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21986
21987         (BetterConversion): Fix extremely trivial bug where we were referring to
21988         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21989         again !
21990
21991         * ../errors/bug16.cs : Add although we have fixed it.
21992
21993 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21994
21995         * expression.cs (BaseIndexer): Begin implementation.
21996
21997         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21998
21999         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22000         production directly to remove a shift/reduce, and implement
22001         explicit interface implementation.
22002
22003         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22004         after a floating point suffix.
22005
22006         * expression.cs (DoNumericPromotions): Improved the conversion for
22007         uint/uint.  If we have a constant, we avoid doing a typecast to a
22008         larger type.
22009
22010         * class.cs (Indexer): Implement explicit interface implementation
22011         for indexers.
22012
22013 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22014
22015         * class.cs: make the default instance constructor public and hidebysig.
22016
22017 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22018
22019         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22020         so we can call it from elsewhere.
22021
22022         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22023         we emit it internally if the class has a defined indexer; otherwise the user
22024         emits it by decorating the class definition with the DefaultMemberAttribute.
22025
22026         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22027         attribute is not used on a type which defines an indexer.
22028
22029         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22030         character when we skip whitespace.
22031
22032         * ../errors/cs0646.cs : Add.
22033
22034 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22035
22036         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22037         again. 
22038
22039         * makefile: Add practical target `mcs3.exe' which builds the third
22040         generation compiler. 
22041
22042         * expression.cs (New): Fix structures constructor calling.
22043
22044         * class.cs (Property, Method, Indexer): Emit Final flag on the
22045         method if we are an interface implementation and we are not
22046         abstract. 
22047
22048         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22049         whether this property is referencing a `base' method.
22050
22051         * expression.cs (Invocation.EmitCall): take an extra argument:
22052         is_base, this is used to determine whether the `call' or
22053         `callvirt' opcode should be used.
22054
22055
22056         * delegate.cs: update EmitCall.
22057
22058         * class.cs (Method.Define): Set NewSlot for the cases where we are
22059         not implementing an interface method.
22060
22061         (Property.Define): ditto.
22062
22063 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22064
22065         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22066         'r'.  Allows mcs to parse itself fully.
22067
22068 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22069
22070         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22071         of the number of initializers that require the InitializeArray method.
22072
22073         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22074         update the above field where necessary.
22075
22076         (MakeByteBlob): Update accordingly.
22077
22078         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22079         greater than 2.
22080
22081         (EmitDynamicInitializers): Update in accordance with the new optimization.
22082
22083         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22084         same OpCode applies.
22085
22086         * cs-parser.jay : Fix some glaring errors I introduced.
22087
22088 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22089
22090         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22091         so that we can check for name clashes there too.
22092
22093         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22094         for interface indexers.
22095
22096         * interfaces.cs (Define): Emit the default member attribute.
22097
22098         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22099         variable was being referred to while setting the value ;-)
22100
22101 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22102
22103         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22104         byte-by-byte information when we know the data is zero.
22105
22106         Make the block always a multiple of 4, because
22107         DefineInitializedData has a bug.
22108
22109         * assign.cs: Fix, we should assign from the temporary, not from
22110         the source. 
22111
22112         * expression.cs (MakeByteBlob): Fix my incorrect code.
22113
22114 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22115
22116         * typemanager.cs (EnumToUnderlying): This function is used to get
22117         the underlying type from an enumeration, because it does not
22118         always work. 
22119
22120         * constant.cs: Use the I4_S form for values between -128 and 127.
22121
22122         * statement.cs (Block.LookupLabel): Looks up a label.
22123         (Block): Drop support for labeled blocks.
22124
22125         (LabeledStatement): New kind of statement that represents a label
22126         only.
22127
22128         (Goto): Finally implement this bad boy.
22129
22130         * cs-parser.jay: Update to reflect new mechanism to implement
22131         labels.
22132
22133 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22134
22135         * codegen.cs (EmitContext.This): a codegen property that keeps the
22136         a single instance of this instead of creating many different this
22137         instances. 
22138
22139         * delegate.cs (Delegate.DoResolve): Update to use the property;
22140
22141         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22142
22143         * expression.cs (BaseAccess.DoResolve): Ditto.
22144
22145 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22146
22147         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22148         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22149
22150         (InitCoreTypes): Update accordingly.
22151
22152         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22153         so we can quickly store the state.
22154
22155         (ApplyAttributes): Set the correct implementation flags
22156         for InternalCall methods.
22157
22158 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22159
22160         * expression.cs (EmitCall): if a method is not virtual, then do
22161         not use callvirt on it.
22162
22163         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22164         user defined stuff) requires the use of stobj, which takes an
22165         address on the stack instead of an array and an index.  So emit
22166         the Ldelema operation for it.
22167
22168         (EmitStoreOpcode): Use stobj for valuetypes.
22169
22170         (UnaryMutator.EmitCode): Use the right 1 value depending on
22171         whether we are dealing with int64/uint64, float or doubles.
22172
22173         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22174         constructors that I implemented last night.
22175
22176         (Constructor.IsDefault): Fix to work properly for static
22177         constructors.
22178
22179         * cs-parser.jay (CheckDef): report method signature errors.
22180         Update error number 103 to be 132.
22181
22182         * decl.cs: New AdditionResult enumeration value: MethodExists.
22183         Although we do this check for methods later on in the semantic
22184         analysis, catching repeated default constructors is so easy that
22185         we catch these here. 
22186
22187         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22188         promotions code.
22189
22190         (ParameterReference.EmitAssign, Emit): handle
22191         bools as bytes.
22192
22193         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22194         (ArrayAccess.EmitStoreOpcode): ditto.
22195
22196         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22197
22198         * expression.cs (MakeByteBlob): Complete all the missing types
22199         (uint, short, ushort, byte, sbyte)
22200
22201         * class.cs: Only init instance field initializers on instance
22202         constructors. 
22203
22204         Rename `constructors' to instance_constructors. 
22205
22206         (TypeContainer.AddConstructor): Only add constructors to the list
22207         if it is not static.
22208
22209         Make sure that we handle default_static_constructor independently
22210         everywhere where we handle instance_constructors
22211
22212 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22213
22214         * class.cs: Do not lookup or create a base initializer for a
22215         static constructor.
22216
22217         (ConstructorInitializer.Resolve): use the proper type to lookup
22218         for constructors.
22219
22220         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22221
22222         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22223         in DeclSpace. 
22224
22225         * decl.cs: CloseType is now an virtual method, the default
22226         implementation just closes this type.
22227
22228 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22229
22230         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22231         to PreserveSig by default. Also emit HideBySig on such methods.
22232
22233         Basically, set the defaults to standard values.
22234
22235         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22236         argument, if candidate is better, it can't be worse than the best !
22237
22238         (Invocation): Re-write bits to differentiate between methods being
22239         applicable in their expanded form and their normal form - for params
22240         methods of course.
22241
22242         Get rid of use_standard everywhere as only standard conversions are allowed
22243         in overload resolution. 
22244
22245         More spec conformance.
22246
22247 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22248
22249         * driver.cs: Add --timestamp, to see where the compiler spends
22250         most of its time.
22251
22252         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22253         `this' in static code.
22254
22255         (SimpleName.DoResolve): Implement in terms of a helper function
22256         that allows static-references to be passed upstream to
22257         MemberAccess.
22258
22259         (Expression.ResolveWithSimpleName): Resolve specially simple
22260         names when called by MemberAccess to implement the special
22261         semantics. 
22262
22263         (Expression.ImplicitReferenceConversion): Handle conversions from
22264         Null to reference types before others, as Null's type is
22265         System.Object. 
22266
22267         * expression.cs (Invocation.EmitCall): Handle the special case of
22268         calling methods declared on a reference type from a ValueType
22269         (Base classes System.Object and System.Enum)
22270
22271         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22272         the left hand side is a TypeExpr, not on every enumeration. 
22273
22274         (Binary.Resolve): If types are reference types, then do a cast to
22275         object on operators != and == of both arguments.
22276
22277         * typemanager.cs (FindMembers): Extract instance and static
22278         members if requested.
22279
22280         * interface.cs (PopulateProperty): Use void_type instead of null
22281         as the return type for the setter method.
22282
22283         (PopulateIndexer): ditto.
22284
22285 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22286
22287         * support.cs (ReflectionParameters): Fix minor bug where we
22288         were examining the wrong parameter for the ParamArray attribute.
22289
22290         Cope with requests for the type of the parameter at position
22291         greater than the params parameter's. We now return the element
22292         type of the params array as that makes more sense.
22293
22294         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22295         accordingly as we no longer have to extract the element type
22296         ourselves.
22297
22298         (Invocation.OverloadResolve): Update.
22299
22300 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22301
22302         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22303         against IEnumerator, test whether the return value is a descendant
22304         of the IEnumerator interface.
22305
22306         * class.cs (Indexer.Define): Use an auxiliary method to implement
22307         the other bits of the method definition.  Begin support for
22308         explicit interface implementation.
22309
22310         (Property.DefineMethod): Use TypeManager.void_type instead of null
22311         for an empty return value.
22312
22313 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22314
22315         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22316         dealing with a FieldExpr which is composed of a FieldBuilder, in
22317         the code path we did extract the constant, but we should have
22318         obtained the underlying value to be able to cast it (otherwise we
22319         end up in an infinite loop, this is what Ravi was running into).
22320
22321         (ArrayCreation.UpdateIndices): Arrays might be empty.
22322
22323         (MemberAccess.ResolveMemberAccess): Add support for section
22324         14.5.4.1 that deals with the special case of E.I when E is a type
22325         and something else, that I can be a reference to a static member.
22326
22327         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22328         handle a particular array type to create byte blobs, it is just
22329         something we dont generate byteblobs for.
22330
22331         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22332         arguments. 
22333
22334         * location.cs (Push): remove the key from the hashtable that we
22335         are about to add.   This happens for empty files.
22336
22337         * driver.cs: Dispose files after we have parsed them.
22338
22339         (tokenize): new function that only runs the tokenizer on its
22340         input, for speed testing.
22341
22342 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22343
22344         * class.cs (Event.Define): Define the private field only if there
22345         are no accessors defined.
22346
22347         * expression.cs (ResolveMemberAccess): If there is no associated
22348         field with the event, that means we have an event defined with its
22349         own accessors and we should flag error cs0070 since transforming
22350         ourselves into a field is not valid in that case.
22351
22352         * ecore.cs (SimpleName.DoResolve): Same as above.
22353
22354         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22355         and charset to sane values.
22356
22357 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22358
22359         * assign.cs (DoResolve): Perform check on events only if they 
22360         are being accessed outside the declaring type.
22361
22362         * cs-parser.jay (event_declarations): Update rules to correctly
22363         set the type of the implicit parameter etc.
22364
22365         (add_accessor, remove_accessor): Set current local parameters.
22366
22367         * expression.cs (Binary): For delegate addition and subtraction,
22368         cast the return value from the method into the appropriate delegate
22369         type.
22370
22371 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22372
22373         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22374         of these as the workaround is unnecessary.
22375
22376         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22377         delegate data - none of that is needed at all.
22378
22379         Re-write bits to extract the instance expression and the delegate method
22380         correctly.
22381
22382         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22383         on delegates too.
22384
22385         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22386         of attaching attributes instead of duplicating code everywhere.
22387
22388         * everywhere : Update code to do attribute emission using the above method.
22389
22390 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22391
22392         * expression.cs (IsParamsMethodApplicable): if there are not
22393         parameters, return immediately.
22394
22395         * ecore.cs: The 0 literal can be implicity converted to an enum
22396         type. 
22397
22398         (SimpleName.DoResolve): First lookup the type, then lookup the
22399         members. 
22400
22401         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22402         want to get its address.  If the InstanceExpression is not
22403         addressable, store the result in a temporary variable, then get
22404         the address of it.
22405
22406         * codegen.cs: Only display 219 errors on warning level or above. 
22407
22408         * expression.cs (ArrayAccess): Make it implement the
22409         IMemoryLocation interface.
22410
22411         (Binary.DoResolve): handle the operator == (object a, object b)
22412         and operator != (object a, object b) without incurring into a
22413         BoxedCast (because 5 != o should never be performed).
22414
22415         Handle binary enumerator operators.
22416
22417         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22418         value type, otherwise use Ldelem_ref.
22419
22420         Use precomputed names;
22421
22422         (AddressOf): Implement address of
22423
22424         * cs-parser.jay (labeled_statement): Fix recursive block
22425         addition by reworking the production.
22426
22427         * expression.cs (New.DoEmit): New has a special case:
22428                 
22429                  If we are dealing with a ValueType, we have a few
22430                  situations to deal with:
22431                 
22432                     * The target of New is a ValueType variable, that is
22433                       easy, we just pass this as the variable reference
22434                 
22435                     * The target of New is being passed as an argument,
22436                       to a boxing operation or a function that takes a
22437                       ValueType.
22438                 
22439                       In this case, we need to create a temporary variable
22440                       that is the argument of New.
22441
22442
22443 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22444
22445         * rootcontext.cs (LookupType): Check that current_type is not null before
22446         going about looking at nested types.
22447
22448         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22449         not implement the IAssignMethod interface any more.
22450
22451         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22452         where we tranform them into FieldExprs if they are being resolved from within
22453         the declaring type.
22454
22455         * ecore.cs (SimpleName.DoResolve): Do the same here.
22456
22457         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22458
22459         * ../errors/bug10.cs : Add.
22460
22461         * ../errors/cs0070.cs : Add.
22462
22463         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22464
22465         * assign.cs : Get rid of EventIsLocal everywhere.
22466
22467 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22468
22469         * ecore.cs (ConvertIntLiteral): finished the implementation.
22470
22471         * statement.cs (SwitchLabel): Convert the value we are using as a
22472         key before looking up the table.
22473
22474 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22475
22476         * codegen.cs (EmitTopBlock): Require a Location argument now.
22477
22478         * cs-parser.jay (constructor_declarator): We need to setup
22479         current_local_parameters before we parse the
22480         opt_constructor_initializer, to allow the variables to be bound
22481         to the constructor arguments.
22482
22483         * rootcontext.cs (LookupType): First lookup nested classes in our
22484         class and our parents before we go looking outside our class.
22485
22486         * expression.cs (ConstantFold): Extract/debox the values at the
22487         beginnning. 
22488
22489         * rootcontext.cs (EmitCode): Resolve the constants first before we
22490         resolve the types.  This is not really needed, but it helps debugging.
22491
22492         * statement.cs: report location.
22493
22494         * cs-parser.jay: pass location to throw statement.
22495
22496         * driver.cs: Small bug fix.
22497
22498         * report.cs: Updated format to be 4-zero filled digits.
22499
22500 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22501
22502         * expression.cs (CheckIndices): Fix minor bug where the wrong
22503         variable was being referred to ;-)
22504
22505         (DoEmit): Do not call EmitStaticInitializers when the 
22506         underlying type is System.Object.
22507
22508 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22509
22510         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22511         and do the usual workaround for SRE.
22512
22513         * class.cs (MyEventBuilder.EventType): New member to get at the type
22514         of the event, quickly.
22515
22516         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22517
22518         * assign.cs (Assign.DoResolve): Handle the case when the target
22519         is an EventExpr and perform the necessary checks.
22520
22521         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22522         interface.
22523
22524         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22525
22526         (EventExpr): Set the type in the constructor itself since we 
22527         are meant to be born fully resolved.
22528
22529         (EventExpr.Define): Revert code I wrote earlier.
22530                 
22531         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22532         instance expression is null. The instance expression is a This in that case
22533         or a null, depending on whether it is a static method or not.
22534
22535         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22536         refers to more than one method.
22537
22538         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22539         and accordingly flag errors.
22540
22541 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22542
22543         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22544
22545 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22546
22547         * location.cs (ToString): Provide useful rutine.
22548
22549 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22550
22551         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22552         objects, return the actual integral boxed.
22553
22554         * statement.cs (SwitchLabel): define an ILLabel for each
22555         SwitchLabel. 
22556
22557         (Switch.CheckSwitch): If the value is a Literal, extract
22558         the underlying literal.
22559
22560         Also in the unused hashtable we had, add the SwitchLabel so we can
22561         quickly look this value up.
22562
22563         * constant.cs: Implement a bunch of new constants.  Rewrite
22564         Literal based on this.  Made changes everywhere to adapt to this.
22565
22566         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22567         dereferencing array only once, and also copes with enumrations.
22568
22569         bytes are two bytes wide, not one.
22570
22571         (Cast): Perform constant conversions.
22572
22573         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22574         wrappers to the literals here.
22575
22576         * expression.cs (DoNumericPromotions): long literals can converted
22577         to ulong implicity (this is taken care of elsewhere, but I was
22578         missing this spot).
22579
22580         * ecore.cs (Expression.Literalize): Make the return type Literal,
22581         to improve type checking.
22582
22583         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22584
22585 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22586
22587         * literal.cs: Revert code from ravi that checked the bounds.  The
22588         bounds are sane by the definition of the type itself. 
22589
22590         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22591         need to actually look up in our parent hierarchy for interfaces
22592         implemented. 
22593
22594         * const.cs: Use the underlying type for enumerations
22595
22596         * delegate.cs: Compute the basename for the delegate creation,
22597         that should fix the delegate test case, and restore the correct
22598         Type Lookup semantics in rootcontext
22599
22600         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22601         referencing a nested type with the Reflection API is using the "+"
22602         sign. 
22603
22604         * cs-parser.jay: Do not require EOF token at the end.
22605
22606 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22607
22608         * rootcontext.cs (LookupType): Concatenate type names with
22609         a '.' instead of a '+' The test suite passes again.
22610
22611         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22612         field of the enumeration.
22613
22614         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22615         the case when the member is an EventExpr.
22616
22617         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22618         static has an associated instance expression.
22619
22620         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22621
22622         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22623
22624         * class.cs (Event.Define): Register event and perform appropriate checks
22625         for error #111.
22626
22627         We define the Add and Remove methods even if the use provides none because
22628         in that case, we provide default implementations ourselves.
22629
22630         Define a private field of the type of the event. This is done by the CSC compiler
22631         and we should be doing it too ;-)
22632
22633         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22634         More methods we use in code we generate.
22635
22636         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22637         is important.
22638
22639         (InitCoreTypes): Update accordingly for the above.
22640
22641         * class.cs (Event.Emit): Generate code for default accessors that we provide
22642
22643         (EmitDefaultMethod): Do the job in the above.
22644
22645         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22646         appropriate place.
22647
22648 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22649
22650         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22651         builders even if we were missing one.
22652
22653         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22654         pass the Basename as our class name instead of the Name.  The
22655         basename will be correctly composed for us.
22656
22657         * parameter.cs (Paramters): Now takes a Location argument.
22658
22659         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22660         make all the code call directly LookupType in RootContext and take
22661         this chance to pass the Location information everywhere.
22662
22663         * Everywhere: pass Location information.
22664
22665 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22666
22667         * class.cs (Constructor.Define): Updated way of detecting the
22668         length of the parameters.
22669
22670         (TypeContainer.DefineType): Use basename as the type name for
22671         nested types.
22672
22673         (TypeContainer.Define): Do not recursively define types here, as
22674         definition is taken care in order by the RootContext.
22675
22676         * tree.cs: Keep track of namespaces in a per-file basis.
22677
22678         * parameter.cs (Parameter.ComputeSignature): Update to use
22679         DeclSpace. 
22680
22681         (Parameters.GetSignature): ditto.
22682
22683         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22684         instead of a TypeContainer.
22685
22686         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22687         resolve names.  Because we need to be resolve in our context, not
22688         our parents.
22689
22690         * driver.cs: Implement response files.
22691
22692         * class.cs (TypeContainer.DefineType): If we are defined, do not
22693         redefine ourselves.
22694
22695         (Event.Emit): Emit the code for add/remove handlers.
22696         (Event.Define): Save the MethodBuilders for add/remove.
22697
22698         * typemanager.cs: Use pair here too.
22699
22700         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22701         DictionaryEntry requires the first argument to be non-null.  
22702
22703         (enum_declaration): Compute full name for registering the
22704         enumeration.
22705
22706         (delegate_declaration): Instead of using
22707         formal_parameter_list, use opt_formal_parameter_list as the list
22708         can be empty.
22709
22710         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22711         (EventParsing): New property that controls whether `add' and
22712         `remove' are returned as tokens or identifiers (for events);
22713
22714 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22715
22716         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22717         use MyEventBuilder only and let it wrap the real builder for us.
22718
22719         (MyEventBuilder): Revamp constructor etc.
22720
22721         Implement all operations that we perform on EventBuilder in precisely the same
22722         way here too.
22723
22724         (FindMembers): Update to use the EventBuilder member.
22725
22726         (Event.Emit): Update accordingly.
22727
22728 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22729
22730         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22731         by calling the appropriate methods.
22732
22733         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22734         useful.
22735
22736         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22737
22738 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22739
22740         * delegate.cs (Delegate.Populate): Check that the return type
22741         and various parameters types are indeed accessible.
22742
22743         * class.cs (Constructor.Define): Same here.
22744
22745         (Field.Define): Ditto.
22746
22747         (Event.Define): Ditto.
22748
22749         (Operator.Define): Check that the underlying Method defined itself
22750         correctly - so it's MethodBuilder should not be null.
22751
22752         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22753         expression happens to be null.
22754
22755         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22756         members but as of now we don't seem to be able to do anything really useful with it.
22757
22758         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22759         not the EventBuilder.
22760
22761 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22762
22763         * cs-tokenizer.cs: Add support for defines.
22764         Add support for #if, #elif, #else, #endif
22765
22766         (eval_var): evaluates a variable.
22767         (eval): stubbed for evaluating functions.
22768
22769         * cs-parser.jay: Pass the defines information
22770
22771         * driver.cs: Add --define command line option.
22772
22773         * decl.cs: Move MemberCore here.
22774
22775         Make it the base class for DeclSpace.  This allows us to catch and
22776         report 108 and 109 for everything now.
22777
22778         * class.cs (TypeContainer.Define): Extract all the members
22779         before populating and emit the warning 108 (new keyword required
22780         to override) instead of having each member implement this.
22781
22782         (MemberCore.Define): New abstract method, we will be using this in
22783         the warning reporting engine in Populate.
22784
22785         (Operator.Define): Adjust to new MemberCore protocol. 
22786
22787         * const.cs (Const): This does not derive from Expression, it is a
22788         temporary object we use to create fields, it is a MemberCore. 
22789
22790         * class.cs (Method.Define): Allow the entry point to be in a
22791         specific class.
22792
22793         * driver.cs: Rewrite the argument handler to clean it up a bit.
22794
22795         * rootcontext.cs: Made it just an auxiliary namespace feature by
22796         making everything static.
22797
22798         * driver.cs: Adapt code to use RootContext type name instead of
22799         instance variable.
22800
22801         * delegate.cs: Remove RootContext argument.
22802
22803         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22804         argument. 
22805
22806         * class.cs (Event.Define): The lookup can fail.
22807
22808         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22809
22810         * expression.cs: Resolve the this instance before invoking the code.
22811
22812 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22813
22814         * cs-parser.jay: Add a production in element_access that allows
22815         the thing to become a "type" reference.  This way we can parse
22816         things like "(string [])" as a type.
22817
22818         Note that this still does not handle the more complex rules of
22819         casts. 
22820
22821
22822         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22823
22824         * ecore.cs: (CopyNewMethods): new utility function used to
22825         assemble the list of methods from running FindMembers.
22826
22827         (MemberLookup): Rework FindMembers so that 
22828
22829 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22830
22831         * class.cs (TypeContainer): Remove Delegates who fail to be
22832         defined.
22833
22834         * delegate.cs (Populate): Verify that we dont get null return
22835         values.   TODO: Check for AsAccessible.
22836
22837         * cs-parser.jay: Use basename to emit error 574 (destructor should
22838         have the same name as container class), not the full name.
22839
22840         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22841         possible representation.  
22842
22843         Also implements integer type suffixes U and L.
22844
22845 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22846
22847         * expression.cs (ArrayCreation.DoResolve): We need to do the
22848         argument resolution *always*.
22849
22850         * decl.cs: Make this hold the namespace.  Hold the root context as
22851         well.
22852         (LookupType): Move here.
22853
22854         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22855
22856         * location.cs (Row, Name): Fixed the code, it was always returning
22857         references to the first file.
22858
22859         * interface.cs: Register properties defined through interfaces.
22860
22861         * driver.cs: Add support for globbing on the command line
22862
22863         * class.cs (Field): Make it derive from MemberCore as well.
22864         (Event): ditto.
22865
22866 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22867
22868         * class.cs (Event::Define): Check that the type of the event is a delegate
22869         type else flag error #66.
22870
22871         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22872         same.
22873
22874         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22875         values of EntryPoint, CharSet etc etc.
22876
22877         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22878
22879         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22880         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22881         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22882         which needs this to do its work.
22883
22884         * ../errors/cs0066.cs : Add.
22885
22886 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22887
22888         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22889         helper functions.
22890
22891         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22892         clears out the parameters field.
22893         (MemberSignatureCompare): Cleanup
22894
22895         (MemberCore): New base class used to share code between MethodCore
22896         and Property.
22897
22898         (RegisterRequiredImplementations) BindingFlags.Public requires
22899         either BindingFlags.Instace or Static.  Use instance here.
22900
22901         (Property): Refactored code to cope better with the full spec.
22902
22903         * parameter.cs (GetParameterInfo): Return an empty array instead
22904         of null on error.
22905
22906         * class.cs (Property): Abstract or extern properties have no bodies.
22907
22908         * parameter.cs (GetParameterInfo): return a zero-sized array.
22909
22910         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22911         method modifier validation to the typecontainer so we can reuse
22912         this on properties.
22913
22914         (MethodCore.ParameterTypes): return an empty sized array of types.
22915
22916         (Property.Define): Test property modifier validity.
22917
22918         Add tests for sealed/override too.
22919
22920         (Method.Emit): abstract or extern methods have no bodies.
22921
22922 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22923
22924         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22925         thing.
22926
22927         (Method::Define, ::Emit): Modify accordingly.
22928
22929         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22930
22931         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22932
22933         * makefile: Pass in /unsafe.
22934
22935 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22936
22937         * class.cs (MakeKey): Kill routine.
22938
22939         * class.cs (TypeContainer.Define): Correctly define explicit
22940         method implementations (they require the full interface name plus
22941         the method name).
22942
22943         * typemanager.cs: Deply the PtrHashtable here and stop using the
22944         lame keys.  Things work so much better.
22945
22946         This of course broke everyone who depended on `RegisterMethod' to
22947         do the `test for existance' test.  This has to be done elsewhere.
22948
22949         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22950         the object stupid Equals method (because, that like fails all over
22951         the place).  We still do not use it.
22952
22953         * class.cs (TypeContainer.SetRequiredInterface,
22954         TypeContainer.RequireMethods): Killed these two routines and moved
22955         all the functionality to RegisterRequiredImplementations.
22956
22957         (TypeContainer.RegisterRequiredImplementations): This routine now
22958         registers all the implementations required in an array for the
22959         interfaces and abstract methods.  We use an array of structures
22960         which can be computed ahead of time to reduce memory usage and we
22961         also assume that lookups are cheap as most classes will not
22962         implement too many interfaces.
22963
22964         We also avoid creating too many MethodSignatures.
22965
22966         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22967         clear the "pending" bit if we find that there are problems with
22968         the declaration.
22969
22970         (TypeContainer.VerifyPendingMethods): Update to report errors of
22971         methods that look like implementations but are not.
22972
22973         (TypeContainer.Define): Add support for explicit interface method
22974         implementation. 
22975
22976 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22977
22978         * typemanager.cs: Keep track of the parameters here instead of
22979         being a feature of the TypeContainer.
22980
22981         * class.cs: Drop the registration of parameters here, as
22982         InterfaceMethods are also interface declarations.
22983
22984         * delegate.cs: Register methods with the TypeManager not only with
22985         the TypeContainer.  This code was buggy.
22986
22987         * interface.cs: Full registation here.
22988
22989 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22990
22991         * expression.cs: Remove reducer for binary expressions, it can not
22992         be done this way.
22993
22994         * const.cs: Put here the code that used to go into constant.cs
22995
22996         * constant.cs: Put here the code for constants, this is a new base
22997         class for Literals.
22998
22999         * literal.cs: Make Literal derive from Constant.
23000
23001 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23002
23003         * statement.cs (Return.Emit): Report error 157 if the user
23004         attempts to return from a finally block.
23005
23006         (Return.Emit): Instead of emitting a return, jump to the end of
23007         the function.
23008
23009         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23010         LocalBuilder to store the result of the function.  ReturnLabel is
23011         the target where we jump.
23012
23013
23014 2001-12-09  Radek Doulik  <rodo@ximian.com>
23015
23016         * cs-parser.jay: remember alias in current namespace
23017
23018         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23019         namespaces
23020
23021         * class.cs (LookupAlias): lookup alias in my_namespace
23022
23023         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23024         aliases hashtable
23025         (LookupAlias): lookup alias in this and if needed in parent
23026         namespaces
23027
23028 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23029
23030         * support.cs: 
23031
23032         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23033         making things static.  I need this to avoid passing the
23034         TypeContainer when calling ParameterType.
23035
23036         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23037         that did string manipulation to compute the type and then call
23038         GetType.  Use Parameter.ParameterType instead.
23039
23040         * cs-tokenizer.cs: Consume the suffix for floating values.
23041
23042         * expression.cs (ParameterReference): figure out whether this is a
23043         reference parameter or not.  Kill an extra variable by computing
23044         the arg_idx during emission.
23045
23046         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23047         function that returns whether a parameter is an out/ref value or not.
23048
23049         (Parameter.ParameterType): The type of the parameter (base,
23050         without ref/out applied).
23051
23052         (Parameter.Resolve): Perform resolution here.
23053         (Parameter.ExternalType): The full type (with ref/out applied).
23054
23055         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23056         support for expressions on the using statement.
23057
23058 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23059
23060         * statement.cs (Using.EmitLocalVariableDecls): Split the
23061         localvariable handling of the using statement.
23062
23063         (Block.EmitMeta): Keep track of variable count across blocks.  We
23064         were reusing slots on separate branches of blocks.
23065
23066         (Try.Emit): Emit the general code block, we were not emitting it. 
23067
23068         Check the type of the declaration to be an IDisposable or
23069         something that can be implicity converted to it. 
23070
23071         Emit conversions if required.
23072
23073         * ecore.cs (EmptyExpression): New utility class.
23074         (Expression.ImplicitConversionExists): New utility function.
23075
23076 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23077
23078         * statement.cs (Using): Implement.
23079
23080         * expression.cs (LocalVariableReference): Support read only variables.
23081
23082         * statement.cs: Remove the explicit emit for the Leave opcode.
23083         (VariableInfo): Add a readonly field.
23084
23085 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23086
23087         * ecore.cs (ConvCast): new class used to encapsulate the various
23088         explicit integer conversions that works in both checked and
23089         unchecked contexts.
23090
23091         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23092         properly generate the overflow opcodes.
23093
23094 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23095
23096         * statement.cs: The correct type for the EmptyExpression is the
23097         element_type, not the variable type.  Ravi pointed this out.
23098
23099 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23100
23101         * class.cs (Method::Define): Handle PInvoke methods specially
23102         by using DefinePInvokeMethod instead of the usual one.
23103
23104         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23105         above to do the task of extracting information and defining the method.
23106
23107 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23108
23109         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23110         of the condition for string type.
23111
23112         (Emit): Move that here. 
23113
23114         (ArrayCreation::CheckIndices): Keep string literals in their expression
23115         form.
23116
23117         (EmitDynamicInitializers): Handle strings appropriately.
23118
23119 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23120
23121         * codegen.cs (EmitContext): Replace multiple variables with a
23122         single pointer to the current Switch statement.
23123
23124         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23125         EmitContext.
23126
23127 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23128
23129         * statement.cs 
23130
23131         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23132         default'.
23133
23134         (Foreach.Emit): Foreach on arrays was not setting
23135         up the loop variables (for break/continue).
23136
23137         (GotoCase): Semi-implented.
23138
23139 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23140
23141         * attribute.cs (CheckAttribute): Handle system attributes by using
23142         Attribute.GetAttributes to examine information we need.
23143
23144         (GetValidPlaces): Same here.
23145
23146         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23147
23148         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23149
23150         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23151
23152         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23153
23154         (Method::Emit): Handle the case when we are a PInvoke method.
23155
23156 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23157
23158         * expression.cs: Use ResolveWithSimpleName on compound names.
23159
23160 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23161
23162         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23163         before trying to reduce it.
23164
23165         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23166
23167         * constant.cs (LookupConstantValue): Implement.
23168
23169         (EmitConstant): Use the above in emitting the constant.
23170
23171         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23172         that are user-defined by doing a LookupConstantValue on them.
23173
23174         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23175         too, like above.
23176
23177 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23178
23179         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23180
23181         (BaseAccess.DoResolve): Implement.
23182
23183         (MemberAccess.DoResolve): Split this routine into a
23184         ResolveMemberAccess routine that can be used independently
23185
23186 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23187
23188         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23189         As that share bits of the implementation.  Is returns a boolean,
23190         while As returns the Type that is being probed.
23191
23192 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23193
23194         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23195         instead of a Literal - much easier.
23196
23197         (EnumInTransit): Remove - utterly useless :-)
23198
23199         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23200
23201         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23202
23203         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23204         chain when we have no associated expression.
23205
23206 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23207
23208         * constant.cs (Define): Use Location while reporting the errror.
23209
23210         Also emit a warning when 'new' is used and there is no inherited
23211         member to hide.
23212
23213         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23214         populated.
23215
23216         (LookupEnumValue): Implement to lookup an enum member's value and define it
23217         if necessary.
23218
23219         (Populate): Re-write accordingly to use the above routine.
23220
23221 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23222
23223         * expression.cs (This): Fix prototype for DoResolveLValue to
23224         override the base class DoResolveLValue.
23225
23226         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23227         declarations) 
23228
23229         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23230         (we need to load the address of the field here).  This fixes
23231         test-22. 
23232
23233         (FieldExpr.DoResolveLValue): Call the DoResolve
23234         function to initialize the Instance expression.
23235
23236         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23237         correctly the GetEnumerator operation on a value type.
23238
23239         * cs-parser.jay: Add more simple parsing error catches.
23240
23241         * statement.cs (Switch): Add support for string switches.
23242         Handle null specially.
23243
23244         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23245
23246 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23247
23248         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23249
23250         (declare_local_constant): New helper function.
23251
23252         * statement.cs (AddConstant): Keep a separate record of constants
23253
23254         (IsConstant): Implement to determine if a variable is a constant.
23255
23256         (GetConstantExpression): Implement.
23257
23258         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23259
23260         * statement.cs (IsVariableDefined): Re-write.
23261
23262 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23263
23264         * class.cs (TypeContainer::FindMembers): Look for constants
23265         in the case when we are looking for MemberTypes.Field
23266
23267         * expression.cs (MemberAccess::DoResolve): Check that in the
23268         case we are a FieldExpr and a Literal, we are not being accessed
23269         by an instance reference.
23270
23271         * cs-parser.jay (local_constant_declaration): Implement.
23272
23273         (declaration_statement): Implement for constant declarations.
23274
23275 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23276
23277         * statement.cs (Switch): Catch double defaults.
23278
23279         (Switch): More work on the switch() statement
23280         implementation.  It works for integral values now, need to finish
23281         string support.
23282
23283
23284 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23285
23286         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23287         integer literals into other integer literals.  To be used by
23288         switch. 
23289
23290 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23291
23292         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23293         some memory.
23294
23295         (EmitDynamicInitializers): Cope with the above since we extract data
23296         directly from ArrayData now.
23297
23298         (ExpectInitializers): Keep track of whether initializers are mandatory
23299         or not.
23300
23301         (Bounds): Make it a hashtable to prevent the same dimension being 
23302         recorded for every element in that dimension.
23303
23304         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23305         from being found.
23306
23307         Also fix bug which was causing the indices to be emitted in the reverse
23308         order.
23309
23310 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23311
23312         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23313         unfinished.  They do not work, because the underlying code is
23314         sloppy.
23315
23316 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23317
23318         * cs-parser.jay: Remove bogus fixme.
23319
23320         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23321         on Switch statement.
23322
23323 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23324
23325         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23326         the same. 
23327
23328         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23329         parameter. Apparently, any expression is allowed. 
23330
23331         (ValidateInitializers): Update accordingly.
23332
23333         (CheckIndices): Fix some tricky bugs thanks to recursion.
23334
23335         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23336         I was being completely brain-dead.
23337
23338         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23339         and re-write acordingly.
23340
23341         (DelegateInvocation): Re-write accordingly.
23342
23343         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23344
23345         (MakeByteBlob): Handle types more correctly.
23346
23347         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23348         initialization from expressions but it is incomplete because I am a complete
23349         Dodo :-|
23350
23351 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23352
23353         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23354         on If.  Basically, we have to return `true' (ie, we do return to
23355         our caller) only if both branches of the if return.
23356
23357         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23358         short-circuit operators, handle them as short circuit operators. 
23359
23360         (Cast.DoResolve): Resolve type.
23361         (Cast.Cast): Take an expression as the target type.
23362
23363         * cs-parser.jay (cast_expression): Remove old hack that only
23364         allowed a limited set of types to be handled.  Now we take a
23365         unary_expression and we resolve to a type during semantic
23366         analysis.
23367
23368         Use the grammar productions from Rhys to handle casts (this is
23369         not complete like Rhys syntax yet, we fail to handle that corner
23370         case that C# has regarding (-x), but we will get there.
23371
23372 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23373
23374         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23375         field which is an array type.
23376
23377         * cs-parser.jay (declare_local_variables): Support array initialization too.
23378
23379         * typemanager.cs (MakeKey): Implement.
23380
23381         (everywhere): Use the above appropriately.
23382
23383         * cs-parser.jay (for_statement): Update for array initialization while
23384         declaring variables.
23385
23386         * ecore.cs : The error message was correct, it's the variable's names that
23387         were misleading ;-) Make the code more readable.
23388
23389         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23390         the correct type etc.
23391
23392         (ConvertExplicit): Handle Enum types by examining the underlying type.
23393
23394 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23395
23396         * parameter.cs (GetCallingConvention): Always return
23397         CallingConventions.Standard for now.
23398
23399 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23400
23401         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23402         and `r' after calling DoNumericPromotions.
23403
23404         * ecore.cs: Fix error message (the types were in the wrong order).
23405
23406         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23407         BindingFlags.Instance as well 
23408
23409         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23410         implicit int literal conversion in an empty cast so that we
23411         propagate the right type upstream.
23412
23413         (UnboxCast): new class used to unbox value types.
23414         (Expression.ConvertExplicit): Add explicit type conversions done
23415         by unboxing.
23416
23417         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23418         the target type before applying the implicit LongLiterals to ULong
23419         literal cast.
23420
23421 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23422
23423         * cs-parser.jay (for_statement): Reworked the way For works: now
23424         we declare manually any variables that are introduced in
23425         for_initializer to solve the problem of having out-of-band code
23426         emition (that is what got for broken).
23427
23428         (declaration_statement): Perform the actual variable declaration
23429         that used to be done in local_variable_declaration here.
23430
23431         (local_variable_declaration): Do not declare anything, just pass
23432         the information on a DictionaryEntry
23433
23434 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23435
23436         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23437         re-write of the logic to now make it recursive.
23438
23439         (UpdateIndices): Re-write accordingly.
23440
23441         Store element data in a separate ArrayData list in the above methods.
23442
23443         (MakeByteBlob): Implement to dump the array data into a byte array.
23444
23445 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23446
23447         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23448         into CheckIndices.
23449
23450         * constant.cs (Define): Implement.
23451
23452         (EmitConstant): Re-write fully.
23453
23454         Pass in location info.
23455
23456         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23457         respectively.
23458
23459         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23460         DictionaryEntry since we need location info too.
23461
23462         (constant_declaration): Update accordingly.
23463
23464         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23465         code into another method : UpdateIndices.
23466
23467 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23468
23469         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23470         some type checking etc.
23471
23472 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23473
23474         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23475         bits to provide dimension info if the user skips doing that.
23476
23477         Update second constructor to store the rank correctly.
23478
23479 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23480
23481         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23482         and try to implement.
23483
23484         * ../errors/cs0150.cs : Add.
23485
23486         * ../errors/cs0178.cs : Add.
23487
23488 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23489
23490         * statement.cs: Implement foreach on multi-dimensional arrays. 
23491
23492         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23493         name of the params argument.
23494
23495         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23496         initializing the array.
23497
23498         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23499         we can use this elsewhere.
23500
23501         * statement.cs: Finish implementation of foreach for single
23502         dimension arrays.
23503
23504         * cs-parser.jay: Use an out-of-band stack to pass information
23505         around, I wonder why I need this.
23506
23507         foreach_block: Make the new foreach_block the current_block.
23508
23509         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23510         function used to return a static Parameters structure.  Used for
23511         empty parameters, as those are created very frequently.
23512
23513         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23514
23515 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23516
23517         * interface.cs : Default modifier is private, not public. The
23518         make verify test passes again.
23519
23520 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23521
23522         * support.cs (ReflectionParameters): Fix logic to determine
23523         whether the last parameter is a params one. Test 9 passes again.
23524
23525         * delegate.cs (Populate): Register the builders we define with
23526         RegisterParameterForBuilder. Test 19 passes again.
23527
23528         * cs-parser.jay (property_declaration): Reference $6 instead
23529         of $$ to get at the location.
23530
23531         (indexer_declaration): Similar stuff.
23532
23533         (attribute): Ditto.
23534
23535         * class.cs (Property): Register parameters for the Get and Set methods
23536         if they exist. Test 23 passes again.
23537
23538         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23539         call to EmitArguments as we are sure there aren't any params arguments. 
23540         Test 32 passes again.
23541
23542         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23543         IndexOutOfRangeException. 
23544
23545         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23546         Test 33 now passes again.
23547
23548 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23549
23550         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23551         broke a bunch of things.  Will have to come up with a better way
23552         of tracking locations.
23553
23554         * statement.cs: Implemented foreach for single dimension arrays.
23555
23556 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23557
23558         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23559         an error.  This removes the lookup from the critical path.
23560
23561         * cs-parser.jay: Removed use of temporary_loc, which is completely
23562         broken. 
23563
23564 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23565
23566         * support.cs (ReflectionParameters.ParameterModifier): Report
23567         whether the argument is a PARAMS argument or not.
23568
23569         * class.cs: Set the attribute `ParamArrayAttribute' on the
23570         parameter argument.
23571
23572         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23573         and cons_param_array_attribute (ConstructorInfo for
23574         ParamArrayAttribute)., 
23575
23576         * codegen.cs: Emit the return using the `Return' statement, that
23577         way we can report the error correctly for missing return values. 
23578
23579         * class.cs (Method.Emit): Clean up.
23580
23581         * expression.cs (Argument.Resolve): Take another argument: the
23582         location where this argument is used.  Notice that this is not
23583         part of the "Argument" class as to reduce the size of the
23584         structure (we know the approximate location anyways).
23585
23586         Test if the argument is a variable-reference, if not, then
23587         complain with a 206.
23588
23589         (Argument.Emit): Emit addresses of variables.
23590
23591         (Argument.FullDesc): Simplify.
23592
23593         (Invocation.DoResolve): Update for Argument.Resolve.
23594
23595         (ElementAccess.DoResolve): ditto.
23596
23597         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23598         method should be virtual, as this method is always virtual.
23599
23600         (NewDelegate.DoResolve): Update for Argument.Resolve.
23601
23602         * class.cs (ConstructorInitializer.DoResolve): ditto.
23603
23604         * attribute.cs (Attribute.Resolve): ditto.
23605
23606 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23607
23608         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23609
23610         * expression.cs (ParameterReference): Drop IStackStorage and implement
23611         IAssignMethod instead. 
23612
23613         (LocalVariableReference): ditto.
23614
23615         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23616         IAssignMethod instead. 
23617
23618 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23619
23620         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23621         enumerations that are used in heavily used structures derive from
23622         byte in a laughable and pathetic attempt to reduce memory usage.
23623         This is the kind of pre-optimzations that you should not do at
23624         home without adult supervision.
23625
23626         * expression.cs (UnaryMutator): New class, used to handle ++ and
23627         -- separatedly from the other unary operators.  Cleans up the
23628         code, and kills the ExpressionStatement dependency in Unary.
23629
23630         (Unary): Removed `method' and `Arguments' from this class, making
23631         it smaller, and moving it all to SimpleCall, so I can reuse this
23632         code in other locations and avoid creating a lot of transient data
23633         strucutres when not required.
23634
23635         * cs-parser.jay: Adjust for new changes.
23636
23637 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23638
23639         * enum.cs (Enum.Populate): If there is a failure during
23640         definition, return
23641
23642         * cs-parser.jay (opt_enum_base): we used to catch type errors
23643         here, but this is really incorrect.  The type error should be
23644         catched during semantic analysis.
23645
23646 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23647
23648         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23649         current_local_parameters as expected since I, in my stupidity, had forgotten
23650         to do this :-)
23651
23652         * attribute.cs (GetValidPlaces): Fix stupid bug.
23653
23654         * class.cs (Method::Emit): Perform check on applicability of attributes.
23655
23656         (Constructor::Emit): Ditto.
23657
23658         (Field::Emit): Ditto.
23659
23660         (Field.Location): Store location information.
23661
23662         (Property, Event, Indexer, Operator): Ditto.
23663
23664         * cs-parser.jay (field_declaration): Pass in location for each field.
23665
23666         * ../errors/cs0592.cs : Add.
23667
23668 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23669
23670         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23671
23672         (InitCoreTypes): Update accordingly.
23673
23674         (RegisterAttrType, LookupAttr): Implement.
23675
23676         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23677         info about the same.
23678
23679         (Resolve): Update to populate the above as necessary.
23680
23681         (Error592): Helper.
23682
23683         (GetValidPlaces): Helper to the above.
23684
23685         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23686
23687         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23688
23689 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23690
23691         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23692
23693         * ../errors/cs0617.cs : Add.
23694
23695 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23696
23697         * enum.cs (Emit): Rename to Populate to be more consistent with what
23698         we expect it to do and when exactly it is called.
23699
23700         * class.cs, rootcontext.cs : Update accordingly.
23701
23702         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23703         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23704
23705         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23706
23707         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23708         of a fieldinfo using the above, when dealing with a FieldBuilder.
23709
23710 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23711
23712         * ../errors/cs0031.cs : Add.
23713
23714         * ../errors/cs1008.cs : Add.
23715
23716         * ../errrors/cs0543.cs : Add.
23717
23718         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23719         enum type.
23720
23721         (FindMembers): Implement.
23722
23723         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23724         enums and delegates too.
23725
23726         (enum_types): Rename to builder_to_enum.
23727
23728         (delegate_types): Rename to builder_to_delegate.
23729
23730         * delegate.cs (FindMembers): Implement.
23731
23732 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23733
23734         * typemanager.cs (IsEnumType): Implement.
23735
23736         * enum.cs (Emit): Re-write parts to account for the underlying type
23737         better and perform checking etc.
23738
23739         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23740         of the underlying type.
23741
23742         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23743         value
23744
23745         * enum.cs (error31): Helper to report error #31.
23746
23747         * cs-parser.jay (enum_declaration): Store location of each member too.
23748
23749         * enum.cs (member_to_location): New hashtable. 
23750
23751         (AddEnumMember): Update location hashtable.
23752
23753         (Emit): Use the location of each member while reporting errors.
23754
23755 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23756
23757         * cs-parser.jay: A for_initializer if is a
23758         local_variable_declaration really ammount to have an implicit
23759         block with the variable declaration and no initializer for for.
23760
23761         * statement.cs (For.Emit): Cope with null initializers.
23762
23763         This fixes the infinite loop on for initializers.
23764
23765 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23766
23767         * enum.cs: More cleanup.
23768
23769         * ecore.cs: Remove dead code.
23770
23771         * class.cs (Property.Emit): More simplification.
23772         (Event.Emit): ditto.
23773
23774         Reworked to have less levels of indentation.
23775
23776 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23777
23778         * class.cs (Property): Emit attributes.
23779
23780         (Field): Ditto.
23781
23782         (Event): Ditto.
23783
23784         (Indexer): Ditto.
23785
23786         (Operator): Ditto.
23787
23788         * enum.cs (Emit): Ditto.
23789
23790         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23791         Enums too.
23792
23793         * class.cs (Field, Event, etc.): Move attribute generation into the
23794         Emit method everywhere.
23795
23796         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23797         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23798         as we had no way of defining nested enums !
23799
23800         * rootcontext.cs : Adjust code accordingly.
23801
23802         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23803
23804 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23805
23806         * expression.cs (EvalConstantExpression): Move into ecore.cs
23807
23808         * enum.cs (Enum): Rename some members and make them public and readonly
23809         according to our convention.
23810
23811         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23812         nothing else.
23813
23814         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23815
23816         (Enum::Emit): Write a simple version for now which doesn't try to compute
23817         expressions. I shall modify this to be more robust in just a while.
23818
23819         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23820
23821         (TypeContainer::CloseType): Create the Enum types too.
23822
23823         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23824
23825         * expression.cs (EvalConstantExpression): Get rid of completely.
23826
23827         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23828         user-defined values and other cases.
23829
23830         (IsValidEnumLiteral): Helper function.
23831
23832         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23833         out there in the case we had a literal FieldExpr.
23834
23835         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23836
23837         (Literalize): Revamp a bit to take two arguments.
23838
23839         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23840
23841 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23842
23843         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23844
23845         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23846
23847         (Resolve): Use the above to ensure we have proper initializers.
23848
23849 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23850
23851         * expression.cs (Expression::EvalConstantExpression): New method to 
23852         evaluate constant expressions.
23853
23854         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23855
23856 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23857
23858         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23859         in an array.
23860
23861         (Binary.ResolveOperator): Handle operator != (object a, object b)
23862         and operator == (object a, object b);
23863
23864         (Binary.DoNumericPromotions): Indicate whether the numeric
23865         promotion was possible.
23866
23867         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23868         Implement.  
23869
23870         Made the ArrayAccess implement interface IAssignMethod instead of
23871         IStackStore as the order in which arguments are passed reflects
23872         this.
23873
23874         * assign.cs: Instead of using expr.ExprClass to select the way of
23875         assinging, probe for the IStackStore/IAssignMethod interfaces.
23876
23877         * typemanager.cs: Load InitializeArray definition.
23878
23879         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23880         static data that can be used to initialize arrays. 
23881
23882 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23883
23884         * expression.cs: Handle operator== and operator!= for booleans.
23885
23886         (Conditioal.Reduce): Implement reducer for the ?: operator.
23887
23888         (Conditional.Resolve): Implement dead code elimination.
23889
23890         (Binary.Resolve): Catch string literals and return a new
23891         concatenated string.
23892
23893         (Unary.Reduce): Implement reduction of unary expressions.
23894
23895         * ecore.cs: Split out the expression core handling here.
23896
23897         (Expression.Reduce): New method used to perform constant folding
23898         and CSE.  This is needed to support constant-expressions. 
23899
23900         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23901         targets, and optimize for !x.
23902
23903 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23904
23905         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23906         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23907         set custom atttributes.
23908
23909         * literal.cs (Literal::GetValue): New abstract method to return the actual
23910         value of the literal, cast as an object.
23911
23912         (*Literal): Implement GetValue method.
23913
23914         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23915         expressions to the arraylist but objects of type Argument.
23916
23917         * class.cs (TypeContainer::Emit): Emit our attributes too.
23918
23919         (Method::Emit, Constructor::Emit): Ditto.
23920
23921         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23922         to be ignoring earlier.
23923
23924 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23925
23926         * attribute.cs (AttributeSection::Define): Implement to do the business
23927         of constructing a CustomAttributeBuilder.
23928
23929         (Attribute): New trivial class. Increases readability of code.  
23930
23931         * cs-parser.jay : Update accordingly.
23932
23933         (positional_argument_list, named_argument_list, named_argument): New rules
23934
23935         (attribute_arguments): Use the above so that we are more correct.
23936
23937 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23938
23939         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23940         to perform all checks for a method with a params parameter.
23941
23942         (Invocation::OverloadResolve): Update to use the above method and therefore
23943         cope correctly with params method invocations.
23944
23945         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23946         params too.
23947
23948         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23949         constructors in our parent too because we can't afford to miss out on 
23950         protected ones ;-)
23951
23952         * attribute.cs (AttributeSection): New name for the class Attribute
23953
23954         Other trivial changes to improve readability.
23955
23956         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23957         use the new class names.
23958
23959 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23960
23961         * class.cs (Method::Define): Complete definition for params types too
23962
23963         (Indexer::Define): Ditto.
23964
23965         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23966         Cope everywhere with a request for info about the array parameter.
23967
23968 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23969
23970         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23971
23972         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23973         local_variable_type to extract the string corresponding to the type.
23974
23975         (local_variable_type): Fixup the action to use the new helper method.
23976
23977         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23978         go.
23979
23980         * expression.cs : Clean out code which uses the above.
23981
23982 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23983
23984         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23985         and bale out if necessary by returning a false.
23986
23987         (RegisterProperty): Ditto.
23988
23989         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23990         and print out appropriate error messages.
23991
23992         * interface.cs (everywhere): Ditto.
23993
23994         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23995         location to constructor.
23996
23997         * class.cs (Property, Event, Indexer): Update accordingly.
23998
23999         * ../errors/cs111.cs : Added.
24000
24001         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24002         of a method, as laid down by the spec.
24003
24004         (Invocation::OverloadResolve): Use the above method.
24005
24006 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24007
24008         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24009         now take a TypeContainer and a Parameters object.
24010
24011         (ParameterData): Modify return type of ParameterModifier method to be 
24012         Parameter.Modifier and not a string.
24013
24014         (ReflectionParameters, InternalParameters): Update accordingly.
24015
24016         * expression.cs (Argument::GetParameterModifier): Same here.
24017
24018         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24019         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24020         symbol in it at all so maybe this is only for now.
24021
24022 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24023
24024         * support.cs (InternalParameters): Constructor now takes an extra argument 
24025         which is the actual Parameters class.
24026
24027         (ParameterDesc): Update to provide info on ref/out modifiers.
24028
24029         * class.cs (everywhere): Update call to InternalParameters to pass in
24030         the second argument too.
24031
24032         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24033         to return the modifier info [ref/out etc]
24034
24035         (InternalParameters, ReflectionParameters): Implement the above.
24036
24037         * expression.cs (Argument::ParameterModifier): Similar function to return
24038         info about the argument's modifiers.
24039
24040         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24041         too.
24042
24043         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24044         a new SetFormalParameters object which we pass to InternalParameters.
24045
24046 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24047
24048         * expression.cs (NewArray): Merge into the ArrayCreation class.
24049
24050 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24051
24052         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24053         NewUserdefinedArray into one as there wasn't much of a use in having
24054         two separate ones.
24055
24056         * expression.cs (Argument): Change field's name to ArgType from Type.
24057
24058         (Type): New readonly property which returns the proper type, taking into 
24059         account ref/out modifiers.
24060
24061         (everywhere): Adjust code accordingly for the above.
24062
24063         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24064         whether we are emitting for a ref or out parameter.
24065
24066         * expression.cs (Argument::Emit): Use the above field to set the state.
24067
24068         (LocalVariableReference::Emit): Update to honour the flag and emit the
24069         right stuff.
24070
24071         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24072
24073         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24074
24075         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24076
24077         (ReflectionParameters, InternalParameters): Implement the above method.
24078
24079         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24080         reporting errors.
24081
24082         (Invocation::FullMethodDesc): Ditto. 
24083
24084 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24085
24086         * cs-parser.jay: Add extra production for the second form of array
24087         creation. 
24088
24089         * expression.cs (ArrayCreation): Update to reflect the above
24090         change. 
24091
24092         * Small changes to prepare for Array initialization.
24093
24094 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24095
24096         * typemanager.cs (ImplementsInterface): interface might be null;
24097         Deal with this problem;
24098
24099         Also, we do store negative hits on the cache (null values), so use
24100         this instead of calling t.GetInterfaces on the type everytime.
24101
24102 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24103
24104         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24105
24106         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24107         split functionality out into different classes.
24108
24109         (New::FormArrayType): Move into NewBuiltinArray.
24110
24111         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24112         quite useless.
24113
24114         (NewBuiltinArray): New class to handle creation of built-in arrays.
24115
24116         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24117         account creation of one-dimensional arrays.
24118
24119         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24120
24121         (NewUserdefinedArray::DoResolve): Implement.
24122
24123         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24124
24125         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24126         we maintain inside the TypeManager. This is necessary to perform lookups on the
24127         module builder.
24128
24129         (LookupType): Update to perform GetType on the module builders too.     
24130
24131         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24132
24133         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24134
24135 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24136
24137         * expression.cs (New::DoResolve): Implement guts of array creation.
24138
24139         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24140
24141 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24142
24143         * expression.cs: Fix bug I introduced lsat night that broke
24144         Delegates. 
24145
24146         (Expression.Resolve): Report a 246 error (can not resolve name)
24147         if we find a SimpleName in the stream.
24148
24149         (Expression.ResolveLValue): Ditto.
24150
24151         (Expression.ResolveWithSimpleName): This function is a variant of
24152         ResolveName, this one allows SimpleNames to be returned without a
24153         warning.  The only consumer of SimpleNames is MemberAccess
24154
24155 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24156
24157         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24158         might arrive here.  I have my doubts that this is correct.
24159
24160         * statement.cs (Lock): Implement lock statement.
24161
24162         * cs-parser.jay: Small fixes to support `lock' and `using'
24163
24164         * cs-tokenizer.cs: Remove extra space
24165
24166         * driver.cs: New flag --checked, allows to turn on integer math
24167         checking. 
24168
24169         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24170         Threading.Monitor.Exit 
24171
24172 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24173
24174         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24175         Expression Class to be IndexerAccess.
24176
24177         Notice that Indexer::DoResolve sets the eclass to Value.
24178
24179 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24180
24181         * class.cs (TypeContainer::Emit): Emit code for indexers.
24182
24183         * assign.cs (IAssignMethod): New interface implemented by Indexers
24184         and Properties for handling assignment.
24185
24186         (Assign::Emit): Simplify and reuse code. 
24187
24188         * expression.cs (IndexerAccess, PropertyExpr): Implement
24189         IAssignMethod, clean up old code. 
24190
24191 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24192
24193         * typemanager.cs (ImplementsInterface): New method to determine if a type
24194         implements a given interface. Provides a nice cache too.
24195
24196         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24197         method.
24198
24199         (ConvertReferenceExplicit): Ditto.
24200
24201         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24202         various methods, with correct names etc.
24203
24204         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24205         Operator.UnaryNegation.
24206
24207         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24208         we have a unary plus or minus operator.
24209
24210         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24211         UnaryMinus.
24212
24213         * everywhere : update accordingly.
24214
24215         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24216         respectively.
24217
24218         * class.cs (Method::Define): For the case where we are implementing a method
24219         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24220         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24221
24222 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24223
24224         * interface.cs (FindMembers): Implement to work around S.R.E
24225         lameness.
24226
24227         * typemanager.cs (IsInterfaceType): Implement.
24228
24229         (FindMembers): Update to handle interface types too.
24230
24231         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24232         use IsAssignableFrom as that is not correct - it doesn't work.
24233
24234         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24235         and accordingly override EmitStatement.
24236
24237         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24238         using the correct logic :-)
24239
24240 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24241
24242         * ../errors/cs-11.cs : Add to demonstrate error -11 
24243
24244 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24245
24246         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24247         then pass this as a hint to ResolveLValue.
24248
24249         * expression.cs (FieldExpr): Add Location information
24250
24251         (FieldExpr::LValueResolve): Report assignment to readonly
24252         variable. 
24253
24254         (Expression::ExprClassFromMemberInfo): Pass location information.
24255
24256         (Expression::ResolveLValue): Add new method that resolves an
24257         LValue. 
24258
24259         (Expression::DoResolveLValue): Default invocation calls
24260         DoResolve. 
24261
24262         (Indexers): New class used to keep track of indexers in a given
24263         Type. 
24264
24265         (IStackStore): Renamed from LValue, as it did not really describe
24266         what this did.  Also ResolveLValue is gone from this interface and
24267         now is part of Expression.
24268
24269         (ElementAccess): Depending on the element access type
24270
24271         * typemanager.cs: Add `indexer_name_type' as a Core type
24272         (System.Runtime.CompilerServices.IndexerNameAttribute)
24273
24274         * statement.cs (Goto): Take a location.
24275
24276 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24277
24278         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24279         if two delegates are compatible.
24280
24281         (NewDelegate::DoResolve): Update to take care of the case when
24282         we instantiate a delegate from another delegate.
24283
24284         * typemanager.cs (FindMembers): Don't even try to look up members
24285         of Delegate types for now.
24286
24287 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24288
24289         * delegate.cs (NewDelegate): New class to take care of delegate
24290         instantiation.
24291
24292         * expression.cs (New): Split the delegate related code out into 
24293         the NewDelegate class.
24294
24295         * delegate.cs (DelegateInvocation): New class to handle delegate 
24296         invocation.
24297
24298         * expression.cs (Invocation): Split out delegate related code into
24299         the DelegateInvocation class.
24300
24301 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24302
24303         * expression.cs (New::DoResolve): Implement delegate creation fully
24304         and according to the spec.
24305
24306         (New::DoEmit): Update to handle delegates differently.
24307
24308         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24309         because of which we were printing out arguments in reverse order !
24310
24311         * delegate.cs (VerifyMethod): Implement to check if the given method
24312         matches the delegate.
24313
24314         (FullDelegateDesc): Implement.
24315
24316         (VerifyApplicability): Implement.
24317
24318         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24319         delegate invocations too.
24320
24321         (Invocation::Emit): Ditto.
24322
24323         * ../errors/cs1593.cs : Added.
24324
24325         * ../errors/cs1594.cs : Added.
24326
24327         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24328
24329 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24330
24331         * typemanager.cs (intptr_type): Core type for System.IntPtr
24332
24333         (InitCoreTypes): Update for the same.
24334
24335         (iasyncresult_type, asynccallback_type): Ditto.
24336
24337         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24338         correct.
24339
24340         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24341         too.
24342
24343         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24344         the builders for the 4 members of a delegate type :-)
24345
24346         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24347         type.
24348
24349         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24350
24351         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24352
24353 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24354
24355         * statement.cs (Break::Emit): Implement.   
24356         (Continue::Emit): Implement.
24357
24358         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24359         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24360         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24361         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24362         end loop
24363
24364         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24365         properties that track the label for the current loop (begin of the
24366         loop and end of the loop).
24367
24368 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24369
24370         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24371         use of emitting anything at all.
24372
24373         * class.cs, rootcontext.cs : Get rid of calls to the same.
24374
24375         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24376
24377         (Populate): Define the constructor correctly and set the implementation
24378         attributes.
24379
24380         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24381         have been defined.
24382
24383         (AddDelegateType): Implement.
24384
24385         (IsDelegateType): Implement helper method.
24386
24387         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24388
24389         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24390         and accordingly handle it.
24391
24392         * delegate.cs (Populate): Take TypeContainer argument.
24393         Implement bits to define the Invoke method. However, I still haven't figured out
24394         how to take care of the native int bit :-(
24395
24396         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24397         Qualify the name of the delegate, not its return type !
24398
24399         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24400         conversion.
24401
24402         (StandardConversionExists): Checking for array types turns out to be recursive.
24403
24404         (ConvertReferenceExplicit): Implement array conversion.
24405
24406         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24407
24408 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24409
24410         * cs-parser.jay (delegate_declaration): Store the fully qualified
24411         name as it is a type declaration.
24412
24413         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24414         readonly.
24415
24416         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24417         as TypeContainer::DefineType.
24418
24419         (Populate): Method in which all the definition of the various methods (Invoke)
24420         etc is done.
24421
24422         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24423         see.
24424
24425         (CloseDelegate): Finally creates the delegate.
24426
24427         * class.cs (TypeContainer::DefineType): Update to define delegates.
24428         (Populate, Emit and CloseType): Do the same thing here too.
24429
24430         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24431         delegates in all these operations.
24432
24433 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24434
24435         * expression.cs: LocalTemporary: a new expression used to
24436         reference a temporary that has been created.
24437
24438         * assign.cs: Handle PropertyAccess back here, so that we can
24439         provide the proper semantic access to properties.
24440
24441         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24442         a few more explicit conversions. 
24443
24444         * modifiers.cs: `NEW' modifier maps to HideBySig.
24445
24446         * expression.cs (PropertyExpr): Make this into an
24447         ExpressionStatement, and support the EmitStatement code path. 
24448
24449         Perform get/set error checking, clean up the interface.
24450
24451         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24452         them into toplevel access objects.
24453
24454 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24455
24456         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24457         SRE.
24458
24459         * typemanager.cs: Keep track here of our PropertyBuilders again to
24460         work around lameness in SRE.
24461
24462 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24463
24464         * expression.cs (LValue::LValueResolve): New method in the
24465         interface, used to perform a second resolution pass for LValues. 
24466
24467         (This::DoResolve): Catch the use of this in static methods.
24468
24469         (This::LValueResolve): Implement.
24470
24471         (This::Store): Remove warning, assigning to `this' in structures
24472         is 
24473
24474         (Invocation::Emit): Deal with invocation of
24475         methods on value types.  We need to pass the address to structure
24476         methods rather than the object itself.  (The equivalent code to
24477         emit "this" for structures leaves the entire structure on the
24478         stack instead of a pointer to it). 
24479
24480         (ParameterReference::DoResolve): Compute the real index for the
24481         argument based on whether the method takes or not a `this' pointer
24482         (ie, the method is static).
24483
24484         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24485         value types returned from functions when we need to invoke a
24486         method on the sturcture.
24487
24488
24489 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24490
24491         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24492         defining the type in the Modulebuilder or Typebuilder. This is to take
24493         care of nested types which need to be defined on the TypeBuilder using
24494         DefineNestedMethod.
24495
24496         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24497         methods in RootContext, only ported to be part of TypeContainer.
24498
24499         (TypeContainer::GetInterfaceOrClass): Ditto.
24500
24501         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24502
24503         * interface.cs (Interface::DefineInterface): New method. Does exactly
24504         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24505         too.
24506
24507         (Interface::GetInterfaces): Move from RootContext here and port.
24508
24509         (Interface::GetInterfaceByName): Same here.
24510
24511         * rootcontext.cs (ResolveTree): Re-write.
24512
24513         (PopulateTypes): Re-write.
24514
24515         * class.cs (TypeContainer::Populate): Populate nested types too.
24516         (TypeContainer::Emit): Emit nested members too.
24517
24518         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24519         instead just use the name argument passed in as it is already fully
24520         qualified.
24521
24522         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24523         to TypeContainer mapping to see if a type is user-defined.
24524
24525         * class.cs (TypeContainer::CloseType): Implement. 
24526
24527         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24528         the default constructor.
24529
24530         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24531         twice.
24532
24533         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24534
24535         * interface.cs (CloseType): Create the type here.
24536
24537         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24538         the hierarchy.
24539
24540         Remove all the methods which are now in TypeContainer.
24541
24542 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24543
24544         * delegate.cs (Define): Re-write bits to define the delegate
24545         correctly.
24546
24547 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24548
24549         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24550
24551         * expression.cs (ImplicitReferenceConversion): handle null as well
24552         as a source to convert to any reference type.
24553
24554         * statement.cs (Return): Perform any implicit conversions to
24555         expected return type.  
24556
24557         Validate use of return statement.  
24558
24559         * codegen.cs (EmitContext): Pass the expected return type here.
24560
24561         * class.cs (Method, Constructor, Property): Pass expected return
24562         type to EmitContext.
24563
24564 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24565
24566         * expression.cs: Make DoResolve take an EmitContext instead of a
24567         TypeContainer.
24568
24569         Replaced `l' and `location' for `loc', for consistency.
24570
24571         (Error, Warning): Remove unneeded Tc argument.
24572
24573         * assign.cs, literal.cs, constant.cs: Update to new calling
24574         convention. 
24575
24576         * codegen.cs: EmitContext now contains a flag indicating whether
24577         code is being generated in a static method or not.
24578
24579         * cs-parser.jay: DecomposeQI, new function that replaces the old
24580         QualifiedIdentifier.  Now we always decompose the assembled
24581         strings from qualified_identifier productions into a group of
24582         memberaccesses.
24583
24584 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24585
24586         * rootcontext.cs: Deal with field-less struct types correctly now
24587         by passing the size option to Define Type.
24588
24589         * class.cs: Removed hack that created one static field. 
24590
24591 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24592
24593         * statement.cs: Moved most of the code generation here. 
24594
24595 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24596
24597         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24598         seem very right.
24599
24600         (ElementAccess): Remove useless bits for now - keep checks as the spec
24601         says.
24602
24603 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24604
24605         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24606         and start performing checks according to the spec.
24607
24608 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24609
24610         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24611         rank_specifiers instead.
24612
24613         (rank_specifiers): Change the order in which the rank specifiers are stored
24614
24615         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24616
24617         * expression.cs (ElementAccess): Implement the LValue interface too.
24618
24619 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24620
24621         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24622         except that user defined conversions are not included.
24623
24624         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24625         perform the conversion of the return type, if necessary.
24626
24627         (New::DoResolve): Check whether we are creating an array or an object
24628         and accordingly do the needful.
24629
24630         (New::Emit): Same here.
24631
24632         (New::DoResolve): Implement guts of array creation.
24633
24634         (New::FormLookupType): Helper function.
24635
24636 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24637
24638         * codegen.cs: Removed most of the code generation here, and move the
24639         corresponding code generation bits to the statement classes. 
24640
24641         Added support for try/catch/finalize and throw.
24642
24643         * cs-parser.jay: Added support for try/catch/finalize.
24644
24645         * class.cs: Catch static methods having the flags override,
24646         virtual or abstract.
24647
24648         * expression.cs (UserCast): This user cast was not really doing
24649         what it was supposed to do.  Which is to be born in fully resolved
24650         state.  Parts of the resolution were being performed at Emit time! 
24651
24652         Fixed this code.
24653
24654 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24655
24656         * expression.cs: Implicity convert the result from UserCast.
24657
24658 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24659
24660         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24661         prevented it from working correctly. 
24662
24663         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24664         merely ConvertImplicit.
24665
24666 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24667
24668         * typemanager.cs: Make the LookupTypeContainer function static,
24669         and not per-instance.  
24670
24671         * class.cs: Make static FindMembers (the one that takes a Type
24672         argument). 
24673
24674         * codegen.cs: Add EmitForeach here.
24675
24676         * cs-parser.jay: Make foreach a toplevel object instead of the
24677         inline expansion, as we need to perform semantic analysis on it. 
24678
24679 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24680
24681         * expression.cs (Expression::ImplicitUserConversion): Rename to
24682         UserDefinedConversion.
24683
24684         (Expression::UserDefinedConversion): Take an extra argument specifying 
24685         whether we look for explicit user conversions too.
24686
24687         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24688
24689         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24690
24691         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24692         with the appropriate arguments.
24693
24694         * cs-parser.jay (cast_expression): Record location too.
24695
24696         * expression.cs (Cast): Record location info.
24697
24698         (Expression::ConvertExplicit): Take location argument.
24699
24700         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24701         to determine if we are doing explicit conversions.
24702
24703         (UserCast::Emit): Update accordingly.
24704
24705         (Expression::ConvertExplicit): Report an error if everything fails.
24706
24707         * ../errors/cs0030.cs : Add.
24708
24709 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24710
24711         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24712         virtual and newslot bits. 
24713
24714         * class.cs (TypeContainer::RegisterRequiredImplementations):
24715         Record methods we need.
24716
24717         (TypeContainer::MakeKey): Helper function to make keys for
24718         MethodBases, since the Methodbase key is useless.
24719
24720         (TypeContainer::Populate): Call RegisterRequiredImplementations
24721         before defining the methods.   
24722
24723         Create a mapping for method_builders_to_methods ahead of time
24724         instead of inside a tight loop.
24725
24726         (::RequireMethods):  Accept an object as the data to set into the
24727         hashtable so we can report interface vs abstract method mismatch.
24728
24729 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24730
24731         * report.cs: Make all of it static.
24732
24733         * rootcontext.cs: Drop object_type and value_type computations, as
24734         we have those in the TypeManager anyways.
24735
24736         Drop report instance variable too, now it is a global.
24737
24738         * driver.cs: Use try/catch on command line handling.
24739
24740         Add --probe option to debug the error reporting system with a test
24741         suite. 
24742
24743         * report.cs: Add support for exiting program when a probe
24744         condition is reached.
24745
24746 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24747
24748         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24749         we do a forcible conversion regardless of type, to check if 
24750         ForceConversion returns a null.
24751
24752         (Binary::error19): Use location to report error.
24753
24754         (Unary::error23): Use location here too.
24755
24756         * ../errors/cs0019.cs : Check in.
24757
24758         * ../errors/cs0023.cs : Check in.
24759
24760         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24761         case of a non-null MethodInfo object with a length of 0 !
24762
24763         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24764         an applicable member - according to the spec :-)
24765         Also fix logic to find members in base types.
24766
24767         (Unary::ResolveOperator): Same here.
24768
24769         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24770         as I was getting thoroughly confused between this and error19 :-)
24771
24772         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24773         (::FindMostEncompassedType): Implement.
24774         (::FindMostEncompassingType): Implement.
24775         (::StandardConversionExists): Implement.
24776
24777         (UserImplicitCast): Re-vamp. We now need info about most specific
24778         source and target types so that we can do the necessary conversions.
24779
24780         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24781         mathematical union with no duplicates.
24782
24783 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24784
24785         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24786         in order from base classes to child classes, so that we can in
24787         child classes look up in our parent for method names and
24788         attributes (required for handling abstract, virtual, new, override
24789         constructs: we need to instrospect our base class, and if we dont
24790         populate the classes in order, the introspection might be
24791         incorrect.  For example, a method could query its parent before
24792         the parent has any methods and would determine that the parent has
24793         no abstract methods (while it could have had them)).
24794
24795         (RootContext::CreateType): Record the order in which we define the
24796         classes.
24797
24798 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24799
24800         * class.cs (TypeContainer::Populate): Also method definitions can
24801         fail now, keep track of this.
24802
24803         (TypeContainer::FindMembers): Implement support for
24804         DeclaredOnly/noDeclaredOnly flag.
24805
24806         (Constructor::Emit) Return the ConstructorBuilder.
24807
24808         (Method::Emit) Return the MethodBuilder. 
24809         Check for abstract or virtual methods to be public.
24810
24811         * rootcontext.cs (RootContext::CreateType): Register all the
24812         abstract methods required for the class to be complete and the
24813         interface methods that must be implemented. 
24814
24815         * cs-parser.jay: Report error 501 (method requires body if it is
24816         not marked abstract or extern).
24817
24818         * expression.cs (TypeOf::Emit): Implement.
24819
24820         * typemanager.cs: runtime_handle_type, new global type.
24821
24822         * class.cs (Property::Emit): Generate code for properties.
24823
24824 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24825
24826         * expression.cs (Unary::ResolveOperator): Find operators on base type
24827         too - we now conform exactly to the spec.
24828
24829         (Binary::ResolveOperator): Same here.
24830
24831         * class.cs (Operator::Define): Fix minor quirk in the tests.
24832
24833         * ../errors/cs0215.cs : Added.
24834
24835         * ../errors/cs0556.cs : Added.
24836
24837         * ../errors/cs0555.cs : Added.
24838
24839 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24840
24841         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24842         single integer which is really efficient
24843
24844 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24845
24846         *  expression.cs (Expression::ImplicitUserConversion): Use location
24847         even in the case when we are examining True operators.
24848  
24849         * class.cs (Operator::Define): Perform extensive checks to conform
24850         with the rules for operator overloading in the spec.
24851
24852         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24853         some of the other conversions mentioned in the spec.
24854
24855         * typemanager.cs (array_type): New static member for the System.Array built-in
24856         type.
24857
24858         (cloneable_interface): For System.ICloneable interface.
24859
24860         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24861         we start resolving the tree and populating types.
24862
24863         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24864  
24865 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24866
24867         * expression.cs (Expression::ExprClassFromMemberInfo,
24868         Expression::Literalize): Create literal expressions from
24869         FieldInfos which are literals.
24870
24871         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24872         type casts, because they were wrong.  The test suite in tests
24873         caught these ones.
24874
24875         (ImplicitNumericConversion): ushort to ulong requires a widening
24876         cast. 
24877
24878         Int32 constant to long requires widening cast as well.
24879
24880         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24881         for integers because the type on the stack is not i4.
24882
24883 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24884
24885         * expression.cs (report118): require location argument. 
24886
24887         * parameter.cs: Do not dereference potential null value.
24888
24889         * class.cs: Catch methods that lack the `new' keyword when
24890         overriding a name.  Report warnings when `new' is used without
24891         anything being there to override.
24892
24893         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24894
24895         * class.cs: Only add constructor to hashtable if it is non-null
24896         (as now constructors can fail on define).
24897
24898         (TypeManager, Class, Struct): Take location arguments.
24899
24900         Catch field instance initialization in structs as errors.
24901
24902         accepting_filter: a new filter for FindMembers that is static so
24903         that we dont create an instance per invocation.
24904
24905         (Constructor::Define): Catch errors where a struct constructor is
24906         parameterless 
24907
24908         * cs-parser.jay: Pass location information for various new
24909         constructs. 
24910
24911         * delegate.cs (Delegate): take a location argument.
24912
24913         * driver.cs: Do not call EmitCode if there were problesm in the
24914         Definition of the types, as many Builders wont be there. 
24915
24916         * decl.cs (Decl::Decl): Require a location argument.
24917
24918         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24919         into integers, and find the most appropiate integer for it.
24920
24921         * literal.cs: Implement ULongLiteral.
24922
24923         * rootcontext.cs: Provide better information about the location of
24924         failure when CreateType fails.
24925
24926 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24927
24928         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24929         as well.
24930
24931         * expression.cs (Binary::CheckShiftArguments): Add missing type
24932         computation.
24933         (Binary::ResolveOperator): Add type to the logical and and logical
24934         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24935         before.
24936
24937         (Binary::DoNumericPromotions): In the case where either argument
24938         is ulong (and most signed types combined with ulong cause an
24939         error) perform implicit integer constant conversions as well.
24940
24941 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24942
24943         * expression.cs (UserImplicitCast): Method should always be
24944         non-null. 
24945         (Invocation::BetterConversion): Simplified test for IntLiteral.
24946
24947         (Expression::ImplicitNumericConversion): Split this routine out.
24948         Put the code that performs implicit constant integer conversions
24949         here. 
24950
24951         (Expression::Resolve): Become a wrapper around DoResolve so we can
24952         check eclass and type being set after resolve.
24953
24954         (Invocation::Badness): Remove this dead function
24955
24956         (Binary::ResolveOperator): Do not compute the expensive argumnets
24957         unless we have a union for it.
24958
24959         (Probe::Emit): Is needs to do an isinst and then
24960         compare against null.
24961
24962         (::CanConvert): Added Location argument.  If the Location argument
24963         is null (Location.Null), then we do not report errors.  This is
24964         used by the `probe' mechanism of the Explicit conversion.  We do
24965         not want to generate an error for something that the user
24966         explicitly requested to be casted.  But the pipeline for an
24967         explicit cast first tests for potential implicit casts.
24968
24969         So for now, if the Location is null, it means `Probe only' to
24970         avoid adding another argument.   Might have to revise this
24971         strategy later.
24972
24973         (ClassCast): New class used to type cast objects into arbitrary
24974         classes (used in Explicit Reference Conversions).
24975
24976         Implement `as' as well.
24977
24978         Reverted all the patches from Ravi below: they were broken:
24979
24980                 * The use of `level' as a mechanism to stop recursive
24981                   invocations is wrong.  That was there just to catch the
24982                   bug with a strack trace but not as a way of addressing
24983                   the problem.
24984
24985                   To fix the problem we have to *understand* what is going
24986                   on and the interactions and come up with a plan, not
24987                   just get things going.
24988
24989                 * The use of the type conversion cache that I proposed
24990                   last night had an open topic: How does this work across
24991                   protection domains.  A user defined conversion might not
24992                   be public in the location where we are applying the
24993                   conversion, a different conversion might be selected
24994                   (ie, private A->B (better) but public B->A (worse),
24995                   inside A, A->B applies, but outside it, B->A will
24996                   apply).
24997
24998                 * On top of that (ie, even if the above is solved),
24999                   conversions in a cache need to be abstract.  Ie, `To
25000                   convert from an Int to a Short use an OpcodeCast', not
25001                   `To convert from an Int to a Short use the OpcodeCast on
25002                   the variable 5' (which is what this patch was doing).
25003
25004 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25005
25006         * expression.cs (Invocation::ConversionExists): Re-write to use
25007         the conversion cache
25008
25009         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25010         cache all conversions done, not just user-defined ones.
25011
25012         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25013         to determine if a conversion exists instead of acutually trying to 
25014         perform the conversion. It's faster too.
25015
25016         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25017         and only then attempt the implicit conversion.
25018
25019 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25020
25021         * expression.cs (ConvertImplicit): Use a cache for conversions
25022         already found. Check level of recursion and bail out if necessary.
25023
25024 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25025
25026         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25027         Export standard methods that we expect for string operations.
25028
25029         * statement.cs (Block::UsageWarning): Track usage of variables and
25030         report the errors for not used variables.
25031
25032         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25033         operator. 
25034
25035 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25036
25037         * codegen.cs: remove unnneded code 
25038
25039         * expression.cs: Removed BuiltinTypeAccess class
25040
25041         Fix the order in which implicit conversions are
25042         done.  
25043
25044         The previous fixed dropped support for boxed conversions (adding a
25045         test to the test suite now)
25046
25047         (UserImplicitCast::CanConvert): Remove test for source being null,
25048         that code is broken.  We should not feed a null to begin with, if
25049         we do, then we should track the bug where the problem originates
25050         and not try to cover it up here.
25051
25052         Return a resolved expression of type UserImplicitCast on success
25053         rather than true/false.  Ravi: this is what I was talking about,
25054         the pattern is to use a static method as a "constructor" for
25055         objects. 
25056
25057         Also, do not create arguments until the very last minute,
25058         otherwise we always create the arguments even for lookups that
25059         will never be performed. 
25060
25061         (UserImplicitCast::Resolve): Eliminate, objects of type
25062         UserImplicitCast are born in a fully resolved state. 
25063
25064         * typemanager.cs (InitCoreTypes): Init also value_type
25065         (System.ValueType). 
25066
25067         * expression.cs (Cast::Resolve): First resolve the child expression.
25068
25069         (LValue): Add new method AddressOf to be used by
25070         the `&' operator.  
25071
25072         Change the argument of Store to take an EmitContext instead of an
25073         ILGenerator, because things like FieldExpr need to be able to call
25074         their children expression to generate the instance code. 
25075
25076         (Expression::Error, Expression::Warning): Sugar functions for
25077         reporting errors.
25078
25079         (Expression::MemberLookup): Accept a TypeContainer instead of a
25080         Report as the first argument.
25081
25082         (Expression::ResolvePrimary): Killed.  I still want to improve
25083         this as currently the code is just not right.
25084
25085         (Expression::ResolveMemberAccess): Simplify, but it is still
25086         wrong. 
25087
25088         (Unary::Resolve): Catch errors in AddressOf operators.
25089
25090         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25091         index to a byte for the short-version, or the compiler will choose
25092         the wrong Emit call, which generates the wrong data.
25093
25094         (ParameterReference::Emit, ::Store): same.
25095
25096         (FieldExpr::AddressOf): Implement.
25097
25098         * typemanager.cs: TypeManager: made public variable instead of
25099         property.
25100
25101         * driver.cs: document --fatal.
25102
25103         * report.cs (ErrorMessage, WarningMessage): new names for the old
25104         Error and Warning classes.
25105
25106         * cs-parser.jay (member_access): Turn built-in access to types
25107         into a normal simplename
25108
25109 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25110
25111         * expression.cs (Invocation::BetterConversion): Fix to cope
25112         with q being null, since this was introducing a bug.
25113
25114         * expression.cs (ConvertImplicit): Do built-in conversions first.
25115
25116 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25117
25118         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25119
25120 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25121
25122         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25123         I had introduced long ago (what's new ?).
25124
25125         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25126         the work of all the checking. 
25127         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25128         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25129
25130         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25131         that is the right way. 
25132
25133         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25134         overloading resolution. Use everywhere instead of cutting and pasting code.
25135
25136         (Binary::ResolveOperator): Use MakeUnionSet.
25137
25138         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25139         we have to convert to bool types. Not complete yet.
25140
25141 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25142
25143         * typemanager.cs (TypeManager::CSharpName): support ushort.
25144
25145         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25146         to provide an expression that performsn an implicit constant int
25147         conversion (section 6.1.6).
25148         (Expression::ConvertImplicitRequired): Reworked to include
25149         implicit constant expression conversions.
25150
25151         (Expression::ConvertNumericExplicit): Finished.
25152
25153         (Invocation::Emit): If InstanceExpression is null, then it means
25154         that we perform a call on this.
25155
25156 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25157
25158         * expression.cs (Unary::Emit): Remove some dead code.
25159         (Probe): Implement Resolve and Emit for `is'.
25160         (Expression::ConvertImplicitRequired): Attempt to do constant
25161         expression conversions here.  Maybe should be moved to
25162         ConvertImplicit, but I am not sure.
25163         (Expression::ImplicitLongConstantConversionPossible,
25164         Expression::ImplicitIntConstantConversionPossible): New functions
25165         that tell whether is it possible to apply an implicit constant
25166         expression conversion.
25167
25168         (ConvertNumericExplicit): Started work on explicit numeric
25169         conversions.
25170
25171         * cs-parser.jay: Update operator constants.
25172
25173         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25174         (Parameters::GetSignature): Hook up VerifyArgs here.
25175         (Parameters::VerifyArgs): Verifies that no two arguments have the
25176         same name. 
25177
25178         * class.cs (Operator): Update the operator names to reflect the
25179         ones that the spec expects (as we are just stringizing the
25180         operator names).
25181
25182         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25183         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25184         previous usage did only work for our methods.
25185         (Expression::ConvertImplicit): Handle decimal implicit numeric
25186         conversions as well.
25187         (Expression::InternalTypeConstructor): Used to invoke constructors
25188         on internal types for default promotions.
25189
25190         (Unary::Emit): Implement special handling for the pre/post
25191         increment/decrement for overloaded operators, as they need to have
25192         the same semantics as the other operators.
25193
25194         (Binary::ResolveOperator): ditto.
25195         (Invocation::ConversionExists): ditto.
25196         (UserImplicitCast::Resolve): ditto.
25197
25198 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25199
25200         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25201         operator, return after emitting body. Regression tests pass again !
25202
25203         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25204         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25205         (Invocation::OverloadResolve): Ditto.
25206         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25207
25208         * everywhere : update calls to the above methods accordingly.
25209
25210 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25211
25212         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25213
25214         * expression.cs (ExpressionStatement): New base class used for
25215         expressions that can appear in statements, so that we can provide
25216         an alternate path to generate expression that do not leave a value
25217         on the stack.
25218
25219         (Expression::Emit, and all the derivatives): We no longer return
25220         whether a value is left on the stack or not.  Every expression
25221         after being emitted leaves a single value on the stack.
25222
25223         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25224         facilties of ExpressionStatement if possible.
25225
25226         * cs-parser.jay: Update statement_expression.
25227
25228 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25229
25230         * driver.cs: Change the wording of message
25231
25232 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25233
25234         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25235         the type of the expression to the return type of the method if
25236         we have an overloaded operator match ! The regression tests pass again !
25237         (Unary::ResolveOperator): Ditto.
25238
25239         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25240         to find "op_Implicit", not "implicit" ;-)
25241         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25242         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25243
25244         * everywhere : Correct calls to the above accordingly.
25245
25246         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25247         (ConvertImplicit): Do user-defined conversion if it exists.
25248
25249 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25250
25251         * assign.cs: track location.
25252         (Resolve): Use implicit conversions on assignment.
25253
25254         * literal.cs: Oops.  Not good, Emit of short access values should
25255         pass (Bytes) or the wrong argument will be selected.
25256
25257         * expression.cs (Unary::Emit): Emit code for -expr.
25258
25259         (Unary::ResolveOperator): Handle `Substract' for non-constants
25260         (substract from zero from the non-constants).
25261         Deal with Doubles as well. 
25262
25263         (Expression::ConvertImplicitRequired): New routine that reports an
25264         error if no implicit conversion exists. 
25265
25266         (Invocation::OverloadResolve): Store the converted implicit
25267         expressions if we make them
25268
25269 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25270
25271         * class.cs (ConstructorInitializer): Take a Location argument.
25272         (ConstructorBaseInitializer): Same here.
25273         (ConstructorThisInitializer): Same here.
25274
25275         * cs-parser.jay : Update all calls accordingly.
25276
25277         * expression.cs (Unary, Binary, New): Take location argument.
25278         Update accordingly everywhere.
25279
25280         * cs-parser.jay : Update all calls to the above to take a location
25281         argument.
25282
25283         * class.cs : Ditto.
25284
25285 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25286
25287         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25288         (Invocation::BetterConversion): Same here
25289         (Invocation::ConversionExists): Ditto.
25290
25291         (Invocation::ConversionExists): Implement.
25292
25293 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25294
25295         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25296         Also take an additional TypeContainer argument.
25297
25298         * All over : Pass in TypeContainer as argument to OverloadResolve.
25299
25300         * typemanager.cs (CSharpName): Update to check for the string type and return
25301         that too.
25302
25303         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25304         a given method.
25305
25306 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25307
25308         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25309         (Invocation::BetterFunction): Implement.
25310         (Invocation::BetterConversion): Implement.
25311         (Invocation::ConversionExists): Skeleton, no implementation yet.
25312
25313         Okay, things work fine !
25314
25315 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25316
25317         * typemanager.cs: declare and load enum_type, delegate_type and
25318         void_type. 
25319
25320         * expression.cs (Expression::Emit): Now emit returns a value that
25321         tells whether a value is left on the stack or not.  This strategy
25322         might be reveted tomorrow with a mechanism that would address
25323         multiple assignments.
25324         (Expression::report118): Utility routine to report mismatches on
25325         the ExprClass.
25326
25327         (Unary::Report23): Report impossible type/operator combination
25328         utility function.
25329
25330         (Unary::IsIncrementableNumber): Whether the type can be
25331         incremented or decremented with add.
25332         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25333         complemented. 
25334         (Unary::ResolveOperator): Implement ++, !, ~,
25335
25336         (Invocation::Emit): Deal with new Emit convetion.
25337
25338         * All Expression derivatives: Updated their Emit method to return
25339         whether they leave values on the stack or not.
25340
25341         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25342         stack for expressions that are statements. 
25343
25344 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25345
25346         * expression.cs (LValue): New interface.  Must be implemented by
25347         LValue objects.
25348         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25349         LValue interface.
25350
25351         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25352         interface for generating code, simplifies the code.
25353
25354 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25355
25356         * expression.cs (everywhere): Comment out return statements in ::Resolve
25357         methods to avoid the warnings.
25358
25359 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25360
25361         * driver.cs (parse): Report error 2001 if we can not open the
25362         source file.
25363
25364         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25365         not resolve it.
25366
25367         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25368         object. 
25369
25370         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25371         otherwise nested blocks end up with the same index.
25372
25373         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25374
25375         * expression.cs:  Instead of having FIXMEs in the Resolve
25376         functions, throw exceptions so it is obvious that we are facing a
25377         bug. 
25378
25379         * cs-parser.jay (invocation_expression): Pass Location information.
25380
25381         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25382         Use a basename for those routines because .NET does not like paths
25383         on them. 
25384
25385         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25386         already defined.
25387
25388 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25389
25390         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25391         are loading the correct data types (throws an exception if not).
25392         (TypeManager::InitCoreTypes): Use CoreLookupType
25393
25394         * expression.cs (Unary::ResolveOperator): return the child
25395         expression for expressions which are just +expr.
25396         (Unary::ResolveOperator): Return negative literals for -LITERAL
25397         expressions (otherwise they are Unary {Literal}).
25398         (Invocation::Badness): Take into account `Implicit constant
25399         expression conversions'.
25400
25401         * literal.cs (LongLiteral): Implement long literal class.
25402         (IntLiteral): export the `Value' of the intliteral. 
25403
25404 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25405
25406         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25407
25408         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25409         instead of 'Operator'
25410
25411         * expression.cs (Binary::ResolveOperator): Update accordingly.
25412         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25413         and 'Minus'
25414
25415         * cs-parser.jay (unary_expression): Update to use the new names.
25416
25417         * gen-treedump.cs (GetUnary): Same here.
25418
25419         * expression.cs (Unary::Resolve): Implement.
25420         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25421         operators are found instead of making noise ;-)
25422         (Unary::ResolveOperator): New method to do precisely the same thing which
25423         Binary::ResolveOperator does for Binary expressions.
25424         (Unary.method, .Arguments): Add.
25425         (Unary::OperName): Implement.   
25426         (Unary::ForceConversion): Copy and Paste !
25427
25428         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25429         a unary operator.
25430
25431         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25432         for the inbuilt operators. Only overloading works for now ;-)
25433
25434 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25435
25436         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25437         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25438
25439         * expression.cs (This::Emit): Implement. 
25440         (This::Resolve): Implement.
25441         (TypeOf:Resolve): Implement.
25442         (Expression::ResolveSimpleName): Add an implicit this to instance
25443         field references. 
25444         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25445         Bind instance variable to Field expressions.
25446         (FieldExpr::Instance): New field used to track the expression that
25447         represents the object instance.
25448         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25449         binding 
25450         (FieldExpr::Emit): Implement.
25451
25452         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25453         the last instruction contains a return opcode to avoid generating
25454         the last `ret' instruction (this generates correct code, and it is
25455         nice to pass the peverify output).
25456
25457         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25458         initializer for static and instance variables.
25459         (Constructor::Emit): Allow initializer to be null in the case of
25460         static constructors.  Only emit initializer for instance
25461         constructors. 
25462
25463         (TypeContainer::FindMembers): Return a null array if there are no
25464         matches.
25465
25466         Also fix the code for the MemberTypes.Method branch, as it was not
25467         scanning that for operators (or tried to access null variables before).
25468
25469         * assign.cs (Assign::Emit): Handle instance and static fields. 
25470
25471         * TODO: Updated.
25472
25473         * driver.cs: Stop compilation if there are parse errors.
25474
25475         * cs-parser.jay (constructor_declaration): Provide default base
25476         initializer for non-static constructors.
25477         (constructor_declarator): Do not provide a default base
25478         initializers if none was specified.
25479         Catch the fact that constructors should not have parameters.
25480
25481         * class.cs: Do not emit parent class initializers for static
25482         constructors, that should be flagged as an error.
25483
25484 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25485
25486         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25487         Move back code into TypeContainer::Populate.
25488
25489 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25490
25491         * class.cs (TypeContainer::AddConstructor): Fix the check to
25492         compare against Name, not Basename. 
25493         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25494
25495         * cs-parser.jay : Update accordingly.
25496
25497         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25498         for methods, don't forget to look into the operators too.
25499         (RegisterMethodBuilder): Helper method to take care of this for
25500         methods, constructors and operators.
25501         (Operator::Define): Completely revamp.
25502         (Operator.OperatorMethod, MethodName): New fields.
25503         (TypeContainer::Populate): Move the registering of builders into
25504         RegisterMethodBuilder.
25505         (Operator::Emit): Re-write.
25506
25507         * expression.cs (Binary::Emit): Comment out code path to emit method
25508         invocation stuff for the case when we have a user defined operator. I am
25509         just not able to get it right !
25510
25511 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25512
25513         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25514         argument. 
25515
25516         (Expression::MemberLookup): Provide a version that allows to
25517         specify the MemberTypes and BindingFlags. 
25518
25519         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25520         so it was not fetching variable information from outer blocks.
25521
25522         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25523         Beforefieldinit as it was buggy.
25524
25525         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25526         that Ravi put here.  
25527
25528         * class.cs (Constructor::Emit): Only emit if block is not null.
25529         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25530         deal with this by semantically definining it as if the user had
25531         done it.
25532
25533         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25534         constructors as we now "emit" them at a higher level.
25535
25536         (TypeContainer::DefineDefaultConstructor): Used to define the
25537         default constructors if none was provided.
25538
25539         (ConstructorInitializer): Add methods Resolve and Emit. 
25540
25541         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25542
25543 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25544
25545         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25546         the default constructor builder with our hashtable for methodbuilders
25547         to methodcores.
25548
25549         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25550         and argument_count is 0 in which case we have a match.
25551         (Binary::ResolveOperator): More null checking and miscellaneous coding
25552         style cleanup.
25553
25554 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25555
25556         * rootcontext.cs (IsNameSpace): Compare against null.
25557
25558         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25559
25560         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25561         and Unary::Operator.
25562
25563         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25564         accordingly.
25565
25566         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25567         we have overloaded operators.
25568         (Binary::ResolveOperator): Implement the part which does the operator overload
25569         resolution.
25570
25571         * class.cs (Operator::Emit): Implement.
25572         (TypeContainer::Emit): Emit the operators we have too.
25573
25574         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25575         the case when we have a user-defined operator.
25576
25577 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25578
25579         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25580
25581 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25582
25583         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25584         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25585         (Constructor::Emit): Implement.
25586         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25587         if we have no work to do. 
25588         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25589         Emit method.
25590
25591         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25592         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25593
25594         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25595         of parent.parent.
25596
25597 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25598
25599         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25600         in the source.
25601         (Tree::RecordNamespace): Method to do what the name says ;-)
25602         (Tree::Namespaces): Property to get at the namespaces hashtable.
25603
25604         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25605         keep track.
25606
25607         * rootcontext.cs (IsNamespace): Fixed it :-)
25608
25609 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25610
25611         * class.cs (TypeContainer::FindMembers): Add support for
25612         constructors. 
25613         (MethodCore): New class that encapsulates both the shared aspects
25614         of a Constructor and a Method.  
25615         (Method, Constructor): Factored pieces into MethodCore.
25616
25617         * driver.cs: Added --fatal which makes errors throw exceptions.
25618         Load System assembly as well as part of the standard library.
25619
25620         * report.cs: Allow throwing exceptions on errors for debugging.
25621
25622         * modifiers.cs: Do not use `parent', instead use the real type
25623         container to evaluate permission settings.
25624
25625         * class.cs: Put Ravi's patch back in.  He is right, and we will
25626         have to cope with the
25627
25628 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25629
25630         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25631         FamORAssem, not FamANDAssem.
25632
25633 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25634
25635         * driver.cs: Added --parse option that only parses its input files
25636         and terminates.
25637
25638         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25639         incorrect.  IsTopLevel is not used to tell whether an object is
25640         root_types or not (that can be achieved by testing this ==
25641         root_types).  But to see if this is a top-level *class* (not
25642         necessarly our "toplevel" container). 
25643
25644 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25645
25646         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25647         parent instead of a direct call to GetType.
25648
25649 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25650
25651         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25652         Modifiers.TypeAttr. This should just be a call to that method.
25653
25654         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25655         object so that we can determine if we are top-level or not.
25656
25657         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25658         TypeContainer too.
25659
25660         * enum.cs (Enum::Define): Ditto.
25661
25662         * modifiers.cs (FieldAttr): Re-write.
25663
25664         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25665         (TypeContainer::HaveStaticConstructor): New property to provide access
25666         to precisely that info.
25667
25668         * modifiers.cs (MethodAttr): Re-write.
25669         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25670
25671         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25672         of top-level types as claimed.
25673
25674 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25675
25676         * expression.cs (MemberLookup): Fruitless attempt to lookup
25677         constructors.  Maybe I need to emit default constructors?  That
25678         might be it (currently .NET emits this for me automatically).
25679         (Invocation::OverloadResolve): Cope with Arguments == null.
25680         (Invocation::EmitArguments): new function, shared by the new
25681         constructor and us.
25682         (Invocation::Emit): Handle static and instance methods.  Emit
25683         proper call instruction for virtual or non-virtual invocations.
25684         (New::Emit): Implement.
25685         (New::Resolve): Implement.
25686         (MemberAccess:Resolve): Implement.
25687         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25688         to track instances.
25689         (FieldExpr::Resolve): Set type.
25690
25691         * support.cs: Handle empty arguments.
25692                 
25693         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25694         SimpleLookup): Auxiliary routines to help parse a qualifier
25695         identifier.  
25696
25697         Update qualifier_identifier rule.
25698
25699         * codegen.cs: Removed debugging messages.
25700
25701         * class.cs: Make this a global thing, this acts just as a "key" to
25702         objects that we might have around.
25703
25704         (Populate): Only initialize method_builders_to_methods once.
25705
25706         * expression.cs (PropertyExpr): Initialize type from the
25707         PropertyType. 
25708
25709         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25710         Resolve pattern.  Attempt to implicitly convert value to boolean.
25711         Emit code.
25712
25713         * expression.cs: Set the type for the int32/int32 argument case.
25714         (Binary::ResolveOperator): Set the return type to boolean for
25715         comparission operators
25716
25717         * typemanager.cs: Remove debugging print code.
25718
25719         (Invocation::Resolve): resolve type.
25720
25721         * class.cs: Allocate a MemberInfo of the correct size, as the code
25722         elsewhere depends on the test to reflect the correct contents.
25723
25724         (Method::) Keep track of parameters, due to System.Reflection holes
25725
25726         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25727         mapping here.
25728
25729         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25730         of the exact size and return that.
25731
25732         (Class::LookupMethodByBuilder): New function that maps
25733         MethodBuilders to its methods.  Required to locate the information
25734         on methods because System.Reflection bit us again.
25735
25736         * support.cs: New file, contains an interface ParameterData and
25737         two implementations: ReflectionParameters and InternalParameters
25738         used to access Parameter information.  We will need to grow this
25739         as required.
25740
25741         * expression.cs (Invocation::GetParameterData): implement a cache
25742         and a wrapper around the ParameterData creation for methods. 
25743         (Invocation::OverloadResolve): Use new code.
25744
25745 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25746
25747         * class.cs (TypeContainer::EmitField): Remove and move into 
25748         (Field::Define): here and modify accordingly.
25749         (Field.FieldBuilder): New member.
25750         (TypeContainer::Populate): Update accordingly.
25751         (TypeContainer::FindMembers): Implement.
25752
25753 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25754
25755         * statement.cs: (VariableInfo::VariableType): New field to be
25756         initialized with the full type once it is resolved. 
25757
25758 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25759
25760         * parameter.cs (GetParameterInfo): Use a type cache to compute
25761         things only once, and to reuse this information
25762
25763         * expression.cs (LocalVariableReference::Emit): Implement.
25764         (OpcodeCast::Emit): fix.
25765
25766         (ParameterReference::Resolve): Implement.
25767         (ParameterReference::Emit): Implement.
25768
25769         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25770         that are expressions need to stay as Expressions.
25771
25772         * typemanager.cs (CSharpName): Returns the C# name of a type if
25773         possible. 
25774
25775         * expression.cs (Expression::ConvertImplicit): New function that
25776         implements implicit type conversions.
25777
25778         (Expression::ImplicitReferenceConversion): Implements implicit
25779         reference conversions.
25780
25781         (EmptyCast): New type for transparent casts.
25782
25783         (OpcodeCast): New type for casts of types that are performed with
25784         a sequence of bytecodes.
25785
25786         (BoxedCast): New type used for casting value types into reference
25787         types.  Emits a box opcode.
25788
25789         (Binary::DoNumericPromotions): Implements numeric promotions of
25790         and computation of the Binary::Type.
25791
25792         (Binary::EmitBranchable): Optimization.
25793
25794         (Binary::Emit): Implement code emission for expressions.
25795
25796         * typemanager.cs (TypeManager): Added two new core types: sbyte
25797         and byte.
25798
25799 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25800
25801         * class.cs (TypeContainer::FindMembers): Method which does exactly
25802         what Type.FindMembers does, only we don't have to use reflection. No
25803         implementation yet.
25804
25805         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25806         typecontainer objects as we need to get at them.
25807         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25808
25809         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25810         typecontainer object.
25811
25812         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25813         of just a Report object.
25814
25815 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25816
25817         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25818         "remove_"
25819         (TypeContainer::Populate): Now define the delegates of the type too.
25820         (TypeContainer.Delegates): Property to access the list of delegates defined
25821         in the type.
25822
25823         * delegates.cs (Delegate::Define): Implement partially.
25824
25825         * modifiers.cs (TypeAttr): Handle more flags.
25826
25827 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25828
25829         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25830         and not <=
25831         (Operator::Define): Re-write logic to get types by using the LookupType method
25832         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25833         (Indexer::Define): Ditto.
25834         (Event::Define): Ditto.
25835         (Property::Define): Ditto.
25836
25837 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25838
25839         * class.cs (TypeContainer::Populate): Now define operators too. 
25840         (TypeContainer.Operators): New property to access the list of operators
25841         in a type.
25842         (Operator.OperatorMethodBuilder): New member to hold the method builder
25843         for the operator we are defining.
25844         (Operator::Define): Implement.
25845
25846 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25847
25848         * class.cs (Event::Define): Make the prefixes of the accessor methods
25849         addOn_ and removeOn_ 
25850
25851         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25852         of the location being passed in too. Ideally, this should go later since all
25853         error reporting should be done through the Report object.
25854
25855         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25856         (Populate): Iterate thru the indexers we have and define them too.
25857         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25858         for the get and set accessors.
25859         (Indexer::Define): Implement.
25860
25861 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25862
25863         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25864         my previous implementation, did not work.
25865
25866         * typemanager.cs: Add a couple of missing types (the longs).
25867
25868         * literal.cs: Use TypeManager.bool_type instead of getting it.
25869
25870         * expression.cs (EventExpr): New kind of expressions.
25871         (Expressio::ExprClassFromMemberInfo): finish
25872
25873 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25874
25875         * assign.cs: Emit stores to static fields differently.
25876
25877 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25878
25879         * Merge in changes and adjust code to tackle conflicts. Backed out my
25880         code in Assign::Resolve ;-) 
25881
25882 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25883
25884         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25885         instead Report.Error and also pass in the location.
25886         (CSharpParser::Lexer): New readonly property to return the reference
25887         to the Tokenizer object.
25888         (declare_local_variables): Use Report.Error with location instead of plain 
25889         old error.
25890         (CheckDef): Ditto.
25891
25892         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25893         (Operator.CheckBinaryOperator): Ditto.
25894
25895         * cs-parser.jay (operator_declarator): Update accordingly.
25896
25897         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25898         (CheckBinaryOperator): Same here.
25899
25900         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25901         on the name without any prefixes of namespace names etc. This is because we
25902         already might have something already fully qualified like 
25903         'System.Console.WriteLine'
25904
25905         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25906
25907 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25908
25909         * cs-tokenizer.cs (location): Return a string which also contains
25910         the file name.
25911
25912         * expression.cs (ElementAccess): New class for expressions of the
25913         type 'element access.'
25914         (BaseAccess): New class for expressions of the type 'base access.'
25915         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25916         respectively.
25917
25918         * cs-parser.jay (element_access): Implement action.
25919         (base_access): Implement actions.
25920         (checked_expression, unchecked_expression): Implement.
25921
25922         * cs-parser.jay (local_variable_type): Correct and implement.
25923         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25924
25925         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25926
25927         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25928         name and the specifiers.
25929
25930         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25931
25932         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25933         making them all public ;-)
25934
25935         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25936         class anyways.
25937
25938 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25939
25940         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25941         PropertyExprs.
25942         (FieldExpr, PropertyExprs): New resolved expressions.
25943         (SimpleName::MemberStaticCheck): Perform static checks for access
25944         to non-static fields on static methods. Maybe this should be
25945         generalized for MemberAccesses. 
25946         (SimpleName::ResolveSimpleName): More work on simple name
25947         resolution. 
25948
25949         * cs-parser.jay (primary_expression/qualified_identifier): track
25950         the parameter index.
25951
25952         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25953         (EmitContext::EmitBoolExpression): Chain to expression generation
25954         instead of temporary hack.
25955         (::EmitStatementExpression): Put generic expression code generation.
25956
25957         * assign.cs (Assign::Emit): Implement variable assignments to
25958         local variables, parameters and fields.
25959
25960 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25961
25962         * statement.cs (Block::GetVariableInfo): New method, returns the
25963         VariableInfo for a variable name in a block.
25964         (Block::GetVariableType): Implement in terms of GetVariableInfo
25965
25966         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25967         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25968
25969 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25970
25971         * cs-parser.jay (operator_declaration): Continue on my quest : update
25972         to take attributes argument.
25973         (event_declaration): Ditto.
25974         (enum_declaration): Ditto.
25975         (indexer_declaration): Ditto.
25976
25977         * class.cs (Operator::Operator): Update constructor accordingly.
25978         (Event::Event): Ditto.
25979
25980         * delegate.cs (Delegate::Delegate): Same here.
25981
25982         * enum.cs (Enum::Enum): Same here.
25983
25984 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25985
25986         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25987
25988         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25989
25990         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25991         being passed around as an arraylist.
25992         (Attributes::AddAttribute): Method to add attribute sections.
25993
25994         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25995         (struct_declaration): Update accordingly.
25996         (constant_declaration): Update.
25997         (field_declaration): Update.
25998         (method_header): Update.
25999         (fixed_parameter): Update.
26000         (parameter_array): Ditto.
26001         (property_declaration): Ditto.
26002         (destructor_declaration): Ditto.
26003
26004         * class.cs (Struct::Struct): Update constructors accordingly.
26005         (Class::Class): Ditto.
26006         (Field::Field): Ditto.
26007         (Method::Method): Ditto.
26008         (Property::Property): Ditto.
26009         (TypeContainer::OptAttribute): update property's return type.
26010
26011         * interface.cs (Interface.opt_attributes): New member.
26012         (Interface::Interface): Update to take the extra Attributes argument.
26013
26014         * parameter.cs (Parameter::Parameter): Ditto.
26015
26016         * constant.cs (Constant::Constant): Ditto.
26017
26018         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26019         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26020         the attributes as a parameter.
26021         (InterfaceProperty): Update constructor call.
26022         (InterfaceEvent): Ditto.
26023         (InterfaceMethod): Ditto.
26024         (InterfaceIndexer): Ditto.
26025
26026         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26027         pass the attributes too.
26028         (interface_event_declaration): Ditto.
26029         (interface_property_declaration): Ditto.
26030         (interface_method_declaration): Ditto.
26031         (interface_declaration): Ditto.
26032
26033 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26034
26035         * class.cs (Method::Define): Track the "static Main" definition to
26036         create an entry point. 
26037
26038         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26039         EntryPoint if we find it. 
26040
26041         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26042         (EmitContext::ig): Make this variable public.
26043
26044         * driver.cs: Make the default output file be the first file name
26045         with the .exe extension.  
26046
26047         Detect empty compilations
26048
26049         Handle various kinds of output targets.  Handle --target and
26050         rename -t to --dumper.
26051
26052         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26053         methods inherited from Expression return now an Expression.  This
26054         will is used during the tree rewriting as we resolve them during
26055         semantic analysis.
26056
26057         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26058         the spec.  Missing entirely is the information about
26059         accessability of elements of it.
26060
26061         (Expression::ExprClassFromMemberInfo): New constructor for
26062         Expressions that creates a fully initialized Expression based on
26063         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26064         a Type.
26065
26066         (Invocation::Resolve): Begin implementing resolution of invocations.
26067
26068         * literal.cs (StringLiteral):  Implement Emit.
26069
26070 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26071
26072         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26073         member.
26074
26075 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26076
26077         * cs-parser.jay (attribute_arguments): Implement actions.
26078         (attribute): Fix bug in production. Implement action.
26079         (attribute_list): Implement.
26080         (attribute_target): Implement.
26081         (attribute_target_specifier, opt_target_specifier): Implement
26082         (CheckAttributeTarget): New method to check if the attribute target
26083         is valid.
26084         (attribute_section): Implement.
26085         (opt_attributes): Implement.
26086
26087         * attribute.cs : New file to handle attributes.
26088         (Attribute): Class to hold attribute info.
26089
26090         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26091         (attribute_section): Modify production to use 2 different rules to 
26092         achieve the same thing. 1 s/r conflict down !
26093         Clean out commented, useless, non-reducing dimension_separator rules.
26094
26095         * class.cs (TypeContainer.attributes): New member to hold list
26096         of attributes for a type.
26097         (Struct::Struct): Modify to take one more argument, the attribute list.
26098         (Class::Class): Ditto.
26099         (Field::Field): Ditto.
26100         (Method::Method): Ditto.
26101         (Property::Property): Ditto.
26102
26103         * cs-parser.jay (struct_declaration): Update constructor call to
26104         pass in the attributes too.
26105         (class_declaration): Ditto.
26106         (constant_declaration): Ditto.
26107         (field_declaration): Ditto.
26108         (method_header): Ditto.
26109         (fixed_parameter): Ditto.
26110         (parameter_array): Ditto.
26111         (property_declaration): Ditto.
26112
26113         * constant.cs (Constant::Constant): Update constructor similarly.
26114         Use System.Collections.
26115
26116         * parameter.cs (Parameter::Parameter): Update as above.
26117
26118 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26119
26120         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26121         (TypeContainer.delegates): New member to hold list of delegates.
26122
26123         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26124         this time as I seem to be on crack ;-)
26125
26126 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26127
26128         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26129         tell whether an identifier represents a namespace.
26130
26131         * expression.cs (NamespaceExpr): A namespace expression, used only
26132         temporarly during expression resolution.
26133         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26134         utility functions to resolve names on expressions.
26135
26136 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26137
26138         * codegen.cs: Add hook for StatementExpressions. 
26139
26140         * class.cs: Fix inverted test for static flag in methods.
26141
26142 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26143
26144         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26145         to make it coincide with MS' number.
26146         (Operator::CheckBinaryOperator): Ditto.
26147
26148         * ../errors/errors.txt : Remove error numbers added earlier.
26149
26150         * ../errors/cs1019.cs : Test case for error # 1019
26151
26152         * ../errros/cs1020.cs : Test case for error # 1020
26153
26154         * cs-parser.jay : Clean out commented cruft.
26155         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26156         used anywhere - non-reducing rule.
26157         (namespace_declarations): Non-reducing rule - comment out.
26158
26159         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26160         with TypeContainer::AddEnum.
26161
26162         * delegate.cs : New file for delegate handling classes.
26163         (Delegate): Class for declaring delegates.
26164
26165         * makefile : Update.
26166
26167         * cs-parser.jay (delegate_declaration): Implement.
26168
26169 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26170
26171         * class.cs (Event::Define): Implement.
26172         (Event.EventBuilder): New member.
26173
26174         * class.cs (TypeContainer::Populate): Update to define all enums and events
26175         we have.
26176         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26177         readonly fields for all these cases ?
26178
26179 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26180
26181         * class.cs (Property): Revamp to use the convention of making fields readonly.
26182         Accordingly modify code elsewhere.
26183
26184         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26185         the Define method of the Property class.
26186
26187         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26188         trivial bug.
26189         (TypeContainer::Populate): Update to define all the properties we have. Also
26190         define all enumerations.
26191
26192         * enum.cs (Define): Implement.
26193
26194 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26195
26196         * cs-parser.jay (overloadable_operator): The semantic value is an
26197         enum of the Operator class.
26198         (operator_declarator): Implement actions.
26199         (operator_declaration): Implement.
26200
26201         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26202         validity of definitions.
26203         (Operator::CheckBinaryOperator): Static method to check for binary operators
26204         (TypeContainer::AddOperator): New method to add an operator to a type.
26205
26206         * cs-parser.jay (indexer_declaration): Added line to actually call the
26207         AddIndexer method so it gets added ;-)
26208
26209         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26210         already taken care of by the MS compiler ?  
26211
26212 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26213
26214         * class.cs (Operator): New class for operator declarations.
26215         (Operator::OpType): Enum for the various operators.
26216
26217 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26218
26219         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26220         ostensibly handle this in semantic analysis.
26221
26222         * cs-parser.jay (general_catch_clause): Comment out
26223         (specific_catch_clauses, specific_catch_clause): Ditto.
26224         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26225         (catch_args, opt_catch_args): New productions.
26226         (catch_clause): Rewrite to use the new productions above
26227         (catch_clauses): Modify accordingly.
26228         (opt_catch_clauses): New production to use in try_statement
26229         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26230         and re-write the code in the actions to extract the specific and
26231         general catch clauses by being a little smart ;-)
26232
26233         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26234         Hooray, try and catch statements parse fine !
26235
26236 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26237
26238         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26239         string from the hashtable of variables.
26240
26241         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26242         I end up making that mistake ;-)
26243         (catch_clauses): Fixed gross error which made Key and Value of the 
26244         DictionaryEntry the same : $1 !!
26245
26246 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26247
26248         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26249
26250         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26251         when the add and remove accessors are specified. 
26252
26253 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26254
26255         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26256         information about indexer_declarator.
26257         (indexer_declarator): Implement actions.
26258         (parsing_indexer): New local boolean used to keep track of whether
26259         we are parsing indexers or properties. This is necessary because 
26260         implicit_parameters come into picture even for the get accessor in the 
26261         case of an indexer.
26262         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26263
26264         * class.cs (Indexer): New class for indexer declarations.
26265         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26266         (TypeContainer::indexers): New member to hold list of indexers for the
26267         type.
26268
26269 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26270
26271         * cs-parser.jay (add_accessor_declaration): Implement action.
26272         (remove_accessor_declaration): Implement action.
26273         (event_accessors_declaration): Implement
26274         (variable_declarators): swap statements for first rule - trivial.
26275
26276         * class.cs (Event): New class to hold information about event
26277         declarations.
26278         (TypeContainer::AddEvent): New method to add an event to a type
26279         (TypeContainer::events): New member to hold list of events.
26280
26281         * cs-parser.jay (event_declaration): Implement actions.
26282
26283 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26284
26285         * cs-parser.jay (dim_separators): Implement. Make it a string
26286         concatenating all the commas together, just as they appear.
26287         (opt_dim_separators): Modify accordingly
26288         (rank_specifiers): Update accordingly. Basically do the same
26289         thing - instead, collect the brackets here.
26290         (opt_rank_sepcifiers): Modify accordingly.
26291         (array_type): Modify to actually return the complete type string
26292         instead of ignoring the rank_specifiers.
26293         (expression_list): Implement to collect the expressions
26294         (variable_initializer): Implement. We make it a list of expressions
26295         essentially so that we can handle the array_initializer case neatly too.
26296         (variable_initializer_list): Implement.
26297         (array_initializer): Make it a list of variable_initializers
26298         (opt_array_initializer): Modify accordingly.
26299
26300         * expression.cs (New::NType): Add enumeration to help us
26301         keep track of whether we have an object/delegate creation
26302         or an array creation.
26303         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26304         members to hold data about array creation.
26305         (New:New): Modify to update NewType
26306         (New:New): New Overloaded contructor for the array creation
26307         case.
26308
26309         * cs-parser.jay (array_creation_expression): Implement to call
26310         the overloaded New constructor.
26311
26312 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26313
26314         * class.cs (TypeContainer::Constructors): Return member
26315         constructors instead of returning null.
26316
26317 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26318
26319         * typemanager.cs (InitCoreTypes): Initialize the various core
26320         types after we have populated the type manager with the user
26321         defined types (this distinction will be important later while
26322         compiling corlib.dll)
26323
26324         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26325         on Expression Classification.  Now all expressions have a method
26326         `Resolve' and a method `Emit'.
26327
26328         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26329         generation from working.     Also add some temporary debugging
26330         code. 
26331
26332 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26333
26334         * codegen.cs: Lots of code generation pieces.  This is only the
26335         beginning, will continue tomorrow with more touches of polish.  We
26336         handle the fundamentals of if, while, do, for, return.  Others are
26337         trickier and I need to start working on invocations soon.
26338
26339         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26340         s.InitStatement. 
26341
26342         * codegen.cs (EmitContext): New struct, used during code
26343         emission to keep a context.   Most of the code generation will be
26344         here. 
26345
26346         * cs-parser.jay: Add embedded blocks to the list of statements of
26347         this block.  So code generation proceeds in a top down fashion.
26348
26349 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26350
26351         * statement.cs: Add support for multiple child blocks.
26352
26353 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26354
26355         * codegen.cs (EmitCode): New function, will emit the code for a
26356         Block of code given a TypeContainer and its ILGenerator. 
26357
26358         * statement.cs (Block): Standard public readonly optimization.
26359         (Block::Block constructors): Link children. 
26360         (Block::Child): Child Linker.
26361         (Block::EmitVariables): Emits IL variable declarations.
26362
26363         * class.cs: Drop support for MethodGroups here, delay until
26364         Semantic Analysis.
26365         (Method::): Applied the same simplification that I did before, and
26366         move from Properties to public readonly fields.
26367         (Method::ParameterTypes): Returns the parameter types for the
26368         function, and implements a cache that will be useful later when I
26369         do error checking and the semantic analysis on the methods is
26370         performed.
26371         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26372         and made a method, optional argument tells whether this is a class
26373         or a structure to apply the `has-this' bit.
26374         (Method::GetCallingConvention): Implement, returns the calling
26375         convention. 
26376         (Method::Define): Defines the type, a second pass is performed
26377         later to populate the methods.
26378
26379         (Constructor::ParameterTypes): implement a cache similar to the
26380         one on Method::ParameterTypes, useful later when we do semantic
26381         analysis. 
26382
26383         (TypeContainer::EmitMethod):  New method.  Emits methods.
26384
26385         * expression.cs: Removed MethodGroup class from here.
26386
26387         * parameter.cs (Parameters::GetCallingConvention): new method.
26388
26389 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26390
26391         * class.cs (TypeContainer::Populate): Drop RootContext from the
26392         argument. 
26393
26394         (Constructor::CallingConvention): Returns the calling convention.
26395         (Constructor::ParameterTypes): Returns the constructor parameter
26396         types. 
26397
26398         (TypeContainer::AddConstructor): Keep track of default constructor
26399         and the default static constructor.
26400
26401         (Constructor::) Another class that starts using `public readonly'
26402         instead of properties. 
26403
26404         (Constructor::IsDefault): Whether this is a default constructor. 
26405
26406         (Field::) use readonly public fields instead of properties also.
26407
26408         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26409         track of static constructors;  If none is used, turn on
26410         BeforeFieldInit in the TypeAttributes. 
26411
26412         * cs-parser.jay (opt_argument_list): now the return can be null
26413         for the cases where there are no arguments. 
26414
26415         (constructor_declarator): If there is no implicit `base' or
26416         `this', then invoke the default parent constructor. 
26417
26418         * modifiers.cs (MethodAttr): New static function maps a set of
26419         modifiers flags into a MethodAttributes enum
26420         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26421         MethodAttr, TypeAttr to represent the various mappings where the
26422         modifiers are used.
26423         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26424
26425 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26426
26427         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26428         method arguments.
26429
26430         * interface.cs (PopulateIndexer): Implemented the code generator
26431         for interface indexers.
26432
26433 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26434
26435         * interface.cs (InterfaceMemberBase): Now we track the new status
26436         here.  
26437
26438         (PopulateProperty): Implement property population.  Woohoo!  Got
26439         Methods and Properties going today. 
26440
26441         Removed all the properties for interfaces, and replaced them with
26442         `public readonly' fields. 
26443
26444 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26445
26446         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26447         initialize their hashtables/arraylists only when they are needed
26448         instead of doing this always.
26449
26450         * parameter.cs: Handle refs and out parameters.
26451
26452         * cs-parser.jay: Use an ArrayList to construct the arguments
26453         instead of the ParameterCollection, and then cast that to a
26454         Parameter[] array.
26455
26456         * parameter.cs: Drop the use of ParameterCollection and use
26457         instead arrays of Parameters.
26458
26459         (GetParameterInfo): Use the Type, not the Name when resolving
26460         types. 
26461
26462 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26463
26464         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26465         and instead use public readonly fields.
26466
26467         * class.cs: Put back walking code for type containers.
26468
26469 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26470
26471         * class.cs (MakeConstant): Code to define constants.
26472
26473         * rootcontext.cs (LookupType): New function.  Used to locate types 
26474
26475
26476 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26477
26478         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26479         this System.Reflection code is.  Kudos to Microsoft
26480
26481         * typemanager.cs: Implement a type cache and avoid loading all
26482         types at boot time.  Wrap in LookupType the internals.  This made
26483         the compiler so much faster.  Wow.  I rule!
26484
26485         * driver.cs: Make sure we always load mscorlib first (for
26486         debugging purposes, nothing really important).
26487
26488         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26489         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26490
26491         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26492         on namespaces that have been imported using the `using' keyword.
26493
26494         * class.cs (TypeContainer::TypeAttr): Virtualize.
26495         (Class::TypeAttr): Return attributes suitable for this bad boy.
26496         (Struct::TypeAttr): ditto.
26497         Handle nested classes.
26498         (TypeContainer::) Remove all the type visiting code, it is now
26499         replaced with the rootcontext.cs code
26500
26501         * rootcontext.cs (GetClassBases): Added support for structs. 
26502
26503 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26504
26505         * interface.cs, statement.cs, class.cs, parameter.cs,
26506         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26507         Drop use of TypeRefs, and use strings instead.
26508
26509 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26510
26511         * rootcontext.cs: 
26512
26513         * class.cs (Struct::Struct): set the SEALED flags after
26514         checking the modifiers.
26515         (TypeContainer::TypeAttr): new property, returns the
26516         TypeAttributes for a class.  
26517
26518         * cs-parser.jay (type_list): Oops, list production was creating a
26519         new list of base types.
26520
26521         * rootcontext.cs (StdLib): New property.
26522         (GetInterfaceTypeByName): returns an interface by type name, and
26523         encapsulates error handling here.
26524         (GetInterfaces): simplified.
26525         (ResolveTree): Encapsulated all the tree resolution here.
26526         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26527         types. 
26528
26529         * driver.cs: Add support for --nostdlib, to avoid loading the
26530         default assemblies.
26531         (Main): Do not put tree resolution here. 
26532
26533         * rootcontext.cs: Beginning of the class resolution.
26534
26535 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26536
26537         * rootcontext.cs: Provide better error reporting. 
26538
26539         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26540
26541         * rootcontext.cs (CreateInterface): Handle the case where there
26542         are no parent interfaces.
26543
26544         (CloseTypes): Routine to flush types at the end.
26545         (CreateInterface): Track types.
26546         (GetInterfaces): Returns an array of Types from the list of
26547         defined interfaces.
26548
26549         * typemanager.c (AddUserType): Mechanism to track user types (puts
26550         the type on the global type hash, and allows us to close it at the
26551         end). 
26552
26553 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26554
26555         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26556         RecordInterface instead.
26557
26558         * cs-parser.jay: Updated to reflect changes above.
26559
26560         * decl.cs (Definition): Keep track of the TypeBuilder type that
26561         represents this type here.  Not sure we will use it in the long
26562         run, but wont hurt for now.
26563
26564         * driver.cs: Smaller changes to accomodate the new code.
26565
26566         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26567         when done. 
26568
26569         * rootcontext.cs (CreateInterface):  New method, used to create
26570         the System.TypeBuilder type for interfaces.
26571         (ResolveInterfaces): new entry point to resolve the interface
26572         hierarchy. 
26573         (CodeGen): Property, used to keep track of the code generator.
26574
26575 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26576
26577         * cs-parser.jay: Add a second production for delegate_declaration
26578         with `VOID'.
26579
26580         (enum_body): Put an opt_comma here instead of putting it on
26581         enum_body or enum_member_declarations so we can handle trailing
26582         commas on enumeration members.  Gets rid of a shift/reduce.
26583
26584         (type_list): Need a COMMA in the middle.
26585
26586         (indexer_declaration): Tell tokenizer to recognize get/set
26587
26588         * Remove old targets.
26589
26590         * Re-add the parser target.
26591
26592 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26593
26594         * cs-parser.jay: Add precendence rules for a number of operators
26595         ot reduce the number of shift/reduce conflicts in the grammar.
26596
26597 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26598
26599         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26600         and put it here.
26601
26602         Get rid of old crufty code.
26603
26604         * rootcontext.cs: Use this to keep track of the parsed
26605         representation and the defined types available to the program. 
26606
26607         * gen-treedump.cs: adjust for new convention.
26608
26609         * type.cs: Split out the type manager, and the assembly builder
26610         from here. 
26611
26612         * typemanager.cs: the type manager will live here now.
26613
26614         * cil-codegen.cs: And the code generator here. 
26615
26616 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26617
26618         * makefile: Fixed up for easy making.
26619
26620 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26621
26622         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26623         the 
26624
26625         (unary_expression): Expand pre_increment_expression and
26626         post_decrement_expression to reduce a shift/reduce.
26627
26628 2001-07-11  Simon Cozens
26629
26630         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26631
26632         Improve allow_keyword_as_indent name.
26633
26634 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26635
26636         * Adjustments for Beta2. 
26637
26638 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26639
26640         * decl.cs: Added `Define' abstract method.
26641         (InTransit): new property, used to catch recursive definitions. 
26642
26643         * interface.cs: Implement `Define'. 
26644
26645         * modifiers.cs: Map Modifiers.constants to
26646         System.Reflection.TypeAttribute flags.
26647
26648         * class.cs: Keep track of types and user-defined types.
26649         (BuilderInit): New method for creating an assembly
26650         (ResolveType): New function to launch the resolution process, only
26651         used by interfaces for now.
26652
26653         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26654         that are inserted into the name space. 
26655
26656 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26657
26658         * ARGH.  I have screwed up my tree so many times due to the use of
26659         rsync rather than using CVS.  Going to fix this at once. 
26660
26661         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26662         load types.
26663
26664 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26665
26666         * Experiment successful: Use System.Type rather that our own
26667         version of Type.  
26668
26669 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26670
26671         * cs-parser.jay: Removed nsAliases from here.
26672
26673         Use new namespaces, handle `using XXX;' 
26674
26675         * namespace.cs: Reimplemented namespace handling, use a recursive
26676         definition of the class.  Now we can keep track of using clauses
26677         and catch invalid using clauses.
26678
26679 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26680
26681         * gen-treedump.cs: Adapted for all the renaming.
26682
26683         * expression.cs (Expression): this class now has a Type property
26684         which returns an expression Type.
26685
26686         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26687         `Type', as this has a different meaning now in the base
26688
26689 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26690
26691         * interface.cs, class.cs: Removed from all the sources the
26692         references to signature computation, as we can not do method
26693         signature computation during the parsing time, as we are not
26694         trying to solve at that point distinguishing:
26695
26696         class X {
26697                 void a (Blah x) {}
26698                 void a (NS.Blah x) {}
26699         }
26700
26701         Which depending on the context might be valid or not, as we do not
26702         know if Blah is the same thing as NS.Blah at that point.
26703
26704         * Redid everything so the code uses TypeRefs now instead of
26705         Types.  TypeRefs are just temporary type placeholders, that need
26706         to be resolved.  They initially have a pointer to a string and the
26707         current scope in which they are used.  This is used later by the
26708         compiler to resolve the reference to an actual Type. 
26709
26710         * DeclSpace is no longer a CIR.Type, and neither are
26711         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26712         are all DeclSpaces, but no Types. 
26713
26714         * type.cs (TypeRefManager): This implements the TypeRef manager,
26715         which keeps track of all the types that need to be resolved after
26716         the parsing has finished. 
26717
26718 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26719
26720         * ARGH.  We are going to have to store `foreach' as a class rather
26721         than resolving it, as we need to verify error 1579 after name
26722         resolution.   *OR* we could keep a flag that says `This request to
26723         IEnumerator comes from a foreach statement' which we can then use
26724         to generate the error.
26725
26726 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26727
26728         * class.cs (TypeContainer.AddMethod): we now add methods to the
26729         MethodGroup instead of the method hashtable.  
26730
26731         * expression.cs: Add MethodGroup abstraction, which gets us one
26732         step closer to the specification in the way we handle method
26733         declarations.  
26734
26735         * cs-parser.jay (primary_expression): qualified_identifier now
26736         tried to match up an identifier to a local variable reference or
26737         to a parameter reference.
26738
26739         current_local_parameters is now a parser global variable that
26740         points to the current parameters for the block, used during name
26741         lookup.
26742
26743         (property_declaration): Now creates an implicit `value' argument to
26744         the set accessor.
26745
26746 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26747
26748         * parameter.cs: Do not use `param' arguments as part of the
26749         signature, per the spec.
26750
26751 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26752
26753         * decl.cs: Base class for classes, structs and interfaces.  This
26754         is the "Declaration Space" 
26755
26756         * cs-parser.jay: Use CheckDef for checking declaration errors
26757         instead of having one on each function.
26758
26759         * class.cs: Factor out some code for handling error handling in
26760         accordance to the "Declarations" section in the "Basic Concepts"
26761         chapter in the ECMA C# spec.
26762
26763         * interface.cs: Make all interface member classes derive from
26764         InterfaceMemberBase.
26765
26766 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26767
26768         * Many things: all interfaces are parsed and generated in
26769         gen-treedump.  Support for member variables, constructors,
26770         destructors, properties, constants is there.
26771
26772         Beginning of the IL backend, but very little done, just there for
26773         testing purposes. 
26774
26775 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26776
26777         * cs-parser.jay: Fix labeled statement.
26778
26779         * cs-tokenizer.cs (escape): Escape " and ' always.
26780         ref_line, ref_name: keep track of the line/filename as instructed
26781         by #line by the compiler.
26782         Parse #line.
26783
26784 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26785
26786         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26787         to match the values in System.CodeDOM.
26788
26789         Divid renamed to Divide.
26790
26791         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26792         statements. 
26793         (Statements.set): remove.
26794
26795         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26796         statements. 
26797
26798         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26799         falseStatements always have valid values. 
26800
26801         * cs-parser.jay: Use System.CodeDOM now.
26802