888dfd95ff408b9152b8ec8db0ad7cef8a3c3640
[mono.git] / mcs / mcs / ChangeLog
1 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2
3         ** C# 3.0 Anonymous Types (update to the latest standard)
4         
5         * expression.cs (Binary.ResolveOperator): Threat all null based types
6         same.
7         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
8         (AnonymousTypeParameter): Updated.
9         
10         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
11         (AnonymousTypeClass): New anonymous type container.
12         
13         * class.cs (AddField): Return operation result.
14         
15         * generic.cs: Another empty TypeArguments overload.
16         
17         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
18         are stored at top of normal hierarchy.
19         
20         * typemanager.cs (CSharpName): Filter anonymous types.
21         
22 2007-08-09  Marek Safar  <marek.safar@gmail.com>
23
24         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
25         as single Concat call. How could we miss that :-(
26         
27 2007-08-08  Marek Safar  <marek.safar@gmail.com>
28
29         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
30         
31 2007-08-07  Miguel de Icaza  <miguel@novell.com>
32
33         * expression.cs: Fix the previous commit, the creation of the
34         arguments array list needs also to be conditional on the arguments
35         not being null.
36
37         * class.cs: Add a little bit of help to help narrow down problems.
38
39         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
40         not try to copy in that case. 
41
42         * driver.cs: When building SMCS, include a new different set of
43         default assemblies here.   Do this here so we can control whether
44         to include the default assemblies with /noconfig.
45
46 2007-08-03  Marek Safar  <marek.safar@gmail.com>
47
48         A fix for bug #81979
49         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
50         only.
51
52 2007-08-03  Marek Safar  <marek.safar@gmail.com>
53
54         A fix for bug #82300
55
56         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
57         we are in probing scope.
58
59 2007-08-03  Marek Safar  <marek.safar@gmail.com>
60
61         A fix for bug #82301
62
63         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
64         (Statement.CloneTo): Clone and not map children blocks.
65
66 2007-08-03  Marek Safar  <marek.safar@gmail.com>
67
68         A fix for bug #82299
69
70         * expression.cs (LocalVariableReference.CloneTo): Remap local info
71         variable too.
72         
73         * statement.cs (Statement.CloneTo): Clone variables before statements
74         to allow remaping of local variables.
75
76 2007-08-03  Marek Safar  <marek.safar@gmail.com>
77
78         A fix for bug #82296
79
80         * anonymous.cs,
81         * report.cs: Log crash details for future clone problems.
82         
83         * statement.cs (Return.Clone): Don't clone non-existent expression.
84
85 2007-08-03  Raja R Harinath  <harinath@gmail.com>
86
87         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
88         (Class.AddBasesForPart): Move CS0537 check here from ...
89         * cs-parser.jay (class_declaration): ... here.  Move calling of
90         'AddBasesForPart' to ...
91         (class_bases): ... here.
92         (struct_declaration, interface_declaration): Update to changes.
93
94 2007-08-02  Marek Safar  <marek.safar@gmail.com>
95
96         A fix for bug #81923
97
98         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
99         conversion is allowed.
100
101 2007-08-02  Marek Safar  <marek.safar@gmail.com>
102
103         A fix for bug #81564
104
105         * ecore.cs (EventExpr): Add IsBase handling.
106
107         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
108         too.    
109         
110 2007-08-02  Raja R Harinath  <harinath@gmail.com>
111
112         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
113         * cs-parser.jay: Some whitespace cleanups.
114         (current_delegate): New.
115         (type_name): New.
116         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
117         a dummy code block, and use 'type_name' instead of 'member_name'.
118         (interface_declaration, class_declaration): Likewise.
119         (delegate_declaration): Likewise.  Rearrange slightly and use
120         'current_delegate'.
121         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
122         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
123
124 2007-08-02  Marek Safar  <marek.safar@gmail.com>
125
126         A fix for bug #82039
127
128         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
129         available.
130
131         * typemanager.cs (CSharpName): Split to string overload.
132
133 2007-08-02  Marek Safar  <marek.safar@gmail.com>
134
135         * expression.cs,
136         * report.cs: Updated warning CS0472.
137
138 2007-08-01  Marek Safar  <marek.safar@gmail.com>
139
140         A fix for bug #82181
141         * cs-parser.jay,
142         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
143
144 2007-08-01  Marek Safar  <marek.safar@gmail.com>
145
146         A fix for bug #82277
147         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
148
149 2007-08-01  Marek Safar  <marek.safar@gmail.com>
150
151         ** C# 3.0 Type Inference (major bits are working)
152         
153         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
154         (.ImplicitStandardConversionExists): Uses compatible.
155         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
156         (.InferReturnType): New method.
157         (.Compatible): Refactored.
158         (.ResolveParameters): Uses factory to create resolved parameters.
159         (.CompatibleMethod): Add probing mode support.
160         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
161         clearly distinguish between 2 different operations.
162         (LambdaMethod): Moved to lambda.cs.
163         (AnonymousMethod): Removed unused fields and methods.
164         (AnonymousDelegate): Simplified.
165         
166         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
167         
168         * convert. cs (ImplicitConversionStandard): Compatible works differently.
169         
170         * delegate.cs (Delegate): New mehods to reduce code duplication.
171         (.GetConstructor): New method.
172         (.GetInvokeMethod): New method.
173         (DelegateCreation): Updated.
174         
175         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
176         does not exist.
177         (OverloadResolve): Made probing little bit faster.
178         
179         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
180         when probing is on.
181         
182         * generic.cs (TypeInferenceContext): Dummy implementation.
183         
184         * iterators.cs: Updated after Resolve/Define rename.
185         
186         * lambda.cs (LambdaExpression)
187         (.ResolveParameters): Handles both type of arguments and type inference too.
188         
189         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
190         (InflateTypes): Updated.
191         
192         * support.cs (InflateTypes): Changed signature and updated.
193         
194         * typemanager.cs (LookupMemberCache): Better dynamic type check.
195         (MemberLookup_FindMembers): More MS tricks.
196         (GetParameterData): Ditto.
197         (GetDelegateParameters): Uses quick path for dynamic types.
198         
199 2007-08-01  Marek Safar  <marek.safar@gmail.com>
200
201         * class.cs (MethodData.Define): EmitContext is required for generic stuff
202         only.
203
204 2007-07-31  Marek Safar  <marek.safar@gmail.com>
205
206         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
207         syntax.
208         
209 2007-07-26  Jb Evain  <jbevain@novell.com>
210
211         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
212         which takes a boolean 'report_errors', similar to the GetMethod.
213         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
214         in .net 2.1, do not report errors here.
215
216         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
217         System.Runtime.CompilerServices.RequiredAttributeAttribute and
218         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
219         in .net 2.1.
220
221         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
222         of the type InternalsVisibleToAttribute before the first call
223         to CoreLookupType which is allowed to fail (third boolean parameter
224         to true). Because, during the resolution for a type that is not
225         immediately found, we try to check if the type is not defined in
226         a friend assembly, and to do so, we need the
227         InternalVisibleToAttribute.
228
229 2007-07-23  Miguel de Icaza  <miguel@novell.com>
230
231         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
232         feature that allows structs to be compared against null and inline
233         the result as true or false.
234
235         Notice that the same code is not permitted inside a generic block
236         of code that would do:
237
238         class Foo<T> where T : struct {
239             bool Eval (T x)
240             {
241                  return x == null;
242             }
243         }
244
245         It is only allowed if the type of T is not bound (no where
246         clause).   In my opinion, this CSC 2 behavior is broken but people
247         seem to be using it (IronRuby does, a few bug reports on bugzilla
248         have it and some people have complained about it).
249
250         All of the users that depend on this behavior have code that is
251         very likely broken. 
252         
253         * report.cs (Warning, Error): make these take object arguments,
254         not strings, as that allows us to take advantage of Format.
255
256 2007-07-20  William Holmes  <billholmes54@gmail.com>
257
258         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
259           Left member variable for the Count.
260         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
261           MemberName.CountTypeArguments to avoid a NRE. 
262
263         This code is contributed under the MIT X11 license
264
265 2007-07-18  Marek Safar  <marek.safar@gmail.com>
266
267         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
268
269 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
270
271         * doc.cs : generic method arguments are written as ``x while generic
272           type arguments are `x. Combined with the previous change, fixed bug
273           #79706.
274
275 2007-07-18  Raja R Harinath  <rharinath@novell.com>
276
277         Fix #82120
278         * expression.cs (Binary.ResolveOperator): When converting
279         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
280
281 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
282
283         * doc.cs : when T: or whatever x: is specified, it does not really
284           check the doc comment's syntax correctness. Fixed bug #82006.
285
286 2007-07-18  Marek Safar  <marek.safar@gmail.com>
287
288         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
289         LambdaExpression better.
290         
291         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
292         
293         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
294         
295         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
296         as it can be generated.
297         
298         * expression.cs (Invocation.Error_InvalidArguments): Show correct
299         modifiers.
300         
301         * lambda.cs (LambdaExpression): Refactored to share same code with
302         AnonymousMethodExpression.
303         
304 2007-07-17  Marek Safar  <marek.safar@gmail.com>
305
306         * anonymous.cs (MakeName): Include host name for easier debugging.
307         (LambdaMethod): New class for lambda spcecific stuff.
308         
309         * attribute.cs: Set EmitContext return type.
310
311         * class.cs: Set EmitContext return type.
312         
313         * codegen.cs (EmitContext): Return type cannot be null to stop messing
314         with null/void meaning.
315         
316         * iterators.cs (ContainerType): Implemented.
317         
318         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
319         
320         * statement.cs (Return): Updated to lambda expressions.
321         (Block.CloneTo): Parent can be null.
322                 
323 2007-07-13  Marek Safar  <marek.safar@gmail.com>
324
325         A fix for bug #81917
326         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
327         
328         * class.cs (FixedField): Check whether field is in unsafe scope.
329
330         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
331         (FieldExpr.Emit): Fixed buffers cannot be volatile.
332
333         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
334         FieldExpr.
335         
336         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
337                 
338 2007-07-13  Marek Safar  <marek.safar@gmail.com>
339
340         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
341         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
342         from Report class.
343
344 2007-07-13  Marek Safar  <marek.safar@gmail.com>
345
346         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
347         
348 2007-07-13  Marek Safar  <marek.safar@gmail.com>
349
350         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
351         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
352         
353         * codegen.cs(EmitContext): Add ProbingMode flag.
354         
355         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
356         
357         * driver.cs: For now set both warning values.
358         
359         * ecore.cs (SimpleName): Name is readonly.
360         (MethodGroup.OverloadResolve): One quick path for probing.
361         
362         * expression.cs (Unary): Set Oper r/o.
363         (Binary): Set Oper r/o.
364         (ParameterReference): Set few instance variables as r/o.
365         (ParameterReference.DoResolveBase): Don't capture aruments when 
366         the probing is on.
367         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
368         (Arglist): arguments are private.
369         (SizeOf): type is private and r/o.
370         (MemberAccess): arguments are private.
371
372         * report.cs: Enhanced reporting on/off capabilities.
373         
374         * lambda.cs: Uses ec.IsInProbingMode.
375         (ContextualReturn): Derives from return.
376         
377         * rootcontext.cs: For now set both warning values.
378         
379         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
380         copy if one exists.
381         (Return.Resolve): Don't die immediately.
382         (Block.Resolve): Speed-up probing.
383         (Block.CloneTo): Clone only child blocks.
384
385 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
386
387         * iterators.cs: reverted Miguel's latest change (r81925) as it
388         breaks the build in System.
389
390 2007-07-13  Miguel de Icaza  <miguel@novell.com>
391
392         * iterators.cs (Yield.CheckContext): Check for the iterator type
393         also here as we can call into Yield even in codepaths that are not
394         directly checked by
395         (MethodOrOperator is the only path that was checked).
396
397         In addition to the standard check, use a more specific check for
398         constructors to report a more verbose error. 
399
400 2007-07-12  Miguel de Icaza  <miguel@novell.com>
401
402         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
403         report the warning and continue 
404
405         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
406         values on the stack on the call to Emit.   Use EmitStatement if
407         possible, or using Emit + Pop if not possible.   Fixes #82064
408
409 2007-07-12  Raja R Harinath  <rharinath@novell.com>
410
411         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
412         avoid try...finally in some cases.
413
414 2007-07-10  Marek Safar  <marek.safar@gmail.com>
415
416         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
417         
418         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
419         instead of method. Re-use standard error handling.
420         (ConstructorInitializer.Emit): Simplified.
421         
422         * delegate.cs: Updated after Invocation.EmitCall change.
423         
424         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
425         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
426         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
427         method and don't permanently changing input arguments.
428         (MethodGroupExpr): Introduced resolved best_candidate, when method group
429         is resolved it has one of the candidates is the best one which is later
430         used to emit. Removed a few unused method.
431         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
432
433         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
434         (Binary.ResolveOperator): Ditto.
435         (ConditionalLogicalOperator.DoResolve): Ditto.
436         (Invocation): Uses method group.
437         (Invocation.DoResolve): Simplified.
438         (Invocation.EmitCall): Removed useless is_static.
439         (Invocation.Emit): Delegate to method group.
440         (Invocation.EmitStatement): Simplified.
441         (New): Uses method group.
442         (MemberAccess.DoResolve): Don't destroy original expression.
443         
444         * statement.cs (ForEach.Resolve): Use null for no method arguments.
445         
446 2007-07-04  Marek Safar  <marek.safar@gmail.com>
447
448         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
449         
450         * anonymous.cs,
451         * lambda.cs: Add custom error message type.
452
453 2007-07-03  Marek Safar  <marek.safar@gmail.com>
454
455         * lambda.cs: Simplified little bit.
456         
457         * parameter.cs: Introduced ImplicitLambdaParameter.
458         (Parameters.CreateFullyResolved): New factory instead of ctor.
459         
460         * anonymous.cs,
461         * class.cs,
462         * delegate.cs: Updated parameter creation.
463         
464 2007-07-03  Marek Safar  <marek.safar@gmail.com>
465
466         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
467         arguments.
468         
469         * generic.cs: Synchronized with gmcs.
470         
471 2007-07-03  Marek Safar  <marek.safar@gmail.com>
472
473         * class.cs (Indexer): Check return type as soon as possible.
474         
475         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
476         members too.
477         
478         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
479         
480         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
481         
482         * parameter.cs (Parameter): Use expression type when it is available.
483         
484         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
485         method modifier for the first parameter only.
486
487 2007-06-24  Marek Safar  <marek.safar@gmail.com>
488
489         A fix for bug #81938
490         * typemanager.cs (ChangeType): Fixed couple of char conversions.
491         
492         * constant.cs: Tide up an exception message.
493
494 2007-06-22  Marek Safar  <marek.safar@gmail.com>
495
496         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
497         an uninitialized variable is used.
498         
499         * expression.cs (LocalVariableReference.DoResolve): Ditto.
500
501 2007-06-22  Marek Safar  <marek.safar@gmail.com>
502
503         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
504         not found error handling.
505
506         * expression.cs (ArrayCreation): Removed redundant fields and little bit
507         simplified.
508         (ArrayCreation.ResolveArrayElement): To be ready to customization.
509         (ArrayCreation.DoResolve): Simplified.
510         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
511         its own resolve process.
512         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
513
514 2007-06-20  Marek Safar  <marek.safar@gmail.com>
515
516         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
517         more error details.
518         
519 2007-06-20  Marek Safar  <marek.safar@gmail.com>
520
521         * cs-tokenizer.cs: Removed var related stuff.
522         
523         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
524         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
525         a type and a keyword at same time.
526         
527         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
528         matches to "var".
529         
530         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
531         implicitly typed arrays, more changes will follow.
532         
533         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
534         
535 2007-06-19  Marek Safar  <marek.safar@gmail.com>
536
537         * ecore.cs (VarExpr): Removed Handled field.
538         
539         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
540         build-in assign functionality.
541         (ForEach.Resolve): Removed all implicitly typed local variable code and
542         simplified.
543         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
544         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
545
546 2007-06-18  Marek Safar  <marek.safar@gmail.com>
547
548         * assign.cs: Removed implicitly typed local variable check.
549         
550         * expression.cs (LocalVariableReference.DoResolve): Add check for self
551         referencing implicitly typed local variable.
552         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
553         variable here.
554         
555         * statement.cs (Fixed): Removed unsupported implicitly typed local
556         variable code.
557
558 2007-06-15  Marek Safar  <marek.safar@gmail.com>
559
560         * decl.cs (MemberName): Moved all Unbound stuff to parser.
561
562 2007-06-14  Marek Safar  <marek.safar@gmail.com>
563
564         A fix for bugs #81855 and #76274
565         * attribute.cs (AttachTo): Always set owner for global attributes to
566         prefined owner.
567         
568         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
569         usefull too.
570         
571         * cs-parser.jay: Assembly and module attributes must precede all other
572         elements except using clauses and extern alias declarations.
573
574 2007-06-13  Marek Safar  <marek.safar@gmail.com>
575
576         A fix for bug #81748
577         * cs-tokenizer.cs,
578         * expression.cs: More checks for non ISO-1 features.
579
580 2007-06-12  Marek Safar  <marek.safar@gmail.com>
581
582         A fix for bug #81807
583         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
584         present inside switch statement and it is required by nullable check.
585
586 2007-06-12  Marek Safar  <marek.safar@gmail.com>
587
588         A fix for bug #81840
589         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
590         when type matching fails.
591         
592         * namespace.cs: Tiny error message change.
593
594 2007-06-12  Marek Safar  <marek.safar@gmail.com>
595
596         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
597         reporting. Added automatic property check.
598         
599         * class.cs: Updated after CheckAbstractAndExtern relocation.
600         (AEventPropertyAccessor.GetSignatureForError): Customized.
601         
602 2007-06-11  Marek Safar  <marek.safar@gmail.com>
603
604         * class.cs (DefineBaseTypes): Base type can be undefined.
605         
606         * ecore.cs (TypeLookup): Minor refactoring.
607         (DoResolveAsTypeStep): Removed redundant check.
608
609         * namespace.cs (Lookup): Removed redundant check.
610                 
611         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
612         ResolveAsTypeTerminal step.
613         (BootstrapCorlib_*): Simplified.
614         (PopulateCoreType): Core types can be now external.
615
616 2007-06-07  Marek Safar  <marek.safar@gmail.com>
617
618         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
619          verification only.
620          (InferTypeArguments): Infers anonymous expression type arguments.
621          (Compatible): Split to Compatible and InferTypeArguments. 
622         
623         * lambda.cs: Updated.
624
625 2007-06-08  Marek Safar  <marek.safar@gmail.com>
626
627         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
628
629 2007-06-07  Raja R Harinath  <harinath@gmail.com>
630
631         Fix #80477, cs0135-2.cs, cs0135-3.cs
632         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
633         names to the "known" variables list.
634         (Block.CheckInvariantMeaningInBlock): Handle the fact the
635         parameter names are also "known".
636         (Block.CheckError136): Remove.
637         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
638         null.
639
640 2007-06-07  Marek Safar  <marek.safar@gmail.com>
641
642         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
643
644 2007-06-06  Marek Safar  <marek.safar@gmail.com>
645
646         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
647         internal error not an user error.
648          
649         * expression.cs (IsApplicable): Refactored to make debugging easier.
650
651         * support.cs: More tricks for non-mono runtimes.
652         
653         * typemanager.cs (CoreLookupType): Made public.
654         (InitSystemCore): All linq specific stuff moved to linq.cs
655
656 2007-06-05  Marek Safar  <marek.safar@gmail.com>
657
658         * typemanager.cs (CSharpSignature): One more missing build-in types
659         replacement.
660         More tricks for non-mono runtime.
661
662 2007-06-05  Raja R Harinath  <harinath@gmail.com>
663
664         * statement.cs (Block.CheckError136_InParents): Remove.
665         (Block.AddVariable): Use GetParameterInfo instead.
666         (ToplevelBlock.ProcessArguments): Likewise.
667
668 2007-06-04  Raja R Harinath  <rharinath@novell.com>
669
670         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
671         information too.
672         (ToplevelBlock.GetParameterInfo): Split out of ...
673         (ToplevelBlock.GetParameterRefernce): ... this.
674         (ToplevelBlock.ParameterMap): Remove.
675         * expression.cs (ParameterReference): Update to use
676         ToplevelParameterInfo.
677
678         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
679         regression.
680
681         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
682         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
683
684         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
685         (ToplevelBlock.ProcessParameters) ... here.
686         (ToplevelBlock..ctor): Invoke it.
687
688         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
689         new parameters.
690
691         * statement.cs (IKnownVariable): New interface.
692         (LocalInfo): Implement it.
693         (ToplevelParameterInfo): New class.
694         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
695         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
696         GetKnownVariableInfo.
697
698 2007-06-03  Raja R Harinath  <harinath@gmail.com>
699
700         Partly speed up CS0136 error checks.
701         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
702         'recurse' parameter.
703         (Block.DoCheckError136): Only check errors in parameters.  Move
704         local variable checks ...
705         (Block.AddVariable): ... here, and ...
706         (ToplevelBlock.ResolveMeta): ... here.
707
708 2007-06-02  Raja R Harinath  <harinath@gmail.com>
709
710         * statement.cs (Block.IsChildOf): Remove.
711
712         * statement.cs (Statement.Clone): Move special case code ...
713         (Block.CloneTo): ... here.
714
715 2007-05-29  Raja R Harinath  <rharinath@novell.com>
716
717         * statement.cs (ToplevelBlock.container): Remove field.  It's
718         redundant with 'Parent'.
719         (ToplevelBlock.ContainerBlock): Remove accessor.
720         (ToplevelBlock..ctor): Update to changes.  Register anonymous
721         child with parent here, ...
722         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
723         current_block.
724         (start_anonymous): Don't save current_block.
725         (top_current_block): Remove.
726
727         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
728         (Block.Resolve): Update to changes.
729         (Block..ctor): Move setting of "correct" 'Toplevel'
730         and 'Explicit' fields to ...
731         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
732
733 2007-05-27  Raja R Harinath  <harinath@gmail.com>
734
735         Kill Block.Implicit
736         * statement.cs (Block.Implicit): Remove.
737         (Block): Update to changes.
738         * flowanalysis.cs: Likewise.
739
740         Mildly speed up CheckInvariantMeaningInBlock
741         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
742         Recursively call AddKnownVariable to all enclosing blocks.
743         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
744         Remove recursive calls.
745         (Block): Update to changes.
746
747         New ExplicitBlock invariants
748         * statement.cs (Block.Explicit): New field.  It points to the
749         immediately enclosing non-implicit block.
750         (Block..ctor): Maintain the invariant.
751         * cs-parser.jay: Take advantage of invariant.
752
753         Introduce ExplicitBlock
754         * statement.cs (ExplicitBlock): New.
755         (ToplevelBlock): Derive from it.
756         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
757         sense of flag.
758         (Block.Implicit): Update to changes.
759         * cs-parser.jay: Update to changes.
760
761         Remove unused field
762         * codegen.cs (EmitContext.IsLastStatement): Remove.
763         * statement.cs (Block.DoEmit): Update to changes.
764
765 2007-05-25  Raja R Harinath  <rharinath@novell.com>
766
767         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
768         modifying current_block directly.
769
770 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
771         
772         * class.cs: Implemented automatic properties (C# 3.0)
773           Thanks to Marek for the help.
774
775 2007-05-23  Raja R Harinath  <rharinath@novell.com>
776
777         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
778         variable as assigned, note also that all its components are
779         assigned too.
780         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
781
782 2007-05-19  Marek Safar  <marek.safar@gmail.com>
783
784         * anonymous.cs, class.cs: Emit Compiler generated attribute when
785         member is marked as compiler generated.
786         
787         * decl.cs (MemberCore): Refactored ModFlags into property.
788
789         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
790         (Check): Check only accessibility modifiers.
791
792 2007-05-18  Raja R Harinath  <rharinath@novell.com>
793
794         Track all assignable slots in one bit array
795         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
796         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
797         logic from VariableMap constructor here.  Use the same 'offset'
798         variable that's later used for computing offsets of local
799         variables.
800         * flowanalysis.cs (UsageVector.parameters): Remove.
801         (UsageVector): Update to changes.
802         (VariableMap): Remove.
803
804         Avoid creating ParameterMap in every block
805         * statement.cs (Block.ParameterMap): Move ...
806         (ToplevelBlock.ParameterMap): ... here.
807         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
808         only once.
809         * flowanalysis.cs (FlowBranching.param_map): Remove.
810         (FlowBranching.UsageVector): Update to changes.
811         (FlowBranchingToplevel.CheckOutParameters): Likewise.
812
813         * statement.cs (Block.CloneTo): Clone Toplevel field too.
814
815         * expression.cs (ParameterReference): Distinguish between block
816         where parameter was referenced and declared.
817
818 2007-05-18  Marek Safar  <marek.safar@gmail.com>
819
820         * flowanalysis.cs, statement.cs: Put back improved error handling.
821
822 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
823         
824         * assign.cs:
825         * expression.cs:
826           Imporved object and collection initialization (C# 3.0).
827
828 2007-05-15  Marek Safar  <marek.safar@gmail.com>
829
830         A fix for bug #81380
831         * expression.cs (Is.DoResolve): Only value types have constant `is'
832         behaviour.
833
834 2007-05-15  Raja R Harinath  <rharinath@novell.com>
835
836         * statement.cs (ToplevelBlock.child): Remove.
837
838 2007-05-15  Raja R Harinath  <harinath@gmail.com>
839
840         Rationalize ResolveMeta: refactoring
841         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
842         out constant handling code into ...
843         (Block.DoResolveConstants): ... this.
844
845         Rationalize ResolveMeta: kill local_map
846         * statement.cs (Block.local_map, Block.LocalMap): Remove.
847         (Block.AssignableSlots): New.
848         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
849         for locals -- move code from VariableMap here.  Avoid unnecessary
850         allocations.
851         * flowanalysis.cs (FlowBranching.local_map): Remove.
852         (FlowBranching..ctor): Use Block.AssignableSlots.
853         (VariableMap): Remove unused constructors.
854
855 2007-05-11  Raja R Harinath  <rharinath@novell.com>
856
857         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
858
859 2007-05-11  Marek Safar  <marek.safar@gmail.com>
860
861         * typemanager.cs (IsFriendAssembly): Should not be called for building
862         assembly.
863
864 2007-05-09  Marek Safar  <marek.safar@gmail.com>
865
866         * literal.cs (NullConstant): Print null in all cases.
867         
868         * expression.cs (Binary.ResolveOperator): Implemented delegate
869          comparison based on C# 2.0 changes.
870
871 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
872
873         This code is contributed under the MIT X11 license
874         
875         The following enables support for several C# 3.0 language features:
876         
877         * cs-tokenizer.cs: Added support for the "var" keyword.
878         
879         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
880           Added VarExpr class to facilitate type inferencing.
881         
882         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
883           to support anonymous types.
884         
885         * assign.cs: Added support for type inferencing and initialization.
886         
887         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
888         
889         * expression.cs: Added implicit array support to ArrayCreation.
890           Added 5 types and 1 interface:
891           
892           IInitializable                Implementing classes can inject initializing
893                                         statements after object instantiation.
894           
895           Initializer                   Stores data for object initialization.
896           
897           AnonymousType                 An expression for anonymous types.
898           
899           AnonymousTypeParameter        Stores data about an anonymous type's field.
900           
901           NewInitialize                 An expression for object initialization.
902           
903           CollectionInitialize          An expression for collection initialization.
904         
905         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
906           statements.
907
908 2007-05-06  Marek Safar  <marek.safar@gmail.com>
909
910         A fix for bug #81500
911         * cs-tokenizer.cs: Add special handling for coalescing operator.
912
913 2007-05-06  Marek Safar  <marek.safar@gmail.com>
914
915         A fix for bug #81529
916         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
917         its value from base class until it is redefined.
918
919 2007-05-02  Raja R Harinath  <rharinath@novell.com>
920
921         Fix regression in cs0631-3.cs
922         * cs-parser.jay (operator_declarator): Add opt_attributes to error
923         fallback.  Make error fallback catch more cases.
924
925 2007-05-01  Miguel de Icaza  <miguel@novell.com>
926
927         * cs-parser.jay: Allow parameters in operator declarations to have
928         attributes. 
929
930 2007-04-27  Miguel de Icaza  <miguel@novell.com>
931
932         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
933         exists. 
934
935         * lambda.cs (ContextualReturn.Resolve): An expression is valid
936         inside the ContextualReturn, it does not have to be an
937         ExpressionStatement. 
938
939 2007-04-24  Miguel de Icaza  <miguel@novell.com>
940
941         * lambda.cs (ContextualReturn.Resolve): if the return type is not
942         set, set it.
943
944 2007-04-23  Miguel de Icaza  <miguel@novell.com>
945
946         * anonymous.cs (AnonymousContainer): split the virtual Resolve
947         method in two methods: ResolveNoDefine and Resolve.
948
949         ResolveNoDefine will stop just after ResolveTopBlock has been
950         called.   
951
952         Resolve will then continue by creating a method and issuing the
953         call to method.Define ().
954
955         (AnonymousMethod): Split and implement the new Resolve and
956         ResolveNoDefine as well.
957
958         * lambda.cs (LambdaExpression): Split the anonymous method
959         resolution code into a separate routine (CoreCompatibilityTest)
960         from DoCompatibleTest.
961
962         (LambdaExpression.TryBuild): New method, this method tries to
963         build the LambdaExpression with the given set of types to be used
964         as the types for the various parameters of the lambda expression. 
965
966         If the compilation succeed with the given types, the infered type
967         of the Anonymous method is returned, otherwise null is returned.
968
969 2007-04-23  Marek Safar  <marek.safar@gmail.com>
970
971         A fix for bug #81414
972         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
973
974 2007-04-22  Miguel de Icaza  <miguel@novell.com>
975
976         * cs-tokenizer.cs: Change various identifiers here from the
977         camelCasing to the recommended Linux-like style for instance
978         variables from the Coding Guidelines. 
979
980 2007-04-19  Martin Baulig  <martin@ximian.com>
981
982         * convert.cs
983         (Convert.ImplicitReferenceConversionCore): Allow conversions from
984         System.Enum to System.ValueType.
985
986 2007-04-13  Martin Baulig  <martin@ximian.com>
987
988         Rewrote implicit reference conversions.  We need to distinguish
989         between implicit reference conversions (13.1.4) and implicit
990         boxing conversions (13.1.5).
991
992         According to the spec, there's an an implicit conversion
993         "From a one-dimensional array-type S[] to IList<T> and base
994         interfaces of this interface, provided there is an implicit
995         reference conversion from S to T."  Note that this does not
996         include boxing conversions.
997
998         * convert.cs
999         (Convert.ImplicitTypeParameterBoxingConversion): New method.
1000         (Convert.ImplicitReferenceConversion): Split into
1001         ImplicitReferenceConversionCore() and
1002         ImplicitBoxingConversionExist().
1003         (Convert.ImplicitReferenceConversionExists): Use the new
1004         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
1005
1006 2007-04-12  Martin Baulig  <martin@ximian.com>
1007
1008         * convert.cs (Convert.ImplicitReferenceConversion): Move the
1009         `TypeManager.null_type' checks up to the top of the method.
1010
1011 2007-04-11  Marek Safar  <marek.safar@gmail.com>
1012
1013         A fix for bug #81350
1014         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
1015         extension methods.
1016
1017 2007-04-11  Martin Baulig  <martin@ximian.com>
1018
1019         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
1020         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
1021         to make this work for generic classes; fixes #79561.
1022
1023 2007-04-11  Martin Baulig  <martin@ximian.com>
1024
1025         * expression.cs (As): Add support for nullable types; fixes #79371.
1026
1027 2007-04-11  Martin Baulig  <martin@ximian.com>
1028
1029         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
1030         `type.FullName' is null; fixes #80243.
1031
1032 2007-04-11  Martin Baulig  <martin@ximian.com>
1033
1034         * expression.cs (Invocation.IsApplicable): Don't modify the method
1035         if type inference succeeded, but the method was not applicable.
1036         Fixes #81250.
1037
1038 2007-04-10  Marek Safar  <marek.safar@gmail.com>
1039
1040         A fix for bug #81324
1041         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
1042         internal and external namespaces containers.
1043
1044 2007-04-10  Martin Baulig  <martin@ximian.com>
1045
1046         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
1047         TypeManager.DropGenericMethodArguments() so we also call
1048         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
1049
1050 2007-04-10  Martin Baulig  <martin@ximian.com>
1051
1052         * iterators.cs (Iterator.CreateIterator): Don't crash if
1053         `method.ReturnType' is null.  This happens if something went wrong
1054         while resolving that typ (we already reported an error in this case).
1055
1056 2007-04-10  Martin Baulig  <martin@ximian.com>
1057
1058         * expression.cs (New.DoResolve): Don't call CheckComImport() on
1059         generic interfaces; report the CS0144 directly.
1060
1061 2007-04-10  Martin Baulig  <martin@ximian.com>
1062
1063         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
1064         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
1065
1066 2007-04-10  Martin Baulig  <martin@ximian.com>
1067
1068         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
1069
1070 2007-04-09  Raja R Harinath  <rharinath@novell.com>
1071
1072         A better fix
1073         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
1074         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
1075
1076         Fix #81338
1077         * statement.cs (For.Resolve): If resolution fails, use
1078         KillFlowBranching.
1079
1080 2007-04-08  Marek Safar  <marek.safar@gmail.com>
1081
1082         * anonymous.cs (MakeName): Make faster and zero-based.
1083         (VerifyExplicitParameterCompatibility): Back to mode where generic
1084         parameter is ignored.
1085         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
1086
1087         * class.cs (EmitType): Method can emit another new method.
1088
1089         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
1090
1091         * driver.cs: Updated.
1092
1093         * lambda.cs: Reuse predefined empty parameters.
1094
1095         * parameter.cs: Updated
1096
1097         * support.cs: Implemented InflateTypes.
1098
1099         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
1100         (InitSystemCore): Introduced to isolate 3.0 dependencies.
1101
1102 2007-04-03  Martin Baulig  <martin@ximian.com>
1103
1104         Fix #80632.
1105
1106         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
1107         version of TypeManager.IsOverride() which also works with generic
1108         types.  
1109
1110 2007-04-03  Martin Baulig  <martin@ximian.com>
1111
1112         Fix #81044.
1113
1114         * convert.cs
1115         (Convert.ExplicitReferenceConversion): We need to cast when
1116         converting from IList<T> to S[].
1117
1118 2007-04-01  Marek Safar  <marek.safar@gmail.com>
1119
1120         * decl.cs (FindExtensionMethods): Consider all candidates with same name
1121         at this level.
1122         
1123         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
1124
1125 2007-03-31  Marek Safar  <marek.safar@gmail.com>
1126
1127         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
1128         argument and return type inferring.
1129
1130         * codegen.cs (InferReturnType): Flag whether return can be inferred.
1131         (ReturnType): Turned to property.
1132
1133         * statement.cs (Return): Implemented return type inferring.
1134
1135         * support.cs (ReflectionParameters): Use local types if possible.
1136
1137 2007-03-30  Raja R Harinath  <rharinath@novell.com>
1138
1139         * flowanalysis.cs (FlowBranching.Reachability): Remove.
1140         (FlowBranching.UsageVector): Update to changes.
1141
1142         Prepare to kill 'Reachability'
1143         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
1144         argument of constructor.
1145
1146 2007-03-29  Raja R Harinath  <rharinath@novell.com>
1147
1148         Prepare to kill 'Reachability'
1149         * flowanalysis.cs (UsageVector.is_unreachable): New.
1150         (UsageVector): Update to maintain 'is_unreachable' in parallel to
1151         'reachability', and verify they're consistent.
1152
1153         Fix #81121
1154         * expression.cs (New.EmitStatement): Handle type parameters here too.
1155
1156 2007-03-29  Martin Baulig  <martin@ximian.com>
1157
1158         Fix #79148.
1159
1160         * anonymous.cs
1161         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
1162         CompilerGeneratedClass.
1163         (ScopeInfo.EmitScopeInstance): Make this protected.
1164         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
1165         `ec.CurrentAnonymousMethod.Scope == Scope'.
1166
1167         * statement.cs (Block.ScopeInfo): Make this a property.
1168
1169 2007-03-27  Raja R Harinath  <harinath@gmail.com>
1170
1171         Prepare to kill 'Reachability'
1172         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
1173         (FlowBranching.UsageVector.Reachability): Remove property.
1174         (FlowBranching.UsageVector.IsUnreachable): New property.
1175         (FlowBranching.UsageVector.ResetBarrier): New.
1176         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
1177         * codegen.cs, statement.cs: Update to changes.
1178
1179 2007-03-27  Martin Baulig  <martin@ximian.com>
1180
1181         Fix #81209.
1182
1183         * decl.cs
1184         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
1185         generic types.
1186
1187 2007-03-26  Raja R Harinath  <rharinath@novell.com>
1188
1189         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
1190         instead of TriState.  Remove all mention of TriState.
1191
1192         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
1193         replaced by a boolean.  Add boolean 'is_unreachable' field, check
1194         and maintain invariants.
1195
1196 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1197
1198         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
1199
1200 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1201
1202         * expression.cs: Stop using obsolete 2.0 opcodes.
1203
1204 2007-03-25  Marek Safar  <marek.safar@gmail.com>
1205
1206         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
1207         one of the latests Martin's fixes.
1208
1209 2007-03-23  Miguel de Icaza  <miguel@novell.com>
1210
1211         * expression.cs: On BigEndian systems, swap the bytes, temporary
1212         solution until we get a new bitconverter class.
1213
1214 2007-03-23  Martin Baulig  <martin@ximian.com>
1215
1216         Fix #81158.
1217
1218         * decl.cs (MemberCache.AddMembers): Add generic methods both as
1219         "Method" and "Method`1".  Normally, a cache lookup is done on the
1220         "Method" form (ie. without the generic arity), but this one makes
1221         lookups on the full form work as well.
1222
1223 2007-03-22  Raja R Harinath  <rharinath@novell.com>
1224
1225         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
1226         unused properties.
1227
1228 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
1229         * class.cs: 
1230         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
1231         ordered_member_list, to TypeBuilder to store members to be defined
1232         in the order they were parsed in.
1233         - ordered_explicit_member_list contains all properties indexers
1234           and methods that are defined as explicit implementation of an
1235           interface or base class.
1236         - ordered_member_list contains all properties indexers and methods
1237           that are not defined as explicit implementation of an interface
1238           or base class.
1239
1240         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
1241         functionality in these removed classes has been replaced with 
1242         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
1243         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
1244
1245         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
1246         to CheckForDuplications inside GetMethod and SetMethod Define Method
1247         to handle method property and indexer name conflicts.
1248
1249         Fixes #79434
1250
1251         All code is contributed under the MIT/X11 license.
1252
1253 2007-03-20  Martin Baulig  <martin@ximian.com>
1254
1255         * class.cs (TypeContainer.Interfaces): Removed; they're now
1256         included in `TypeContainer.Types'.
1257
1258 2007-03-20  Martin Baulig  <martin@ximian.com>
1259
1260         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
1261
1262         * class.cs (TypeContainer.CreateType): New public method.  This is
1263         now called before DefineType() to create the TypeBuilders.
1264         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
1265         has already been created by CreateType().
1266         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
1267         don't resolve our base classes here; this has been moved into
1268         DefineBaseTypes().  We're now called from CreateType().
1269         (TypeContainer.DefineBaseTypes): New private method; resolve our
1270         base classes here.  We're now called from DefineType().
1271
1272         * rootcontext.cs
1273         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
1274         our types first to create all the TypeBuilders.  After that, call
1275         TypeContainer.DefineType() on all the types which'll resolve their
1276         base classes and setup the resolve order.
1277
1278 2007-03-20  Martin Baulig  <martin@ximian.com>
1279
1280         * class.cs (TypeContainer.Enums): Removed; they're now included in
1281         `TypeContainer.Types'.  
1282
1283 2007-03-20  Martin Baulig  <martin@ximian.com>
1284
1285         * class.cs
1286         (TypeContainer.DefineType): Don't call ResolveMembers() here.
1287         (TypeContainer.DoResolveMembers): Call DefineType() on our
1288         `compiler_generated' classes; moved here from DefineNestedTypes().
1289
1290         * rootcontext.cs
1291         (RootContext.ResolveTree): Call ResolveMembers() on all
1292         TypeContainer's in the `type_container_resolve_order'.
1293
1294 2007-03-19  Marek Safar  <marek.safar@gmail.com>
1295
1296         * class.cs: Use corlib to handle InternalMethodImplAttribute.
1297
1298 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1299
1300         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
1301         implementation flags.
1302
1303 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1304
1305         * class.cs: More optimizations for type parameters.
1306
1307 2007-03-15  Marek Safar  <marek.safar@gmail.com>
1308
1309         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
1310
1311         * ecore.cs, parameter.cs: More common code for both corlibs.
1312
1313         * typemanager.cs (IsGenericMethod): Simplified.
1314
1315 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1316
1317         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1318         'returns'.
1319         * statement.cs, iterators.cs, lambda.cs: Update to changes.
1320
1321         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
1322         unconditionally.  Simplify explanation.
1323         (Try.Resolve, Using.Resolve): Likewise.
1324
1325 2007-03-15  Martin Baulig  <martin@ximian.com>
1326
1327         Fix #80731.
1328
1329         * decl.cs (DeclSpace): If we're a partial class, use our
1330         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
1331
1332 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1333
1334         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1335         'throws'.
1336         (FlowBranching.UsageVector): Update to changes.
1337         (FlowBranching.MergeSiblings): Likewise.
1338         * statement.cs: Likewise.
1339
1340 2007-03-15  Martin Baulig  <martin@ximian.com>
1341
1342         Fix #79302.
1343
1344         * decl.cs
1345         (MemberCache): Added a special .ctor for type parameters.
1346
1347         * typemanager.cs
1348         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
1349         `MemberCache'.  
1350
1351 2007-03-09  Martin Baulig  <martin@ximian.com>
1352
1353         * enum.cs (Enum): Make this a TypeContainer.
1354         (EnumMember): Derive from `Const'.
1355
1356         * const.cs
1357         (Const.DoResolveValue): New protected virtual method; move most of
1358         the functionality of ResolveValue() here so we can override it in
1359         `EnumMember'.
1360         (Const.CreateConstantReference): Make this virtual.
1361
1362         * class.cs (Kind): Add `Kind.Enum'.
1363         (TypeContainer.Emit): Don't emit the enums here; they're already
1364         in the `RootContext.typecontainer_resolve_order'.
1365
1366         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
1367         here; they're already in the `typecontainer_resolve_order'.
1368
1369         * ecore.cs (EnumConstant.ConvertImplicitly): Add
1370         TypeManager.DropGenericTypeArguments().
1371
1372         * typemanager.cs
1373         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
1374         (TypeManager.IsEnumType): Likewise.
1375         (TypeManager.EnumToUnderlying): Likewise.
1376         (TypeManager.IsEqual): Add support for enums.
1377
1378 2007-03-12  Raja R Harinath  <rharinath@novell.com>
1379
1380         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
1381         DefaultParameterValueAttribute to be undefined, say if System.dll
1382         is not referenced.
1383
1384 2007-03-11  Marek Safar  <marek.safar@gmail.com>
1385
1386         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
1387         any mscorlib.
1388
1389 2007-03-10  Marek Safar  <marek.safar@gmail.com>
1390
1391         * class.cs, parameter.cs: Unified parameters verification.
1392
1393 2007-03-08  Martin Baulig  <martin@ximian.com>
1394
1395         * cs-parser.jay (constructor_header): Pass the location to the
1396         newly created TopLevelBlock.
1397
1398 2007-03-07  Martin Baulig  <martin@ximian.com>
1399
1400         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
1401
1402 2007-03-06  Miguel de Icaza  <miguel@novell.com>
1403
1404         * convert.cs (ExplicitReferenceConversionExists): Sync this method
1405         with the changes from David, fixes the build.
1406
1407 2007-03-05  David Mitchell  <dmitchell@logos.com>
1408
1409         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
1410         and its base interfaces to a one-dimensional array type S[],
1411         provided there is an implicit or explicit reference conversion
1412         from S to T.
1413
1414 2007-03-03  Marek Safar  <marek.safar@gmail.com>
1415
1416         * cs-tokenizer.cs: Implemented basic linq grammar.
1417
1418         * driver.cs: Set linq lang version on demand.
1419
1420 2007-02-26  Marek Safar  <marek.safar@gmail.com>
1421
1422         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
1423
1424 2007-02-25  Marek Safar  <marek.safar@gmail.com>
1425
1426         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
1427         (Fixes #80455)
1428
1429         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
1430         here.
1431         Check property and event extern attributes.
1432
1433         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
1434         charset.
1435
1436 2007-02-24  Marek Safar  <marek.safar@gmail.com>
1437
1438         A fix for bug #80407
1439         * ecore.cs: Don't report ambiguity error when methods have same parent.
1440
1441 2007-02-23  Marek Safar  <marek.safar@gmail.com>
1442
1443         A fix for bug #80878
1444         * class.cs, cs-parser.jay: Event property can host anonymous methods.
1445
1446 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1447
1448         * attribute.cs: Enable ExtensionAttribute presence test.
1449
1450 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1451
1452         * class.cs: Warn about missing GetHashCode only when Equals is override.
1453
1454         * decl.cs: Check accessibility of type arguments.
1455
1456         * typemanager.cs: Correctly report nullable array.
1457
1458 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1459
1460         * class.cs, report.cs: Capture more details when things go wrong.
1461
1462 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1463
1464         A fix for bug #80650
1465         * cs-parser.jay: Anonymous container starts at constructor declaration
1466         and not at block beginning because it has to be usable in constructor
1467         initializer.
1468
1469         * statement.cs: Use context location and not block one for error reporting.
1470
1471 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1472
1473         A fix for bug #78712
1474         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
1475         too.
1476
1477 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1478
1479         A fix for bug #80493 by Atsushi Enomoto
1480         * cs-parser.jay: Ignore invalid attribute target.
1481
1482 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1483  
1484         * cs-tokenizer.cs: Ignore '\0' as white space character.
1485
1486 2007-02-17  Miguel de Icaza  <miguel@novell.com>
1487
1488         * cs-parser.jay: Add support for lambda expressions to the mcs
1489         compiler as well.
1490
1491         * lambda.cs: Only clone when we are probing, not on the final call
1492         (Compatible is the final call). 
1493
1494         * statement.cs (CloneContext): Introduce class to provide block
1495         remapping during clone.
1496
1497         All statements Clone themselves now.
1498
1499         (Clone): special handling for blocks, when we clone a block, we
1500         register the block inside this routine, as children of the block
1501         might trigger a lookup. 
1502         
1503         * expression.cs: Add support for CloneContext in all expressions. 
1504         
1505 2007-02-17  Marek Safar  <marek.safar@gmail.com>
1506  
1507         A fix for bug #80493
1508         * statement.cs: Report ambiguous warning when interfaces are not related.
1509
1510 2007-02-15  Marek Safar  <marek.safar@gmail.com>
1511
1512         C# 3.0 extension methods.
1513
1514         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
1515         cannot be used directly.
1516
1517         * class.cs (Class.Emit): Emit extension attribute if any class method
1518         is extension method.
1519         (Method.Define): Add basic extension method validation conditions.
1520         (Method.Emit): Emit extension attribute for method.
1521
1522         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
1523         extension method exists. Currently we follow same approach as Microsoft
1524         does, emit even if a method or a class are private but this can change
1525         later.
1526
1527         * cs-parser.jay: Add handling of `this' keyword in method parameters
1528         context.
1529
1530         * decl.cs (DeclSpace.IsStaticClass): New property.
1531         (MemberCache.FindExtensionMethods): Looks for extension methods with
1532         defined name and extension type.
1533
1534         * doc.cs: Updated after OverloadResolve changes.
1535
1536         * driver.cs: Add new soft reference to System.Core.dll.
1537
1538         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
1539         (ExtensionMethodGroupExpr): Represents group of extension methods.
1540
1541         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
1542         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
1543         to MethodGroupExpr and made non-static for easier customization.
1544         (Invocation.DoResolve): Add extension method lookup when no standard
1545         method was found.
1546         (MemberAccess.DoResolve): Try extension methods if no member exists.
1547
1548         * modifiers.cs: Add METHOD_EXTENSION modifier.
1549
1550         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
1551         as well as candidate extension type.
1552         (ComputeNamespaces): When assembly constains extension methods registers
1553         them.
1554         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
1555         extension method lookup.
1556         (Namespace.LookupExtensionMethod): Looks for extension method in this
1557         namespace.
1558         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
1559         find a method which matches name and extensionType.
1560
1561         * parameter.cs (Parameter): Add This modifer.
1562         (HasExtensionMethodModifier): New property.
1563         (Resolve): Add extension parameter check.
1564         (ModFlags): turned to property to exclude this modifier as it is not real
1565         parameter modifier.
1566         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
1567
1568         * support.cs (ParameterData): Add ExtensionMethodType.
1569         (ReflectionParameters): Implemented ExtensionMethodType interface property.
1570
1571         * typemanager.cs: Add type and ctor extension attribute type.
1572
1573 2007-02-15  Miguel de Icaza  <miguel@novell.com>
1574
1575         * report.cs (DisableErrors, EnableErrors): used to prevent error
1576         output when we are "trying" to compile various methods with
1577         different types. 
1578
1579         * ecore.cs (Expression): Add Clone method that calls the virtual
1580         CloneTo method.  The current CloneTo method in Expression throws
1581         an exception so we can track down all the places where this must
1582         be implemented (not using abstract, because that would be a lot of
1583         up-front-work before we can start testing the implementation
1584         idea). 
1585
1586         Important: we only need Clone capabilities for expressions created
1587         by the parser, as the expressions we will be cloning are
1588         expressions in the pre-resolved state.   This vastly simplifies
1589         the work required. 
1590         
1591         (SimpleName): Add CloneTo that does nothing.
1592         (EmptyCast): Add CloneTo.
1593         
1594         * expression.cs (Binary): Implement CloneTo.
1595         (Invocation.IsApplicable): Store the current ec in
1596         EmitContext.TempEc and restore it on return.  This is used so we
1597         do not have to sprinkle hundres of methods with an extra
1598         EmitContext, we know that the only user is the lambda expression
1599         ImplicitConversionExists code. 
1600         
1601         (Argument): Add Cloning capabilities.
1602         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
1603         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
1604         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
1605         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
1606         IndexerAccess): Add Clone capability.
1607
1608         (LocalVariableReference, This): TODO: needs cloned Block mapping.
1609
1610         (Argument): Add cloning capability.
1611
1612         * assign.cs (Assign): Implement CloneTo.
1613
1614         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
1615         
1616         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
1617         version by calling Convert with the EmitContext (that we are
1618         currently storing in ec, this is not great, but will do for now,
1619         to avoid passing EmitContext parameters to hundreds of functions
1620         that do not need them now).
1621
1622         (SetExpression): Remove, it is not needed.
1623         
1624         (ContextualReturn): Implement CloneTo.
1625
1626         * statement.cs (Statement): Implement cloning infrastructure,
1627         similar to expressions.
1628
1629         (Block): Partial implementation of Clone for statements.
1630
1631         (Return): Implement clone.
1632         
1633         * constant.cs (Constant.CloneTo): New method, does nothing.
1634
1635         * codegen.cs (TempEc): Add a static EmitContext as a temporary
1636         solution, until we decide how to exactly do this.  
1637         
1638 2007-02-14  Marek Safar  <marek.safar@gmail.com>
1639  
1640         A fix for bug #80493
1641         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
1642         a property is override we need to use second accessor.
1643
1644 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1645  
1646         A fix for bug #80418
1647         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1648         methods.
1649
1650 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1651
1652         Another fix for bug #80749
1653         * pending.cs: Abstract class has priority over interfaces.
1654
1655 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1656
1657         Another fix for bug #80749
1658         * pending.cs: Abstract class has priority over interfaces.
1659
1660 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1661
1662         Another fix for bug #80749
1663         * pending.cs: Abstract class has priority over interfaces.
1664
1665 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1666
1667         Another fix for bug #80749
1668         * pending.cs: Abstract class has priority over interfaces.
1669
1670 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1671
1672         * class.cs Better error message.
1673
1674         * driver.cs: Add shorter versions of -optimize option.
1675
1676 2007-02-13  Martin Baulig  <martin@ximian.com>
1677
1678         * class.cs (Constructor.Emit): Check the return value of
1679         ec.ResolveTopBlock() and return on error.
1680
1681 2007-02-13  Raja R Harinath  <rharinath@novell.com>
1682
1683         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1684         message to fix error message regression.
1685
1686 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1687
1688         * delegate.cs: Delegate creation expression cannot be of Nullable type.
1689
1690 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1691
1692         A fix for bug #80749
1693         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1694         its parent container.
1695
1696         * class.cs (DefineFieldInitializers): Each initializer can has different
1697         resolve context.
1698
1699         * const.cs: Updated.
1700
1701 2007-02-11  Miguel de Icaza  <miguel@novell.com>
1702
1703         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1704         now all the heavy lifting to check that embedded statements or
1705         expressions have the right form is done in the ContextualReturn.
1706
1707         (ContextualReturn): New class.  
1708
1709         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1710         method that can be invoked to report 201, so we do not replicate
1711         this everywhere.
1712
1713         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1714         
1715         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1716         treating tabs as spaces. 
1717
1718 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1719
1720         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1721         * assign.cs: Use full implicit conversion for right side check.
1722
1723 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1724
1725         * statement.cs (Switch): Switch over boolean type is not standardized.
1726
1727 2007-02-08  Marek Safar  <marek.safar@gmail.com>
1728
1729         A fix for bug #80755
1730         * decl.cs (FindBaseEvent): Don't use method cache for events.
1731
1732 2007-02-07  Marek Safar  <marek.safar@gmail.com>
1733
1734         * cs-parser.jay: Better syntax error handling.
1735
1736         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1737         instead of underlying type value.
1738
1739 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1740
1741         * driver.cs: Check define identifier before is registered.
1742
1743         * namespace.cs: Use existing error message.
1744
1745         * report.cs: New warning.
1746
1747 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1748
1749         A fix for bug #80742
1750         * expression.cs: Delegate Invoke method can be called directly.
1751
1752 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1753
1754         A fix for bug #80676
1755         * class.cs (IsEntryPoint): The Main method can have params modifier.
1756
1757 2007-02-04  Miguel de Icaza  <miguel@novell.com>
1758
1759         * parameter.cs (Parameter, Parameters): Add Clone method.
1760
1761         * anonymous.cs (Compatible): Turn method into virtual method, so
1762         LambdaExpression can implement a different behavior.
1763
1764         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1765         out the basic checking here, so it can be used by
1766         LambdaExpressions.
1767         
1768         * lambda.cs: Introduce "Compatible" function that will do the
1769         heavy lifting.
1770
1771 2007-02-02  Marek Safar  <marek.safar@gmail.com>
1772
1773         * attribute.cs: Unified one error message.
1774
1775         * class.cs (Class): Use type attributes and not properties to test static
1776         class.
1777         (IsEntryPoint): Don's pass local variable.
1778
1779         * convert.cs: Removed duplicate check.
1780
1781         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1782
1783         * driver.cs: Don't crash when soft reference does not exist.
1784
1785         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1786         (UsingEntry): Removed redundant allocation.
1787
1788         * parameter.cs: Add fast path for type parameters.
1789
1790         * support.cs: Don't allocate attribute when it's not used.
1791
1792 2007-01-30  Miguel de Icaza  <miguel@novell.com>
1793
1794         * anonymous.cs
1795         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1796         this into a virtual method, so we can override it in LambdaExpression.
1797
1798         * driver.cs: Improve diagnostics in case of failure. 
1799
1800         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1801         write a function that is slightly more complex and that parses:
1802
1803         type identifier [, type identifier]* )
1804
1805         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1806         this expression:
1807
1808                 (canEmpty ? i >= 0 : i > 0)
1809
1810 2007-01-30  Raja R Harinath  <rharinath@novell.com>
1811
1812         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1813         exception on possibly valid code.
1814
1815 2007-01-29  Raja R Harinath  <rharinath@novell.com>
1816
1817         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1818         Push/PopPosition.
1819         (parse_opt_type_arguments): Remove.  It's almost the same as
1820         parse_less_than.
1821         (parse_namespace_or_typename): Use parse_less_than.
1822
1823 2007-01-28  Miguel de Icaza  <miguel@novell.com>
1824
1825         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1826         this bug took a few hours to find, because the state saved and
1827         restored by PushPosition and PopPosition was ignoring the state of
1828         parse_generic_less_than.
1829
1830         I can also now remove the handling of OP_LT and OP_GT, this solves
1831         the big mistery.
1832         
1833         * cs-tokenizer.cs: store the location for the ARROW token, we use
1834         that in the parser.
1835
1836         (PushPosition, PopPosition): save/restore also `current_token',
1837         restore `parse_generic_less_than' (was missing).
1838
1839         (parse_opt_type_arguments): use parse_type, not
1840         parse_namespace_or_typename to parse types.
1841
1842         * lambda.cs: Empty new file, will eventually have the lambda
1843         expression implementation.
1844
1845         * lambda.test: used to test the internal tokenizer. 
1846
1847         * report.cs (FeatureIsNotISO1): Rename from
1848         FeatureIsNotStandardized, because it was about the language level
1849         (1 vs 2) it was not about standarization.
1850
1851         (FeatureRequiresLINQ): New.
1852
1853         * support.cs (SeekableStreamReader): Only require that the reader
1854         is a TextReader, not a StreamReader, so we can plug StringReader. 
1855
1856         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1857         given position in the input stream the following tokens can be
1858         parsed as a type followed by an identifier.
1859
1860         (is_punct): after a '(' if parse_type_and_parameter returns true,
1861         then return a special token OPEN_PARENS_LAMBDA which is used to
1862         avoid reduce/reduce errors in the grammar for the
1863         lambda_expression rules.
1864
1865         (parse_type): implement a type parser inside the
1866         tokenizer, the parser only returns true or false depending on
1867         whether the input at a given position can be parsed as a type.
1868
1869         (peek_token): new method used during type parsing.
1870
1871 2007-01-28  Raja R Harinath  <rharinath@novell.com>
1872
1873         Fix #80531
1874         * anonymous.cs (ScopeInfo.InflateParameters): New.
1875         (AnonymousContainer.Resolve): Use it to redirect types of
1876         delegate parameters.
1877
1878 2007-01-27  Raja R Harinath  <rharinath@novell.com>
1879
1880         Fix #80530
1881         * expression.cs (Error_InvalidArguments): Don't use two different
1882         messages for CS1503.  Use ExtraInformation and
1883         SymbolRelatedToPreviousError instead.
1884
1885         Fix #80358
1886         * decl.cs (DeclSpace.initialize_type_params): Don't access
1887         'type_params' of a partial class directly.
1888
1889 2007-01-26  Miguel de Icaza  <miguel@novell.com>
1890
1891         * constant.cs: Removed a handful of out-of-range checks that were
1892         not necessary. 
1893
1894 2007-01-25  Marek Safar  <marek.safar@gmail.com>
1895
1896         * expression.cs (CheckUselessComparison): Add additional check for char
1897         constants.
1898
1899         * namespace.cs: Fixed typo.
1900
1901 2007-01-23  Miguel de Icaza  <miguel@novell.com>
1902
1903         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1904         gone, instead we inline the test, preventing the needless casts to
1905         longs, ulongs and doubles for the parameters, avoiding calls to
1906         methods that overchecked stuff, and instead inlined things
1907         nicely. 
1908
1909 2007-01-20  Marek Safar  <marek.safar@gmail.com>
1910
1911         * cs-parser.jay: Better parameter error handling.
1912
1913 2007-01-17  Marek Safar  <marek.safar@gmail.com>
1914
1915         A fix for bug #80368, #80522
1916         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1917         whether array initializer contains constants only.
1918         (ArrayCreation.Emit): Use better formula to decide when
1919         are array initializers for static initialization.
1920         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1921         have to emit even constants otherwise they are pre-initialized.
1922
1923 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
1924             Raja R Harinath  <rharinath@novell.com>
1925
1926         Fix emit order of 'get' vs. 'set'.
1927         * support.cs (Accessors): New.
1928         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1929         Note the order in which accessors are declared in the source.
1930         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1931         Refactored from Property.Define and Indexer.Define.
1932         (PropertyBase.DefineAccessors): New helper that calls the above in
1933         appropriate order as noted by the parser.
1934         (Property.Define, Indexer.Define): Update to changes.
1935         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1936
1937 2007-01-17  Raja R Harinath  <rharinath@novell.com>
1938
1939         Fix cs0029-6.cs and gcs0029-2.cs (regression)
1940         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1941         there's an implicit conversion from the current type to the target
1942         type before converting the underlying constant.
1943
1944 2007-01-16  Marek Safar  <marek.safar@gmail.com>
1945
1946         * const.cs (ResolveValue): Updated after constant conversion was made more
1947         generic.
1948
1949         * constant.cs (GetAttributableValue): constant to object conversion is
1950         used for attributes only.
1951         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1952         constant conversions.
1953         (LongConstant.ConvertImplicitly): Ditto.
1954
1955         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1956         (ImplicitConversionStandard): Handle constant conversion as extra step.
1957         It solves the issue when constant conversion was called indirectly like
1958         inside array initializer and constant folding was skipped.
1959
1960         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1961         this change.
1962
1963         * statement.cs(ImplicitConversionStandard): Updated after constant
1964         conversion was made more generic.
1965
1966 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
1967
1968         * expression.cs (As.DoResolve): Use GenericConstraints instead of
1969         Constraints, solves the problem where the compiler incorrectly
1970         reported that a type parameter was not constrained to a class (Bug
1971         80518)
1972
1973 2007-01-14  Marek Habersack  <grendello@gmail.com>
1974
1975         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1976
1977 2007-01-14  Marek Safar  <marek.safar@gmail.com>
1978
1979         A fix for bug #80368
1980         * assign.cs (FieldInitializer): New class implements field
1981         initializer statement.
1982
1983         * attribute.cs: Update after FieldMember rename.
1984
1985         * class.cs (PropertyBasedMember): New common class for property based
1986         types.
1987         (InterfaceMemberBase): New base class for all members which can be used as
1988         an interface members.
1989         (MethodCore): Moved really common code to InterfaceMemberBase.
1990         (Method.Define): Equal and GetHasCode detection is relevant for methods
1991         only.
1992         (MethodData.Define): Don't assume that public event implements an
1993         interface automatically.
1994         (MethodData.DefineMethodBuilder): Issue an error even if only extern
1995         modifier is used.
1996         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1997         (FieldMember): Merged with FieldBase.
1998         (EventProperty.AEventPropertyAccessor): New specialization to check whether
1999         event extern modifier can be used.
2000         (EventField.EventFieldAccessor): Moved event field specific code here.
2001         (Event.AllowedModifiers): Even event can be extern.
2002         (Event.FindOutBaseMethod): New override specific to events.
2003         (Indexer.parameters): Reintroduce parameters because base class holds
2004         only properties common data.
2005         (Indexer.CheckForDuplications): Indexers are threated as methods so we
2006         need do extra parameters check.
2007
2008         * const.cs: Update after FieldMember rename.
2009
2010         * decl.cs (MemberCache.FindBaseEvent): New method.
2011
2012         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
2013         to reflect that indexer is now derived from PropertyBased.
2014
2015         * ecore.cs (GetMemberType): Made public.
2016         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
2017         obsolete event.
2018
2019         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
2020         
2021         * typemanager.cs (CSharpSignature): Correctly print event accessors.
2022         (RegisterEvent): Removed.
2023         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
2024         (GetPrivateFieldOfEvent): Renamed to GetEventField.
2025
2026 2007-01-11  Raja R Harinath  <rharinath@novell.com>
2027
2028         Fix #80249
2029         * statement.cs (CollectionForeach.TryType): Prefer generic
2030         GetEnumerator over non-generic variant.  Fix code to follow comments.
2031
2032 2007-01-09  Raja R Harinath  <rharinath@novell.com>
2033
2034         Fix #80446
2035         * support.cs (ReflectionParameter): Don't use an invalid index on
2036         the generic parameter data.
2037
2038 2007-01-08  Miguel de Icaza  <miguel@novell.com>
2039
2040         * driver.cs: Just add a tiny bit of infrastructure.
2041
2042 2007-01-02  Marek Safar  <marek.safar@gmail.com>
2043
2044         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
2045         where field type is struct from current assembly.
2046         
2047         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
2048         it is possible.
2049
2050 2007-01-02  Marek Safar  <marek.safar@gmail.com>
2051
2052         A fix for bug #80381
2053         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
2054         the core types.
2055
2056         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
2057         messages.
2058         (Namespace.LookupType): Always use core types from corlib when speficied.
2059
2060         * report.cs: A new warning.
2061
2062         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
2063         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
2064         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
2065
2066         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
2067         (InitCoreTypes): Set expression type of object_type and value_type
2068         immediately after lookup.
2069
2070 2007-01-01  Miguel de Icaza  <miguel@novell.com>
2071
2072         * cs-tokenizer.cs: Accept Pc class characters (Connector
2073         Punctuation) as valid identifiers.  Fixes #78259
2074
2075         * expression.cs (Invocation.DoResolve): Moved the check for the
2076         use of `this' for doing method calls to the Invocation resolution
2077         step, after overload resolution has taken place instead of doing
2078         the check at the low-level `This.DoResolve' level.
2079
2080         The `This.DoResolve'(appens before overload resolution, so it has
2081         no way of knowing if the method that will be called will be
2082         instace or static, triggering an erroneous report for cs0188 (Bug
2083         78113).
2084
2085         We now do the check for instance method invocations after we know
2086         what method will be called.
2087
2088         (This.CheckThisUsage): Move the actual use of this structure
2089         checking into its own method and expose it. 
2090
2091         * Everywhere that called Error_ValueCannotBeConverted: pass a new
2092         EmitContext.
2093
2094         Exceptions: Null.ConvertImplicitly,
2095         Constant.ImplicitConversionRequired as there are too many call
2096         sites for passing the ec. 
2097
2098         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
2099         EmitContext, if the value is null, then we do not try to provide
2100         the extra information from the error (If a userdefined conversion
2101         exists, as UserDefinedConversion requires a non null-EmitContext).
2102
2103         Fixes: #80347
2104
2105 2006-12-30  Raja R Harinath  <rharinath@novell.com>
2106
2107         * flowanalysis.cs (MyBitVector): Document some invariants.
2108         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
2109         introduced below, and add a couple of others, 
2110
2111 2006-12-30  Marek Safar  <marek.safar@gmail.com>
2112
2113         * attribute.cs (GetMethodObsoleteAttribute): Uses new
2114         GetPropertyFromAccessor and GetEventFromAccessor.
2115         
2116         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
2117         overrides non-obsolete one.
2118         (Indexer.Define): Error message has been moved to the parser.
2119
2120         * cs-parser.jay: Better syntax errors handling.
2121
2122         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
2123         when an invocation has no arguments.
2124
2125         * ecore.cs: Removed not used caching.
2126
2127         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
2128         implementation.
2129
2130         * report.cs: Add a new warning.
2131
2132         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
2133
2134         * typemanager.cs (enumeration_type): Removed.
2135         (CSharpSignature): Reuses IsSpecialMethod.
2136         (IsEqual): Hack for MS BCL.
2137         (GetPropertyFromAccessor): New method.
2138         (GetEventFromAccessor): New method.
2139         (IsSpecialMethod): Fixed to handle more cases.
2140
2141 2006-12-30  Marek Safar  <marek.safar@gmail.com>
2142
2143         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
2144         Made white spaces array static.
2145
2146         * ecore.cs (RemoveGenericArity): Optimized.
2147
2148         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
2149         10 times faster).
2150         (MyBitVector.initialize_vector): Simplified.
2151
2152 2006-12-22  Miguel de Icaza  <miguel@novell.com>
2153
2154         * ecore.cs: Am not entirely happy with this hack, but it seems to
2155         address the issue in 80257 (a small test case for
2156         CreativeDocs.NET). 
2157
2158         I set the MethodGroupExpr.Type to an internal compiler type
2159         (itself in this case) to force the resolution to take place.   Why
2160         it does not take place with a null is beyond me.
2161
2162 2006-12-20  Marek Safar  <marek.safar@gmail.com>
2163
2164         A fix for bug #80288
2165         * expression.cs (ResolveOperator): Consider user defined conversion for
2166         logical and operator too.
2167         (EmitBranchable): Optimization for logical and when full constant folding
2168         could not be applied but one operand is constant.
2169
2170 2006-12-19  Marek Safar  <marek.safar@gmail.com>
2171
2172         * class.cs (GetClassBases): Write 5 times every day, will never use
2173         FullName for error reporting.
2174
2175         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
2176
2177 2006-12-19  Martin Baulig  <martin@ximian.com>
2178
2179         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
2180         the symbol file info here.
2181
2182 2006-12-18  Marek Safar  <marek.safar@gmail.com>
2183
2184         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
2185         of `elseif' is taking then following sections are not taking.
2186         Fixes an issue reported on mono mailing list.
2187
2188 2006-12-18  Marek Safar  <marek.safar@gmail.com>
2189
2190         A fix for bug #80300
2191         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
2192         a caller is not taking.
2193
2194 2006-12-18  Raja R Harinath  <rharinath@novell.com>
2195
2196         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
2197         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
2198         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
2199         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
2200         * class.cs: Update to changes.
2201
2202 2006-12-17  Marek Safar  <marek.safar@gmail.com>
2203
2204         A fix for bug #79934
2205         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
2206         partial container.
2207
2208         * class.cs (ResolveMembers): Register an iterator in current container and
2209         not in shared one.
2210
2211 2006-12-16  Raja R Harinath  <rharinath@novell.com>
2212
2213         Fix test-543.cs
2214         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
2215         satisfy a params annotated parameter.
2216
2217 2006-12-16  Marek Safar  <marek.safar@gmail.com>
2218
2219         A fix for bug #77014
2220         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
2221         paramters correctly and not rely on hacks in Parameters class.
2222         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
2223         at any possition.
2224         (Invocation.VerifyArgumentsCompat): Ditto.
2225         (Invocation.EmitArguments): Changed to correctly emit params arguments at
2226         any possition.
2227
2228         * parameter.cs (HasParams): Don't assume that params is the last one.
2229
2230         * support.cs (ReflectionParameters.ctor): Look for params attribute
2231         correctly.
2232         (ReflectionParameters.ParameterType): Removed hack when we returned last
2233         parameter for out of range parameters.
2234         (ParameterName, ParameterModifier): Ditto.
2235
2236 2006-12-14  Marek Safar  <marek.safar@gmail.com>
2237
2238         A fix for bug #79987
2239         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
2240         when assembly is not CLS compliant but type is. I have no idea why is this
2241         allowed.
2242
2243         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
2244
2245 2006-12-13  Miguel de Icaza  <miguel@novell.com>
2246
2247         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
2248         in struct constructors, they are basically no-ops.
2249
2250 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2251
2252         * cs-tokenizer.cs (Position): Save preprocessor status too.
2253
2254 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2255
2256         A fix for bug #77794
2257         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
2258
2259 2006-12-12  Marek Safar  <marek.safar@gmail.com>
2260
2261         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
2262         Fixes #69299.
2263         (pp_expr): Report error for an invalid expression.
2264         (handle_preprocessing_directive): Simplified; add more error checking.
2265
2266 2006-12-11  Marek Safar  <marek.safar@gmail.com>
2267
2268         A fix for bug #74939
2269         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
2270         directives handling.
2271
2272 2006-12-10  Marek Safar  <marek.safar@gmail.com>
2273
2274         A fix for bugs #80093, and #75984
2275         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
2276         logic, it seems to me as it worked before "by coincidence".
2277         (xtoken): Simplified to use reworked handle_preprocessing_directive.
2278         (cleanup): Enabled endif check.
2279
2280 2006-12-09  Marek Safar  <marek.safar@gmail.com>
2281
2282         A fix for bug #80162
2283         * statement.cs (CollectionForeach.TryType): Generics and non-generics
2284         enumerators are never ambiguous.
2285
2286 2006-12-08  Raja R Harinath  <rharinath@novell.com>
2287
2288         Fix #80060
2289         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
2290
2291 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2292
2293         A fix for bug #80144
2294         * class.cs (EventProperty.Define): Explicit implementation means
2295         that an even is used.
2296
2297 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2298
2299         Fixes the operators implementation (part II)
2300
2301         * cfold.cs (DoConstantNumericPromotions): Renamed to
2302         DoBinaryNumericPromotions and simplified.
2303         (BinaryFold): Couple of conversion fixes; simplified.
2304
2305         * constant.cs, ecore.cs, literal.cs
2306         (ToType): Renamed to ConvertImplicitly.
2307         (Reduce): Renamed to ConvertExplicitly.
2308
2309         * class.cs, convert.cs: Updated.
2310
2311         * expression.cs: TryReduce doesn't throw an exception.
2312
2313 2006-12-01  Marek Safar  <marek.safar@gmail.com>
2314
2315         A fix for bug #80108
2316         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
2317         compatible.
2318
2319 2006-11-30  Marek Safar  <marek.safar@gmail.com>
2320
2321         Fixes unary operators implementation (part I)
2322         Also fixes #80026
2323
2324         * cfold.cs (Error_CompileTimeOverflow): Made internal
2325
2326         * const.cs (IConstant): Changed to use reference to constant and
2327         not constant itself.
2328         Updated IConstant implementations.
2329
2330         * constant.cs (CreateConstant): New factory method.
2331         Updated IConstant implementation.
2332
2333         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
2334
2335         * ecore.cs: Updated to use CreateConstantReference.
2336
2337         * enum.cs: Reflects IConstant changes.
2338
2339         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
2340
2341         * literal.cs (NullConstant): Change to be independently usable.
2342
2343 2006-11-29  Martin Baulig  <martin@ximian.com>
2344
2345         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
2346         we need to emit the scope initializer before calling the base .ctor.
2347
2348         * anonymous.cs: Merged back from the new anonymous methods branch.
2349         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
2350
2351         * expression.cs (ParameterReference.DoResolveBase): Create a
2352         "normal" ScopeInfo when capturing parameters rather than using the
2353         root scope; this makes things work with anonymous methods having
2354         parameters.
2355
2356         * statement.cs
2357         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
2358
2359 2006-11-22  Marek Safar  <marek.safar@gmail.com>
2360
2361         A fix for bug #79987
2362         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
2363         check to a base class.
2364         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
2365         only when assembly has missing attribute.
2366         * report.cs: Update.
2367
2368 2006-11-21  Marek Safar  <marek.safar@gmail.com>
2369
2370         * cs-tokenizer.cs: Merged with gmcs version.
2371
2372 2006-11-20  Marek Safar  <marek.safar@gmail.com>
2373
2374         * cs-tokenizer.cs,
2375         * cs-parser.jay: Better error message when partial keyword is misplaced.
2376
2377 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
2378
2379         A fix for bug #79810
2380         report.cs: CS1058 only applies to 2.0 profile (gmcs).
2381         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
2382         a RuntimeWrappedException by default.
2383
2384 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2385
2386         A fix for bug #79843
2387         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
2388         implementation.
2389         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
2390
2391 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2392
2393         * driver.cs, namespace.cs: Uses faster IndexOf version.
2394
2395 2006-11-17  Marek Safar  <marek.safar@gmail.com>
2396
2397         A fix for bug #79941
2398         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
2399         operators.
2400         (Operator.Define): Implicit/Explicit operator of same type is duplicate
2401         even if internal name is different.
2402         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
2403         (UserDefinedConversion): Simplified as the operators cannot be internal.
2404         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
2405         conversions.
2406         (MethodLookup): Replaced EmitContext with parentType.
2407         * expression.cs: Updated.
2408
2409 2006-11-09  Raja R Harinath  <rharinath@novell.com>
2410
2411         * driver.cs (BadAssembly): Handle all the ugliness of
2412         DefineDynamicAssembly.
2413
2414 2006-11-08  Raja R Harinath  <rharinath@novell.com>
2415
2416         Address parts of #58244 -- most of what's left is in the runtime
2417         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
2418         CS1509 error checks, and handle them for all assembly loads, not
2419         just the first invocation.
2420         (LoadModule): Likewise.  Move handling of 'adder_method' ...
2421         * codegen.cs (AssemblyClass.AddModule): ... here.
2422
2423 2006-11-02  Marek Safar  <marek.safar@gmail.com>
2424
2425         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
2426         IEnumerable<T> is ambiguous.
2427
2428 2006-10-31  Marek Safar  <marek.safar@gmail.com>
2429
2430         A fix for bug #67689
2431         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
2432         GetEnumerator is ambiguous.
2433
2434         * report.cs: Add new warning.
2435
2436 2006-10-29  Marek Safar  <marek.safar@gmail.com>
2437
2438         A fix for bug #78602
2439         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2440         to protected member can be nested type.
2441
2442 2006-10-28  Marek Safar  <marek.safar@gmail.com>
2443
2444         A fix for bug #78965
2445         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2446         to protected member must derive from current type.
2447
2448 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2449
2450         assign.cs: Reuses error method.
2451
2452         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
2453         instead of type for constants.
2454         (Expression.Error_ValueAssignment): Common error method.
2455
2456         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
2457         for any assignment.
2458
2459 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2460
2461         A fix for bug #79081
2462         * expression.cs (MemberAccess.DoResolve): Check nested type
2463         accessibility.
2464
2465 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
2466
2467         * doc.cs : nested delegates were not handled. Fixed bug #79754.
2468
2469 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2470
2471         A fix for bug #76591
2472         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
2473
2474 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2475
2476         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
2477         type forwarder of the same type multiple times.
2478
2479 2006-10-26  Raja R Harinath  <rharinath@novell.com>
2480
2481         Fix #78820
2482         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
2483         instance as an rvalue, even when we later resolve as an lvalue.
2484
2485 2006-10-25  Martin Baulig  <martin@ximian.com>
2486
2487         * anonymous.cs: Fix #79673.
2488
2489 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
2490
2491         A fix for bug #79666
2492         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
2493         ignored when is optimized (= default value) as its value is already set.
2494
2495 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2496
2497         A fix for bug #79724
2498         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
2499         TypeContainer for type lookup.
2500
2501 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2502
2503         A fix for bug #79231
2504         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
2505         * expression.cs (OverloadResolve): Always convert type name for
2506         an error message.
2507         (ResolveNamespaceOrType): Don't confuse a nested type with any 
2508         other member.
2509
2510 2006-10-18  Martin Baulig <martin@ximian.com>
2511
2512         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
2513
2514 2006-10-17  Miguel de Icaza  <miguel@novell.com>
2515
2516         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
2517         an int32, but requesting an int64 from the conversion
2518
2519 2006-10-12  Martin Baulig  <martin@ximian.com>
2520
2521         * anonymous.cs
2522         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
2523         
2524 2006-10-12  Martin Baulig  <martin@ximian.com>
2525
2526         * statement.cs
2527         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
2528
2529 2006-10-11  Miguel de Icaza  <miguel@novell.com>
2530
2531         * convert.cs: Remove broken code: I was doing the "Existance"
2532         tests for Implicit conversions.
2533
2534 2006-10-10  Miguel de Icaza  <miguel@novell.com>
2535
2536         * convert.cs: Added one missing case in
2537         ImplicitStandardConversionExists uint64 to intptr.
2538
2539         Fixes #59800
2540         
2541         * typemanager.cs (uintptr_type): another core known type.   
2542
2543         * ecore.cs (OperatorCast): routine used to do cast operations that
2544         depend on op_Explicit.  We could change some of the Decimal
2545         conversions to use this.
2546
2547         This one has a probe mechanism that checks both types for an op_
2548         which it coudl be used to eliminate two classes: CastToDecimal
2549         and CastFromDecimal.
2550
2551         * convert.cs: Implement the conversions documented in #59800
2552         
2553 2006-10-10  Martin Baulig  <martin@ximian.com>
2554
2555         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
2556         before RootScope.ResolveMembers().
2557
2558         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
2559         `CurrentType' if appropriate.
2560
2561 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
2562
2563         A fix for bug #78568
2564         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
2565         when contains binary operators.
2566         * cs-parser.jay: Updated.
2567
2568 2006-10-09  Martin Baulig  <martin@ximian.com>
2569
2570         * delegate.cs
2571         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
2572         moved that into Define() and also do the other type parameter
2573         checks there.  Fixes #79094.  Added gtest-292.cs.
2574
2575         * expression.cs
2576         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
2577         since that doesn't include type parameters; don't use `Ldelema'
2578         for type parameters.  Fixes #78980.  Added gtest-293.cs.
2579
2580 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
2581
2582         A fix for #77796
2583         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
2584         conversion is allowed.
2585
2586 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2587
2588         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
2589         error reporting when no error occurs.
2590
2591 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2592
2593         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
2594         does not exist.
2595
2596 2006-10-06  Raja R Harinath  <rharinath@novell.com>
2597
2598         Fix #79584
2599         * class.cs (DefineTypeBuilder): Check circular dependencies before
2600         setting the parent of the TypeBuilder.
2601         (CheckRecursiveDefinition): Don't use 'BaseType', since
2602         it may not be valid until after DefineTypeBuilder.  Use
2603         'base_type' instead.
2604
2605 2006-10-04  Martin Baulig  <martin@ximian.com>
2606
2607         Merged the Anonymous Methods patch.
2608
2609         * anonymous.cs, iterators.cs: The new anonymous methods code.
2610
2611         * statement.cs (Variable): New public abstract class.
2612         (LocalInfo.Variable): New public property.
2613         (LocalInfo.ResolveVariable): New public method.
2614         (Block.Flags): Add `IsIterator'.
2615         (Block.AddVariable): Improved the CS0136 check.
2616         (Block.AnonymousChildren): New public property.
2617         (Block.AddAnonymousChild): New public method.
2618         (ToplevelBlock): Update to use the new anonymous method framework.
2619         (ToplevelBlock.ctor): `container' is now a `Block' and not a
2620         `ToplevelBlock'; this is required to correctly implement the
2621         CS0136 check.
2622         (Fixed, Using): Use `TemporaryVariable' instead of directly
2623         creating the `LocalBuilder'.
2624
2625         * parameter.cs (Parameter.ResolveVariable): New public method.
2626         (Parameters.ResolveVariable): Likewise.
2627
2628         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
2629
2630         * class.cs (TypeContainer): Replaced the `iterators' list and
2631         corresponding methods with a list of `CompilerGeneratedClass'es.
2632         (TypeContainer.ResolveMembers): New public method.
2633         (Method): `IIteratorContainer' has been replaced by
2634         `IAnonymousHost'.
2635
2636         * expression.cs (VariableReference): New public abstract base
2637         class for `LocalVariableReference', `ParameterReference' and
2638         `This'.
2639
2640         * codegen.cs (EmitContext): Removed `capture_context',
2641         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
2642         (EmitContext.EmitThis): Removed.
2643
2644         * cs-parser.jay: Replace `iterator_container' with
2645         `anonymous_host'.       
2646
2647 2006-10-04  Martin Baulig  <martin@ximian.com>
2648
2649         * generic.cs (GenericMethod): Don't make this abstract.
2650         (Constraints.Clone): Added dummy implementation.
2651
2652 2006-10-04  Raja R Harinath  <harinath@gmail.com>
2653
2654         Fix #79577
2655         * namespace.cs (LookForAnyGenericType): Avoid nullref on
2656         'declspaces'.  Avoid allocating arrays willy-nilly.
2657
2658         Fix #79553
2659         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2660         cases out of the switch.
2661
2662 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2663
2664         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2665         message when non-generic type is used with the type arguments.
2666         * expression.cs: Updated.
2667
2668 2006-09-28  Raja R Harinath  <rharinath@novell.com>
2669
2670         Fix #79013
2671         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2672         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2673         Change semantics slightly.  Don't insist on having only one
2674         temporary EmptyExpression -- just throttle the creation of new ones.
2675
2676         Fix #79451
2677         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2678         non-interfaces too.  If no methods are found, don't try to create
2679         a MethodGroupExpr.
2680
2681 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2682
2683         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2684         generic type.
2685
2686         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2687         us produce better error message.
2688
2689 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
2690
2691         * expression.cs (Binary.ResolveOperator): Warn about a side effect
2692         of the `|' operator.
2693
2694         * report.cs: A new warning added.
2695
2696 2006-09-27  Martin Baulig  <martin@ximian.com>
2697
2698         * generic.cs (GenericMethod): Don't make this abstract.
2699
2700 2006-09-27  Martin Baulig  <martin@ximian.com>
2701
2702         * report.cs
2703         (InternalErrorException): Added overloaded ctor taking a params array.
2704
2705 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
2706
2707         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2708         Fixed the cases when same error was reported twice.
2709
2710         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2711         now report symbol information.
2712
2713 2006-09-25  Martin Baulig  <martin@ximian.com>
2714
2715         * class.cs: Completely unified with the gmcs version.
2716
2717 2006-09-25  Martin Baulig  <martin@ximian.com>
2718
2719         * typemanager.cs (TypeManager.IsNullableType): New public function.
2720         (TypeManager.IsNullableTypeOf): Likewise.
2721         (TypeManager.IsNullableValueType): Likewise.
2722
2723         * class.cs (MethodCore): Added the `GenericMethod' argument from
2724         gmcs and also unified all classes derived from `MethodCore' with gmcs.
2725
2726 2006-09-24  Raja R Harinath  <harinath@gmail.com>
2727
2728         * convert.cs: Unify with gmcs version.
2729
2730 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2731
2732         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2733         verify them as well.
2734
2735         * report.cs: New warning.
2736
2737 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2738
2739         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2740         for anonymous block with out argument.
2741
2742 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2743
2744         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2745         not used private events only.
2746
2747 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
2748
2749         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2750
2751         * const.cs (Const.Define): Check for constant type.
2752         (Const.IsConstantTypeValid): Looks for valid constant types.
2753
2754         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2755
2756         * ecore.cs (EmptyConstantCast): New common class for all constant based
2757         EmptyCast(s).
2758
2759         * expression.cs (Is.DoResolve): Handle null constant especially.
2760         (New.DoResolve): Check for new void().
2761         (MemberAccess.DoResolve): Cope with all kind of nulls.
2762
2763         * literal.cs (NullConstant): Uses EmptyConstantCast.
2764         (NullDefault): Based on EmptyConstantCast.
2765         (NullLiteral): Uses EmptyConstantCast.
2766
2767         * statement.cs (Block.ResolveMeta): Check for constant type.
2768
2769 2006-09-22  Martin Baulig  <martin@ximian.com>
2770
2771         * delegate.cs, attribute.cs: Merged with the gmcs versions.
2772
2773 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2774
2775         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2776         not the null type.
2777
2778         Fix part of #79451
2779         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2780         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
2781         code slightly.
2782
2783 2006-09-22  Martin Baulig  <martin@ximian.com>
2784
2785         * ecore.cs: Merged with the gmcs version.
2786
2787         * generic.cs (ConstructedType): New dummy class.
2788         (TypeArguments): Don't make this abstract.
2789
2790         * typemanager.cs
2791         (TypeManager.IsGenericTypeDefinition): New method.
2792         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2793
2794 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2795
2796         * expression.cs (ComposedCast): Check for arrays of TypedReference
2797         before creating the type, not after.
2798
2799 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
2800
2801         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2802         after ToType change.
2803
2804         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2805         when constant must be implicitly convertible.
2806
2807         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2808
2809         * ecore.cs (NullCast): Derives from NullConstant.
2810
2811         * expression.cs (Is.DoResolve): Removed useless variables.
2812         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2813         (New.Constantify): Add enum support.
2814         (MemberAccess.DoResolve): Add warning when accessing null constant or
2815         variable.
2816
2817         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2818         property.
2819
2820         * literal.cs (NullConstant): New abstract class with common
2821         functionality for all null specializations.
2822         (NullDefault): Represents default(X) when result can be
2823         reduced to null.
2824         (NullLiteral): Updated.
2825
2826         * report.cs: Add new warning.
2827
2828 2006-09-21  Martin Baulig  <martin@ximian.com>
2829
2830         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2831
2832 2006-09-21  Martin Baulig  <martin@ximian.com>
2833
2834         * generic.cs (GenericConstraints): New dummy class.
2835         (Constraints): Likewise.
2836         (TypeParameter): Likewise.
2837         (TypeParameterName): Likewise.
2838         (GenericMethod): Likewise.
2839
2840         * typemanager.cs (TypeManager.GetGenericArguments): New method.
2841
2842         * decl.cs: Merged with the gmcs version.
2843
2844 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2845
2846         * generic.cs (TypeParameter): Implement IMemberContainer.
2847         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
2848
2849         * rootcontext.cs: Unify with gmcs version.
2850
2851         * report.cs: Unify with gmcs version.
2852         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2853         from gmcs/generics.cs.
2854         * generics.cs (TypeParameter): New dummy class.
2855
2856         * support.cs: Unify with gmcs version.
2857
2858 2006-09-20  Raja R Harinath  <rharinath@novell.com>
2859
2860         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2861         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2862
2863         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2864         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2865         * mcs.exe.sources: Add generic.cs.
2866
2867         * codegen.cs: Unify with gmcs version.
2868
2869         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2870         (EmitContext): Add GenericDeclContainer implementation.
2871         * decl.cs (MemberCore, DeclSpace): Likewise.
2872         * namespace.cs: Remove #ifdef GMCS_SOURCE.
2873
2874         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2875         MCS TypeManager has a corresponding dummy method.
2876
2877 2006-09-19  Martin Baulig  <martin@ximian.com>
2878
2879         * expression.cs: Completely merged with the gmcs version.
2880
2881 2006-09-19  Martin Baulig  <martin@ximian.com>
2882
2883         * expression.cs (Invocation): Merged with the gmcs version.
2884         (ArrayAccess.GetStoreOpcode): Likewise.
2885
2886 2006-09-19  Martin Baulig  <martin@ximian.com>
2887
2888         * typemanager.cs
2889         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2890         (TypeManager.IsGenericMethodDefinition): Likewise.
2891
2892 2006-09-19  Martin Baulig  <martin@ximian.com>
2893
2894         * typemanager.cs
2895         (TypeManager.IsEqual): Moved the gmcs implementation here.
2896         (TypeManager.DropGenericTypeArguments): Likewise.
2897         (TypeManager.DropGenericMethodArguments): Likewise.
2898         (TypeManager.GetTypeArguments): Moved here from gmcs.
2899         (TypeManager.HasGenericArguments): Likewise.
2900
2901 2006-09-19  Martin Baulig  <martin@ximian.com>
2902
2903         * expression.cs (Binary): Merged with the gmcs version.
2904
2905 2006-09-19  Martin Baulig  <martin@ximian.com>
2906
2907         * expression.cs (Probe, As, Is): Merged with the gmcs version.
2908
2909 2006-09-19  Martin Baulig  <martin@ximian.com>
2910
2911         * typemanager.cs: Merged with the gmcs version.
2912
2913 2006-09-16  Raja R Harinath  <rharinath@novell.com>
2914
2915         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2916         * driver.cs: Likewise.
2917
2918 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
2919
2920         A fix for #79401
2921         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2922         only if parent type is class.
2923         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2924         update.
2925
2926 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
2927
2928         * cs-parser.jay,
2929         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2930         keywords are used.
2931         * typemanager.cs(CSharpName): Converts NullType to null.
2932
2933 2006-09-15  Martin Baulig  <martin@ximian.com>
2934
2935         * typemanager.cs
2936         (TypeManager.GetMethodName): Added mcs implementation.
2937         (TypeManager.IsEqual): Likewise.
2938
2939         * ecore.cs
2940         (SimpleName.RemoveGenericArity): Added dummy implementation.
2941
2942         * pending.cs: Merged with the gmcs version.     
2943
2944 2006-09-15  Martin Baulig  <martin@ximian.com>
2945
2946         * statement.cs: Merge with the gmcs version.
2947
2948 2006-09-15  Martin Baulig  <martin@ximian.com>
2949
2950         * statement.cs (Switch): Merge with the gmcs implementation
2951         (without nullables), which is newer.
2952
2953 2006-09-15  Martin Baulig  <martin@ximian.com>
2954
2955         * statement.cs (Block.Variables): Make this public.
2956         (ToplevelBlock.Parameters): Make this a property.
2957         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2958
2959 2006-09-15  Martin Baulig  <martin@ximian.com>
2960
2961         * namespace.cs: Merge with the gmcs version.
2962
2963 2006-09-15  Martin Baulig  <martin@ximian.com>
2964
2965         * decl.cs (MemberName): Minor code cleanups.
2966
2967 2006-09-15  Martin Baulig  <martin@ximian.com>
2968
2969         * parameter.cs: Merge with the gmcs version.
2970
2971 2006-09-15  Martin Baulig  <martin@ximian.com>
2972
2973         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2974         and an error in mcs.
2975
2976 2006-09-15  Martin Baulig  <martin@ximian.com>
2977
2978         * flowanalysis.cs: Merged from GMCS; added the generics code into
2979         a `GMCS_SOURCE' conditional so we can share this file.
2980
2981 2006-09-08  Martin Baulig  <martin@ximian.com>
2982
2983         * typemanager.cs (TypeManager.interlocked_type): New public field.
2984         (TypeManager.int_interlocked_compare-exchange): New public field.
2985         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2986         enumerator types here and call InitGenericCoreTypes().
2987         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2988         after calling InitEnumUnderlyingTypes().
2989
2990         * rootcontext.cs
2991         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2992         `classes_second_stage'. 
2993
2994 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
2995
2996         * assign.cs, ecore.cs, expression.cs: Share error message text.
2997         * class.cs (FieldMember.Define): Check for varible of static type.
2998         * driver.cs (LoadAssembly): Uses error output for errors.
2999         * statement.cs: Updated.
3000
3001 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
3002
3003         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
3004         type instance.
3005
3006 2006-09-07  Martin Baulig  <martin@ximian.com>
3007
3008         * driver.cs
3009         (MainDriver): Revert r62663 from Marek; see #70506 for details.
3010
3011 2006-08-29  Miguel de Icaza  <miguel@novell.com>
3012
3013         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
3014         
3015 2006-08-17  Miguel de Icaza  <miguel@novell.com>
3016
3017         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
3018         #52019 and #79064, the use of the \uXXXX sequence in source code
3019         to represent unicode characters.
3020
3021 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
3022
3023         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
3024         support.
3025         * class.cs, ecore.cs, statement.cs: Merged to one error message.
3026
3027 2006-08-13  Miguel de Icaza  <miguel@novell.com>
3028
3029         * assign.cs: Catch attempts to assign to a method groups in += and
3030         report as 1656
3031
3032 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
3033
3034         A fix for #79056
3035         * cs-parser.jay: Don't destroy current array type by typeof of array's.
3036
3037 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
3038
3039         * class.cs (Method.Define): Issue a warning when generic method looks like
3040         an entry point.
3041         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
3042         as well.
3043
3044 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
3045  
3046         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
3047         looking for ctor.
3048         * decl.cs (MemberCache.FindMembers): When container is interface we need to
3049         search all base interfaces as a member can be ambiguous.
3050         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
3051         Constructor member type filter. 
3052         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
3053         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
3054         reporting for returned memberinfos.
3055         * report.cs: Updated.
3056         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
3057         version to work on all runtimes.
3058         (TypeManager.RealMemberLookup): Removed members filtering.
3059
3060 2006-08-08  Raja R Harinath  <rharinath@novell.com>
3061
3062         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
3063         (PropertyExpr.EmitAssign): Likewise.
3064         * expression.cs (Indirection.EmitAssign): Likewise.
3065         (LocalVariableReference.EmitAssign): Likewise.
3066         (ParameterReference.EmitAssign): Likewise.
3067         (Invocation.EmitArguments): Likewise.
3068         (ArrayAccess.EmitAssign): Likewise.
3069         (IndexerAccess.EmitAssign): Likewise.
3070         (This.EmitAssign): Likewise.
3071         (ConditionalLogicalOperator.Emit): Likewise.
3072
3073         Fix #79026
3074         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
3075         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
3076         leave it in after returning it.
3077         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
3078
3079 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
3080
3081         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
3082         message.
3083
3084 2006-08-03  Raja R Harinath  <rharinath@novell.com>
3085
3086         Fix cs0146-3.cs and cs0146-4.cs.
3087         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
3088         enclosing types don't depend on the current type.
3089
3090 2006-08-02  Raja R Harinath  <rharinath@novell.com>
3091
3092         Fix #77963
3093         * class.cs (TypeContainer.DoDefineMembers): Use
3094         FindBaseMemberWithSameName on Parent, since we're interested in
3095         whether we hide inherited members or not.
3096         (FindBaseMemberWithSameName): Make slightly more robust.
3097
3098         Fix the non-generic testcase from #77396
3099         * decl.cs (DeclSpace.DeclContainer): Remove override.
3100
3101         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
3102         declspaces for doppelgangers too.
3103         (UsingEntry): Implement IResolveContext.
3104         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
3105         'this' as the resolve context.
3106         (LocalAliasEntry): Likewise.
3107
3108         Implement parts of #77403
3109         * roottypes.cs (RootDeclSpace): New.  Used to represent the
3110         toplevel declaration space.  Each namespace declaration introduces
3111         a "partial" root declaretion space.
3112         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
3113         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
3114         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
3115         from 'current_namespace.SlaveDeclSpace'.
3116         (namespace_declaration): Likewise.
3117         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
3118         check.  It can't happen now.
3119         * decl.cs (DeclSpace.LookupType): Likewise.
3120         * driver.cs (MainDriver): Sanity check.
3121
3122 2006-08-01  Raja R Harinath  <rharinath@novell.com>
3123
3124         * decl.cs (DeclSpace.FindNestedType): Remove.
3125         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
3126         LookupTypeContainer to get the container of the nested type.
3127         * class.cs (TypeContainer.FindNestedType): Make non-override.
3128
3129 2006-07-31  Raja R Harinath  <rharinath@novell.com>
3130
3131         * decl.cs (DeclSpace.PartialContainer): Move field from ...
3132         * class.cs (TypeContainer.PartialContainer): ... here.
3133         (TypeContainer.AddBasesForPart): New helper.
3134         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
3135         instead.
3136         * cs-parser.jay (current_class): Convert to DeclSpace.
3137         (struct_declaration, interface_declaration, class_declaration):
3138         Use AddBasesForPart instead of .Bases directly.
3139         * const.cs, iterators.cs: Update to changes.
3140
3141 2006-07-28  Raja R Harinath  <rharinath@novell.com>
3142
3143         * class.cs (TypeContainer.AddMemberType): Rename from
3144         AddToTypeContainer.
3145         (TypeContainer.AddMember): Rename from AddToMemberContainer.
3146         (AddTypeContainer): New.  Combine AddClassOrStruct and
3147         AddInterface.
3148         (AddPartial): Update.  Add 'is_partial' argument.
3149         * roottypes.cs: Update to changes.
3150         * cs-parser.jay (push_current_class): New helper for handling
3151         current_container and current_class.
3152         (struct_declaration, interface_declaration, class_declaration):
3153         Use it.
3154
3155 2006-07-26  Raja R Harinath  <rharinath@novell.com>
3156
3157         * roottypes.cs: Rename from tree.cs.
3158
3159         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
3160         * tree.cs (Tree, ITreeDump): Remove types.
3161         * rootcontext.cs (tree, Tree): Remove fields.
3162         (root, ToplevelTypes): New.
3163         * *.cs: Update to rename.
3164
3165         * tree.cs (Tree.RecordDecl): Remove.
3166         (RootTypes.AddToTypeContainer): Record the toplevel type in its
3167         namespace here.
3168         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
3169
3170 2006-07-23  Raja R Harinath  <harinath@gmail.com>
3171
3172         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
3173         DoFlowAnalysis and OmitStructFlowAnalysis here.
3174         (ec.With): Rename from WithUnsafe and generalize.
3175         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
3176         (ec.WithFlowAnalyis): New.
3177         * ecore.cs, expression.cs, statement.cs: Update.
3178
3179 2006-07-22  Raja R Harinath  <harinath@gmail.com>
3180
3181         * statement.cs (Block.ResolveMeta): Simplify slightly.
3182
3183         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
3184         multiple boolean fields.  Convert InUnsafe, constant_check_state,
3185         check_state to flags.
3186         (CheckState, ConstantCheckState): Update.
3187         (InUnsafe): New read-only property.
3188         (FlagsHandle): Rename from CheckStateHandle and convert to handle
3189         arbitrary flags.
3190         (WithUnsafe): New helper similar to WithCheckState.
3191         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
3192         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
3193
3194 2006-07-21  Raja R Harinath  <rharinath@novell.com>
3195
3196         Make comparisons use the same IL irrespective of whether they're
3197         in a 'checked' or 'unchecked' context: one of the issues in #78899
3198         * codegen.cs (EmitContext.CheckState): Make read-only property.
3199         (EmitContext.ConstantCheckState): Likewise.
3200         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
3201         helper that implement a save/restore stack for CheckState
3202         values.  This is the only way to change check-state.
3203         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
3204         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
3205         (CheckedExpr.EmitBranchable): New forwarding method.
3206         (UnCheckedExpr): Likewise.
3207         * statement.cs (Block.ResolveMeta): Use WithCheckState.
3208         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
3209         (Checked.Resolve, checked.DoEmit): Likewise.
3210
3211 2006-07-20  Miguel de Icaza  <miguel@novell.com>
3212
3213         * anonymous.cs: Cache the resolved anonymous delegate, and return
3214         this so that the ResolveTopBlock is only triggered once, not
3215         twice.
3216
3217         Currently we trigger ResolvetopBlock twice due to a first pass of
3218         argument check compatibility, and a second pass that does the
3219         actual resolution.   
3220         
3221 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
3222
3223         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
3224         modifiers.
3225         * rootcontext.cs (Reset): Add helper_classes.
3226
3227 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
3228
3229         A fix for #78860
3230         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
3231         correctly.
3232
3233 2006-07-13  Miguel de Icaza  <miguel@novell.com>
3234
3235         * statement.cs (Lock): Handle expressions of type
3236         TypeManager.null_type specially.  Fixes #78770
3237
3238 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
3239
3240         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
3241         to an event.
3242
3243 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
3244
3245         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
3246         for accessors as well.
3247         * ecore.cs (EventExpr): Add AccessorTable.
3248
3249 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
3250
3251         A fix for #78738
3252         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
3253         for CS0122 where appropriate.
3254         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
3255         level attributes.
3256         (Filter): Assembly can be null in the case of top level attributes.
3257
3258 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
3259
3260         A fix for #78690
3261
3262         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
3263         is done at global level.
3264
3265 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3266
3267         A fix for #77002, Implemented TypeForwarder support.
3268
3269         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
3270         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
3271         * typemanager.cs (): Add type_forwarder_attr_type.
3272
3273 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3274
3275         * report.cs: Add CS0469 warning.
3276
3277 2006-06-21  Martin Baulig  <martin@ximian.com>
3278
3279         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
3280         the `try'-block, so we also report CS0016 etc. there.
3281
3282 2006-06-21  Martin Baulig  <martin@ximian.com>
3283
3284         * delegate.cs
3285         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
3286
3287 2006-06-21  Martin Baulig  <martin@ximian.com>
3288
3289         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
3290         also report CS1686 for parameters.
3291
3292 2006-06-21  Martin Baulig  <martin@ximian.com>
3293
3294         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
3295         instead of an error if the value is not implicitly convertible to
3296         the switch types; fixes #77964.
3297
3298 2006-06-21  Raja R Harinath  <rharinath@novell.com>
3299
3300         Fix #78673
3301         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
3302         FieldBuilder is null.
3303
3304         Fix #78662
3305         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
3306         'left' and 'right' before error-checking.
3307
3308 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
3309
3310         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
3311         Fixed bug #78601.
3312         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
3313         (FieldExpr.DoResolve): likewise.
3314         (PropertyExpr.InstanceResolve): likewise.
3315         (EventExpr.InstanceResolve): likewise. 
3316
3317 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
3318
3319         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
3320         attribute applicable tests for attribute argument.
3321
3322 2006-06-02  Raja R Harinath  <rharinath@novell.com>
3323
3324         Fix #78079
3325         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
3326         (Binary.OverloadResolve_PredefinedIntegral): New.
3327         (Binary.OverloadResolve_PredefinedFloating): New.
3328         (Binary.OverloadResolve_PredefinedString): New.
3329         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
3330         Follow the standard more closely, and treat numeric promotions in
3331         terms of overload resolution.
3332         (Binary.CheckShiftArguments): Simplify.
3333
3334 2006-06-01  Raja R Harinath  <rharinath@novell.com>
3335
3336         * flowanalysis.cs (MyBitVector): Simplify representation.
3337         (MyBitVector.Clone): Avoid allocating BitArray.
3338         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
3339         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
3340         (*): Update.  Change all references to MyBitVector.And and
3341         MyBitVector.Or to &= and |=.
3342
3343 2006-05-29  Raja R Harinath  <rharinath@novell.com>
3344
3345         Fix cs0231-[34].cs.
3346         * cs-parser.jay (formal_parameter_list): Extend the pattern below
3347         to param arguments too.
3348
3349 2006-05-26  Miguel de Icaza  <miguel@novell.com>
3350
3351         * cs-parser.jay: Catch another parsing form for arglist being
3352         followed by other arguments.  Fixes #78313.
3353
3354 2006-05-24  Raja R Harinath  <rharinath@novell.com>
3355
3356         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
3357         checking of out parameters to ...
3358         (FlowBranchingToplevel.Merge): ... here.
3359         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
3360         set, propagate the origin upward, and only complain if there was
3361         no other error.
3362         (FlowBranchingException.AddContinueOrigin): Likewise.
3363         (FlowBranchingException.AddReturnOrigin): Likewise.
3364         (FlowBranchingException.AddGotoOrigin): Likewise.       
3365
3366 2006-05-23  Raja R Harinath  <rharinath@novell.com>
3367
3368         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
3369         unreachable, skip it.
3370         (FlowBranchingException.Merge): Always propagate jumps, even if
3371         the finally block renders subsequent code unreachable.
3372
3373 2006-05-18  Raja R Harinath  <rharinath@novell.com>
3374
3375         Fix #77601
3376         * statement.cs (Goto.Resolve): Move responsibility for resolving
3377         'goto' to FlowBranching.AddGotoOrigin.
3378         (Goto.SetResolvedTarget): New.  Callback to set the
3379         LabeledStatement that's the target of the goto.
3380         (Goto.DoEmit): Use Leave instead of Br when crossing an
3381         unwind-protect boundary.
3382         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
3383         LookupLabel and adjust to new semantics.
3384         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
3385         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
3386         Goto.SetResolvedTarget to update target.
3387         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
3388         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
3389         AddBreakOrigin & co.  Delay propagation until ...
3390         (FlowBranchingException.Merge): ... this.
3391
3392         * statement.cs (Block.Resolve): Always depend on flow-branching to
3393         determine unreachability.  Kill workaround that originally emitted
3394         only one statement after an "unreachable" label (see infloop in
3395         test-515.cs).
3396
3397         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
3398         This is still "wrong", but anything better would probably need a
3399         multi-pass algorithm.
3400         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
3401         usage vector.  Force current usage vector to be reachable, to
3402         optimistically signify backward jumps.
3403         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
3404         detected.
3405         (FlowBranchingLabeled.Merge): New.  If no backward jump was
3406         detected, return the original salted-away usage vector instead,
3407         updated with appropriate changes.  Print unreachable warning if
3408         necessary.
3409         * statement.cs (Block.Resolve): Don't print unreachable warning on
3410         a labeled statement.
3411
3412 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
3413
3414         * driver.cs: Pass filename without path to AssemblyBuilder's 
3415         AddResourceFile. Fixes bug #78407.
3416
3417 2006-05-17  Raja R Harinath  <rharinath@novell.com>
3418
3419         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
3420         * flowanalysis.cs (FlowBranchingLabeled): ... here.
3421         (FlowBranching.MergeChild): Overwrite
3422         reachability information from Labeled branchings too.
3423
3424 2006-05-16  Raja R Harinath  <rharinath@novell.com>
3425
3426         * statement.cs (Goto.Resolve): Merge jump origins here ...
3427         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
3428
3429         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
3430         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
3431         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
3432         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
3433         here, ...
3434         * statement.cs (Goto.Resolve): ... not here.
3435         (Goto.Emit): Remove CS1632 check.
3436
3437 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
3438
3439         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
3440         error message.
3441
3442 2006-05-11  Raja R Harinath  <rharinath@novell.com>
3443
3444         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
3445         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
3446         (FlowBranchingException.Label): Likewise.
3447
3448         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
3449         given value.
3450         (MyBitVector.Or): Use it to avoid losing information (Count).
3451         (FlowBranching.MergeOrigins): Likewise.
3452
3453         * flowanalysis.cs (UsageVector.IsDirty): Remove.
3454         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
3455         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
3456         (UsageVector.ToString): Simplify.
3457         (UsageVector.MergeSiblings): Move here from ...
3458         (FlowBranching.Merge): ... here.
3459         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
3460         not a MyBitVector.
3461
3462 2006-05-10  Raja R Harinath  <rharinath@novell.com>
3463
3464         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
3465         null bitvector is treated as all-true.
3466
3467         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
3468         (MyBitVector): Rationalize invariants.  'vector != null' implies
3469         that we have our own copy of the bitvector.  Otherwise,
3470         'InheritsFrom == null' implies all inherited bits are true.
3471
3472 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
3473
3474         * statement.cs (LocalInfo): Add IsConstant.
3475         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
3476         local variable for constants.
3477
3478 2006-05-09  Raja R Harinath  <rharinath@novell.com>
3479
3480         * flowanalysis.cs (MyBitVector.Empty): New.
3481         (MyBitVector): Don't allow InheritedFrom to be null.
3482         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
3483         (UsageVector, FlowBranching): Update to changes.
3484
3485         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
3486         recursion.  The 'Parent == null' condition isn't sufficient for
3487         anonymous methods.
3488         (FlowBranching.AddBreakOrigin): Likewise.
3489         (FlowBranching.AddContinueOrigin): Likewise.
3490         (FlowBranching.AddReturnOrigin): Likewise.
3491         (FlowBranching.StealFinallyClauses): Likewise.
3492         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
3493         (FlowBranching.CheckOutParameters): Likewise.
3494         (FlowBranchingToplevel): Terminate all the above recursions here.
3495         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
3496         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
3497
3498         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
3499         toplevel block.
3500         (FlowBranchingToplevel): New.  Empty for now.
3501         (FlowBranching.MergeTopBlock): Update.
3502         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
3503         branching for the anonymous delegate.
3504         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
3505
3506         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
3507         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
3508         information at the start of the merge.  Reorganize.
3509
3510 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3511
3512         * class.cs (MethodData.Define): Method cannot implement interface accessor.
3513
3514 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3515
3516         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
3517         to newly introduced ctor.
3518
3519         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
3520         message to one place.
3521         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
3522         global namespace.
3523
3524 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3525
3526         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
3527
3528         * ecore.cs (Expression.ResolveAsConstant): Updated.
3529
3530         * statement.cs (ResolveMeta): Updated.
3531
3532 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3533
3534         * cs-parser.jay: __arglist cannot be used in initializer.
3535
3536 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3537
3538         A fix for #77879
3539         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
3540         private types.
3541
3542 2006-05-05  Raja R Harinath  <rharinath@novell.com>
3543
3544         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
3545         (LabeledStatement): Add 'name' parameter.
3546         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
3547         (Block.AddLabel): Update to changes.
3548         * cs-parser.jay (labeled_statement): Likewise.
3549
3550         * flowanalysis.cs (BranchingType.Labeled): New.
3551         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
3552         (FlowBranchingLabeled): New.  Does nothing for now, but will
3553         eventually handle 'goto' flows.
3554         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
3555         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
3556         that's terminated ...
3557         (Block.Resolve): ... here.
3558
3559         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
3560         (UsageVector.MergeFinallyOrigins): Likewise.
3561         (FlowBranching.InTryOrCatch): Likewise.
3562         (FlowBranching.AddFinallyVector): Likewise.
3563         (FlowBranchingException): Update to changes.
3564
3565         Fix #78290
3566         * statement.cs (Return.Resolve): Move error checking to ...
3567         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
3568         (FlowBranchingException): Handle return origins like break and
3569         continue origins.
3570         (FlowBranching.UsageVector.CheckOutParameters): Remove.
3571
3572 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3573
3574         A fix for #76122
3575         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
3576         filter.
3577
3578 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3579
3580         A fix for #77543
3581         * class.cs (MethodData.Define): Do public accessor check only when method
3582         implements an interface.
3583
3584 2006-05-04  Raja R Harinath  <rharinath@novell.com>
3585
3586         Remove special handling of 'break'
3587         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
3588         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
3589         (UsageVector.Break): Remove.
3590         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
3591         reachability.
3592         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
3593
3594         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
3595         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
3596
3597 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3598
3599         A fix for #75726
3600         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
3601         be the interface member.
3602
3603 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3604
3605         A fix for #60069
3606         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
3607         for emitting small (int) values.
3608
3609 2006-05-03  Raja R Harinath  <rharinath@novell.com>
3610
3611         Fix #59427
3612         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
3613         control-flow passes through the 'finally' after merging-in all the
3614         control-flows from 'try' and the 'catch' clauses.
3615
3616         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
3617         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
3618         always true at the only non-recursive entry point.
3619         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
3620         FlowBranchingBreakable.
3621         (FlowBranchingLoop): Remove.
3622         * statement.cs (Return.DoResolve): Update to changes.
3623
3624         Fix #76471, #76665
3625         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
3626         (FlowBranching.CreateBranching): Handle it: create a
3627         FlowBranchingContinuable.
3628         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
3629         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
3630         except that it handles the 'continue' command.
3631         (FlowBranching.UsageVector.MergeOrigins): Rename from
3632         MergeBreakOrigins.
3633         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
3634         except that it overrides AddContinueOrigin.
3635         (FlowBranchingException): Override AddContinueOrigin, similar to
3636         AddBreakOrigin.
3637         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
3638         Create a new branching around the embedded statement.
3639         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
3640         control flow after the embedded statement.
3641         (Continue.Resolve): Move all error checking to AddContinueOrigin.
3642
3643         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3644         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3645         FlowBranchingBreakable.
3646         (FlowBranchingSwitch): Remove.
3647
3648         Fix test-503.cs
3649         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
3650         error reporting to ...
3651         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3652         Rename from 'AddBreakVector'.  Add new location argument.  Return
3653         a bool indicating whether the 'break' crosses an unwind-protect.
3654         (FlowBranchingException.AddBreakOrigin): Add.
3655         (FlowBranchingException.Merge): Propagate 'break's to surrounding
3656         flowbranching after updating with the effects of the 'finally'
3657         clause.
3658         (FlowBranchingBreakable): New common base class for
3659         FlowBranchingLoop and FlowBranchingSwitch.
3660
3661         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3662         embedded statement.
3663         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3664
3665 2006-05-02  Raja R Harinath  <rharinath@novell.com>
3666
3667         * statement.cs (Do.Resolve): If the loop is infinite, set the
3668         barrier.
3669         (While.Resolve, For.Resolve): Set a barrier after the embedded
3670         statement.  There's no direct control flow that goes from the end
3671         of the embedded statement to the end of the loop.
3672         * flowanalysis.cs (FlowBranching.Infinite): Remove.
3673         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
3674         above ensure that the reachability is correctly computed.
3675
3676         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3677         (UsageVector.MergeBreakOrigins): If the current path is
3678         unreachable, treat it as if all parameters/locals are initialized.
3679         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
3680         infinite loops before merging-in break origins.
3681
3682         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3683         (Reachability.Reachable): Split part into ...
3684         (Reachability.Unreachable): ... this.  Simplify.
3685         (Reachability.IsUnreachable): Use 'Unreachable' instead.
3686
3687         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3688         (Reachability.SetThrowsSometimes): Likewise.
3689         (FlowBranchingBlock.MergeTopBlock): Don't compare against
3690         TriState.Always, use corresponding property.
3691         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3692         (Block.Resolve): Likewise.  Remove some redundant checks.
3693
3694 2006-05-02  Raja R Harinath  <harinath@gmail.com>
3695
3696         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3697         (Reachability.Meet): Don't bother checking AlwaysThrows --
3698         barrier is always set.
3699         (FlowBranchingBlock.Merge): Likewise.
3700
3701 2006-05-01  Raja R Harinath  <harinath@gmail.com>
3702
3703         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3704         checks for unreachable.
3705
3706 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
3707
3708         A fix for #77980
3709         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3710
3711         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3712         whether field is really assigned.
3713
3714 2006-04-30  Raja R Harinath  <harinath@gmail.com>
3715
3716         * flowanalysis.cs (Reachability): Make 4-argument constructor
3717         private.
3718         (Reachability.Meet): Rename from 'And'.  Remove static variant.
3719         (Reachability.Always): Rename from the highly misleading
3720         'Reachability.Never'.
3721         (FlowBranching.Merge): Update to changes.  Mark an impossible
3722         situation with a 'throw'.
3723         (*): Update to changes.
3724
3725 2006-04-29  Raja R Harinath  <harinath@gmail.com>
3726
3727         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3728         Remove 'Undefined'.
3729         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3730         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3731         (*): Update to changes.
3732         * statement.cs: Update to changes.
3733
3734 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
3735
3736         A fix for #78049
3737         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3738
3739 2006-04-28  Raja R Harinath  <harinath@gmail.com>
3740
3741         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3742         dummy UsageVector.
3743
3744         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3745         argument to two arguments: an usage-vector and a bool.  Move call
3746         to FlowBranching.Merge () ...
3747         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3748
3749         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3750         handling of loop and switch reachability to ...
3751         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3752
3753 2006-04-27  Raja R Harinath  <harinath@gmail.com>
3754
3755         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3756         handling to FlowBranchingLoop.InLoop.
3757         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3758
3759 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
3760
3761         A fix for #78115
3762         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3763         anonymous method is allowed from AnonymousContainer here.
3764
3765         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3766
3767 2006-04-24  Raja R Harinath  <rharinath@novell.com>
3768
3769         Fix #78156
3770         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3771
3772 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
3773
3774         A fix for #49011.
3775         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3776         (DoubleConstant.Reduce): Ditto.
3777
3778 2006-04-23  Raja R Harinath  <rharinath@novell.com>
3779
3780         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3781         Remove 'lvalue_right_side' argument.  Move parts to ...
3782         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3783         (LocalVariable.DoResolveLValue): ... these.
3784
3785 2006-04-21  Raja R Harinath  <rharinath@novell.com>
3786
3787         Fix cs1655.cs
3788         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3789         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3790         (LocalVariableReference.DoResolveBase): Use it to implement new
3791         CS1655 check.
3792         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3793         (Argument.Resolve): Simplify.  Move CS1510 check ...
3794         * ecore.cs (Expression.ResolveLValue): ... here.
3795         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3796         (PropertyExpr.DoResolveLValue): Likewise.
3797         (FieldExpr.Report_AssignToReadonly): Likewise.
3798         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
3799         LValueMemberAccess or LValueMemberOutAccess on instance depending
3800         on it.
3801         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3802         DoResolve as appropriate.
3803
3804 2006-04-20  Raja R Harinath  <rharinath@novell.com>
3805
3806         Fix #75800
3807         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3808         implicit conversions on 'out' and 'ref' arguments.
3809
3810         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3811         improve clarity.  Remove dead code.
3812
3813         Fix #66031
3814         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3815         (Catch.Resolve): Resolve VarBlock if it exists.
3816
3817 2006-04-19  Miguel de Icaza  <miguel@novell.com>
3818
3819         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3820         twice, this was some residual code, the enumerator was emitted
3821         properly in the two branche of if later.
3822
3823 2006-04-19  Raja R Harinath  <rharinath@novell.com>
3824
3825         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
3826         cast is never an lvalue.
3827         (Cast.DoResolve, Cast.ResolveRest): Combine.
3828         (Argument.Emit): Simplify slightly.  Move 'Expr is
3829         IMemoryLocation' check ...
3830         (Argument.Resolve): ... here.
3831         (Argument.Error_LValueRequired): Remove.  Inline into only user.
3832
3833         Simplifications.  Fix cs0191-2.cs
3834         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3835         CS1649 and CS1651 to ...
3836         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
3837         the actual selection of the error code and message to a lookup
3838         table.  Add a dummy return value to simplify callsites.
3839         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3840         readonly fields of other instances of the same type.  Move CS0197
3841         warning from ...
3842         * expression.cs (Argument.Resolve): ... here.  Simplify code.
3843         Ensure that ec.InRefOutArgumentResolving is only set during LValue
3844         resolution of an out or ref argument.  The code simplification
3845         above uses this invariant.
3846
3847 2006-04-18  Raja R Harinath  <rharinath@novell.com>
3848
3849         Possibly fix #77752.  Fix cs1690-[4-7].cs.
3850         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3851         CheckMarshallByRefAccess.  Drop parameter.
3852         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
3853         warning.
3854         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3855         InstanceExpression.
3856         * report.cs (AllWarnings): Add CS1690.
3857         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3858         for ref access too.
3859         (LocalVariableReference.DoResolveBase): Update.
3860
3861 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3862
3863         * class.cs (MethodOrOperator): Moved common parts from method class.
3864         detect obsolete attributes.
3865         (Method.Define): Simplified as it reuses code from base.
3866         (Constructor.ValidAttributeTargets): Fixed issue found during
3867         refactoring.
3868         (Destructor.ValidAttributeTargets): Fixed issue found during
3869         refactoring.
3870         (Operator): Finished refactoring set off by #78020. Operator class is now
3871         ordinary method class.
3872
3873         * anonymous.cs: Updated.
3874
3875         * decl.cs (DeclSpace): Add IsGeneric
3876
3877 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3878
3879         * class.cs (Constructor.Emit): Don't emit the attributes twice.
3880
3881 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3882
3883         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3884         detect obsolete attributes.
3885         (Method.CreateEmitContext): Moved to MethodOrOperator.
3886
3887 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3888
3889         A fix for #78048.
3890         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3891         customized exception to make crash detection easier.
3892         (MethodOrOperator): Started to work on new base class for methods and
3893         operators.
3894         (Method): Derives from MethodOrOperator.
3895         (Constructor.Emit): Emits its own attributes.
3896         (AbstractPropertyEventMethod.Emit): Ditto.
3897         (Operator): Derives from MethodOrOperator, will refactor fully in extra
3898         patch.
3899         (Operator.Emit): It's temporary more tricky than should be.
3900         
3901         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3902
3903         * report.cs (InternalErrorException): Add ctor with inner exception.
3904
3905 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
3906
3907         A fix for #76744.
3908         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3909         only not visible.
3910
3911 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
3912
3913         A fix for #77916.
3914         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3915         array.
3916
3917 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3918
3919         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3920         attribute is present and Guid not.
3921         (Interface.ApplyAttributeBuilder): Ditto.
3922
3923         * attribute.cs: Add error message.
3924
3925 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3926
3927         A fix for #78020.
3928
3929         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3930         sources (it's composite) so hold them in extra array as they are used in
3931         Emit phase only. It worked in the previous versions by mistake.
3932         (Attribute.Emit): Emit attribute for more owners when exist.
3933
3934         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3935         it has now different behaviour.
3936
3937 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
3938
3939         * constant.cs (Constant.IsDefaultInitializer): New method.
3940
3941         * class.cs: Updated.
3942
3943         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3944         re-initialize default values. It saves KBs almost for every assembly.
3945         Thanks Zoltan for the idea.
3946         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3947         (ArrayCreation.DoResolve): Resolve only once.
3948         (ArrayCreation.Emit): Emit static initializer only when it is faster.
3949         (ArrayCreation.GetAttributableValue): Cope with optimized values.
3950
3951 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
3952
3953         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3954         From #77961.
3955
3956 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3957
3958         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3959         in an embedded statement too.
3960
3961 2006-04-01  Raja R Harinath  <rharinath@novell.com>
3962
3963         Fix #77958
3964         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3965
3966 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3967
3968         A fix for #77966.
3969
3970         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3971         was not specified.
3972
3973         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3974
3975 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
3976
3977         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3978         phase.
3979
3980         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3981         LocalTemporary change.
3982
3983         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3984         TypeContainer.
3985         (ClassOrStruct.DefineFieldInitializers): Implemented static field
3986         initializers optimization.
3987         (ClassOrStruct.TypeAttr): Moved from modifiers.
3988         (Constructor.CheckBase): Don't crash when static ctor has parameters.
3989         (FieldBase.ResolveInitializer): Resolves initializer.
3990         (FieldBase.HasDefaultInitializer): New property.
3991
3992         * cs-parser.jay: Removed message.
3993
3994         * expression.cs (CompilerGeneratedThis): New specialization.
3995
3996         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3997
3998 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
3999
4000         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
4001
4002 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
4003
4004         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
4005         be now EnumConstants only.
4006
4007 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
4008
4009         * attribute.cs, driver.cs: Reset more caches.
4010
4011 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4012
4013         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
4014
4015 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4016
4017         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
4018         for easier reuse. Updated all overrides.
4019         (IntegralConstant): New base class for all integral constants.
4020         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
4021         of the constant range, report custom error.
4022         (UIntConstant.Reduce): Fixed uint conversion.
4023
4024         * ecore.cs, literal.cs: Reduce updates.
4025
4026 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4027
4028         A fix for #75813.
4029
4030         * class.cs (Constructor.Define): Removed extra if for default ctors.
4031         A patch from Atsushi Enomoto.
4032
4033 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
4034
4035         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
4036         GetAttributableValue.
4037
4038         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
4039         when required.
4040
4041         * convert.cs (ImplicitConversionRequired): Error message moved to
4042         DoubleLiteral.
4043
4044         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
4045         automatic implicit conversion of an output value.
4046         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
4047
4048         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
4049         conversion.
4050         (TypeOf.GetAttributableValue): Add extra handling for object type.
4051
4052         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
4053         special error message.
4054
4055 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
4056
4057         * class.cs (Constructor.Emit): Don't crash when struct ctor is
4058         InternalCall.
4059         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
4060         compatible with MS runtime.
4061
4062 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
4063
4064         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
4065         attribute arguments here.
4066
4067         * class.cs (Indexer.Define): The check was moved to attribute class.
4068
4069 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
4070
4071         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
4072         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
4073         easier.
4074
4075 2006-03-22  Raja R Harinath  <rharinath@novell.com>
4076
4077         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
4078         mcs to keep code differences small.
4079         * attribute.cs (Attribute.GetParameterDefaultValue): New.
4080         * typemanager.cs (parameter_default_value_attribute_type): New.
4081         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
4082         CS1908 check.
4083
4084 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
4085
4086         * expression.cs (StringConcat.Append): Reverted back to no warning state.
4087
4088 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
4089
4090         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
4091
4092         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
4093         the blocks too.
4094
4095 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
4096
4097         * doc-bootstrap.cs : fix build.
4098
4099 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
4100
4101         * expression.cs (StringConcat.Append): Issue a warning when empty string
4102         is going to append.
4103
4104 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
4105
4106         * assign.cs (CompoundAssign.ResolveSource): Removed.
4107
4108         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
4109         clean up.
4110
4111         * class.cs (TypeContainer.FindMethods): Removed.
4112         (TypeContainer.CheckMemberUsage): Made static.
4113
4114         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
4115
4116         * constant.cs (CheckRange): Removed unused type argument.
4117         (CheckUnsigned): Removed unused type argument.
4118
4119         * cs-parser.jay: Updated after MemberAccess clean up.
4120         Uses Length for empty string test.
4121
4122         * cs-tokenizer.cs: Uses Length for empty string test.
4123         (IsCastToken): Made static.
4124         (is_hex): Made static.
4125         (real_type_suffix): Made static.
4126
4127         * decl.cs (SetupCache): Made static.
4128         (OnGenerateDocComment): Removed unused ds argument.
4129
4130         * delegate.cs (VerifyDelegate): Removed unused argument.
4131
4132         * doc.cs: Uses Length for empty string test.
4133
4134         * driver.cs: Uses Length for empty string test.
4135
4136         * enum.cs (IsValidEnumType): Made static
4137
4138         * expression.cs (EnumLiftUp): Removed unused argument.
4139         (ResolveMethodGroup): Ditto.
4140         (BetterConversion): Ditto.
4141         (GetVarargsTypes): Ditto.
4142         (UpdateIndices): Ditto.
4143         (ValidateInitializers): Ditto.
4144         (MemberAccess.ctor): Ditto.
4145         (GetIndexersForType): Ditto.
4146
4147         * flowanalysis.cs: (MergeFinally): Removed unused argument.
4148
4149         * iterators.cs: Updated after MemberAccess clean up.
4150
4151         * location.cs: Uses Length for empty string test.
4152
4153         * namespace.cs: Uses Length for empty string test.
4154
4155          * report.cs (CheckWarningCode): Made static.
4156
4157         * statement.cs (LabeledStatement): Removed unused argument.
4158
4159         * typemanager.cs (FilterNone): Removed.
4160
4161 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4162
4163         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
4164         obsolete.
4165
4166         * class.cs: Updated.
4167
4168 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4169
4170         * cs-parser.jay.cs: __arglist is not allowed for delegates.
4171
4172 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4173
4174         A fix for #77822.
4175
4176         * expression.cs (VerifyArgumentsCompat): Reverted to double error
4177         reporting, it's more tricky than I thought.
4178
4179 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
4180
4181         A fix for #77816.
4182
4183         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
4184         host container.
4185         (AnonymousMethod.ImplicitStandardConversionExists): New method.
4186         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
4187         Add more error reporting; Fixed issue with params.
4188
4189         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
4190
4191         * cs-parser.jay: AnonymousMethod requires host container.
4192
4193         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
4194
4195 2006-03-18  Raja R Harinath  <harinath@gmail.com>
4196
4197         * class.cs: Change 'TypeContainer ds' constructor argument to
4198         'DeclSpace parent'.  Some classes were missed below due to
4199         different naming convention.
4200
4201         * class.cs (MemberCore.Parent): Delete.  This makes the
4202         ParentContainer changes below enforceable by the compiler.
4203
4204         Treat pointers to enclosing declaration space as 'DeclSpace', not
4205         'TypeContainer'.
4206         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
4207         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
4208
4209         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
4210         of TypeContainer.
4211         (Block.AddThisVariable): Likewise.
4212         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
4213         (AbstractPropertyEventMethod.Emit): Likewise.
4214         (AbstractPropertyEventMethod.EmitMethod): Likewise.
4215         (GetMethod.Define, SetMethod.Define): Likewise.
4216         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
4217         (DelegateMethod.EmitMethod): Likewise.
4218
4219         Fix regression test-partial-13.cs.
4220         Rationalize use of PartialContainer.  Ensure that the partial
4221         class semantics can be tied to type-correctness, i.e., any
4222         violation will cause a compile error.
4223         * class.cs, const.cs: Access all fields that belong to class
4224         TypeContainer via ParentContainer.  Arguments of EmitContexts and
4225         Resolve()-like functions still use 'Parent'.
4226
4227         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
4228         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
4229         (PropertyMethod.CheckModifiers): Remove unused argument.
4230         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
4231         DeclSpace.
4232
4233 2006-03-17  Raja R Harinath  <harinath@gmail.com>
4234
4235         Make semantics of PartialContainer simpler.
4236         * decl.cs (DeclSpace.IsPartial): Remove.
4237         * class.cs (TypeContainer.IsPartial): Likewise.
4238         (TypeContainer..ctor): Set PartialContainer to point to self.
4239         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
4240         (TypeContainer.FindNestedType): Likewise.
4241         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
4242
4243 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
4244
4245         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
4246
4247 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
4248
4249         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
4250         classes.
4251
4252 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
4253
4254         * class.cs (Operator.Define): An error for base conversion was not
4255         reported correctly.
4256
4257 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
4258
4259         * iterator.cs : yield break is allowed in try statement which has
4260           catch clauses. Fixed bug #77767.
4261
4262 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
4263
4264         A fix for #77593, #77574.
4265
4266         * class.cs (MethodCore.CheckBase): Another if for operator.
4267
4268 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
4269
4270         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
4271         were not resolved
4272
4273         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
4274         (DelegateCreation.ImplicitStandardConversionExists): New method for just
4275         conversion test.
4276         
4277         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
4278         not needed.
4279
4280         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
4281         Updated after another emitcontext usage was clean up. It should help us to
4282         synchronize with gmcs easier.
4283
4284 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
4285
4286         A fix for #77353.
4287
4288         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
4289         (Event.Define): ditto
4290         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
4291
4292         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
4293         Removed redundant code and set NewSlot for Invoke method too.
4294
4295         * parameter.cs (Parameters.ctor): Add custom, type ctor.
4296         (Parameters.MergeGenerated): New method. Use this method when you merge
4297         compiler generated argument with user arguments.
4298
4299 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
4300
4301         * attribute.cs (ResolveAsTypeTerminal): Removed.
4302
4303         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
4304         specialization for predefined types; 30% speed up.
4305         Finally placed obsolete check to right place.
4306         (Expression.ResolveType): Removed.
4307
4308         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
4309         Updated after ResolveType was removed.
4310
4311         * expression.cs (Cast.ctor): Check void cast.
4312         (Binary.ResolveAsTypeTerminal): Is never type.
4313         (Conditional.ResolveAsTypeTerminal): Is never type.
4314
4315         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
4316
4317 2006-03-01  Raja R Harinath  <rharinath@novell.com>
4318
4319         Fix #77679.
4320         * expression.cs (ParameterReference.DoResolveBase): Change return
4321         type to bool.
4322         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
4323         Update.
4324
4325         Fix #77628.
4326         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
4327
4328         Fix #77642.
4329         * typemanager.cs (GetFullNameSignature): Don't nullref on
4330         protected accessors.
4331
4332 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
4333
4334         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
4335         these two separated members to simplify the code.
4336         (Attribute.Resolve): Refactored to use new fields and methods.
4337         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
4338         implemented obsolete attribute checking.
4339         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
4340         implemented obsolete checking again. It look line never ending quest ;-)
4341         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
4342
4343         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
4344
4345         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
4346
4347         *class.cs (Property.Define): Add RegisterProperty call.
4348
4349         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
4350         argument groups (only 2).
4351
4352         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
4353         encoding expression to arguments.
4354         (Expression.ExprClassToResolveFlags): Just turned to property.
4355
4356         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
4357         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
4358         optimized as well as implemented support for zero-length attributes.
4359
4360         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
4361         Add caching of PropertyInfo's.
4362
4363 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4364
4365         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
4366         error multiple times.
4367
4368 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4369
4370         New partial class implementation.
4371         A fix for #77027, #77029, #77403
4372
4373         * attribute.cs (Attributable): Made attributes protected.
4374
4375         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
4376         the replacements of ClassPart and PartialContainer.
4377         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
4378         (TypeContainer.AddInterface): Ditto.
4379         (TypeContainer.AddPartial): The main method for partial classes. It checks
4380         for errors and merges ModFlags and attributes. At the end class is added to
4381         partial_parts list.
4382         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
4383         required here.
4384         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
4385         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
4386         from the rest of partial classes.
4387         (TypeContainer.GetClassBases): Simplified.
4388         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
4389         DefineType.
4390         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
4391         (TypeContainer.HasExplicitLayout): Uses Flags now.
4392         (PartialContainer): Removed.
4393         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
4394         (StaticClass): Was merged with Class.
4395         (Class.GetClassBases): class and static class bases are verified here.
4396         (Class.TypeAttr): Added static attributes when class is static.
4397         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
4398         (MemberBase): In some cases we need to call parent container for partial
4399         class. It should be eliminated but it's not easy now.
4400
4401         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
4402
4403         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
4404         partial classed to accumulate class comments.
4405         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
4406
4407         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
4408
4409         * driver.cs (MainDriver): Tree.GetDecl was removed.
4410
4411         * modifiers.cs (Modifiers): Add partial modifier.
4412
4413         * tree.cs (Tree.decl): Removed.
4414         (RootTypes): Started to use this class more often for root types
4415         specializations.
4416
4417 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4418
4419         A fix for #77615
4420
4421         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
4422         external interface does not have an attribute.
4423
4424 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4425
4426         Another prerequisites for new partial classs implementation.
4427         
4428         * attribute.cs (Attribute.Equal): Implemented.
4429         (Attribute.Emit): Changed as attributes can be applied more than twice.
4430         (Attributes.Emit): Check for duplicate attributes here.
4431
4432         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
4433         as a parameter, clean-up.
4434
4435 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4436
4437         A fix for #77485
4438
4439         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
4440         contains obsolete attribute check which can in some cases look for base
4441         type of current class which is not initialized yet.
4442         (TypeContainer.BaseType): Replacement of ptype.
4443
4444         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
4445
4446 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4447
4448         First of prerequisites for new partial classs implemention.
4449         
4450         * attribute.cs (Attributable): Extended by ResolveContext;
4451         Attributes finally have correct context for resolving in all cases.
4452         (AttachTo): Attribute owner is assigned here.
4453
4454         * codegen.cs (IResolveContext): Introduce new interface to hold
4455         all information needed in resolving phase.
4456         (EmitContext): Implements IResolveContext; more clean-up needed here.
4457         
4458         * decl.cs (MemberCore): Implemented IResolveContext.
4459
4460         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
4461         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
4462         parameter.cs, statement.cs, tree.cs, typemanager.cs:
4463         Refactored to use new IResolveContext instead of EmitContext; cleanup
4464
4465 2006-02-06  Miguel de Icaza  <miguel@novell.com>
4466
4467         * codegen.cs (EmitScopeInitFromBlock): check here the
4468         capture_context, there is no need to make two calls to the
4469         EmitContext. 
4470
4471         * anonymous.cs: Add some debugging messages that might help me
4472         track other instances of this problem in the future (the
4473         regression of test 467).
4474
4475         * cs-parser.jay: track the variable block, as we need to initalize
4476         any captured variables declared in this block for the "catch"
4477         portion of the "Try" statement.
4478
4479         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
4480         scope initialization for captured variables. 
4481
4482         Also, move the emit for the variables after the block location has
4483         been marked.
4484
4485 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
4486
4487         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
4488
4489 2006-02-02  Miguel de Icaza  <miguel@novell.com>
4490
4491         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
4492         commit yesterday, the initialization for the roots is necessary.
4493         What is not necessary is the scope activation.
4494
4495 2006-02-02  Raja R Harinath  <rharinath@novell.com>
4496
4497         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
4498         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
4499         CS0206 checks.
4500         (Argument.Resolve): Remove CS0206 checks.
4501
4502 2006-02-01  Miguel de Icaza  <miguel@novell.com>
4503
4504         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
4505         scopes for all the roots, the scopes will now be emitted when the
4506         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
4507
4508         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
4509         code.  This reduces a lot of existing cruft.
4510         
4511         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
4512         that the ScopeInfo is generated as we enter the scope, not at the
4513         time of use, which is what we used to do before.
4514
4515         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
4516         every time a Block is about to be emitted if we have a
4517         CaptureContext. 
4518
4519 2006-02-01  Raja R Harinath  <rharinath@novell.com>
4520
4521         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4522         (Reset): Update.
4523         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
4524
4525         * typemanager.cs (cons_param_array_attribute): Make private.
4526         (Reset): Set it to null.
4527         (InitCoreHelpers): Don't initialize it.
4528         (ConsParamArrayAttribute): New.  Initialize it as needed.
4529         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
4530
4531 2006-01-31  Miguel de Icaza  <miguel@novell.com>
4532
4533         * expression.cs: There might be errors reported during the
4534         selection of applicable methods.  If there are errors, do not
4535         continue execution as it will lead the compiler to crash.
4536
4537 2006-01-30  Miguel de Icaza  <miguel@novell.com>
4538
4539         * expression.cs: Member access is not allowed on anonymous
4540         methods.  Fixes #77402.
4541
4542 2006-01-30  Raja R Harinath  <rharinath@novell.com>
4543
4544         Fix #77401
4545         * cs-parser.jay (VariableDeclaration): Don't set
4546         current_array_type to null.
4547         (field_declaration, event_declaration, declaration_statement):
4548         Set it to null here.
4549
4550 2006-01-28  Raja R Harinath  <harinath@gmail.com>
4551
4552         * typemanager.cs (GenericParameterPosition): New.
4553         * doc.cs: Use it.
4554
4555 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
4556
4557         * doc.cs : To process "include" elements, first we should create
4558           another list than XmlNodeList, because it could result in node
4559           removal, which could result in that the XmlNodeList gives up
4560           yielding next node.
4561
4562           (Also made code identical to gmcs again.)
4563
4564 2006-01-25  Miguel de Icaza  <miguel@novell.com>
4565
4566         * ecore.cs: Introduce an error report that we were not catching
4567         before, if not silent, we must report the error.  Gonzalo ran into
4568         it.
4569
4570 2006-01-23  Miguel de Icaza  <miguel@novell.com>
4571
4572         A fix for bug: #76957
4573         
4574         * iterators.cs (MoveNextMethod.CreateMethodHost): call
4575         ComputeMethodHost before creating the method, this is a new
4576         requirement. 
4577
4578         * anonymous.cs (AnonymousContainer): Now we track all the scopes
4579         that this method references (RegisterScope).  The actual scope
4580         where the method is hosted is computed with the ComputeMethodHost
4581         before we create the method.
4582
4583         Moved the Deepest routine here.
4584
4585         (AnonymousContainer.ComputeMethodHost): New routine used to
4586         compute the proper ScopeInfo that will host the anonymous method.
4587
4588         (ScopeInfo): Deal with multiple roots.  The problem was that we
4589         did not have a unique root where all ScopeInfos could be hanged
4590         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
4591         of roots.  
4592
4593         Remove AdjustMethodScope which is now computed at the end.  Remove
4594         LinkScope which did a partial link, instead link all ScopeInfos
4595         before code generation from the new "LinkScopes" routine. 
4596
4597         Simplify all the Add* routines as they no longer need to maintain
4598         the tree, they just need to record that they are using variables
4599         from a ScopeInfo.
4600
4601         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
4602         routines to produce the forest of ScopeInfo trees.
4603
4604         * class.cs (TypeContainer.AppendMethod): This is just like
4605         AddMethod, but ensures that an interface implementation method
4606         (IEnumerable.XXX) is not inserted at the beginning of the queue of
4607         methods, but at the end.
4608
4609         We use this functionality to ensure that the generated MoveNext
4610         method in the iterator class is resolved/emitted before the
4611         enumerator methods created.   
4612
4613         This is required because the MoveNext method computes the right
4614         ScopeInfo for the method.  And the other methods will eventually
4615         need to resolve and fetch information computed from the anonymous
4616         method. 
4617
4618 2006-01-21  Raja R Harinath  <harinath@gmail.com>
4619             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
4620
4621         Fix rest of #76995.
4622         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
4623         the 'aliases' hash.
4624         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
4625         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
4626
4627 2006-01-18  Raja R Harinath  <rharinath@novell.com>
4628
4629         Fix #76656, cs0231-2.cs.
4630         * cs-parser.jay (formal_parameter_list): Make error case catch
4631         more issues.
4632         (parenthesized_expression_0): Add CS1026 check.
4633         (invocation_expression): Remove unused { $$ = lexer.Location }.
4634
4635 2006-01-17  Raja R Harinath  <rharinath@novell.com>
4636
4637         Fix #76824.
4638         * cs-parser.jay (statement_expression): Don't list out the
4639         individual statement-expressions.  Convert syntax error into
4640         CS0201 check.
4641
4642 2006-01-16  Raja R Harinath  <rharinath@novell.com>
4643
4644         Fix #76874.
4645         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4646         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
4647         CheckIntermediateModification.
4648         (FieldExpr.DoResolve): Add new two-argument version that
4649         allows us to resolve the InstanceExpression as an lvalue.
4650         The one-argument variant is now just a wrapper.
4651         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4652         Resolve the lhs as an lvalue if the it has a value type.
4653         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4654         from Assign.DoResolve.
4655         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4656         resolved as an lvalue.
4657         (PropertyExpr.DoResolve): Update.
4658         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4659         has a value type.  Move CS1612 check here from
4660         CheckIntermediateModification.
4661         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4662         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
4663         'right_side' of a ResolveLValue on an 'out' argument.
4664         (EmptyExpression.LValueMemberAccess): New.  Used as the
4665         'right_side' of a propagated ResolveLValue on a value type.
4666         (LocalVariableReference.DoResolveBase): Recognize
4667         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4668         Add CS1654 check.
4669         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4670         EmptyExpression.Null.
4671
4672 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
4673
4674         * typemanager.cs : added IsGenericParameter(). In mcs it always
4675           return false.
4676         * doc.cs : for generic parameters, use GenericParameterPosition,
4677           not FullName.
4678
4679 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
4680
4681         * expression.cs: Fix Console.WriteLine ((this = x).foo);
4682
4683 2006-01-12  Miguel de Icaza  <miguel@novell.com>
4684
4685         This fixes the problem where we used ldfld instead of ldflda to
4686         load the "THIS" pointer on captured parameters, when THIS is a
4687         value type.  See bug #77205.
4688         
4689         * iterators.cs (CapturedThisReference.Emit): Pass false to
4690         EmitThis (we do not need the address).
4691
4692         * codegen.cs (EmitThis): it needs to know whether we need the
4693         address of `this' or not.  This is used by value types.  
4694
4695         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4696         every other call passes false.
4697
4698 2006-01-12  Raja R Harinath  <rharinath@novell.com>
4699
4700         Fix #77221.
4701         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4702         GetOverride.
4703         * expression.cs (Invocation.OverloadResolve): Update.
4704         (Invocation.DoResolve): Avoid double resolution of invocation.
4705
4706 2006-01-11  Raja R Harinath  <rharinath@novell.com>
4707
4708         Fix #77180.
4709         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4710         unary negation of floating point types as 0-expr; negation cannot
4711         overflow in floating point types.
4712
4713         Fix #77204.
4714         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4715         on operands of 'void' type.
4716
4717         Fix #77200.
4718         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4719         and ExclusiveOr for boolean constants too.
4720
4721 2006-01-09  Raja R Harinath  <rharinath@novell.com>
4722
4723         Fix #75636.
4724         * expression.cs (Invocation.OverloadResolve): Replace reflected
4725         override methods with their base virtual methods, rather than
4726         skipping over them.
4727         * typemanager.cs (TypeManager.GetOverride): New.
4728
4729 2006-01-05  Jb Evain  <jbevain@gmail.com>
4730
4731         * class.cs (Property.Define, Indexer.Define): do not tag the
4732         properties as SpecialName | RTSpecialName.
4733
4734 2006-01-04  Miguel de Icaza  <miguel@novell.com>
4735
4736         * class.cs (MethodCore.IsDuplicateImplementation): This method was
4737         doing a low-level comparission of parameter types.  It was lacking
4738         a check for __argslist. 
4739
4740 2005-12-30  Miguel de Icaza  <miguel@novell.com>
4741
4742         * expression.cs (ParameterReference.DoResolveBase): Allow
4743         reference parameters if they are local to this block. 
4744
4745         This allows the ref and out parameters of a delegate to be used in
4746         an anonymous method, for example:
4747
4748         delegate void set (out int x);
4749
4750         set s = delegate (out int x){
4751                 x = 0;
4752         };
4753
4754         This is used by functionality introduced late in the C# language.
4755         
4756         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4757         method that take ref and out parameters. 
4758
4759         Fixes #77119 which was a late change in the spec.
4760
4761 2005-12-23  Miguel de Icaza  <miguel@novell.com>
4762
4763         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4764         parent if its the same scope.  Fixes #77060.
4765
4766 2005-12-21  Miguel de Icaza  <miguel@novell.com>
4767
4768         * driver.cs: Report the case of no source files and no -out:
4769         argument provided.
4770
4771 2005-12-20  Raja R Harinath  <rharinath@novell.com>
4772
4773         Fix #77035.
4774         * expression.cs (ComposedCast.GetSignatureForError): Define.
4775
4776 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4777
4778         Fix #76995
4779
4780         * namespace.cs (NamespaceEntry): Add extern_aliases as a
4781         ListDictionary, to contain the ExternAliasEntry entries (in
4782         addition to the NamespaceEntry.aliases hashtable). This field is
4783         shared between the original entry and its doppelganger (bodyless 
4784         copy of it).
4785         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4786         extern_aliases field.
4787         (NamespaceEntry.Lookup): Move the IsImplicit check after the
4788         lookup in extern_aliases.
4789
4790 2005-12-16  Raja R Harinath  <rharinath@novell.com>
4791
4792         Fix #77006.
4793         * class.cs (TypeContainer.Mark_HasEquals): New.
4794         (TypeContainer.Mark_HasGetHashCode): New.
4795         (ClassPart): Override them.
4796         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4797
4798         Fix #77008.
4799         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4800         'parent' argument to the base constructor.
4801
4802         Remove all mention of TypeContainer from decl.cs.
4803         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4804         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4805         (DeclSpace.DeclSpace): Likewise.
4806         (DeclSpace.DefineMembers): Remove unused argument.
4807         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
4808         debugging check -- we don't care if the debug code throws an
4809         InvalidCastException instead of an InternalErrorException.
4810         * class.cs (TypeContainer.DefineMembers): Update to changes.
4811         (TypeContainer.DoDefineMembers): Likewise.
4812         (TypeContainer.GetMethods): Likewise.
4813         (PropertyMember.Define): Likewise.
4814         (MemberBase.Parent): New property that forwards to
4815         MemberCore.Parent, but ensures that we get a TypeContainer.
4816         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4817         (RootContext.PopulateTypes): Likewise.  Remove special case code
4818         for !RootContext.StdLib: DefineMembers is idempotent.
4819
4820 2005-12-14  Miguel de Icaza  <miguel@novell.com>
4821
4822         * convert.cs (ExplicitConversionCore): Check the return value from
4823         ExplicitConversionCore which can return null on failure.  Fixes #76914
4824
4825 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
4826
4827         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4828
4829 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
4830
4831         * doc.cs : The search for referenced namespace was insufficient to
4832           get global one as it used to do. Fixed bug #76965.
4833
4834 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
4835
4836         * doc.cs : check name in cref in the last phase that whether it is
4837           namespace or not.
4838
4839 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4840
4841         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4842           Mono.C5.
4843
4844 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4845
4846         * doc.cs : so it turned out that we cannot skip override check for 
4847           interface members. Fixed bug #76954.
4848
4849 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4850
4851         * cs-tokenizer.cs : fixed bug #75984:
4852           - #warning and #error should not be handled when the source line
4853             is disabled.
4854           - #line is not checked strictly when the source line is disabled.
4855           - #define and #undef is on the other hand checked strictly at any
4856             state.
4857
4858 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
4859
4860         * cs-tokenizer.cs : missing Location (actually, filename) in one of
4861           CS1027 report.
4862
4863 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4864
4865         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4866
4867         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4868         event initializers.
4869         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4870         (FieldBase.Initializer): Initializer is now optional.
4871         (EventField.Define): Only event field can have initializer.
4872
4873         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4874
4875         * const.cs (Const): Reuse initializer.
4876
4877         * cs-parser.jay: Updated after FieldBase changes.
4878         Added current_array_type to simplify array initializers.
4879
4880         * ecore.cs (NullCast.IsDefaultValue): Implemented.
4881
4882         * expression.cs, iterators.cs: Updated.
4883
4884         * namespace.cs (NamespaceEntry): Made UsingFound private.
4885
4886 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4887
4888         * parameterCollection.cs: Obsolete, removed.
4889         * parser.cs: Obsolete, removed.
4890
4891 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4892
4893         Fix #76849.
4894         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4895
4896         * enum.cs (Enum.Define): Set obsolete context here.
4897
4898 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4899
4900         * doc.cs :
4901           - FindDocumentedMember() now expects 1) paramList as null
4902             when "we don't have to check the number of parameters" and
4903             2) Type.EmptyTypes when "there is no arguments".
4904           - Introduced FoundMember struct to hold the exact type which was
4905             used to find the documented member (the above change broke
4906             test-xml-044; it might be better just to use DeclaringType than
4907             what MS does, like this change does, but it depends on usage.)
4908
4909 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4910
4911         * doc.cs : documented member might be from DeclaringType for nested
4912           types. Fixed bug #76782.
4913
4914 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
4915
4916         * anonymous.cs: Have the param code handle leaving copies on the
4917         stack etc. Allows anonymous params to take part in the assignment
4918         code (++, +=, etc). Fixes bug #76550
4919
4920         * expression.cs: Handle the prepare_for_load/leave_copy by passing
4921         it down to the anon code.
4922
4923         * iterators.cs: Use dummy var here
4924
4925         * codegen.cs: Handle new vars
4926
4927 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4928
4929         Fix #76849.
4930         * class.cs (MethodData.Define): Set proper Obsolete context.
4931
4932         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4933         obsolete context.
4934         (FieldExpr.DoResolve): Ditto.
4935
4936 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4937
4938         Fix #76849.
4939         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4940         parent is not obsolete.
4941
4942 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
4943
4944         * doc.cs : (FindDocumentedMember) find parameterless members first
4945           and get CS0419 in the early stage. Fixed first case of bug #76727.
4946
4947 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
4948
4949         Fix #76859.
4950         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4951         no error was reported.
4952
4953         *expression.cs (Binary.DoResolve): left can be null.
4954
4955 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
4956
4957         Fix #76783.
4958         * class.cs (MethodData.Emit): Parameters should be labeled first.
4959
4960 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
4961
4962         Fix #76761.
4963         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4964
4965 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
4966
4967         * attribute.cs (AreParametersCompliant): Moved to Parameter.
4968
4969         * class.cs (MethodCore): Parameter clean up.
4970         (IMethodData): Added ParameterInfo.
4971         (MethodData): Parameter clean up.
4972         (Indexer.Define): Parameter clean up.
4973
4974         * anonymous.cs,
4975         * codegen.cs,
4976         * cs-parser.jay,
4977         * decl.cs,
4978         * doc.cs,
4979         * ecore.cs,
4980         * flowanalysis.cs,
4981         * iterators.cs,
4982         * pending.cs,
4983         * statement.cs,
4984         * typemanager.cs: Parameter clean up.
4985
4986         * delegate.cs (Define): Get rid of duplicated code.
4987
4988         * expression.cs (ParameterReference): Removed useless parameters
4989         and simplified.
4990         (Invocation): Ditto.
4991
4992         * parameter.cs (ParamsParameter): New class, params specialization.
4993         (ArglistParameter): Attemp to separate arglist.
4994         (Parameter): Refactored to be reusable and faster.
4995         (Parameter.Modifier): Made understandable.
4996         (Parameters): Changed to be used as a class for `this' assembly
4997         parameters. Refactored to use new specialized classes.
4998
4999         * support.cs (ParameterData): Added Types property.
5000         (InternalParameters): Deleted.
5001
5002 2005-08-20  Martin Baulig  <martin@ximian.com>
5003
5004         Merging this patch from GMCS to fix #75867.
5005
5006         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5007         scope if we don't already have it.
5008
5009 2005-11-17  Martin Baulig  <martin@ximian.com>
5010
5011         * anonymous.cs
5012         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
5013         inherit the scope from our parent.  Fixes #76653.
5014
5015 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
5016
5017         * doc.cs : the previous patch does not actually fix the bug.
5018           PropertyInfo override check is now implemented and really fixed it.
5019         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
5020
5021 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
5022
5023         * doc.cs : apply "override filter" also to properties.
5024           Fixed bug #76730.
5025
5026 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
5027
5028         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
5029           no need to check overrides. For classes, omit those results from 
5030           interfaces since they must exist in the class. Fixed bug #76726.
5031
5032 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5033
5034         * typemanager.cs : (GetFullNameSignature) differentiate indexers
5035           with different parameters. Fixed the second problem in #76685.
5036
5037 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5038
5039         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
5040           get expected 'protected' access in CheckValidFamilyAccess()).
5041           Fixed bug #76692.
5042
5043 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
5044
5045         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
5046           Fixed bug #76705.  CS1569 was incorrectly commented out.
5047
5048 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
5049
5050         * doc.cs : use Invocation.IsOverride() to do real override check.
5051         * expression.cs : made Invocation.IsOverride() internal.
5052
5053 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
5054
5055         * doc.cs : use TypeManager.FindMembers() instead of (possible)
5056           TypeBuilder.FindMembers() and filter overriden base members out.
5057           Fixed bug #76990.
5058
5059 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5060
5061         * doc.cs : ref/out parameters are represented as '@' (instead of
5062           '&' in type FullName). Fixed bug #76630 (additionally crefs).
5063
5064 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5065
5066         * doc.cs : when there was no '.' in cref to methods in doc comment,
5067           then parameters were missing in the output. Fixed bug #76691.
5068
5069 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5070
5071         * driver.cs : don't output docs when there is an error.
5072           Fixed bug #76693.
5073
5074 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5075
5076         * doc.cs :
5077           Now it should detect indexers. Fixed primary concern in bug #76685.
5078           Fixed CS0419 message to not show the identical member signature in
5079           the message.
5080
5081 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
5082
5083         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
5084           instead of Type.FindMembers() since it does not handle events.
5085           Fixed bug #71604.
5086
5087 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
5088
5089         * codegen.cs: Fixed typo (speficied -> specified).
5090
5091 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
5092
5093         Fix #76369.
5094         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
5095
5096 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
5097
5098         * attribute.cs: Changed error message.
5099
5100         * cs-tokenizer.cs: One more check.
5101
5102 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
5103
5104         * statement.cs (Block.Resolve): Ignore empty statement.
5105
5106 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
5107
5108         * report.cs: Made error/warning methods more strict to avoid
5109         their misuse.
5110
5111         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
5112         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
5113         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
5114         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
5115
5116 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
5117
5118         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
5119         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
5120
5121         * class.cs (TypeContainer.IsComImport): New property.
5122         (Constructor.Define): Create proper ctor for ComImport types.
5123
5124         * expression.cs (New.CheckComImport): Fixed.
5125
5126 2005-11-07  Miguel de Icaza  <miguel@novell.com>
5127
5128         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
5129         that a parameter has been captured does not mean that we do not
5130         have to do the rest of the processing.  This fixes the second part
5131         of #76592.  If there was another anonymous method capturing
5132         values in the past, the Scope would never be set for the second
5133         method that captured the same parameter.
5134
5135         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
5136         properly manipulate the stack.   Second part of fix for #76592.
5137
5138         * expression.cs (New): Add support for invoking "new" on
5139         interfaces that have been flagged with the ComImport attribute and
5140         the CoClass.  Fixes #76637 
5141
5142         * statement.cs (Try.DoEmit): When a variable is captured, do not
5143         try to emit the vi.LocalBuilder variable as it has been captured.
5144         Create a temporary variable and store the results on the
5145         FieldBuilder.  Fixes #76642
5146
5147 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
5148
5149         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
5150
5151         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
5152
5153         * expression.cs (Binary.DoResolve): Added && optimalization.
5154     
5155         * typemanager.cs (AddUserType): Removed useless argument.
5156
5157 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
5158
5159         * statement.cs (Block.variables): Uses ListDictionary.
5160
5161 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
5162
5163         Fix #75969.
5164         * class.cs (PartialContainer.EmitType): Customized to emit
5165         security attributes.
5166         (ClassPart.ApplyAttributeBuilder): Transform security attribute
5167         for partial classes.
5168
5169 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
5170
5171         Fix #76599.
5172         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
5173         access has to be fixed.
5174         
5175         * typemanager.cs (IsUnmanagedType): Wrong common field type.
5176
5177 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
5178
5179         Fix #76590.
5180         * ecore.cs (NullCast.Reduce): Implemented.
5181
5182         * expression.cs (ArrayCreation.CheckIndices): Correcly check
5183         constant type.
5184         
5185         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
5186         properly.
5187         (Foreach.Resolve): Catch null properly.
5188
5189 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
5190  
5191         * cs-tokenizer.cs: Warning text fix.
5192
5193         * driver.cs: AllWarningNumbers exposed on public interface.
5194
5195         * report.cs (): Reviewed warning numbers.
5196         (IsValidWarning): Use binary search.
5197
5198 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
5199  
5200         * driver.cs: Implemeted resource visibility.
5201         (Resources): New class for code sharing between /res: and
5202         /linkres:
5203  
5204 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
5205
5206         Fix #76568.
5207         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
5208         folding.
5209         
5210         * convert (Convert.ImplicitReferenceConversion): NullCast holds
5211         contants only.
5212         
5213         * ecore.cs (NullCast): Child is contant only.
5214         
5215         * literal.cs (NullLiteral.Reduce): null can be converted to any
5216         reference type.
5217
5218 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
5219
5220         * driver.cs: Use Encoding.Default as default code page instead
5221           of ISO-28591.
5222
5223 2005-10-27  Raja R Harinath  <rharinath@novell.com>
5224
5225         Fix #76085.
5226         * expression.cs (Invocation.Error_InvalidArguments): Handle
5227         __arglist parameters.
5228         (Invocation.VerifyArgumentsCompat): Likewise.
5229         * support.cs (ReflectionParameters.GetSignatureForError): Print
5230         __arglist parameters.
5231         (InternalParamters.GetSignatureForError): Likewise.
5232         * parameter.cs (Parameters.GetSignatureForError): Likewise.
5233
5234 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
5235
5236         * attribute.cs (GetPropertyValue): Made public.
5237
5238         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
5239         Resolve.
5240         Add new property WrapNonExceptionThrows to handle 2.0 assembly
5241         attribute.
5242         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
5243         is not defined.
5244         
5245         * driver.cs: Reflect method name change.
5246         
5247         * statement.cs (Try.Resolve): Warn when try has both general
5248         exception handlers.
5249         
5250         * typemanager.cs: runtime_compatibility_attr_type new predefined
5251         type.
5252
5253 2005-10-26  Raja R Harinath  <harinath@gmail.com>
5254
5255         Fix #76419.
5256         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
5257         treat it as an empty parameter list.
5258
5259 2005-10-26  Raja R Harinath  <rharinath@novell.com>
5260
5261         Fix #76271.     
5262         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
5263         ResolveAsTypeStep silent.
5264         * statement.cs (Block.AddConstant): Mark block as used.
5265         (Block.ResolveMeta): Avoid piling on error messages
5266         if a constant initializer resolution fails.
5267
5268 2005-10-25  Raja R Harinath  <rharinath@novell.com>
5269
5270         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
5271         Remove.
5272         (NamespaceEntry.VerifyAllUsing): New.
5273         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
5274         behaviour.  Delegates actual resolution of alias to ...
5275         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
5276         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
5277         Update.
5278         * driver.cs (Driver.MainDriver): Update.
5279         
5280         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
5281         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
5282         property.
5283         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
5284         Remove.
5285         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
5286         RootNamespace.DefineNamespacesForAll.
5287
5288 2005-10-24  Raja R Harinath  <harinath@gmail.com>
5289
5290         * typemanager.cs (assemblies, external_aliases, modules)
5291         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
5292         (ComputeNamespaces, GetRootNamespace): Remove extra staging
5293         overhead.  Move resposibility ...
5294         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
5295         * driver.cs, attribute.cs, codegen.cs: Update to changes.
5296
5297 2005-10-23  Raja R Harinath  <harinath@gmail.com>
5298
5299         * namespace.cs (RootNamespace.all_namespaces): Renamed from
5300         cached_namespaces.  Improve usage.
5301         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
5302         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
5303         Move from GlobalRootNamespace and simplify.
5304         (RootNamespace.Global): Make instance variable.
5305         (RootNamespace.RootNamespace): Add "alias name" parameter.
5306         (GlobalRootNamespace): Simplify drastically.
5307         (Namespace.Lookup): Don't use GetNamespace.
5308         * typemanager.cs (GetRootNamespace): Rename from
5309         ComputeNamespaceForAlias.
5310         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
5311
5312 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5313
5314         * anonymous.cs (AnonymousContainer): Don't crash when container
5315         doesn't exist.
5316
5317 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5318
5319         * expression.cs (Binary.DoResolve): Warn when comparing same
5320         values.
5321
5322 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5323
5324         Fix #76486.
5325         * expression.cs (Binary.DoResolve): It looks like there are no
5326         convetsion rules in enum context.
5327
5328 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5329
5330         Add support for extern alias qualifiers.
5331         * typemanager.cs: Move some LookupTypeReflection code
5332         to namespace.cs, to have cleaner code. Added some methods
5333         to help us keep track of the extern aliased references.
5334         * driver.cs: Add suport for extern alias assemblies on command
5335         line and check for their warnings/errors. Also keep track of the
5336         extern aliased assemblies.
5337         * namespace.cs: Move the global functionality of Namespace
5338         to GlobalRootNamespace/RootNamespace. Now the global namespace
5339         is GlobalRootNamespace.Globa. Also the code moved from 
5340         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
5341         Finally added LocalAliasEntry (AliasEntry before) and
5342         ExternAliasEntry, to handle alias statements.
5343         * cs-parser.jay: Add support in the grammar for extern alias
5344         statement.
5345         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
5346         Update callings to Namespace (now in GlobalRootNamespace).
5347
5348 2005-10-18  Raja R Harinath  <rharinath@novell.com>
5349
5350         Fix #76371.
5351         * class.cs (TypeContainer.DefineType): Move updating of
5352         topological sort earlier in the code.
5353         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
5354
5355 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
5356
5357         Fix #76273.
5358         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
5359         
5360         * constant.cs (Constant.TryReduce): Moved from Cast class.
5361         (Reduce): Made little bit more OO and fixed missing conversions.
5362         
5363         * ecore.cs (Reduce): Implemented.
5364         (Binary.EnumLiftUp): New method to upgrade values to enum values.
5365         
5366         * literal.cs (Reduce): Implemented.
5367         
5368         * class.cs: Reverted Miguel's wrong commit.
5369
5370 2005-10-14  Miguel de Icaza  <miguel@novell.com>
5371
5372         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
5373
5374 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
5375
5376         * cs-parser.jay, expression.cs : CS0214 was missing error location
5377           for constants. Fixed bug #76404.
5378
5379 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
5380
5381         Fix #76370.
5382         * convert.cs (ExplicitConversionCore): Fixed object->enum
5383         conversion.
5384
5385 2005-10-10  Raja R Harinath  <rharinath@novell.com>
5386
5387         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5388         InstanceExpression.
5389         (PropertyExpr.EmitCall): Likewise.
5390         * expression.cs (Invocation.EmitArguments): Handle case where
5391         arguments == null.
5392         (Invocation.EmitCall): Avoid allocating temporary variable if
5393         there are no arguments.
5394
5395 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5396
5397         Fix #76323.
5398         * convert.cs (ImplicitConversionStandard): Move conversion of
5399         void* to arbitrary pointer types ...
5400         (ExplicitConversionStandard): .. here.
5401         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
5402         error to always print typenames.
5403
5404 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5405
5406         * convert.cs (GetConversionOperator): Rename from
5407         GetConversionOperators.  Move operator selection code from ...
5408         (UserDefinedConversion): ... here.
5409
5410 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
5411
5412         * convert.cs (ExplicitConversionCore): Removed duplicate enum
5413         conversion.
5414
5415 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
5416
5417         * assign.cs (Assign.DoResolve): Error method changed.
5418
5419         * cfold.cs (DoConstantNumericPromotions): Error method changed.
5420         
5421         * const.cs (ResolveValue): Reset in_transit immediately.
5422         
5423         * constant.cs: Error method changed.
5424         
5425         * convert.cs: Removed useless location parameter.
5426         (ExplicitNumericConversion): Don't do double enum check.
5427         (ExplicitConversionCore): Renamed from ExplicitConversion.
5428         (ExplicitUnsafe): Extracted from ExplicitConversion.
5429         (ExplicitConversion): Uses for error reporting.
5430         
5431         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
5432         error messages.
5433         (ResolveBoolean): Uses common error method.
5434         (CastToDecimal): Get rid of ec.
5435         (CastFromDecimal): Optimized.
5436         (ConvCast): Get rid of ec.
5437         
5438         * enum.cs (ResolveValue): Reset in_transit immediately.
5439         (Emit): Return after first error.
5440         
5441         * expression.cs: Convert changes.
5442         
5443         * literal.cs: Error method changed.
5444         
5445         * statement.cs: Error method changed.
5446
5447 2005-10-03  Raja R Harinath  <rharinath@novell.com>
5448
5449         * support.cs (SeekableStreamReader.Position): Don't error out when
5450         the requested position is just beyond the end of the current
5451         buffered data.
5452
5453 2005-09-28  Raja R Harinath  <rharinath@novell.com>
5454
5455         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
5456         try to keep in sync with the byte count of the underlying Stream.
5457         However, this limits us to a window size of 2048 characters: i.e.,
5458         the maximum lookahead of our lexer/parser can be 2048 characters.
5459
5460 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
5461
5462         Fix #76255.
5463         * driver.cs: Fix compilation files with full root path.
5464
5465 2005-09-25  Miguel de Icaza  <miguel@novell.com>
5466
5467         * report.cs (SymbolRelatedToPreviousError): Format the output so
5468         it does not use an open parenthesis that is never closed. 
5469
5470         * driver.cs: Follow coding guidelines
5471
5472 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5473
5474         Fix #72930.
5475         * const.cs (Const.ResolveValue): Check for assigning non-null
5476         value to reference type.
5477
5478 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5479
5480         * anonymous.cs: Implemented ExprClassName.
5481         
5482         * assign.cs (Assign.DoResolve): Don't chrash when type is not
5483         delegate.
5484         
5485         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
5486         check.
5487         
5488         * class.cs (StaticClass.DefineContainerMembers): Report protected
5489         members as error.
5490         
5491         * codegen.cs: if(ed) PRODUCTION.
5492         
5493         * convert.cs (Error_CannotImplicitConversion): Better error
5494         distinction.
5495         
5496         * cs-parser.jay: More error checks.
5497         
5498         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
5499         
5500         * driver.cs (CSCParseOption): Enabled wrong option check.
5501         
5502         * ecore.cs (Expression.ExprClassName): Turned to property.
5503         (MemberExpr.CheckIntermediateModification): For checking boxed
5504         value types     modification.
5505         
5506         * statement.cs (Fixed.Resolve): Expression type must be
5507         convertible to fixed type.
5508         (CollectionForeach.GetEnumeratorFilter,TryType):
5509         Small refactoring for easier error checking.
5510
5511 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
5512
5513         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
5514         attributes.
5515         
5516         * class.cs (GeneratedBaseInitializer): New class for customization
5517         compiler generated initializers.
5518         (MemberBase.DoDefine): Check Obsolete attribute here.
5519         (FieldMember.DoDefine): Ditto.
5520         
5521         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
5522         constants.
5523         
5524         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
5525         (MemberCore.GetObsoleteAttribute): Removed argument.
5526         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
5527         (MemberCore.CheckObsoleteType): New helper.
5528         
5529         * delegate.cs,
5530         * enum.cs,
5531         * statement.cs: Updates after MemberCore changes.
5532         
5533         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
5534         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
5535         
5536         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
5537         obsolete attribute for compiler construct.
5538         (As.DoResolve): Cache result.
5539         
5540         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
5541
5542 2005-09-26  Raja R Harinath  <rharinath@novell.com>
5543
5544         Fix #76133.
5545         * expression.cs (This.VerifyFixed): In a value type T, the type of
5546         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
5547         value type R, 'this' is treated as a value parameter.
5548
5549 2005-09-22  Miguel de Icaza  <miguel@novell.com>
5550
5551         * statement.cs (Lock): Use the TemporaryVariable class instead of
5552         manually using local variables as those do not work when variables
5553         are captured.
5554
5555         * ecore.cs: Moved the TemporaryVariable class from being a nested
5556         class inside Foreach to be a public class that can be employed in
5557         other places. 
5558
5559 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
5560
5561         * cs-parser.jay: interface_accessors replaced by
5562         accessor_declarations.
5563
5564         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
5565         location.
5566         
5567         * statement.cs (GotoCase.Resolve): Convert null constant to
5568         null case.
5569         (SwitchLabel.ResolveAndReduce): Ditto.
5570         (SwitchLabel.NullStringCase): Custom null stamp.
5571         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
5572         
5573         typemanager.cs (CSharpSignature): Don't skip first argument
5574         for full names.
5575
5576 2005-09-18  Miguel de Icaza  <miguel@novell.com>
5577
5578         * driver.cs: Set InEmacs based on the environment variable EMACS. 
5579
5580         * location.cs (InEmacs): in this mode, do not report column
5581         location as it confuses Emacs.
5582
5583 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
5584
5585         * cfold.cs, constant.cs, convert.cs, ecore.cs,
5586         expression.cs, iterators.cs, literal.cs: Store constants and
5587         literals location.
5588         
5589         * class.cs (MemberBase.ShortName): Pass location.
5590         
5591         * cs-parser.jay: Some location fixes.
5592         
5593         * ecore.cs (Expression.Location): Made virtual.
5594
5595 2005-09-05  Miguel de Icaza  <miguel@novell.com>
5596
5597         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
5598         if the underlying types are the same, otherwise we need to produce
5599         code that will do the proper cast.
5600
5601         This was exposed by Marek's constant rewrite which produced
5602         invalid code for the call site:
5603
5604         enum X : long { a }
5605         void Method (X v) {}
5606
5607         Method ((X) 5)
5608
5609         This fixes test-49.cs
5610
5611 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5612
5613         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
5614           Type/Object should be allowed as well. Fixed bug #75968.
5615
5616 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5617
5618         * expression.cs : (Binary.DoResolve): when one is enum constant and
5619           another is constant 0, then return enum one *as enum type*.
5620           Fixed bug 74846.
5621
5622 2005-09-02  Raja R Harinath  <rharinath@novell.com>
5623
5624         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
5625         internal.
5626
5627         Fix #75941.
5628         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
5629         flow-branching for LocalVariableReferences in case we were invoked
5630         from a MemberAccess.
5631         * expression.cs (LocalVariableReference.VerifyAssigned): New.
5632         Carved out of ...
5633         (LocalVariableReference.DoResolveBase): ... this.
5634         (MemberAccess.Resolve): Do the check that was disabled during
5635         SimpleNameResolve.
5636
5637 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5638
5639         * class.cs :
5640           (PartialContainer.Create): check abstract/sealed/static strictly
5641           but abstract/sealed can exist only at one side. Fixed bug #75883.
5642
5643 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
5644
5645         Fix #75945.
5646         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5647         specified, don't default to UnmanagedType.I4.
5648
5649 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5650
5651         * expression.cs : conditional operator should check possibly
5652           incorrect assign expression. Fixed bug #75946.
5653
5654 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5655
5656         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5657           Reverting the change. gmcs is much complex than mcs on this matter.
5658
5659 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5660
5661         * cs-tokenizer.cs : To read another token ahead of the actual 
5662           consumption, use new SavedToken and cache token instead of moving
5663           back the stream with SeekableStreamReader (it seemed problematic).
5664         * cs-parser.jay,
5665           driver.cs : Thus use StreamReader directly.
5666         * support.cs : Thus removed SeekableStreamReader.
5667
5668 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5669
5670         Fix #75934.
5671         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5672         (ScopeInfo.EmitScopeType): Use it to construct field names from
5673         names of captured locals.
5674
5675         Fix #75929.
5676         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5677         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5678         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
5679         (ExplicitConversion): Remove enum cases already handled by
5680         implicit conversion.  Move implicit conversion check to the beginning.
5681         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5682         * expression.cs (ArrayCreation.EmitDynamicInitializers):
5683         Don't treat System.Enum as a struct.
5684
5685 2005-08-30  Jb Evain  <jbevain@gmail.com>
5686
5687         * attribute.cs: handles as expression in parameters.
5688
5689 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5690
5691         Fix #75802.
5692         * class.cs (TypeContainer.VerifyClsName): Don't use a
5693         PartialContainer when verifying CLS compliance.
5694         (AbstractPropertyEventMethod): Set Parent here, ...
5695         (PropertyMethod): ... not here.
5696
5697 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
5698
5699         * attribute.cs : escaped attribute name should not be allowed to be
5700           resolved (e.g. @class as classAttribute). Fixed bug #75930.
5701
5702 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5703
5704         Fix #75927.
5705         * convert.cs (ImplicitStandardConversionExists): Allow zero also
5706         when converting a long constant to unsigned long.
5707         * expression.cs (Invocation.OverloadResolve): Add sanity check to
5708         detect where IsApplicable and VerifyArgumentsCompat disagree.
5709
5710 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5711         and Carlos Alberto Cortez  <carlos@unixmexico.org>
5712
5713         Fix #75848.
5714         * class.cs (TypeContainer.CanElideInitializer): New helper.
5715         (TypeContainer.EmitFieldInitializers): Use it to determine if we
5716         can safely emitting the initializer of a field.
5717
5718 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5719
5720         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5721           allowed inside a switch (without loop). Fixed bug #75433.
5722
5723 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
5724
5725         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5726         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5727
5728 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5729
5730         * driver.cs : kinda reverting the default encoding changes (not exact 
5731           revert since I noticed that "codepage:reset" might not work fine).
5732
5733 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5734
5735         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5736           Location. Now getter and setter store location correctly.
5737           (errors/cs0111-12.cs now reports the expected location.)
5738
5739 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5740
5741         * driver.cs : Use default encoding on the environment.
5742           Removed (now that) extra parameter for SeekableStreamReader.
5743         * support.cs : (SeekableStreamReader) third .ctor() argument for
5744           StreamReader is not required (always true). preamble size could
5745           be acquired in simpler and safe way.
5746
5747 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5748
5749         * cs-parser.jay: report CS0642 at warning level 3
5750           and report CS0642 for an if else statement also
5751           fixes bug #74745. Patch by John Luke (and a bit
5752           modified by me).
5753           Removed extra CS0642 warning check for "while",
5754           "for" and "fixed".
5755         * statement.cs: In Block.Resolve(), CS0642 check
5756           is reimplemented to check a sequence of an empty
5757           statement and a block.
5758
5759           Both fix bug #66777.
5760
5761 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
5762
5763         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5764         detection until I fix it.
5765         
5766         * cs-tokenizer.cs: Changed error message.
5767         
5768         * cs-parser.jay: Fixed 2 error locations.
5769         
5770         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5771         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5772         properties.
5773         
5774         * enum.cs (GetSignatureForError): Fixed.
5775         
5776         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5777         method detection.
5778         
5779         * class.cs,
5780         * typemanager.cs (RegisterProperty): Removed.
5781         
5782         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5783
5784 2005-08-24  Raja R Harinath  <rharinath@novell.com>
5785
5786         Fix #75874.
5787         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5788         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5789
5790 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5791
5792         * expression.cs : tiny fix is required for not warning positive ulong.
5793           See test-441.cs.
5794
5795 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5796
5797         * expression.cs : add CS0652 check for constant and integral
5798           expression. Fixed bug #53974.
5799
5800 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5801
5802         * expression.cs : in DoNumericPromotions(), check if there is implicit
5803           conversion overload for string (to check CS0034). Fixed bug #52492.
5804
5805 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5806
5807         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5808
5809 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5810
5811         * ecore.cs : report location when it is *not* Null.
5812
5813 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5814
5815         * codegen.cs,
5816           ecore.cs,
5817           flowanalysis.cs,
5818           expression.cs:
5819           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5820           correctly. Fixed bug #75721.
5821
5822 2005-08-23  Raja R Harinath  <rharinath@novell.com>
5823
5824         * support.cs (SeekableStreamReader.Position): Avoid an expensive
5825         loop that performs 'min (pos, char_count)'.
5826
5827         Fix #75862.
5828         * expression.cs (Unary.ResolveOperator): Don't discard implicit
5829         converted value in Operator.OnesComplement.
5830
5831 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
5832
5833         * anonymous.cs: If the anon method is pulled into a helper class,
5834         it needs to be `internal' not `private'. Fixes runtime behavior on
5835         msft. bug #75704
5836
5837 2005-08-20  Martin Baulig  <martin@ximian.com>
5838
5839         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5840         scope if we don't already have it.
5841
5842         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5843         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5844         fixes #75867.
5845
5846 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
5847
5848         Fix #75803
5849         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5850         is a partial class.
5851
5852 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
5853
5854         The big constants rewrite
5855         Fix #75746, #75685 and more
5856         As a side effect saved 1MB for MWF ;-)
5857         
5858         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5859         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5860         enum based for corlib compilation.
5861         
5862         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5863         subtractions.
5864         
5865         * class.cs (FixedField.Define): Use ResolveAsConstant.
5866         
5867         * const.cs (IConstant): Interface constants and enums.
5868         (Const.ResolveValue): New method for constant resolvning.
5869         (ExternalConstant): Constants from imported assemblies.
5870         
5871         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5872         conversion; like enums.
5873         (Constant.ToType): Converts this constant to different type.
5874         (Constant.Increment): Adds 1.
5875         
5876         * convert.cs (ImplicitConversionRequired): Simplified.
5877         
5878         * cs-parser.jay: Create EnumMember directly.
5879         
5880         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5881         
5882         * doc.cs (GenerateEnumDocComment): Removed.
5883         
5884         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5885         (ConvertIntLiteral): Removed.
5886         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5887         
5888         * enum.cs (EnumMember): Implement IConstant.
5889         (Enum.IsValidEnumConstant): Removed.
5890         (Enum.GetNextDefaultValue): Removed.
5891         (Enum.FindMembers): Updated.
5892         (Enum.GenerateDocComment): Iterate enum members.
5893         
5894         * expression.cs (Cast.TryReduce): Handle enums correctly.
5895         (New.Constantify): Made public.
5896         (MemberAccess.DoResolve): Removed contant specific if(s).
5897         
5898         * literal.cs (NullLiteral): Implement new abstract methods.
5899         
5900         * statement.cs (GotoCase.Resolve): Use new constant methods.
5901         (SwitchLabel.ResolveAndReduce): Use new constant methods.
5902         
5903         * typemanager.cs (LookupEnum): Removed.
5904         (IsEnumType): Fixed to work with corlib.
5905         (RegisterConstant): Removed.
5906         (LookupConstant): Removed.
5907         (GetConstant): Changed to work with IConstant.
5908
5909 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
5910
5911         * location.cs : Fixed overflown (>255) column number.
5912
5913 2005-08-03  Raja R Harinath  <rharinath@novell.com>
5914
5915         First cut of the qualified-alias-member feature.
5916         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5917         token.
5918         * cs-parser.jay (DOUBLE_COLON): New token.
5919         (namespace_or_type_name): Add rule for recognizing
5920         qualified-alias-members.
5921         (primary_expression): Likewise.
5922         (element_access): Allow QualifiedAliasMember as a possible
5923         type-bearing expression.
5924         (local_variable_type, local_variable_pointer_type): Likewise.
5925         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
5926         aliases in the current and enclosing namespace declarations.
5927         (NamespaceEntry.UsingAlias): Add CS0440 warning.
5928         * decl.cs (MemberName.is_double_colon): New.
5929         (MemberName.MemberName): Add new constructor for alias-member.
5930         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5931         * expression.cs (QualifiedAliasMember): New expression type.
5932
5933 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5934
5935         * location.cs : it borked when no argument was specified.
5936
5937 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5938
5939         * location.cs : tiny ToString() format fix.
5940
5941 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5942
5943         * statement.cs : oops, it was missing.
5944
5945 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5946
5947         A set of fixes for precise line/column location.
5948
5949         * location.cs :
5950           "token" field now holds a file/line "delta", a line number offset 
5951           from the segment, and a column number. See also:
5952           http://lists.ximian.com/pipermail/mono-devel-list/2004-
5953           December/009508.html
5954           Removed static IsNull. Use instance IsNull property instead.
5955         * cs-tokenizer.cs :
5956           For some tokens it stores Location. For Identifier it stores
5957           LocatedToken which is a pair of string name and location.
5958           Column numbers are adjusted only at getChar().
5959         * report.cs :
5960           Use Location.ToString() for reporting (it now contains column).
5961         * cs-parser.jay :
5962           Largely modified to use LocatedToken instead of
5963           string (IDENTIFIER), and to acquire Location from some tokens.
5964         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5965           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5966           codegen.cs :
5967           Now MemberName holds Location. DeclSpace.ctor() receives Location
5968           as a parameter. Removed extra parameters to all derived classes.
5969           Replaced Location.IsNull() with instance property.
5970         * assign.cs, expression.cs :
5971           Added .ctor() overload that omits Location.
5972         * attribute.cs :
5973           Added "nameEscaped" flag that indicates the identifier was escaped
5974           in the source file. This fixes bug #57047.
5975
5976 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
5977
5978         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5979         New method, looking for lo-case imported cls type.
5980
5981         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5982         here.
5983
5984         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5985
5986         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5987
5988         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5989         all_imported_types.
5990         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5991
5992         Optimized to save 3.5 MB for SWF compilation.
5993
5994 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5995
5996         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5997         (PartialContainer.Create): Moved logic AddToContainer.
5998         (PartialContainer.MarkForDuplicationCheck): Shares name.
5999         
6000         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
6001         place.
6002         
6003         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
6004         initialization.
6005         (Namespace.GetSignatureForError): New method.
6006         
6007         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
6008         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
6009
6010 2005-08-01  Raja R Harinath  <rharinath@novell.com>
6011
6012         Fix #75669.
6013         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
6014         member lookup rather than qualifier_type, since qualifier_type can
6015         be null.
6016
6017 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
6018
6019         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
6020         enum member.
6021
6022 2005-07-31  Miguel de Icaza  <miguel@novell.com>
6023
6024         * statement.cs: Copy the local exception into the exception
6025         captured local.  Fixes 75674
6026
6027 2005-07-31  Raja R Harinath  <harinath@gmail.com>
6028
6029         Fix #75658.
6030         * expression.cs (Invocation.OverloadResolve): Don't report error
6031         CS1501 if error CS1502 has been reported.
6032         (New.DoResolve): Delegate CS1501 reporting to
6033         Invocation.OverloadResolve.
6034
6035         Fix #75656.
6036         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
6037         invariant-meaning-in-block property in an enclosing block if
6038         necessary.
6039
6040 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
6041
6042         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
6043         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
6044         (Switch.CheckSwitch): Just save 50kb for SWF.
6045
6046 2005-07-27  Martin Baulig  <martin@ximian.com>
6047
6048         * anonymous.cs (CaptureContext.AddField): Added
6049         `AnonymousContainer am' argument; compute its toplevel scope if
6050         it's not already computed.  Fixes #75649.
6051
6052 2005-07-26  Raja R Harinath  <rharinath@novell.com>
6053
6054         Fix #75628.
6055         * class.cs (Constructor.Emit): Reset block to null if the block
6056         resolve fails.
6057
6058 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
6059
6060         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
6061
6062 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
6063
6064         * class.cs (MethodData.Define): Check whether accessor implementing
6065         interface is public.
6066
6067         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
6068
6069 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
6070
6071         Fix #57245
6072         * namespace.cs (LookupType): Moved same type check to...
6073         
6074         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
6075         with the same name.
6076
6077 2005-07-21  Raja R Harinath  <rharinath@novell.com>
6078
6079         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
6080         already found a typebuilder.
6081         * class.cs (MethodCore.IsDuplicateImplementation): Compare
6082         MemberNames, not strings.
6083
6084         * const.cs (Error_ExpressionMustBeConst): 
6085         Rename from Error_EpressionMustBeConst.
6086         * const.cs, class.cs, statement.cd: Update.
6087
6088 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
6089
6090         Fix #65573
6091
6092         * const.cs (Const.LookupConstantValue): Report missing contant expression
6093         everytime.
6094         (Error_EpressionMustBeConstant): Only one error method.
6095
6096         * class.cs, statement.c: Updated.
6097
6098 2005-07-20  Raja R Harinath  <rharinath@novell.com>
6099
6100         * statement.cs (Block.Flags): Add back HasVarargs.
6101         (Block.flags): Make protected.
6102         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
6103
6104         * typemanager.cs (types, typecontainers, user_types): Remove.
6105         (UserTypes, TypeContainers): Likewise.
6106         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
6107         (CleanUp, Reset): Update.
6108         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
6109         (GetNestedType): Use Type.GetNestedType.
6110         (CoreLookupType): Take two arguments, the namespace and the
6111         basename of the type.  Update to use the Namespace.Lookup
6112         mechanism.
6113         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
6114         (RealMemberLookup): Use IsNestedChildOf instead of playing with
6115         string concatenation and substring matches.
6116         * class.cs, enum.cs, delegate.cs: Update to changes.
6117
6118 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
6119
6120         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
6121         Expression and made virtual.
6122
6123         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
6124         (ImplicitStandardConversionExists): Fixed `byte' typo ?
6125
6126         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
6127
6128         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
6129         error message.
6130
6131         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
6132         change.
6133
6134 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
6135
6136         Fix #57707
6137         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
6138         AssemblyCultureAttribute is not used on executable.
6139
6140         * rootcontext.cs,
6141         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
6142
6143 2005-07-16  Raja R Harinath  <rharinath@novell.com>
6144
6145         Fix #60638.
6146         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
6147         New.  Reports CS0252/CS0253.
6148         Mostly taken from preliminary patch by Duncak Mak.
6149         (Binary.DoResolveOperator): Store results of operator lookup.
6150         Use them to detect if we need to warn about unintended reference
6151         comparisons.
6152
6153 2005-07-15  Raja R Harinath  <rharinath@novell.com>
6154
6155         Fix #72969.
6156         * namespace.cs (Namespace.Lookup): Add back location parameter.
6157         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
6158         * delegate.cs, ecore.cs, expression.cs: Update to changes.
6159
6160         * codegen.cs (EmitContext.DeclSpace): Make readonly.
6161         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
6162         (Namespace.LookupType): ... this.
6163         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
6164         of namespaces.
6165         * typemanager.cs (LookupTypeReflection): Remove buggy code that
6166         purported to handle pointers.
6167         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
6168         CoreLookupType.
6169
6170 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
6171
6172         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
6173         type as namespace.
6174
6175 2005-07-15  Raja R Harinath  <rharinath@novell.com>
6176
6177         * namespace.cs (Namespace.Lookup): Drop location parameter.
6178         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
6179         (NamespaceEntry.Lookup): ... this.
6180         (NamespaceEntry.Error_AmbiguousTypeReference):
6181         Move here from DeclSpace.
6182         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
6183         names ...
6184         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
6185         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
6186         Move to NamespaceEntry.
6187         * delegate.cs, expression.cs: Update to changes.
6188
6189 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
6190
6191         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
6192         CheckAttributeType and refactored.
6193         (Attribute.ResolvePossibleAttributeType): Changed to reuse
6194         ResolveAsTypeTerminal error handling.
6195         (ResolveAsTypeTerminal): Introduced because of global attributes extra
6196         handling.
6197         (GetSignatureForError): Print errors in same way.
6198
6199         * class.cs,
6200         * codegen.cs: Reflect attribute GetSignatureForError change.
6201
6202         * ecore.cs,
6203         * expression.cs: Add silent parameter to ResolveAsTypeStep.
6204
6205         * namespace.cs (UsingEntry): Refactored to make fields private.
6206
6207         * assign.cs,
6208         statement.cs: Error_UnexpectedKind has extra parameter.
6209
6210 2005-07-14  Raja R Harinath  <rharinath@novell.com>
6211
6212         * ecore.cs (IAlias): Remove.
6213         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
6214         that implement the interface.
6215         * namespace.cs (Namespace): Likewise.
6216         (Namespace.declspaces): Renamed from 'defined_names'.
6217         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
6218         DeclSpace instead of an IAlias.
6219         * tree.cs (Tree.AddDecl): Update.
6220
6221 2005-07-12  Raja R Harinath  <rharinath@novell.com>
6222
6223         * statement.cs (Block.Flags); Remove HasVarargs.
6224         (Block.HasVarargs): Move to ToplevelBlock.
6225         (Block.ThisVariable, Block.AddThisVariable): Likewise.
6226         (Block.Variables): Make protected.  Initialize variable hashtable
6227         if necessary.
6228         (Block.AddVariable): Update.
6229         (Block.Resolve): Update to changes.
6230         (ToplevelBlock.HasVarargs): New boolean.
6231         (ToplevelBlock.ThisVariable): Move here from Block.
6232         (ToplevelBlock.AddThisVariable): Likewise.
6233         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
6234         * expression.cs (This.ResolveBase): Update to changes.
6235         (ArglistAccess.DoResolve): Likewise.
6236
6237 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
6238
6239         Fix #75321
6240         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
6241
6242         * class.cs (TypeContainer.VerifyMembers): Distinguish between
6243         not used and not used & assigned.
6244         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
6245
6246 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
6247
6248         Fix #75053
6249         * expression.cs (Is.DoResolve): null is never provided type.
6250
6251 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
6252
6253         Fix #52496
6254         * cs-parser.jay: Less strict event error rule to catch more errors.
6255
6256 2005-07-08  Martin Baulig  <martin@ximian.com>
6257
6258         Fix test-iter-10.cs - distinguish whether we `yield' in a property
6259         gettter (allowed) or setter (not allowed).
6260
6261         * class.cs (Accessor): Implement IIteratorContainer.
6262         (Accessor.Yields): New public field.
6263         (PropertyBase.PropertyMethod.Define): Handle iterators on a
6264         per-accessor basis.
6265
6266         * cs-parser.jay
6267         (get_accessor_declaration, set_accessor_declaration): Set the
6268         `yields' flag on the accessor, not the property.
6269         (property_declaration): Do the iterators check on a per-accessor
6270         basis and not for the whole property.
6271
6272 2005-07-08  Martin Baulig  <martin@ximian.com>
6273
6274         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
6275         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
6276
6277 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
6278
6279         Fix #74975
6280         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
6281         (ExtractSecurityPermissionSet): Cope with self referencing security
6282         attributes properly.
6283
6284         * driver.cs (SetOutputFile): Made public property OutputFile.
6285
6286 2005-07-07  Raja R Harinath  <rharinath@novell.com>
6287
6288         Fix #75486.
6289         * class.cs (TypeContainer.first_nonstatic_field): Rename from
6290         has_nonstatic_fields.  Make into a FieldBase pointer.
6291         (TypeContainer.AddField): Add CS0282 check.
6292         (TypeContainer.EmitType): Update.
6293
6294 2005-07-06  Miguel de Icaza  <miguel@novell.com>
6295
6296         * cs-tokenizer.cs (consume_identifier): Do not create strings to
6297         compare if they start with __.
6298
6299 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6300
6301         * statement.cs (Switch.SwitchGoverningType): Only look at
6302         UserCasts that don't need implicit standard conversions to one of
6303         the allowed switch types (Fixes test-322.cs).
6304         (LocalInfo.Resolve): Re-enable sanity-test.
6305
6306 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
6307
6308         * cs-tokenizer.cs (consume_identifier): Detect double undescores
6309         
6310         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
6311         
6312         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
6313
6314 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6315
6316         Fix #75472.
6317         * ecore.cs (SimpleName.GetSignatureForError): Add.
6318         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
6319         (MemberAccess.GetSignatureForError): Add.
6320
6321 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
6322  
6323         The big error and warning messages review.
6324         
6325         * anonymous.cs,
6326         * assign.cs,
6327         * attribute.cs,
6328         * class.cs,
6329         * codegen.cs,
6330         * convert.cs,
6331         * cs-parser.jay,
6332         * cs-tokenizer.cs,
6333         * decl.cs,
6334         * delegate.cs,
6335         * doc.cs,
6336         * driver.cs,
6337         * ecore.cs,
6338         * enum.cs,
6339         * expression.cs,
6340         * flowanalysis.cs,
6341         * iterators.cs,
6342         * literal.cs,
6343         * location.cs,
6344         * modifiers.cs,
6345         * namespace.cs,
6346         * parameter.cs,
6347         * pending.cs,
6348         * report.cs,
6349         * rootcontext.cs,
6350         * statement.cs,
6351         * support.cs,
6352         * tree.cs,
6353         * typemanager.cs: Updated.
6354         
6355         * class.cs: (MethodCore.SetYields): Moved here to share.
6356         (PropertyMethod.Define): Moved iterator setup here.
6357         
6358         * iterators.cs: Add orig_method to have full access to parent
6359         container.
6360
6361 2005-07-05  Raja R Harinath  <rharinath@novell.com>
6362
6363         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
6364         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
6365         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
6366         variable of struct type.
6367         * expression.cs (Unary.ResolveOperator): Update to change.
6368         (Indirection.VerifyFixed): Likewise.
6369         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
6370         (ParameterReference.VerifyFixed): Value parameters are fixed.
6371         (This.VerifyFixed): Treat 'this' as a value parameter.
6372         * statement.cs (LocalInfo.IsFixed): Remove.
6373
6374 2005-07-01  Martin Baulig  <martin@ximian.com>
6375
6376         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
6377         `ec.EmitThis ()' to get the correct scope.
6378
6379 2005-07-01  Martin Baulig  <martin@ximian.com>
6380
6381         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
6382         instance is a ParameterReference; fixes #75299.
6383
6384 2005-07-01  Martin Baulig  <martin@ximian.com>
6385
6386         Reverted Marek's latest patch (r46725):
6387         - it contains structural changes which are neither mentioned in
6388           the ChangeLog nor explained anywhere; for example the additional
6389           argument of EmitContext's and Iterator's .ctor's and the
6390           TypeContainer.DefineMembers() change.
6391         - structural changes like this should go in in seperate patches
6392           and not be hidden in a huge patch which just seems to affect
6393           warnings and errors.
6394           a big and hard to understand patch.
6395         - it breaks iterators and causes regressions, for instance in
6396           test-iter-03.cs.      
6397
6398 2005-06-30  Raja R Harinath  <rharinath@novell.com>
6399
6400         Fix #75412.
6401         * expression.cs (Indexers.map): Remove.
6402         (Indexers.Append): Filter out inaccessible setters and getters.
6403         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
6404
6405         Fix #75283.
6406         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
6407         Refactored from ...
6408         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
6409         (FieldExpr.Emit, PropertyExpr.Emit): Update.
6410         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
6411         * expression.cs (Invocation.EmitCall): Add CS0120 check.
6412
6413 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
6414
6415         Fix #75322
6416         * class.cs (FieldBase.GetInitializerExpression): One more field
6417         for backup.
6418
6419 2005-06-28  Miguel de Icaza  <miguel@novell.com>
6420
6421         * pending.cs: Do not define a proxy if the base method is virtual,
6422         it will be picked up by the runtime (bug 75270).
6423
6424 2005-06-08  Martin Baulig  <martin@ximian.com>
6425
6426         The big Iterators rewrite :-)
6427
6428         * iterators.cs: Rewrite this to use the anonymous methods framework.
6429
6430         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
6431         before the TypeContainers; see 2test-21.cs.
6432
6433         * class.cs
6434         (TypeContainer.DefineType): Don't create a new EmitContext if we
6435         already have one (this only happens if we're an Iterator).
6436         (TypeContainer.Define): Also call Define() on all our iterators.
6437         (Method.CreateEmitContext): Added support for iterators.
6438
6439         * anonymous.cs
6440         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
6441         (AnonymousContainer.CreateMethodHost): Moved here from
6442         AnonymousMethod and made abstract.
6443         (AnonymousContainer.CreateScopeType): New abstract method.
6444         (AnonymousContainer.IsIterator): New public property.
6445         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
6446         get the ScopeTypeBuilder rather than manually defining it here. 
6447         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
6448         iterators here.
6449
6450         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
6451         before RootContext.DefineTypes().
6452
6453         * codegen.cs (EmitContext.RemapToProxy): Removed.
6454         (EmitContext.CurrentAnonymousMethod): Changed type from
6455         AnonymousMethod -> AnonymousContainer.
6456         (EmitContext.ResolveTopBlock): Protect from being called twice.
6457         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
6458         (EmitContext.EmitThis): Removed the iterators hacks; use the
6459         anonymous methods framework for that.
6460
6461         * statement.cs
6462         (ToplevelBlock.Container): Make this a property, not a field.
6463         (ToplevelBlock.ReParent): New public method; move the
6464         ToplevelBlock into a new container.
6465         (Foreach.TemporaryVariable): Simplify.
6466
6467 2005-06-05  Martin Baulig  <martin@ximian.com>
6468
6469         * statement.cs (LocalInfo.CompilerGenerated): New flag.
6470         (Block.AddTemporaryVariable): New public method; creates a new
6471         `LocalInfo' for a temporary variable.
6472         (Block.EmitMeta): Create the LocalBuilders for all the temporary
6473         variables here.
6474         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
6475         non-iterator variables.
6476
6477 2005-06-05  Martin Baulig  <martin@ximian.com>
6478
6479         * statement.cs (Foreach.TemporaryVariable): Create the
6480         LocalBuilder in the Emit phase and not in Resolve since in some
6481         situations, we don't have an ILGenerator during Resolve; see
6482         2test-19.cs for an example.
6483
6484 2005-06-04  Martin Baulig  <martin@ximian.com>
6485
6486         **** Merged r45395 from GCS ****
6487
6488         The big Foreach rewrite - Part II.
6489
6490         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
6491         with `PropertyInfo ienumerator_getcurrent'.
6492
6493         * codegen.cs (VariableStorage): Removed.
6494
6495         * statement.cs
6496         (Foreach): Derive from Statement, not ExceptionStatement.
6497         (Foreach.CollectionForeach): New nested class.  Moved all the code
6498         dealing with collection foreach here.
6499         (Foreach.ForeachHelperMethods): Removed.
6500         (Foreach.TemporaryVariable): Implement IMemoryLocation.
6501
6502 2005-05-23  Martin Baulig  <martin@ximian.com>
6503
6504         * statement.cs (Try.DoResolve): Don't create a `finally' if we
6505         don't need to.  Fix #75014.
6506
6507 2005-05-20  Martin Baulig  <martin@ximian.com>
6508
6509         Merged r44808 from GMCS.
6510
6511         * class.cs (TypeContainer.CircularDepException): Removed.
6512         (TypeContainer.DefineType): Removed the `InTransit' stuff.
6513         (TypeContainer.CheckRecursiveDefinition): Check for circular class
6514         (CS0146) and interface (CS0529) dependencies here.
6515
6516 2005-06-21  Raja R Harinath  <rharinath@novell.com>
6517
6518         * expression.cs (Invocation.EmitCall): Fix initialization
6519         'this_call' to reflect current behaviour.  Fix indentation.
6520
6521         * convert.cs (FindMostEncompassedType): Add two trivial special
6522         cases (number_of_types == 0 || number_of_types == 1).
6523         (FindMostEncompasingType): Likewise.
6524
6525 2005-06-17  Raja R Harinath  <rharinath@novell.com>
6526
6527         Some cleanups preparing for the fix of #75283.
6528         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
6529         error testing.
6530         (EventExpr.InstanceResolve): Likewise.
6531         (EventExpr.DoResolve): Remove redundant checks.
6532
6533 2005-06-10  Duncan Mak  <duncan@novell.com>
6534
6535         * cs-tokenizer.cs (process_directives): New flag for controlling
6536         the processing of preprocessor directives.
6537         (x_token): After seeing a '#', return Token.NONE instead of going
6538         to handle_preprocessing_directive() when not processing
6539         directives. This avoids unnecessary processing during the token peek in
6540         is_punct().
6541
6542         This fixes #74939.
6543
6544         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
6545         the existing error reporting methods instead of Report.Error.
6546
6547         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
6548         after Raja's rewrite.
6549
6550 2005-06-08  Miguel de Icaza  <miguel@novell.com>
6551
6552         * class.cs: Small fix.
6553
6554 2005-06-08  Raja R Harinath  <rharinath@novell.com>
6555
6556         Fix #75160.
6557         * class.cs (GetPartialBases): Fix return value check of
6558         part.GetClassBases.
6559
6560 2005-06-07  Raja R Harinath  <rharinath@novell.com>
6561
6562         Ensure that partial classes are registered in their enclosing
6563         namespace.  Initial part of fix of #75160.
6564         * tree.cs (Tree.RecordDecl): Add new namespace argument.
6565         Register declspace with namespace here, not in
6566         DeclSpace.RecordDecl.
6567         * cs-parser.jay: Pass namespace to RecordDecl.
6568         * class.cs (PartialContainer.Create): Likewise.
6569         (ClassPart.DefineType): New sanity-check.  Throws an exception if
6570         called.
6571         * decl.cs (Declspace.RecordDecl): Remove.
6572         * namespace.cs (NamespaceEntry.DefineName): Remove.
6573
6574 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
6575
6576         * rootcontext.cs: Reset TargetExt as well.
6577
6578 2005-06-03  Raja R Harinath  <rharinath@novell.com>
6579
6580         * ecore.cs (Expression.Resolve): Emit CS0654 error when
6581         -langversion:ISO-1.
6582
6583 2005-06-02  Raja R Harinath  <rharinath@novell.com>
6584
6585         Fix #75080, cs0119.cs.
6586         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
6587         of ...
6588         (Expression.Resolve): ... this.  Use it.  Remove bogus code
6589         allowing ExprClass.Type and ExprClass.Namespace for
6590         ResolveFlags.VariableOrValue.
6591         (Expression.Resolve) [1-argument variant]: Change default resolve
6592         flags based on language version.
6593         (Expression.Error_UnexpectedKind): Use a simple string array
6594         rather than an ArrayList.
6595         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
6596         not ExprClass.Type.
6597         (TypeOfVoid.DoResolve): Likewise.
6598         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
6599         flags argument -- it always has the same value.
6600
6601 2005-05-31  Raja R Harinath  <rharinath@novell.com>
6602
6603         Fix #75081.
6604         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
6605         Use it in the error message.
6606         * assign.cs, expression.cs, statement.cs: Update.
6607
6608 2005-05-30  Raja R Harinath  <rharinath@novell.com>
6609
6610         Fix #75088.
6611         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
6612         the "almostMatchedMember" case too.
6613         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
6614         that failed the accessibility checks to 'almost_match'.
6615
6616 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
6617
6618         * attribute.cs: Use internal MethodBuilder methods to set
6619         ExactSpelling and SetLastError on PInvoke methods, instead
6620         of passing them via charset.  Fixes #75060.
6621
6622 2005-05-27  Raja R Harinath  <rharinath@novell.com>
6623
6624         * parameter.cs (Parameter): Remove TODO comment.
6625         (Parameter.DefineParameter): Remove Location parameter.
6626         (Parameters.LabelParameters): Likewise.
6627         * class.cs (Constructor.Emit): Update to change.
6628         (MethodData.Emit): Likewise.
6629         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
6630         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
6631
6632 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
6633
6634         * parameter.cs,
6635           Removed Parameters.Location and added Parameter.Location instead.
6636           Removed Location parameter from Emit() and GetSignature().
6637         * anonymous.cs,
6638           class.cs,
6639           cs-parser.jay,
6640           delegate.cs,
6641           iterators.cs,
6642           statement.cs :
6643           Modified all related calls.
6644
6645 2005-05-26  Raja R Harinath  <rharinath@novell.com>
6646
6647         Improve user-defined conversion handling.
6648         * convert.cs (GetConversionOperators): Rewrite.  Return only the
6649         applicable operators.
6650         (AddConversionOperators): New.  Helper for GetConversionOperators.
6651         (FindMostEncompassedType, FindMostEncompassingType): Verify that
6652         there is only one most encompassed/encompassing type.
6653         (FindMostSpecificSource, FindMostSpecificTarget): Remove
6654         "applicable operator" handling.
6655         (UserConversion): Move cache here from GetConversionOperators.
6656         Directly cache the chosen operator, rather than the whole
6657         MethodGroup.
6658         (ExplicitNumericConversion): Fix buggy implementation of Decimal
6659         case.  Allow conversion of decimal to sbyte and byte too.
6660         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6661         New static methods.  Used to avoid allocating EmptyExpressions in
6662         convert.cs.
6663
6664 2005-05-24  Duncan Mak  <duncan@novell.com>
6665
6666         * ecore.cs (CastFromDecimal): New class for casting a decimal to
6667         another class, used in Convert.ExplicitNumericConversion.
6668         (CastToDecimal): New class, similar to above, but casts to
6669         System.Decimal, used in Convert.ImplicitNumericConversion and also
6670         in explicit convesion from double/float to decimal.
6671
6672         * convert.cs (ImplicitNumericConversion): Handle implicit
6673         conversions to System.Decimal.
6674         (ExplicitNumericConversion): handle explicit conversions to
6675         System.Decimal.
6676
6677         This fixes #68711.
6678         
6679 2005-05-20  Miguel de Icaza  <miguel@novell.com>
6680
6681         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6682         know the type at this stage, just break through.   Fixes #75008 
6683
6684 2005-05-19  Martin Baulig  <martin@ximian.com>
6685
6686         * delegate.cs
6687         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6688         to disable error reporting.
6689
6690         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6691         here since we don't want to report an error; see the new test-336.cs.
6692
6693 2005-05-19  Raja R Harinath  <rharinath@novell.com>
6694
6695         * statement.cs (ToplevelBlock.GetParameterReference)
6696         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6697         Move here from class Block.
6698         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6699         * expression.cs (ParameterReference.DoResolveBase): Likewise.
6700
6701 2005-05-18  Martin Baulig  <martin@ximian.com>
6702
6703         Fix #74978.
6704
6705         * flowanalysis.cs
6706         (FlowBranching.Reachability): Add non-static public And() and Or()
6707         methods.
6708         (FlowBranchingSwitch): New class; do the `break_origins' thing
6709         like in FlowBranchingLoop.
6710         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6711         reachability, not just locals and parameters.
6712         (FlowBranching.MergeChild): Remove some of the hacks for loop and
6713         switch; MergeBreakOrigins() now takes care of that.
6714
6715 2005-05-18  Martin Baulig  <martin@ximian.com>
6716
6717         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6718         a loop and may leave it, reset the barrier; fixes #74974.
6719
6720 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
6721         
6722         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6723         is back.
6724         
6725         * cs-parser.jay: Catch more lexical errors.
6726         
6727         * report.cs: Add one more Error method.
6728         
6729         * rootcontext.cs,
6730         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6731
6732 2005-05-17  Martin Baulig  <martin@ximian.com>
6733
6734         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6735         #70970. 
6736
6737 2005-05-16  Raja R Harinath  <rharinath@novell.com>
6738
6739         Fix test-382.cs.  Emit values of decimal constants.
6740         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6741         Carved out of ...
6742         (TypeContainer.AddField): ... this.
6743         (TypeContainer.EmitFieldInitializers): Allow the list of fields
6744         with initializers to include 'Const's.
6745         (ClassPart.RegisterFieldForInitialization): Forward to
6746         PartialContainer.
6747         * const.cs (Const.Const): Pass initializer to base class.
6748         (Const.Define): In case of decimal constants, register them for
6749         initialization in a static constructor.
6750
6751 2005-05-14  Martin Baulig  <martin@ximian.com>
6752
6753         * statement.cs (Block.Resolve): Correctly handle unreachable code;
6754         do not call ResolveUnreachable() on unreachable statements in
6755         here, see the comment in the source code.
6756
6757 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6758
6759         Fix #74934.
6760         * expression.cs (BinaryResolveOperator): If one of the operands of
6761         an equality comparison is 'null' and the other is a pointer type,
6762         convert the null to a NullPointer.
6763         * convert.cs (ImplicitReferenceConversion): If the expression is a
6764         NullLiteral and the target type is a pointer type, return a
6765         NullPointer instead.
6766         (ImplicitConversionStandard): Likewise.
6767
6768 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
6769         
6770         * cs-parser.jay: Set readonly context based on special constructs.
6771         
6772         * expression.cs (LocalVariableReference.DoResolveBase): Improved
6773         readonly variable error handling.
6774         
6775         * rootcontext.cs (EmitCode): Don't verify members when error
6776         occurred.
6777         
6778         * statement.cs (LocalInfo): Add reaodnly context information.
6779         (SetReadOnlyContext, GetReadOnlyContext): New methods.
6780
6781 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6782
6783         * statement.cs (Block.Resolve): Revert change below.  Modify fix
6784         for #74041 to initialize 'resolved' to false only for explicit
6785         blocks.  Fixes #74873.
6786
6787 2005-05-12  Raja R Harinath  <harinath@gmail.com>
6788
6789         Fix #74920.
6790         * typemanager.cs (unmanaged_enclosing_types): New.
6791         (IsUnmanagedType): Avoid infloops by using
6792         'unmanaged_enclosing_types' to talk with recursive invocations.
6793
6794 2005-05-13  Martin Baulig  <martin@ximian.com>
6795
6796         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6797         instance variable, not a local.  Fix #74873.
6798         (Block.ResolveUnreachable): Set it to true here.
6799
6800 2005-05-11  Duncan Mak  <duncan@novell.com>
6801
6802         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6803         continuing to process for 'arg'.
6804         (handle_preprocessing_directive): Check the argument of the #endif
6805         directive and report error CS1025 if there are any trailing
6806         characters.
6807
6808         According to the C# spec, having even whitespace after the #endif
6809         directive is illegal; however, because we call arg.TrimEnd ()
6810         beforehand, we have the same behavior as csc, allowing whitespace
6811         after the directive.
6812
6813         Fixes #74892.
6814
6815 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
6816
6817         Fix #74863.
6818         
6819         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6820         (Constructor.GetObsoleteAttribute): Implemented correctly.
6821
6822 2005-05-10  Martin Baulig  <martin@ximian.com>
6823
6824         * support.cs (ReflectionParameters.ParameterModifier): Use
6825         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6826         and `ParameterAttributes.In'.  Fixes #74884.
6827
6828 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
6829
6830         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6831         
6832         * expression.cs (Argument.GetParameterModifier): Turned to property.
6833         (Invocation.Error_InvalidArguments): Add more descriptive errors.
6834         
6835         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6836         its C# equivalent.
6837         
6838 2005-05-09  Raja R Harinath  <rharinath@novell.com>
6839
6840         Fix #74852.
6841         * decl.cs (MemberCache.AddMethods): Register override methods,
6842         rather than non-override methods.
6843         * typemanager.cs (RegisterOverride): New.
6844         (IsOverride): Update.
6845
6846 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
6847
6848         Fix #73105.
6849         
6850         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6851         recursive declaration.
6852         
6853         * statement.cs (Block.ResolveMeta): Report any error in resolving.
6854         
6855 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
6856
6857         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6858         
6859         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6860
6861 2005-05-05  Raja R Harinath  <rharinath@novell.com>
6862
6863         Fix #74797.
6864         * decl.cs (DeclSpace.FamilyAccessible): 
6865         Use TypeManager.IsNestedFamilyAccessible.
6866
6867         Fix reopened #64812.
6868         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6869         internal'.
6870
6871 2005-05-04  Raja R Harinath  <rharinath@novell.com>
6872             Abin Thomas  <projectmonokochi@rediffmail.com>
6873             Anoob V E  <projectmonokochi@rediffmail.com>
6874             Harilal P R  <projectmonokochi@rediffmail.com>
6875
6876         Fix #64812.
6877         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6878         allow access to all static members.
6879
6880 2005-05-04  Martin Baulig  <martin@ximian.com>
6881
6882         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6883
6884 2005-05-04  Martin Baulig  <martin@ximian.com>
6885
6886         Fix #74655.
6887
6888         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6889         section at the end; make things work if `default' is not the last
6890         section.        
6891
6892 2005-05-04  Martin Baulig  <martin@ximian.com>
6893
6894         Fix #70400.
6895
6896         * statement.cs (Switch): Replaced the `got_default' field with a
6897         `default_section' one.
6898         (Switch.CheckSwitch): Set `default_section' here.
6899         (Switch.Resolve): If we're a constant switch and the constant is
6900         not found, use the default section.
6901
6902 2005-05-03  Martin Baulig  <martin@ximian.com>
6903
6904         * expression.cs (ArrayAccess.EmitGetLength): New public method.
6905
6906         * statement.cs (Foreach.ArrayForeach): New nested class.
6907         (Foreach.TemporaryVariable): New nested class.
6908         (Foreach.EmitArrayForeach): Removed; this is now in the new
6909         ArrayForeach class.
6910
6911 2005-05-03  Raja R Harinath  <rharinath@novell.com>
6912
6913         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
6914         more conservative.
6915         (VerifyPendingMethods): Revert change below.
6916
6917         * typemanager.cs (IsOverride, RegisterNonOverride): New.
6918         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6919         that used to trigger warning -28.  Remove warning -28.
6920         * expression.cs (Invocation.OverloadResolve): Use
6921         TypeManager.IsOverride to distinguish override methods.
6922
6923         Fix #74773.
6924         * pending.cs (VerifyPendingMethods): If a base type implements the
6925         requested interface, don't bother checking individual methods of
6926         the base type.  As a side-effect, this prevents the creation of
6927         unnecessary proxies.
6928
6929 2005-05-02  Martin Baulig  <martin@ximian.com>
6930
6931         Fix #70182.
6932
6933         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6934         Also `And' the locals if the old vector is null.
6935         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6936         null; in this case we basically reset all the variables.        
6937
6938 2005-05-02  Martin Baulig  <martin@ximian.com>
6939
6940         Fix #74529.
6941
6942         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6943         Added `FlowBranching branching' argument; always `and' the
6944         variables instead of `or'ing them unless we're an infinite loop.
6945
6946         * statement.cs (While.Resolve): Create a new sibling unless we're
6947         infinite.       
6948
6949 2005-05-02  Martin Baulig  <martin@ximian.com>
6950
6951         Fix #70140.
6952
6953         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6954         arguments; use it instead of creating a new TopLevelBlock.
6955         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6956         our ConstructorInitializer.
6957
6958         * statement.cs
6959         (TopLevelBlock.TopLevelBranching): New public property.
6960         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6961         and create our `TopLevelBranching'.
6962
6963         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6964         anonymous method host, use `block.TopLevelBranching' rather than
6965         creating a new branching.
6966
6967 2005-04-20  Miguel de Icaza  <miguel@novell.com>
6968
6969         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6970         a ScopeInfo, if any of the current children is a child of the new
6971         entry, move those children there.
6972
6973 2005-04-30  Martin Baulig  <martin@ximian.com>
6974
6975         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6976         at the beginning of a SwitchSection.  Fix #73335.
6977
6978 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
6979
6980         Fix #74378
6981         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6982         
6983         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6984         (FieldExpr.DoResolve): Obsolete members are ignored for field
6985         initializers.
6986         
6987 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
6988
6989         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6990         of arrays detection.
6991
6992         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6993         verification.
6994         (Field.VerifyClsCompliance): Volatile fields are not compliant.
6995
6996         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6997         arrays report.
6998
6999 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
7000
7001         * cs-parser.jay: Use the prefered version of -unsafe in error
7002         message.
7003
7004 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
7005
7006         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
7007         circumstances.
7008
7009 2005-04-20  John Luke  <john.luke@gmail.com>
7010
7011         * driver.cs: fix typo in error message, --outout to --output
7012
7013 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
7014
7015         * codegen.cs (InRefOutArgumentResolving): New field.
7016         
7017         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
7018         fields outside contructor.
7019         
7020         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
7021         
7022 2005-04-19  Miguel de Icaza  <miguel@novell.com>
7023
7024         * anonymous.cs (CaptureContext.EmitParameterInstance): The
7025         parameter code was not completed ever, so it was not as up-to-date
7026         as local variables.  Must finish it.
7027
7028         The bug fix was to compare the Toplevel of the block, not the
7029         current block.  Thanks for Ben for pointing this out. 
7030
7031 2005-04-19  Raja R Harinath  <rharinath@novell.com>
7032
7033         * decl.cs (AddMethods): Use the declaring type of the problem
7034         method to determine if we want to squash a warning.
7035
7036 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
7037
7038         * attribute.cs: Removed debug output.
7039
7040         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
7041         
7042         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
7043         Report.Stderr.
7044         
7045 2005-04-18  Raja R Harinath  <rharinath@novell.com>
7046
7047         Fix #74481.
7048         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
7049         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
7050         all null comparisons against reference types.
7051
7052 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
7053
7054         Fix# 74565
7055         * class.cs (TypeContainer.CircularDepException) New nested
7056         exception class.
7057         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
7058         (TypeContainer.DefineType): Removed error, reset InTransit before
7059         exit.
7060         (Class.DefineType): Throw exception when is in Transit.
7061         Catch exception and report error.
7062         (Struct.DefineType): Throw exception when is in Transit.
7063         Catch exception and report error.
7064         (Interface.DefineType): Throw exception when is in Transit.
7065         Catch exception and report error.
7066
7067         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
7068         handle nested exception handlers.
7069
7070         * flowanalysis.cs (InTryWithCatch): New method, search for try with
7071         a catch.
7072
7073         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
7074         InFinally and InCatch storage.
7075
7076         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
7077         (Catch.Resolve): Set and Restore ec.InCatch.
7078         (Try.Resolve): Set and Restore ec.InFinally.
7079         (Try.HasCatch): True when try has catch.
7080
7081 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
7082
7083         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
7084           for the same event member, so exclude such cases from warning 419.
7085           Fixed bug #74633.
7086
7087 2005-04-16  Miguel de Icaza  <miguel@novell.com>
7088
7089         * expression.cs (Binary.ResolveOperator): Apply patch from John
7090         Luke to fix bug 59864: operators &, | and ^ on enumerations
7091         require that the same enum type on both sides.
7092
7093         * driver.cs: Add warnings to old flag usage, this is to assist
7094         people who produce Makefiles and hope that the Makefiles will be
7095         used on Windows.
7096
7097         * class.cs (TypeContainer.EmitType): Moved the definition of the
7098         special $PRIVATE$ field from the resolve phase to the Emit phase.
7099         During resolve we do not know if we are a struct with
7100         HasExplicitLayout, we know this only after the attributes for the
7101         type are emitted.
7102
7103         Set the FieldOffset to zero on the dummy field that we create for
7104         the class.   Fixes 74590.
7105
7106 2005-04-16  Raja R Harinath  <rharinath@novell.com>
7107
7108         Fix #73834.
7109         * ecore.cs (PropertyExpr.resolved): New.
7110         (DoResolve): Use it to handle a case of double resolution here.
7111         Handle a case of identical-name-and-type-name.
7112         * expression.cs (ArrayCreation.CheckIndices): Avoid double
7113         resolution by storing the results of expression resolution back
7114         into the "probes" array.
7115
7116 2005-04-15  Raja R Harinath  <rharinath@novell.com>
7117
7118         Fix cs0208-7.cs and cs0208-8.cs.
7119         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
7120         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
7121         error reporting to point out the reason a struct is not unmanaged.
7122
7123 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7124
7125         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
7126           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
7127
7128 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7129
7130         Fix #74528.
7131         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
7132         IdenticalNameAndTypeName here.
7133         (EventExpr.InstanceResolve): Likewise.
7134
7135 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
7136
7137         C# 2.0 DefaultCharSetAttribute implementation
7138         
7139         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
7140         which allows us to set GlobalNamespace for every resolve.
7141         (Attribute.ResolveArguments): Cut from Resolve.
7142         (Attribute.GetCharSetValue): Returns CharSet named argument.
7143         (Attribute.DefinePInvokeMethod): Gets default charset from
7144         module settings.
7145         (GlobalAttribute.ResolveAsTypeStep): Override.
7146         (GlobalAttribute.ResolveArguments): Override.
7147         
7148         * class.cs (TypeAttr): Is protected.
7149         
7150         * codegen.cs (ModuleClass.DefaultCharSet): New member.
7151         (ModuleClass.DefaultCharSetType): New memeber.
7152         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
7153         
7154         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
7155         charset from module.
7156         
7157         * delegate.cs (TypeAttr): Override.
7158         (Delegate.DefineType): Use this TypeAttr.
7159         
7160         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
7161         at very early stage (before types are defined) to resolve model
7162         module attributes. It will probably not work with corlib but it
7163         should be ok.
7164         
7165         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
7166         charset from module.
7167         
7168         * typemanager.cs (default_charset_type): New type.
7169
7170 2005-04-13  Raja R Harinath  <rharinath@novell.com>
7171
7172         * decl.cs (MemberCache.AddMethods): Don't warn if
7173         System.Object.Finalize has buggy MethodAttributes.
7174
7175         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
7176         removed below.
7177
7178 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7179
7180         * doc.cs : detect ambiguous reference to overloaded members.
7181           Fixed bug #71603. MS 1.1 csc does not detect it.
7182
7183 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
7184
7185         * doc.cs : delegates must not be referenced with parameters.
7186           Fixed bug #71605.
7187
7188 2005-04-12  Miguel de Icaza  <miguel@novell.com>
7189
7190         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
7191
7192 2005-04-10  Miguel de Icaza  <miguel@novell.com>
7193
7194         * driver.cs (MainDriver): Stop processing if the CLS stage found
7195         errors. 
7196
7197         (CompilerCallableEntryPoint.InvokeCompiler): Always
7198         reset after execution;   Take a TextWriter argument for the
7199         output.
7200
7201         * report.cs: Use the error stream instead of hardcoding stderr. 
7202
7203 2005-04-09  Miguel de Icaza  <miguel@novell.com>
7204
7205         * class.cs: Reduce code paths to test, too small of an
7206         optimization to make it worth the extra testing.  Always perform
7207         it. 
7208
7209 2005-04-08  Raja R Harinath  <rharinath@novell.com>
7210
7211         Fix #74510.
7212         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
7213         operators that had errors reported on them.
7214
7215 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
7216
7217         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
7218         argument types.
7219         (Attribute.Resolve): Add named argument type checking.
7220         
7221         * class.cs (FixedField.Define): Use IsPrimitiveType
7222         
7223         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
7224         
7225         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
7226         unsafe parameter types.
7227         
7228         * statement.cs (Using.ResolveExpression): Add better error description.
7229         
7230         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
7231         
7232 2005-04-08  Raja R Harinath  <rharinath@novell.com>
7233
7234         Fix #74484.
7235         * attribute.cs (Attribute.GetAttributeUsage): Resolve
7236         AttributeUsageAttribute in the emitcontext of the attribute class,
7237         not in the emitcontext of the attributable entity it was attached to.
7238         * cs-parser.jay: Use 'current_class', not 'current_container',
7239         when creating a GlobalAttribute.
7240
7241 2005-04-08  Alp Toker  <alp@atoker.com>
7242
7243         * pending.cs: The fix to #58413 failed to compile methods implementing
7244         interfaces with/without params modifiers and vice versa, even though
7245         params modifiers aren't part of the signature. Make the modifier check
7246         less strict as in csc.
7247
7248 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
7249             Anoob V E  <projectmonokochi@rediffmail.com>
7250             Harilal P R  <projectmonokochi@rediffmail.com>
7251
7252         Fix #58413.
7253         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
7254         modifiers of pending methods.
7255         (PendingImplementation.PendingImplementation): Initialize it.
7256         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
7257         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
7258         with ParameterData.  Add check for modifiers.
7259         * class.cs (MethodData.Define): Update to changes.
7260
7261 2005-04-07  Raja R Harinath  <rharinath@novell.com>
7262
7263         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
7264
7265 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
7266
7267         * class.cs (PropertyMethod.Define): Check private accessor in abstract
7268         property.
7269         
7270         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
7271         
7272         * rootcontext.cs,
7273         * typemanager.cs: Registered RequiredAttributeAttribute.
7274         
7275 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
7276
7277         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
7278         Warning CS0169 is back at level 3.
7279         (IMethodData.SetMemberIsUsed): New method.
7280         
7281         * decl.cs (IsUsed): New value; moved from FieldBase.Status
7282         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
7283         
7284         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
7285
7286         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
7287         contants.
7288         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
7289         is used.
7290         
7291         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
7292         is used.
7293         
7294         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
7295         to avoid the problems with nested types.
7296
7297 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
7298             Anoob V.E  <projectmonokochi@rediffmail.com>
7299             Harilal P.R  <projectmonokochi@rediffmail.com>
7300             Raja R Harinath  <rharinath@novell.com>
7301
7302         Fix #73820.
7303         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
7304         attribute.
7305         * typemanager (GetConstructor): Make public.
7306
7307 2005-04-05  John Luke  <john.luke@gmail.com>
7308             Raja R Harinath  <rharinath@novell.com>
7309
7310         Fix #62232.
7311         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
7312         struct too.  Return false quicker in a few cases.
7313         (VerifyUnManaged): Use it.
7314
7315 2005-04-05  Raja R Harinath  <rharinath@novell.com>
7316
7317         Fix #74041.
7318         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
7319         not 'unreachable_seen'.
7320
7321 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
7322
7323         * attribute.cs (Attribute.GetValue): Removed unused.
7324         
7325         * codegen.cs (CodeGen.TrimExt): Removed unused.
7326         
7327         * cs-parser.jay (output): Removed unused.
7328         
7329         * cs-tokenizer.cs (hex_digits): Removed unused.
7330         
7331         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
7332         
7333         * expression.cs (Indirection.LoadExprValue): Removed unused.
7334         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
7335         
7336         * iterators.cs (Iterator.param_types): Removed unused.
7337         
7338         * statement.cs (Goto.block): Removed unused.
7339         (ToplevelBlock.did): Removed unused.
7340         (Switch.ResolveConstantSwitch): Removed unused.
7341
7342 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
7343
7344         * rootcontext.cs: Allow mcs to bootstrap with the compilation
7345         resetting thingy.
7346
7347 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7348
7349         Fix #74232 and cs0208-3.cs.
7350         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
7351         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
7352         unmanaged type.  Don't use FieldBuilders when 't' is a
7353         TypeBuilder.  Use ModFlags and MemberType fields.
7354         * class.cs (MemberBase.member_type): Rename from MemberType.
7355         (MemberBase.MemberType): New property.  Determines member_type on
7356         demand.
7357         (MemberBase.DoDefine): Don't initialize MemberType here.
7358         (FieldMember.Define): Likewise.
7359
7360 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
7361
7362         Fix #74241
7363         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
7364         Attributes are emitted there.
7365         
7366 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7367
7368         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
7369         keyword in 'partial enum' too.
7370         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
7371         is not allowed).
7372         Report from Kamil Skalski <nazgul@omega.pl>.
7373
7374         Fix #74309.
7375         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
7376         have partial containers too.
7377
7378         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
7379         in block' checks to Block.CheckInvariantMeaningInBlock.
7380         * statement.cs (Block.GetKnownVariableInfo): Make private.
7381         (Block.IsVariableUsedInChildBlock): Remove.
7382         (Block.IsVariableUsedInBlock): Likewise.
7383         (Block.CheckInvariantMeaningInBlock): New.  Show location of
7384         conflicting declaration.
7385         (Block.AddVariable): Make error messages less long-winded and more
7386         specific.  Show location of conflicting declaration.
7387         * parameter.cs (Parameters.Location): New readonly property.
7388
7389 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7390
7391         Clean up semantics of invoking ResolveMemberAccess.
7392         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
7393         can have an instance, ensure that we pass in a non-TypeExpression
7394         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
7395         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
7396         argument.  Update to changes and simplify.
7397         (FieldExpr.Emitinstance): Remove CS0120 check.
7398         (PropertyExpr.EmitInstance): Likewise.
7399         * expression.cs (Argument.Resolve): Likewise.
7400         (Invocation.DoResolve): Update to changes in semantics of
7401         InstanceExpression.
7402
7403 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
7404
7405         Fix #74241
7406         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
7407         customization.
7408         
7409         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
7410
7411 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7412
7413         Fix difference in behaviour with commandline invocation.
7414         * driver.cs (Driver.Reset): New.
7415         (CompilerCallableEntryPoint): Call it.
7416
7417         * statement.cs (If.Resolve): Avoid spurious "uninitialized
7418         variable" warnings if the boolean expression failed to resolve.
7419
7420 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
7421
7422         * attribute.cs: Fix the union of several permissions when some of them
7423         are unrestricted (so the result isn't an unrestricted permission set).
7424         Fix #74036.
7425
7426 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7427
7428         * ecore.cs (MemberExpr): New class.  Convert from interface
7429         IMemberExpr.
7430         (MemberExpr.ResolveMemberAccess): Refactor and move here from
7431         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
7432         error checks.
7433         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
7434         (MethodGroupExpr.IsExplicitImpl): Remove.
7435         (Expression.GetFieldFromEvent): Remove.
7436         (SimpleName.MemberStaticCheck): Remove.
7437         (SimpleName.DoSimpleNameResolve): Update to changes.
7438         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
7439         (MemberAccess.IdenticalNameAndTypeName): Remove.
7440         (MemberAccess.error176): Move to MemberExpr.
7441         (MemberAccess.DoResolve): Update to changes.
7442         (BaseAccess.DoResolve): Likewise.
7443
7444 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
7445
7446         C# 2.0 Conditional attribute class implementation
7447         
7448         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
7449         Analyzes class whether it has attribute which has ConditionalAttribute
7450         and its condition is not defined.
7451         
7452         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
7453         (Class.IsExcluded): New method. Search for at least one defined
7454         condition in ConditionalAttribute of attribute class.
7455
7456 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7457
7458         * ecore.cs (PropertyExpr): Derive from Expression, not
7459         ExpressionStatement.
7460         (PropertyExpr.EmitStatement): Remove.
7461
7462 2005-03-29  Raja R Harinath  <rharinath@novell.com>
7463
7464         Fix #74060.
7465         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
7466         internal field "value__" of an enum be private.  The examples for
7467         "value__" that I found on MSDN all used FieldAttributes.Private.
7468
7469         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
7470         Don't mention IL method attribute names.
7471
7472         Fix #47991.  Remove a TODO.
7473         * statement.cs (Block.Toplevel): Make into a field.
7474         (Block.Parameters): Move into ToplevelBlock.
7475         (Block.known_variables): Rename from child_variable_names.
7476         (Block.Block): Remove variants that take Parameters.  Initialize
7477         'Toplevel' with the immediately surrounding toplevel block.
7478         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
7479         LocalInfo parameter.
7480         (Block.GetKnownVariableInfo): New.
7481         (Block.IsVariableNameUsedInChildBlock): Update.
7482         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
7483         the block, even though it may not be in scope.
7484         (Block.AddVariable): Remove Parameters parameter.  Use
7485         Toplevel.Parameters instead.
7486         (Block.AddConstant): Remove Parameters parameter.
7487         (Block.GetParameterReference): Update to use Toplevel.Parameters.
7488         (Block.IsParamaterReference): Likewise.
7489         (Block.IsLocalParameter): Likewise.  Simplify a lot.
7490         (ToplevelBlock.Parameters): New.  Moved from Block.
7491         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
7492         initialize Parameters to a non-null value.
7493         * cs-parser.jay: Update to changes.
7494         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
7495         simple names that mean different things in the same block.  Use
7496         Block.IsVariableNameUsedInBlock.
7497
7498 2005-03-28  Raja R Harinath  <rharinath@novell.com>
7499
7500         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7501         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7502         GetTypeHandle.  It is possible for a reflected type to derive from
7503         a TypeBuilder (e.g., int[] derives from the TypeBuilder
7504         System.Array during mscorlib compilation).
7505         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7506         contain a method_hash, don't create one either.  Don't create a
7507         deep copy of the base cache's method_hash.
7508         (MemberCache.SetupCache): Rename back from DeepCopy.
7509         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7510         already initialized.  If we see an override function, add its
7511         underlying base virtual function to the member_hash too.
7512
7513         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
7514
7515 2005-03-26  Raja R Harinath  <harinath@acm.org>
7516
7517         Fix #73038.
7518         * assign.cs (Assign.DoResolve): When the RHS of an assignment
7519         fails to resolve, ensure that the LHS is still resolved as an
7520         lvalue.
7521
7522 2005-03-25  Raja R Harinath  <harinath@acm.org>
7523
7524         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
7525         ec.ContainerType.
7526         (Enum.current_ec): Remove.
7527         (Enum.LookupEnumValue): Remove EmitContext argument.
7528         Just uses the one created during DefineType.
7529         (Enum.FindMembers): Update.
7530         * expression.cs (MemberAccess.DoResolve): Update.
7531
7532 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
7533
7534         * assign.cs (Assign.DoResolve): Check for CS1717 when
7535         source and target are same (uses Equals).
7536
7537         * expression.cs (LocalVariableReference, ParameterReference,
7538         This): Implemented Equals, GetHashCode.
7539
7540         * statement.cs (Block.GetParameterReference): Removed useless
7541         local variable.
7542
7543 2005-03-22  Raja R Harinath  <rharinath@novell.com>
7544
7545         Fix cs0128.cs
7546         * statement.cs (Block.AddVariable): Ensure that we skip implicit
7547         blocks before deciding whether the error is cs0136 or cs0128.
7548
7549         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
7550         (using_alias_directive, using_namespace_directive): Pass
7551         MemberName, not an expression to Namespace.UsingAlias and
7552         Namespace.Using.
7553         (MakeName): Use the MemberName of the namespace.
7554         * namespace.cs (Namespace.MemberName): New.
7555         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
7556         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
7557         Likewise.
7558         * decl.cs (MemberName.Name): Make readonly.
7559         (MemberName.FromDotted): New "constructor".
7560         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
7561         (MemberCore.Name): Compute from MemberName on demand.
7562         (MemberCore.SetMemberName): Provide a way to change the
7563         MemberName.
7564         (MemberCore.AddToContainer): Don't take a fullname parameter.
7565         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
7566         fully qualified name of the container to the member name.
7567         (TypeContainer.AddToTypeContainer): Use a fully qualified name
7568         only if the type is a member of the root container.
7569         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
7570         MemberName.Left rather than searching for an embedded ".".
7571         (PartialContainer.CreatePart): Update to changes in RootContext.
7572         (MemberBase.ShortName): Turn into a property.  Use
7573         MemberCore.SetMemberName.
7574         (MemberBase.ExplicitInterfaceName): Remove.
7575         (MemberBase.UpdateMemberName): Remove.
7576         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
7577         (PropertyBase.SetMemberName): New override.
7578         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
7579         (Tree.GetDecl): New.
7580         (Tree.AllDecls): Rename from Decls.
7581         * attribute.cs, enum.cs, report.cs: Update to changes.
7582         * driver.cs (MainDriver): Use MemberName.FromDotted on
7583         RootContext.MainClass.
7584
7585 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
7586
7587         * class.cs (FixedField.Define): Check for CS1664 and more sanity
7588         checks.
7589
7590         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
7591
7592 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
7593
7594         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
7595         property accessor modifiers.
7596
7597         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
7598         fixed buffer attribute (CS1716).
7599         (PropertyMethod.HasCustomAccessModifier): When property accessor
7600         has custom modifier.
7601
7602         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
7603         modifiers.
7604         (PropertyExpr.DoResolveLValue): Add CS0272.
7605
7606 2005-03-17  Miguel de Icaza  <miguel@novell.com>
7607
7608         * convert.cs: When converting to a pointer, use the proper Conv.U
7609         or Conv.I depending on the source data type.
7610
7611         * cs-tokenizer.cs: Make the size for large decimal constants,
7612         fixes #72957.
7613
7614 2005-03-17  Martin Baulig  <martin@ximian.com>
7615
7616         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7617         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7618
7619 2005-03-17  Martin Baulig  <martin@ximian.com>
7620
7621         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7622         to bool so we can return an error condition.
7623         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7624         returned an error.
7625
7626 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
7627
7628         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
7629         attributes.
7630
7631 2005-03-16  Raja R Harinath  <rharinath@novell.com>
7632
7633         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
7634         Refactor to avoid traversing the list of assemblies, and to avoid
7635         string concatenation.
7636         * typemanager.cs (guid_attr_type): Remove.
7637         (negative_hits, pointers, references): Remove hashes.
7638         (type_hash): New.
7639         (GetConstructedType): New.  Uses type_hash to handle constructed
7640         types (arrays, references, pointers).
7641         (GetReferenceType, GetPointerType): Use it.
7642         (GetNestedType): New.  Uses type_hash to handle nested types of
7643         reflected types.
7644         (LookupType, LookupTypeDirect): Remove.
7645         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
7646         'types' hash and LookupTypeReflection directly.
7647         (params_string, params_object): Use GetConstructedType.
7648         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
7649         top-level types.
7650         (Namespace.Lookup): Use cached_types.
7651         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7652         provided by old TypeManager.LookupType.
7653         * rootcontext.cs (MakeFQN): Remove.
7654         * decl.cs (DeclSpace.MakeFQN): Likewise.
7655         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7656         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7657         TypeManager.GetConstructedType.
7658         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7659
7660 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
7661
7662         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7663         indexers.
7664
7665         * cs-parser.jay: Reports CS1527 for any namespace element.
7666
7667         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7668         Added CS0407.
7669
7670         * expression.cs (ParameterReference.IsAssigned): Changed error to
7671         CS0269.
7672         (Error_WrongNumArguments): Moved CS0245 detection here.
7673
7674         * statement.cs (Return.Resolve): Add CS1622 report.
7675
7676 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
7677
7678         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7679
7680 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
7681
7682         * attribute.cs expression.cs: Get rid of some allocations.
7683
7684 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
7685
7686         * doc.cs : just eliminate the latest change.
7687
7688 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7689
7690         * doc.cs : commented out the latest change. It breaks xml-030.cs
7691
7692 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7693
7694         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7695           fail. So invoke CreateType() in FindDocumentedType().
7696
7697 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7698
7699         * cs-tokenizer.cs : added IsKeyword().
7700         * doc.cs : Detect keyword incorrectly used as identifier.
7701           Allow identifiers prefixed by @.
7702
7703 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
7704
7705         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7706         It caused exception in namespace resolving (again!).
7707         
7708         * class.cs (Class.ctor): Removed exit.
7709         (PropertyMethod.ctor): ditto.
7710         
7711         * codegen.cs (Codegen.Reset): Reset static data.
7712         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7713         
7714         * cs-tokenizer.cs (Cleanup): Removed.
7715         
7716         * driver.cs (GetSystemDir): Rewrote to one line command.
7717         It caused problem with unloaded dynamic modules.
7718         (UnixParseOption): Removed Exit.
7719         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7720         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7721         Now can be mcs used as library.
7722         
7723         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7724         empty location.
7725         
7726         * location.cs (Reset): Reset static data.
7727         
7728         * namespace.cs (Reset): Reset static data.
7729         
7730         * report.cs (Report.Reset): Reset static data.
7731         
7732         * rootcontext.cs (RootContext.Reset): Reset static data.
7733         
7734         * tree.cs (RootTypes.ctor): Use Location.Null
7735         
7736         * typemanager.cs (TypeManager.Reset): Reset static data.
7737         (CoreLookupType): Removed Exit.
7738         (TypeHandle.Reset): Reset static data.
7739         
7740 2005-03-10  Raja R Harinath  <rharinath@novell.com>
7741
7742         Fix #73516.
7743         * typemanager.cs (ComputeNamespaces): Import namespaces from
7744         referenced modules too.
7745
7746 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7747
7748         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7749         than '.'.
7750
7751 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7752
7753         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7754         enclosing DeclSpace.  This ensures that a name-lookup populates
7755         more caches and there are fewer 'TypeExpression's.  Carve out
7756         nested type lookup into ...
7757         (LookupNestedTypeInHierarchy): ... this.
7758
7759 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7760
7761         Clean up a few partial-class semantics.  
7762         Fixes test-357.cs and cs1618-2.cs.
7763         * cs-parser.jay (struct_declaration): Use 'current_class' as
7764         parent of newly-created struct.  Remove call to Register ().
7765         Use 'pop_current_class' to complete handing the current struct.
7766         (interface_declaration): Likewise.
7767         (class_declaration): Likewise.
7768         (enum_declaration): Use 'current_class' as parent of newly created
7769         enum.
7770         (delegate_declaration): Likewise.
7771         (pop_current_class): New function.  This is used to handle closing
7772         up the 'current_class' and 'current_container', and pointing them
7773         to the enclosing class/container.
7774         (CSharpParser): Initialize 'current_class' too.
7775         * decl.cs (MemberCore): Add check for invariant: a partial
7776         container is not a parsed entity, and thus does not enclose any
7777         parsed members.
7778         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7779         (DeclSpace.BaseTypeExpr): Use it.
7780         (DeclSpace.LookupType): Add check for invariant.
7781         * class.cs (TypeContainer): Add check for invariant: a nested
7782         class should have the same NamespaceEntry as its enclosing class.
7783         (TypeContainer.EmitFieldInitializers): Make virtual.
7784         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7785         MemberCore.
7786         (TypeContainer.Register): Remove.
7787         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7788         null.  Use TypeResolveEmitContext for resolving base types and
7789         interfaces.  Move initialization of Parts.TypeBuilder here from
7790         ...
7791         (TypeContainer.DefineNestedTypes): ... here.
7792         (PartialContainer): Take a Namespace not a NamespaceEntry.
7793         (PartialContainer.Create): Don't use Register.  Call the
7794         appropriate Add... function directly.
7795         (ClassPart): Take both the PartialContainer and the enclosing
7796         class as constructor arguments.
7797         (ClassPart.EmitFieldInitializers): Override.
7798         (ClassPart.PartFindNestedTypes): Remove.
7799         (FieldBase.GetInitializerExpression): Resolve the initializer
7800         expression in the emit context of the enclosing class.
7801         * tree.cs (RootTypes): Remove Register ().
7802         
7803 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
7804
7805         * cs-parser.jay: Removed CS0134.
7806         
7807         * driver.cs: Removed CS1901.
7808         
7809         * expression.cs (SizeOf.DoResolve): Don't report CS0233
7810         for predefined types.
7811
7812 2005-03-07  Duncan Mak  <duncan@novell.com>
7813
7814         * codegen.cs (Save):  Catch UnauthorizedAccessException as
7815         well. Fixes bug #73454.
7816
7817 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
7818
7819         * cs-tokenizer.cs (xtoken): Add CS1035.
7820         
7821         * class.cs (MethodData.Define): Add CS0683.
7822         (FieldMember.ctor): Add CS0681.
7823
7824 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7825
7826         * ecore.cs (SimpleName.DoResolve): Rename from
7827         SimpleName.DoResolveAllowStatic.
7828         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7829         Pass 'intermediate' flag to MemberStaticCheck.
7830         (SimpleName.MemberStaticCheck): Skip "static check" only in case
7831         of "intermediate" lookups via MemberAccess.
7832         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
7833         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7834
7835 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7836
7837         Fix #73394.
7838         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7839         slipped in because of variable names that are identical to a
7840         builtin type's BCL equivalent ('string String;', 'int Int32;').
7841         (PropertyExpr.EmitInstance): Likewise.
7842
7843 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
7844
7845         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7846         
7847         * report.cs (warning_ignore_table): Made public.
7848
7849 2005-03-04  Raja R Harinath  <rharinath@novell.com>
7850
7851         Fix #73282.
7852         * class.cs (MethodData.Emit): Pass 'container' to
7853         container.GetObsoleteAttribute instead of 'container.Parent'.
7854
7855 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
7856
7857         * cs-parser.jay: Add 1534 error test.
7858
7859         * iterators.cs (Yield.CheckContext): Add error 1629.
7860         (Iterator.ctor): Save unsafe modifier.
7861         (MoveNextMethod.DoEmit): Restore unsafe context.
7862
7863         * namespace.cs (UsingAlias): Better error message.
7864
7865 2005-03-03  Dan Winship  <danw@novell.com>
7866
7867         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7868         the warning message [#73219]
7869
7870 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7871
7872         Fix compile with MCS 1.0.0.0.
7873         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7874         w_restore to not depend on string constant folding.
7875
7876 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7877
7878         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
7879         CS0246 check to users who passed 'silent = false'.
7880         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7881         check.
7882         (SimpleName.SimpleNameResolve): Update.
7883         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7884         (MemberAccess.IdenticalNameAndTypeName): Update.
7885         * doc.cs (FindDocumentedTypeNonArray): Update.
7886
7887 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
7888
7889         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7890         * parameters.cs (ComputeAndDefineParameters): Remove.
7891         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7892         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7893         Use GetParameterInfo.
7894
7895 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
7896
7897         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7898
7899 2005-03-02  Raja R Harinath  <rharinath@novell.com>
7900
7901         Unify DeclSpace.LookupType and DeclSpace.FindType.
7902         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
7903         is in charge of defining nested types on demand.
7904         (DeclSpace.LookupType): Use it when the current_type is a
7905         TypeBuilder.  Use LookupTypeDirect for reflected types.
7906         (DeclSpace.FindType): Remove.
7907         (DeclSpace.LookupInterfaceOrClass): Likewise.
7908         (DeclSpace.DefineTypeAndParents): Likewise.
7909         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7910         DeclSpace.LookupType.
7911         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7912         * typemanager.cs (LookupType): Simplify.
7913         (AddUserType): Remove type from negative_hits.
7914         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7915         * class.cs (TypeContainer.FindMembers): Move handling of nested
7916         types ...
7917         (TypeContainer.FindMembers_NestedTypes): ... here.
7918         (TypeContainer.FindNestedType): Implement override.
7919         (ClassPart.FindNestedType): Delegate to PartialContainer.
7920         (ClassPart.PartFindNestedType): Looks up the nested types of the
7921         part alone.
7922
7923 2005-03-02  Martin Baulig  <martin@ximian.com>
7924
7925         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7926         static constructor in static classes.
7927
7928 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7929
7930         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7931         sizeParamIndex is not specified.
7932
7933 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
7934
7935         Fix #73117
7936         * report.cs (WarningMessage.IsEnabled): Missing null check.
7937
7938 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7939
7940         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7941         in the fields and not in the properties.
7942
7943 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
7944
7945         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
7946         fields as well.
7947
7948 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7949
7950         * attribute.cs: Small refactoring (improved robustness).
7951         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7952         (ValidateGuid): Removed.
7953         (Resolve): Removed referenced to above mentioned.
7954         (GetAttributeUsage): Made private and changed to work without
7955         class assistance.
7956         (GetIndexerAttributeValue): Don't crash.
7957         (GetConditionalAttributeValue): Ditto.
7958         (GetClsCompliantAttributeValue): Ditto.
7959         (ExtractSecurityPermissionSet): All attributes exceptions are
7960         error 648.
7961         (GetPropertyValue): New helper.
7962         (GetMethodImplOptions): New method.
7963         (DefinePInvokeMethod): Reuse common code. Implemented handling of
7964         some missing properties.
7965         
7966         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7967         (Method.ApplyAttributeBuilder): Updated.
7968         
7969         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7970         exception.
7971
7972 2005-02-28  Raja R Harinath  <rharinath@novell.com>
7973
7974         Fix #73052.
7975         * report.cs (Report.SymbolRelatedToPreviousError): Handle
7976         non-simple types (array, pointer, reference).
7977
7978 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7979
7980         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7981
7982         * class.cs (MethodCore.IsDuplicateImplementation): Special error
7983         for operators.
7984         (Method.CheckBase): Catch wrong destructor here.
7985         (MethodData.Define): Add errors 550, 668.
7986
7987         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7988
7989         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7990
7991         * pending.cs (VerifyPendingMethods): Add error 551.
7992
7993         * typemanager.cs (CSharpName): Next error report helper.
7994
7995 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
7996
7997         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7998         attributes. Removed useless attribute double check.
7999         It saves almost 2MBs for corlib.
8000
8001 2005-02-25  Raja R Harinath  <rharinath@novell.com>
8002
8003         Fix #72924.
8004         * statement.cs (ExpressionStatement.Resolve): Make robust to being
8005         called twice in case of error.
8006
8007 2005-02-23  Chris Toshok  <toshok@ximian.com>
8008
8009         Fix compiler portions of #72827.
8010         * statement.cs (Block.Emit): call Begin/EndScope on the
8011         EmitContext instead of the ILGenerator.
8012
8013         * codegen.cs (EmitContext.BeginScope): new method, call
8014         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
8015         we have one.)
8016         (EmitContext.BeginScope): same, but EndScope and CloseScope
8017
8018         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
8019         offset and call the superclass's OpenScope(int) with it.
8020         (SymbolWriter.CloseScope): get the current il
8021         offset and call superclass's CloseScope(int) with it.
8022
8023 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
8024
8025         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
8026         CS1677 for out and ref as well.
8027
8028         * class.cs (Method.Define): Add error CS1599 detection.
8029         
8030         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
8031         
8032         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
8033         
8034         * delegate.cs (Delegate.Define): Add error CS1599 detection.
8035         
8036         * support.cs.cs (ModifierDesc): New helper method.
8037
8038 2005-02-23  Raja R Harinath  <rharinath@novell.com>
8039             Abin Thomas  <projectmonokochi@rediffmail.com>
8040             Anoob V E  <projectmonokochi@rediffmail.com>
8041             Harilal P R  <projectmonokochi@rediffmail.com>
8042
8043         Fix #57851, #72718.
8044         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
8045         MemberLookup (used for error reporting) actually returns a result.
8046         Fix error report number (122, not 112).
8047
8048 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
8049             Anoob V E  <projectmonokochi@rediffmail.com>
8050             Harilal P R  <projectmonokochi@rediffmail.com>
8051
8052         Fix #71134.
8053         * pending.cs (PendingImplementation.GetAbstractMethods):
8054         Find NonPublic members too.
8055
8056 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
8057
8058         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
8059         Fixed error 217.
8060         
8061         * class.cs (MethodCore.CheckMethodAgainstBase):
8062         Add error 239 report.
8063
8064 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8065
8066         Fix #68955.
8067         * expression.cs (Invocation.IsApplicable): Make public.
8068         (Invocation.IsParamsMethodApplicable): Likewise.
8069         * delegate.cs (Delegate.VerifyApplicability): Don't use
8070         Invocation.VerifyArgumentCompat for parameter applicability
8071         testing.  Use Invocation.IsApplicable and
8072         Invocation.IsParamsMethodApplicable.
8073
8074 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
8075
8076         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
8077         
8078         * class.cs (Operator.Define): Add error 217 report.
8079         
8080 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8081
8082         * namespace.cs (UsingEntry.Resolve): Undo change below.
8083
8084 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8085
8086         Fix #72756.
8087         * ecore.cs (Expression.MemberLookupFailed): Add argument to
8088         disable the error message when the extended MemberLookup also
8089         fails.
8090         (Expression.MemberLookupFinal): Update.
8091         (SimpleName.DoSimpleNameResolve): Update.
8092         * expression.cs (MemberAccess.ResolveNamespaceOrType):
8093         Don't use MemberLookupFinal.
8094         (New.DoResolve): Update.
8095         (BaseAccess.CommonResolve): Update.
8096
8097 2005-02-21  Raja R Harinath  <rharinath@novell.com>
8098
8099         Fix #72732.
8100         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
8101         occured previously, don't resolve again.
8102
8103 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
8104
8105         Fix #69949
8106         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
8107         argument. Call ResolveAttributeUsage for unresolved.
8108         when types doesn't match ctor arguments.
8109         
8110         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
8111         for nested attribute classes.
8112         (Class.attribute_usage): Removed.
8113         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
8114         for attribute class.
8115         
8116         * ecore.cs (IsAttribute): Removed.
8117         
8118         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
8119         
8120         * rootcontext.cs (RegisterAttribute): Removed, attributes are
8121         now normal types.
8122         (attribute_types): Removed.
8123         (EmitCode): Global attributes are emited as the latest.
8124
8125 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
8126
8127         * class.cs (EmitFieldInitializers): Don't emit field initializer
8128         for default values when optimilization is on.
8129         
8130         * constant.cs (Constant.IsDefaultValue): New property.
8131         
8132         * driver.cs: Add /optimize handling.
8133         
8134         * constant.cs,
8135         * ecore.cs,
8136         * literal.cs: Implement new IsDefaultValue property.
8137         
8138         * rootcontext.cs (Optimize): New field, holds /optimize option.
8139
8140 2005-02-18  Raja R Harinath  <rharinath@novell.com>
8141
8142         Fix crasher in re-opened #72347.
8143         * namespace.cs (Namespace.Lookup): Return null if
8144         DeclSpace.DefineType returns null.
8145
8146         Fix #72678.
8147         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
8148
8149 2005-02-18  Raja R Harinath  <rharinath@novell.com>
8150
8151         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
8152         now returns null if it cannot resolve to an lvalue.
8153         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
8154         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
8155         returned null.  Remove check for SimpleName.
8156         (EventExpr.DoResolveLValue): New.
8157         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
8158         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
8159         error from ...
8160         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
8161         avoid CS0131 error.
8162         (Unary.ResolveOperator): Move CS0211 check ...
8163         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
8164         CS0131 error.
8165         (Unary.DoResolveLValue): Simplify.
8166         (AddressOf.DoResolveLValue): New.
8167         (ArrayAccess.DoResolveLValue): New.
8168
8169 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
8170
8171         * attribute.cs (Attribute.Resolve): Add arguments casting for
8172         when types doesn't match ctor arguments.
8173
8174 2005-02-16  Raja R Harinath  <rharinath@novell.com>
8175
8176         Fix parts of #63202.
8177         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
8178         lookup of operator in base type.  Ensure that all checks happen
8179         when the operator resolves to an "op_..." method.
8180
8181 2005-02-15  Raja R Harinath  <rharinath@novell.com>
8182
8183         Fix #71992.
8184         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
8185         'ignore_cs0104' parameter.  Pass it to ...
8186         (NamespaceEntry.Lookup): ... this.
8187         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8188         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
8189         (TypeLookupExpression.DoResolveAsTypeStep): Update.
8190         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
8191         Update.  Request that cs0104 errors be ignored.
8192         (ComposedCast.ResolveAsTypeStep): Update.
8193
8194 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8195
8196         Fix #59209.
8197         * expression.cs (Invocation.BetterFunction): Remove support for
8198         comparing virtual functions and their overrides.
8199         (Invocation.IsOverride): New.
8200         (Invocation.OverloadResolve): Don't consider 'override' functions
8201         during candidate selection.  Store them in a lookaside list.
8202         If the selected method is a 'virtual' function, use the list to
8203         find any overrides that are closer to the LHS type.
8204
8205 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
8206
8207         * expression.cs (New.DoResolve): Add complex core type reduction.
8208         (New.Constantify): Converts complex core type syntax like 'new int ()'
8209         to simple constant.
8210         
8211 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8212
8213         * decl.cs (EntryType.EntryType): New constructor to create an
8214         updated copy of a cache entry.
8215         (MemberCache.AddMethods): Use it.
8216         (MemberCache.ClearDeclaredOnly): Remove.
8217         (MemberCache.MemberCache): Update.
8218
8219 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8220
8221         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
8222         variable.  This one is represents the actual low-level declaration
8223         of the method, as opposed to the semantic level `IsStatic'.   
8224
8225         An anonymous method which is hosted into a static method might be
8226         actually an instance method.  IsStatic would reflect the
8227         container, while MethodIsStatic represents the actual code
8228         generated.
8229
8230         * expression.cs (ParameterReference): Use the new MethodIsStatic
8231         instead of IsStatic.
8232
8233         * anonymous.cs (AnonymousMethod.Compatible): Pass the
8234         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
8235         set on the current EmitContext. 
8236
8237         * expression.cs (Cast): Overload DoResolveLValue so we can pass
8238         resolve our casted expression as an LValue.  This triggers the
8239         proper LValue processing that is later required by Assign.
8240
8241         This fixes 72347.
8242
8243         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
8244
8245 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
8246
8247         C# 2.0 Fixed buffer implementation
8248
8249         * anonymous.cs: Update after RegisterHelperClass renaming.
8250
8251         * attribute.cs (AttributeTester.fixed_buffer_cache):
8252         Cache of external fixed buffers.
8253         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
8254         implementation if field is fixed buffer else null.
8255
8256         * class.cs
8257         (TypeContainer.AddField): Accept FieldMember instead of Field.
8258         (FieldBase.IsFieldClsCompliant): Extracted code from
8259         VerifyClsCompliance descendant customization.
8260         (FixedField): New class handles fixed buffer fields.
8261         (FixedFieldExternal): Keeps information about imported fixed
8262         buffer.
8263         (IFixedField): Make access to internal or external fixed buffer
8264         same.
8265
8266         * cs-parser.jay: Add fixed buffer parsing.
8267
8268         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
8269         buffer.
8270
8271         * expression.cs (Indirection): Extended implementation to accept
8272         fixed buffer field.
8273         (PointerArithmetic.Emit): Get element from fixed buffer as well.
8274         (ElementAccess.MakePointerAccess): Get type as parameter.
8275         (DoResolve): Add fixed buffer field expression conversion.
8276         (DoResolveLValue): Ditto.
8277         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
8278         (ArrayPtr): Derives from FixedBufferPtr.
8279         (ArrayPtr.Emit): Add extra emit for array elements.
8280
8281         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
8282
8283         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
8284         for compiler generated types.
8285         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
8286
8287         * statement.cs (Fixed): Refactored to be easier add fixed buffer
8288         and consume less memory.
8289         (Fixed.Resolve): Add fixed buffer case.
8290
8291         * typemanager.cs (compiler_generated_attr_ctor,
8292         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
8293         (HasElementType): Add our own implementation to work on every
8294         runtime.
8295
8296 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8297
8298         * anonymous.cs (CaptureContext): Track whether `this' has been
8299         referenced.   
8300
8301         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
8302         only captured `this' if it was implicitly done (instance
8303         methods/variables were used). 
8304
8305         * codegen.cs (EmitContext.CaptureThis): New method to flag that
8306         `this' must be captured.
8307
8308 2005-01-30  Miguel de Icaza  <miguel@novell.com>
8309  
8310         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
8311         is null it means that there has been no need to capture anything,
8312         so we just create a sibling.
8313
8314         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
8315
8316         Just a partial fix.  The other half is fairly elusive.
8317         
8318 2005-02-10  Raja R Harinath  <rharinath@novell.com>
8319
8320         Fix #52586, cs0121-4.cs.
8321         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
8322         and return a hashtable.
8323         (MemberCache.ClearDeclaredOnly): New.
8324         (MemberCache.MemberCache): Update to change.  Make a deep copy of
8325         the method_hash of a base type too.
8326         (MemberCache.AddMethods): Adapt to having a deep copy of the base
8327         type methods.  Overwrite entries with the same MethodHandle so
8328         that the ReflectedType is correct.  The process leaves in base
8329         virtual functions and their overrides as distinct entries.
8330         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
8331         matters since it was boxed in a ArrayList before.
8332         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
8333         modifier.
8334         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
8335         case of a virtual function and its override (choose the overload
8336         as better).
8337         (Invocation.OverloadResolve): Avoid 'override' members during
8338         'applicable_type' calculation.
8339
8340 2005-02-09  Raja R Harinath  <rharinath@novell.com>
8341
8342         Combine two near-redundant caches.
8343         * typemanager.cs (method_params): Rename from method_internal_params.
8344         (TypeManager.GetParameterData): New.  Replace
8345         Invocation.GetParameterData.
8346         (TypeManager.LookupParametersByBuilder): Remove.
8347         * expression.cs (Invocation.method_parameter_cache): Remove.
8348         (Invocation.GetParameterData): Remove.
8349         Update to changes.
8350         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
8351         Update to changes.
8352
8353 2005-02-08  Raja R Harinath  <rharinath@novell.com>
8354
8355         Fix #72015.
8356         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
8357         TypeManager.multicast_delegate_type is null, resolve it by looking
8358         up "System.MulticastDelegate".
8359         * rootcontext.cs (RootContext.ResolveCore): Simplify.
8360
8361 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
8362             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
8363             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
8364
8365         Fix cs0164.cs.
8366         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
8367         (LabeledStatement.AddReference): New.  Set 'referenced'.
8368         (Goto.Resolve): Use it.
8369
8370 2005-02-05  John Luke  <john.luke@gmail.com>
8371
8372         * driver.cs: remove duplicate -doc line in Usage ()
8373
8374 2005-02-04  Raja R Harinath  <rharinath@novell.com>
8375
8376         * location.cs (Location.AddFile): Fix CS2002 error report.
8377
8378 2005-02-02  Martin Baulig  <martin@ximian.com>
8379
8380         * delegate.cs (Delegate.DefineType): Report an internal error if
8381         TypeManager.multicast_delegate_type is null.  See bug #72015 for
8382         details.        
8383
8384 2005-02-02  Raja R Harinath  <rharinath@novell.com>
8385
8386         Fix a crasher in a variant of #31984.
8387         * const.cs (Constant.CheckBase): New override that defers the
8388         new-or-override check in case the base type hasn't been populated
8389         yet.
8390         (Constant.Define): Ensure the new-or-override check is performed.
8391
8392 2005-02-01  Duncan Mak  <duncan@ximian.com>
8393
8394         * const.cs (LookupConstantValue): Check that `ce' is not null
8395         before calling GetValue ().
8396
8397 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8398
8399         Fix test-334.cs (#69519).
8400         * cs-parser.jay (using_alias_directive): Pass in an expression to
8401         NamespaceEntry.UsingAlias.
8402         (using_namespace_directive): Pass in an expression to
8403         NamespaceEntry.Using.
8404         (namespace_name): Don't flatten to a string.
8405         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
8406         (NamespaceEntry.AliasEntry.Resolve): Lookup using
8407         ResolveAsTypeStep.
8408         (NamespaceEntry.UsingEntry): Likewise.
8409         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
8410         changes.
8411         (NamespaceEntry.LookupForUsing): Remove.
8412         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
8413         names.
8414         (NamespaceEntry.Lookup): Remove support for dotted names.
8415
8416 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8417
8418         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
8419         split into two.
8420         (NamespaceEntry.ImplicitParent): Compute on demand.
8421         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
8422         parallels the current.
8423         (NamespaceEntry.LookupForUsing): Use it.
8424         (NamespaceEntry.Lookup): If the current namespace-entry is
8425         implicit, don't search aliases and using tables.
8426
8427 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8428
8429         Fix #31984.
8430         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
8431         BaseCache here.
8432         (TypeContainer.BaseCache): Compute on demand.
8433         (TypeContainer.FindMembers): Define constants and types if they're
8434         not already created.
8435         (FieldMember.Define): Move resetting of ec.InUnsafe before error
8436         check.
8437         * const.cs (Constant.Define): Make idempotent.
8438
8439 2005-01-29  Miguel de Icaza  <miguel@novell.com>
8440
8441         * pending.cs: Produce better code (no nops produced by using Ldarg
8442         + value).
8443         
8444         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
8445         i - 1' it should be arg + 1.
8446
8447         Fixes bug #71819.
8448
8449 2005-01-28  Raja R Harinath  <rharinath@novell.com>
8450
8451         * attribute.cs (Attribute.CheckAttributeType): Make private
8452         non-virtual.
8453         (Attribute.ResolveType): Make virtual.
8454         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
8455         handling of RootContext.Tree.Types.
8456
8457 2005-01-27  Raja R Harinath  <rharinath@novell.com>
8458
8459         Update attribute-handling to use the SimpleName/MemberAccess
8460         mechanisms.
8461         * cs-parser.jay (attribute): Pass in an expression to the
8462         constructors of Attribute and GlobalAttribute.
8463         * attribute.cs (Attribute): Take an expression for the name.
8464         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
8465         passed in attribute name expression.
8466         (Attribute.CheckAttributeType): Use it.
8467         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
8468         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
8469         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
8470         argument to prevent error messages if the lookup fails.
8471
8472 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
8473
8474         * expression.cs (Indirection): Implemented IVariable interface
8475         to support indirection in AddressOf operator.
8476         (PointerArithmetic.Emit): Add optimalization for case where
8477         result can be precomputed.
8478
8479 2005-01-26  Martin Baulig  <martin@ximian.com>
8480
8481         * class.cs (TypeContainer.AttributeTargets): Return the correct
8482         AttributeTargets depending on our `Kind' instead of throwing an
8483         exception; fixes #71632.
8484
8485 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
8486
8487         Fix #71257
8488         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
8489         constant members.
8490
8491 2005-01-25  Raja R Harinath  <rharinath@novell.com>
8492
8493         Fix #71602.
8494         * expression.cs (MemberAccess.DoResolve): Don't complain with
8495         cs0572 when the LHS of a member access has identical name and type
8496         name.
8497
8498 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
8499
8500         Fix #71651, #71675
8501         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
8502         CreatePermission.
8503         Create custom PermissionSet only for PermissionSetAttribute.
8504
8505 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
8506
8507         Fix #71649
8508         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
8509         delegates in static class.
8510
8511 2005-01-24  Martin Baulig  <martin@ximian.com>
8512
8513         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8514         merging an implicit block, just use its reachability.
8515
8516         * statement.cs (Block.Resolve): Make the unreachable code check
8517         work wrt. implicit blocks; see test-337 from #63842.
8518
8519 2005-01-21  Alp Toker  <alp@atoker.com>
8520  
8521         * cs-parser.jay: destructor_declaration's container is PartialContainer
8522         not Class when partial types are used, so use Kind prop instead of
8523         'is'.
8524         
8525 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
8526
8527         * cs-parser.jay: Improve error reporting when an interface
8528         declares new types.
8529
8530 2005-01-20  Dick Porter  <dick@ximian.com>
8531
8532         * support.cs: SeekableStreamReader fix from Sandor Dobos
8533         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
8534         chars are read.  Fixes bug 70369.
8535
8536 2005-01-20  Raja R Harinath  <rharinath@novell.com>
8537
8538         * cs-parser.jay (catch_clause): Simplify current_block handling
8539         somewhat.
8540
8541 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
8542
8543         * convert.cs (ImplicitStandardConversionExists): Synchronize the
8544         code with ImplicitStandardConversion to handle the implicit
8545         conversion of method groups into valid delegate invocations. 
8546
8547         The problem is that in parameter handling we were using this code
8548         path.  Fixes bug #64698
8549
8550 2005-01-19  Raja R Harinath  <rharinath@novell.com>
8551
8552         * cs-parser.jay: Fix several infelicities.
8553         - Avoid assigning to the parser value stack.  Code like 
8554           '$3 = null' is unclean.  Synthesize a value for the code block
8555           instead. 
8556         - Avoid using oob_stack for storing location information.  Use ...
8557         (_mark_): ... this.  New (empty) rule.  Saves the current location
8558         in $$.
8559         (foreach_statement): Avoid using oob_stack for current_block
8560         handling.  Use technique used in for_statement and
8561         using_statement.  Synthesize a value for the code block to store
8562         additional intermediate information.
8563
8564 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
8565
8566         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
8567         of a different type is only allowed to private fields of a
8568         containing type, not on fields of a base class.
8569
8570         See test-174.cs and error cs0122-9.cs
8571
8572 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8573
8574         Fix test-335.cs (bug #58126).
8575         * cs-parser.jay (argument): Split out non-expression parts of the
8576         rule into 'non_simple_argument'.
8577         (invocation_expression): Support parenthesized invocations with
8578         multiple arguments, and with single non-simple arguments.
8579
8580 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8581
8582         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
8583         places.
8584
8585 2005-01-12  Raja R Harinath  <rharinath@novell.com>
8586
8587         Fix cs0038-1.cs, cs1640-6.cs.
8588         * ecore.cs (Expression.Resolve): Remove special-case for
8589         SimpleName in error-handling.
8590         (Expression.almostMatchedMembers): Relax access permission to
8591         protected.
8592         (Expression.MemberLookupFailed): Handle duplicates in
8593         almostMatchedMembers list.
8594         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
8595         * expression.cs (New.DoResolve): Report CS1540 for more cases.
8596         * typemanager.cs (GetFullNameSignature): Use the MethodBase
8597         overload if the passed in MemberInfo is a MethodBase.
8598
8599 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
8600
8601         Fix #70749
8602         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
8603         for non-CAS & merge permission sets properly.
8604
8605 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8606
8607         Improve standard-compliance of simple name and member access 
8608         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
8609         * ecore.cs (FullNamedExpression): New abstract base class 
8610         for Namespaces and TypeExpressions.
8611         (ResolveFlags.SimpleName): Remove.
8612         (SimpleName): Remove support for dotted names.
8613         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
8614         DeclSpace.FindType and DeclSpace.LookupType.
8615         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
8616         (Expression.ExprClassName): Make member function.
8617         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
8618         a namespace.  Remove creation of dotted "SimpleName"s.
8619         (MemberAccess.DoResolve): Likewise.
8620         * decl.cs (DeclSpace.Cache): Make private.
8621         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
8622         (DeclSpace.FindType): Update.
8623         (DeclSpace.LookupType): Move here from RootContext.  Return a 
8624         FullNamedExpression.
8625         * namespace.cs (Namespace): Derive from FullNamedExpression
8626         so that it can be part of expression resolution.
8627         (Namespace.Lookup): Return an FullNamedExpression.
8628         (NamespaceEntry.LookupAlias): Lookup aliases only in current
8629         namespace.
8630         * rootcontext.cs (NamespaceLookup): Remove.
8631         (LookupType): Move to DeclSpace.
8632         * attribute.cs (CheckAttributeType): Update.
8633         * doc.cs (FindDocumentedType): Remove allowAlias argument.
8634         (FindDocumentedTypeNonArray): Likewise.
8635
8636 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8637
8638         Fix cs0509.cs, cs1632.cs.
8639         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
8640         is the same as IsInterface.
8641         (TypeContainer.GetClassBases): Likewise.
8642         * statement.cs (LabeledStatement.ig): New field.
8643         (LabeledStatement.LabelTarget): Save ILGenerator which created the
8644         label.
8645         (LabeledStatement.DoEmit): Check that the label was created with
8646         the same ILGenerator.
8647
8648 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8649
8650         Fix #71058
8651         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8652         accessors to its properties.
8653
8654         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8655         from accessors to property.
8656         
8657 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8658
8659         Fix #70722
8660         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8661         only for overrides.
8662         
8663 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
8664
8665         * attribute.cs: Check for null and empty strings.  
8666
8667         I have lost another battle to Paolo.
8668
8669 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
8670
8671         Fix #70942
8672         * class.cs (PropertyMethod): Set Parent field in ctors.
8673         (SetMethod.InternalParameters): Add unsafe switch hack.
8674         Override MarkForDuplicationCheck where it is appropriate.
8675
8676         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8677         It says whether container allows members with the same name.
8678         Base default is no.
8679         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8680         Removed is_method parameter.
8681
8682 2005-01-06  Duncan Mak  <duncan@ximian.com>
8683
8684         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8685         because the previous change led to incorrect reporting of CS1032
8686         ("Cannot define/undefine preprocessor symbols after first token in
8687         file"). Instead of using `tokens_seen' as the only flag that
8688         triggers CS1040, introduce `comments_seen'. This new flag is used
8689         to signify having seen comments on the current line, so it is
8690         unset after a newline.
8691
8692 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8693
8694         * doc.cs : When searching for a type, find nested type too.
8695           This fixes bug #71040.
8696
8697 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8698
8699         * doc.cs :
8700           - Warn missing member comment on those classes which also does not
8701             have doc comments. Fixed bug #71041.
8702           - Don't warn missing doc comment on default constructor.
8703             Fixed bug #71042.
8704
8705 2005-01-06  Duncan Mak  <duncan@ximian.com>
8706
8707         * cs-tokenizer.cs (xtoken): After handling traditional C-style
8708         comments, set `tokens_seen' to true. This allows us to detect
8709         misplaced preprocessor directives (i.e. not at the beginning of
8710         the a line, nor after whitespaces). In that case, report error
8711         CS1040. This fixes bug #56460.
8712
8713         * cs-parser.jay (interface_member_declaration): Add checks for
8714         IsExplicitImpl, and report CS0541 error if an interface member is
8715         defined as an explicit interface declaration.
8716
8717 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
8718
8719         Fix #70817
8720         * class.cs (PropertyMethod): Set Parent field in ctors.
8721         (SetMethod.InternalParameters): Add unsafe switch hack.
8722         
8723         * decl.cs (MemberCore.Parent): Cannot be readonly.
8724
8725 2005-01-06  Raja R Harinath  <rharinath@novell.com>
8726
8727         * decl.cs (DeclSpace.ResolveType): Remove.
8728         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8729         Merge in code from ...
8730         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
8731         * class.cs, enum.cs: Update to changes.
8732
8733 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
8734
8735         * anonymous.cs: Ensure that we init the scope of our parent if it
8736         has not been initialized yet.
8737
8738 2004-12-30  Duncan Mak  <duncan@ximian.com>
8739
8740         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8741         if field.FieldBuilder is null. Fixes #70758.
8742
8743         * convert.cs: Fixed some typos and updated some of the comments.
8744         (ImplicitStandardConversionExists):
8745         (TryImplicitIntConversion): If `target_type' is an interface and
8746         the type of `ic' implements this interface, return true or a new
8747         BoxedCast instead of null. This fixes #70468.
8748
8749 2004-12-29  Duncan Mak  <duncan@ximian.com>
8750
8751         * expression.cs (Argument.Emit): Check that Expr is
8752         IMemoryLocation before casting to it, and report CS1510 otherwise.
8753
8754         This fixes #70402.
8755
8756 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
8757
8758         * statement.cs (Block.ThisVariable): remove the recursion here, to
8759         make the --profile more sane.
8760
8761 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
8762
8763         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8764         assembly, by JB Evain.
8765
8766 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8767
8768         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
8769           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8770         "parent" refers to enclosing type/class.  "base" refers to superclass.
8771
8772 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8773
8774         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8775         Ensure that we only have GlobalAttributes.
8776         * attribute.cs (Attribute.Emit): Make non-virtual.
8777         (GlobalAttribute.Emit): Remove.
8778         (Attribute.Resolve): Make virtual.
8779         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
8780         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8781         the argument. Don't create one.
8782         (Attribute.GetObsoleteAttribute): Likewise.
8783         (Attribute.GetClsCompliantAttributeValue): Likewise.
8784         * class.cs, decl.cs: Update to changes.
8785
8786 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
8787
8788         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8789         
8790         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8791         
8792         * statement.cs (Foreach.Resolve): Add error 186 report.
8793
8794 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
8795
8796         * expression.cs (Conditional.DoResolve): Add warning 429.
8797         
8798         * statement.cs (If.Resolve): Add warning 665.
8799
8800 2004-12-16  Raja R Harinath  <rharinath@novell.com>
8801
8802         New invariant: RootContext.Tree.Types.NamespaceEntry == null
8803         except when in the parser, and in GlobalAttribute.
8804         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8805         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8806         RootContext.Tree.Types.NamespaceEntry once work is done.
8807         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
8808         and resets RootContext.Tree.Types.NamespaceEntry.
8809
8810 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
8811
8812         * cs-parser.jay: Don't create a block for every variable.
8813
8814 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
8815
8816         * location.cs: Provide extra information.
8817
8818         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8819         variables from the captured environment, it is the ldarg_0.
8820
8821 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8822
8823         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8824         find a conclusion.
8825         
8826         * class.cs: Changed warning level for 169 to avoid developer
8827         displeasure from warning flooding. It will be changed back when they
8828         fix most of current BCL warnings.
8829         
8830         * RootContext.cs: Pushed default WarningLevel to 3.
8831         
8832         * statement.cs: Removed unused variable.
8833
8834 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8835
8836         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8837         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8838         Add error 502 report.
8839         (StaticClass.DefineType): Add error 441 report.
8840         (Class.AllowedModifiersProp): New virtual property as temporary
8841         extension to AllowedModifiers.
8842         (Class.DefineType): Add error 418 report. Moved ModFlags check here
8843         to share implementation with StaticClass and don't call virtual
8844         methods from ctor.
8845         
8846         * driver.cs (MainDriver): Add error 1558 test.
8847
8848         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8849         report. Moved error 36 test here.
8850
8851         * statement.cs (Throw.Resolve): Add error 724 report.
8852
8853         * typemanager.cs: Add out_attribute_type core type.
8854         
8855 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
8856
8857         * class.cs (TypeContainer.VerifyClsCompliance): Add error
8858         3018 report.
8859         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8860
8861         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8862         3017 report.
8863         
8864         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8865
8866         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
8867         Add error 3023 report.
8868         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8869
8870         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8871         implementation.
8872
8873 2004-12-12  John Luke  <john.luke@gmail.com>
8874
8875         * driver.cs (AddArgs): take -- into account when
8876         adding arguments, fixes bug 65710 
8877
8878 2004-12-12  Martin Baulig  <martin@ximian.com>
8879
8880         * expression.cs (Unary.TryReduceNegative): Added support for
8881         SByteConstant and ByteConstant.
8882         (Unary.Reduce): Check error values from TryReduceNegative().
8883
8884 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
8885
8886         * attributes.cs (Attribute.Resolve): Avoid multiple error report
8887         and report exception as error 182.
8888
8889 2004-12-10  Raja R Harinath  <rharinath@novell.com>
8890
8891         * driver.cs (Main): Fix message when there are warnings.
8892
8893 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
8894
8895         * delegate.cs: Fixed my fix from yesterday, sorry about that.
8896
8897 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
8898
8899         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
8900         Reduced number of warnings.
8901         
8902         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8903
8904 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
8905
8906         * driver.cs: Removed message.
8907
8908         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8909
8910 2004-12-08    <vargaz@freemail.hu>
8911
8912         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8913
8914 2004-12-08  Martin Baulig  <martin@ximian.com>
8915
8916         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8917         instead of a CS3002 for properties and indexer.
8918
8919 2004-12-08  Martin Baulig  <martin@ximian.com>
8920
8921         * decl.cs (MemberName.ToString): Make this work again.
8922
8923 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
8924
8925         * attribute.cs (Resolve): Add error 591 detection.
8926
8927         * class.cs (FieldMember.Define): Add error 1547 detection.
8928         (Indexer.Define): Add error 620 detection.
8929         (Operator.Define): Add error 590 detection.
8930
8931         * ecore.cs: Missing argument for error 79.
8932
8933         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8934         detection.
8935
8936 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
8937
8938         Fix #70106
8939         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8940         only.
8941
8942 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8943
8944         * cs-parser.jay : handle doc comments on implicit/explicit operators.
8945           Some operator comments were suppressed.
8946         * doc.cs : Implicit/explicit operator name in doc comments are like
8947           "op_Explicit(type)~returnType", so added suffix handling.
8948
8949 2004-12-07  Martin Baulig  <martin@ximian.com>
8950
8951         * decl.cs
8952         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8953         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8954         (DeclSpace.ec): New protected field; store the EmitContext here.
8955         (DeclSpace.EmitContext): New public property; moved here from
8956         `TypeContainer'.
8957         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8958         EmitContext.
8959
8960         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8961         (Enum.Emit): Don't create a new EmitContext.
8962
8963         * delegate.cs (Delegate.DefineType): Always create the
8964         EmitContext.
8965
8966         * iterators.cs (Iterators.DefineIterator): Create a new
8967         EmitContext and store it in `ec'.
8968
8969 2004-08-24  Martin Baulig  <martin@ximian.com>
8970
8971         * typemanager.cs
8972         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8973         this for accessibility checks.
8974         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8975         IsNestedFamilyAccessible.
8976         (TypeManager.IsSubclassOf): New method, do what the name actually
8977         says.   
8978
8979 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8980
8981         Fix crash on cs0657-17.cs.
8982         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8983         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8984         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8985         the case where the NamespaceEntry gets overwritten.
8986
8987 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8988
8989         Fixed #69195, #56821
8990         * ecore.cs (ResolveBoolean): Tiny refactoring.
8991
8992         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8993         of right expression resolving when left is false constant and
8994         operator is LogicalAnd OR true constant and operator is LogicalOr.
8995
8996         * statement.cs (ResolveUnreachable): Always reports warning.
8997
8998 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8999
9000         * class.cs: Distinguish between 1721 and 1722 (just a little help
9001         for the programmer).
9002
9003 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
9004
9005         * delegate.cs: Only allow this on new versions of the language. 
9006
9007 2004-12-02  Duncan Mak  <duncan@ximian.com>
9008
9009         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
9010         Expression class.
9011         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
9012         here as a static method. Take an additional bool out parameter
9013         `must_do_cs1540_check' for signaling to InstanceResolve.
9014         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
9015         member field from PropertyExpr class and made it an argument of
9016         the method instead.
9017         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
9018         check for MarshalByRefObject, and report CS0122 instead of CS1540.
9019         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
9020         and `remove_accessor' as well as InstanceResolve: report CS0122
9021         where applicable.
9022
9023         Fixes #70129.
9024
9025 2004-12-03  Raja R Harinath  <rharinath@novell.com>
9026
9027         Fix test-327.cs, test-328.cs, and put in early infrastructure
9028         for eventually fixing #52697.
9029         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
9030         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
9031         from other methods.
9032         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
9033         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
9034         (VerifyUsing, error246): Update.
9035         * rootcontext.cs (RootContext.NamespaceLookup): Just use
9036         'NamespaceEntry.LookupNamespaceOrType'.
9037
9038 2004-12-03  Martin Baulig  <martin@ximian.com>
9039
9040         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9041         method as our child, call AnonymousMethod.Compatible() on it.
9042
9043 2004-12-03  Raja R Harinath  <rharinath@novell.com>
9044
9045         Disable XML documentation support in 'basic' profile.
9046         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
9047         Redirect XmlElement to System.Object.
9048         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
9049         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
9050         * mcs.exe.sources: Add doc-bootstrap.cs.
9051         * doc-bootstrap.cs: New file.  Contains empty stub implementation
9052         of doc.cs.
9053
9054 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
9055
9056         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
9057           comments are allowed.
9058
9059 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9060
9061         * delegate.cs: Add checks for subtypes in paramaters and return values
9062         in VerifyMethod () to add support for Covariance/Contravariance
9063         in delegates.
9064         
9065 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
9066
9067         * report.cs: Remove extra closing parenthesis.
9068
9069         * convert.cs (Error_CannotImplicitConversion): If the name of the
9070         types are the same, provide some extra information.
9071
9072         * class.cs (FieldBase): Use an unused bit field from the field to
9073         encode the `has_offset' property from the FieldMember.  This saves
9074         a couple of Ks on bootstrap compilation.
9075
9076         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9077         method as our child, return the AnonymousMethod resolved
9078         expression.
9079
9080         * expression.cs (New.DoResolve): Allow return values from
9081         NewDelegate to also include AnonymousMethods.
9082
9083         Fixes #70150.
9084
9085 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
9086
9087         Fix bug #70102
9088         * attribute.cs (Resolve): Improved implementation of params
9089         attribute arguments.
9090
9091         * support.cs (ParameterData): Add HasParams to be faster.
9092
9093 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
9094
9095         all things are for /doc support:
9096
9097         * doc.cs: new file that supports XML documentation generation.
9098         * mcs.exe.sources: added doc.cs.
9099         * driver.cs:
9100           Handle /doc command line option.
9101           Report error 2006 instead of 5 for missing file name for /doc.
9102           Generate XML documentation when required, after type resolution.
9103         * cs-tokenizer.cs:
9104           Added support for picking up documentation (/// and /** ... */),
9105           including a new XmlCommentState enumeration.
9106         * cs-parser.jay:
9107           Added lines to fill Documentation element for field, constant,
9108           property, indexer, method, constructor, destructor, operator, event
9109           and class, struct, interface, delegate, enum.
9110           Added lines to warn incorrect comment.
9111         * rootcontext.cs :
9112           Added Documentation field (passed only when /doc was specified).
9113         * decl.cs:
9114           Added DocComment, DocCommentHeader, GenerateDocComment() and
9115           OnGenerateDocComment() and some supporting private members for
9116           /doc feature to MemberCore.
9117         * class.cs:
9118           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
9119         * delegate.cs:
9120           Added overriden DocCommentHeader.
9121         * enum.cs:
9122           Added overriden DocCommentHeader and GenerateDocComment().
9123
9124 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
9125
9126         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
9127         unwrapping the enumeration values, chain to
9128         DoConstantNumericPromotions again, so we can promote things to the
9129         fundamental types (takes care of enums that are bytes, sbytes).
9130
9131         Fixes bug #62054.
9132
9133 2004-12-01  Raja R Harinath  <rharinath@novell.com>
9134
9135         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
9136         Fix long-standing bug in type-lookup.  Use FindType instead of
9137         LookupType when ec.ResolvingTypeTree.
9138         (Attribute.ResolveType, Attribute.Resolve)
9139         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
9140         Update to changes.
9141         (Attributes.Search): Remove internal version.  Update.
9142         (Attributes.SearchMulti): Update.
9143         (Attributes.GetClsCompliantAttribute): Remove.
9144         (Attributes.GetIndexerNameAttribute): Remove.
9145         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
9146         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
9147         * class.cs (Indexer.Define): Likewise.
9148
9149 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
9150
9151         Fix bug #68790
9152         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
9153         MarshallByReference members access.
9154
9155         * expression.cs: Use CheckMarshallByRefAccess;
9156         Better error CS0197 message.
9157
9158         * report.cs: Print whole related error message.
9159
9160 2004-11-30  Raja R Harinath  <rharinath@novell.com>
9161
9162         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
9163         the current directory to help debugging.
9164
9165 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9166
9167         * class (GetClassBases): Better error 60 report.
9168         (EventProperty): Disabled warning 67 detection.
9169
9170 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9171
9172         Fix bug #60324
9173         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
9174
9175         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
9176         precise values.
9177
9178 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
9179
9180         Fix bug #49488
9181         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
9182
9183         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
9184
9185 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
9186
9187         * attribute.cs (Attribute.Resolve): Refine error reporting and
9188         report a cs0117 if the identifier does not exist, to distinguish
9189         from 0617 which is a miss-use of the actual identifier.
9190
9191         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
9192         between cs0070 and cs0079.
9193
9194         * class.cs (MemberBase.DoDefine): When reporting a wrong
9195         accessibility level, we use MethodCore to compare instead of
9196         Method (this was a regression in some refactoring effort).
9197
9198         So now we correctly report cs0056 again.
9199
9200         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
9201         testing the target_type (which was known to be object_type) and
9202         not the source type (which is anonymous_method).
9203
9204         Fixed reporting of error cs1660.
9205
9206         * expression.cs (UserCast.Source): Expose the underlying cast.
9207
9208         * statement.cs (Switch.SwitchGoverningType): Sort the list of
9209         allowed types to find a match to int32 first (most common).
9210
9211         In addition, it ignores any ImplicitUserConversions that did an
9212         internal implicit conversion (as the switch statement allows only
9213         one integral conversion to exist).
9214
9215         * class.cs (PartialContainer.Create): rename `name' to
9216         `member_name' for clarity.  Then replace the string calls with a
9217         call to MemberName.GetPartialName, as now using
9218         MemberName.ToString is an error (this is due to the side effects
9219         it had, that were fixed in the past).
9220
9221         This will restore the error reporting on a number of partial class
9222         errors that were missusing this (and getting an exception as a
9223         results, which is now just a plain textual warning, because
9224         yyparse debug output would crash otherwise).
9225
9226 2004-11-26  Raja R Harinath  <rharinath@novell.com>
9227
9228         * Makefile (PROGRAM_INSTALL_DIR): Remove.
9229
9230 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
9231
9232         * rootcontext.cs (LookupType): Make sure to cache lookups that
9233         don't give us a negative result. This saves about 5% of corlib
9234         compilation time.
9235
9236 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
9237
9238         * report.cs (AbstractMessage.Print): messages are sent to stderr
9239
9240         * class.cs (TypeContainer.GetClassBases): It is an error to have a
9241         non-interface in the list of interfaces (at this point, either
9242         parent was properly set, or a base class is being listed in the
9243         interfaces section).
9244
9245         This flags error 1722, and resolves the crash from bug 69259.
9246
9247 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
9248
9249         * statement.cs (Using.EmitExpressionFinally): make this work right
9250         for valuetypes. Fixes 69926.
9251
9252 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
9253
9254         * const.cs (Const.ChangeType): Cope with the "0 literal can be
9255         converted to an enum" here, before we try to change the underlying
9256         type.  This code exists, but it is a different code path than the
9257         one used while encoding constants.
9258
9259         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
9260         old bug: when converting from the null literal to a pointer,
9261         return an EmptyCast, not the NullLiteral.
9262
9263         This fixes #69921, the recent null_type changes probably made this
9264         bug more prominent.
9265
9266         (ImplicitReferenceConversionExists): In addition, resynchronized
9267         the code here, so it matches the same code in
9268         ImplicitReferenceConversionExists for the `from any class-type S
9269         to any interface-type T'.
9270         
9271
9272 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
9273
9274         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
9275
9276 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
9277
9278         * cs-parser.jay: Use verbosity accordingly. 
9279
9280 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9281
9282         * expression.cs (Unary.ResolveOperator): Do not report warning;
9283         AddressOf reads from variable.
9284         
9285         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
9286
9287 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9288
9289         Fix bug #69462
9290
9291         * attribute.cs (Attributable): Removed CheckTargets.
9292         (Attributes.Emit): Explicit attribute targets are tested here.
9293
9294         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
9295         not enabled for interfaces.
9296
9297         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
9298         (GetAssemblyName): Ouch next bug there.
9299
9300 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9301
9302         * expression.cs: Error 275 added.
9303         
9304 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
9305
9306         Fix bug #69177 (Implemented decimal constant support)
9307
9308         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
9309         (BinaryFold): Add DecimalConstant.
9310
9311         * const.cs (Define): Decimal constant 
9312         (is not constant.
9313         (ChangeType): Add decimal type handling.
9314         (LookupConstantValue): Don't set value for decimal type but
9315         emit DecimalConstantAttribute. Needed for constant optimization.
9316
9317         * constant.cs (ToDecimal): New method.
9318         (ConvertToDecimal): New method.
9319         (IntConstant): Implemented ConvertToDecimal.
9320         (DecimalConstant.Emit): Emit optimized version for decimals in
9321         int range.
9322
9323         * expression.cs (ResolveOperator): Changed order of constant
9324         reduction to work correctly with native types which have
9325         overloaded operators.
9326         (ResolveMemberAccess): Extract constant value from attribute
9327         for decimal type.
9328
9329         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
9330
9331         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
9332         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
9333         (ChangeType): Decimal is special.
9334         (TypeToCoreType): Add decimal type.
9335
9336 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9337
9338         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
9339         decimal types.
9340
9341 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9342
9343         * class.cs (EventField.ApplyAttributeBuilder): Fix error
9344         test cs1667-5.cs.
9345
9346 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9347
9348         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
9349
9350         * pending.cs (PendingImplementation): Grab only interfaces.
9351
9352 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9353
9354         * statement.cs (ForeachHelperMethods): Add location member and
9355         error 202 detection.
9356
9357 2004-11-19  Raja R Harinath  <rharinath@novell.com>
9358
9359         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
9360         automatically handled by executable.make.
9361         (PROGRAM): Make profile-specific.
9362
9363 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
9364
9365         * expression.cs (DoResolveBase): Fixed wrong warning for out
9366         variables.
9367
9368 2004-11-18  Martin Baulig  <martin@ximian.com>
9369
9370         Merged latest changes into gmcs.  Please keep this comment in
9371         here, it makes it easier for me to see what changed in MCS since
9372         the last time I merged.
9373
9374 2004-11-17  Raja R Harinath  <rharinath@novell.com>
9375
9376         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
9377         (TypeHandle.GetMemberCache): New.
9378         (TypeHandle.TypeHandle): Update.
9379         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
9380         (TypeManager.LookupParentInterfacesCache):
9381         Rename from LookupInterfaceCache.  Optimize slightly.
9382         (TypeManager.MemberLookup_FindMembers): Update.
9383         * decl.cs (MemberCache.MemberCache): Set Container to null in the
9384         multi-type variant.
9385         (AddCacheContents): Rename from AddHashtable.
9386         * class.cs (TypeContainer.parent_container): Remove.
9387         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
9388         (TypeContainer.DoDefineMembers): Don't initialize it.
9389         Update to name changes.
9390         
9391 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
9392
9393         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
9394         that factors the code to check access modifiers on override.  
9395
9396         (PropertyBase): Use the code here.
9397
9398         Patch from Lluis S'anchez, fixes bug #69361.
9399
9400 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
9401
9402         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
9403         routine that is used to report the use of a captured variable
9404         whose address has been taken.
9405
9406         There are two checks: one when variables are being captured and
9407         the other check is when the address of a variable is taken. 
9408         
9409         (because an anonymous methods might be resolved before *or* after
9410         the address has been taken) and 
9411
9412         * expression.cs (Conditional.DoResolve): Remove the special
9413         casing that Martin added to trueExpr and falseExpr being both
9414         NullLiteral.  We get the right behavior now just by introducing
9415         the null_type into the compiler. 
9416
9417         * convert.cs (ExplicitConversion): Change the code to use
9418         null_type instead of testing `expr is NullLiteral'.
9419         (ImplicitConversionStandard): use null_type too.
9420         (ImplicitReferenceConversionExists): use null_type too.
9421         (ImplicitReferenceConversion): use null_type too.
9422
9423         * literal.cs: The type of `NullLiteral' is now null_type instead
9424         of object_type. 
9425         (Resolve): Set the type here.
9426
9427         * typemanager.cs: Introduce null_type.
9428
9429 2004-11-17  Martin Baulig  <martin@ximian.com>
9430
9431         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
9432         direction, like FindMembers() does.  Fixes #69546, testcase is in
9433         test-315.cs.    
9434
9435 2004-11-16  Martin Baulig  <martin@ximian.com>
9436
9437         This is based on a patch from Marek Safar, see bug #69082.
9438         Fixes bugs #63705 and #67130.
9439
9440         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
9441         method; create a MemberCache for an interface type and cache the
9442         result.
9443
9444         * decl.cs (IMemberContainer.ParentContainer): Removed.
9445         (IMemberContainer.ParentCache): New property.
9446         (MemberCache.SetupCacheForInterface): Removed.
9447         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
9448         to create a cache for an interface's "parent".
9449
9450         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9451         interfaces too.
9452
9453 2004-11-16  Martin Baulig  <martin@ximian.com>
9454
9455         Merged back from gmcs; these changes already went into gmcs a
9456         couple of weeks ago.
9457
9458         * typemanager.cs
9459         (TypeManager.AddUserType): Removed the `ifaces' argument.
9460         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
9461         `TypeExpr []'.
9462         (TypeManager.AddUserInterface): Removed.
9463         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
9464         `TypeExpr []'.
9465         (TypeManager.GetInterfaces): Likewise.
9466         (TypeManager.GetExplicitInterfaces): Likewise.
9467
9468         * ecore.cs (TypeExpr.GetInterfaces): Removed.
9469
9470         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
9471         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
9472
9473 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
9474
9475         * statement.cs: Avoid adding bools to a hashtable.
9476
9477 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
9478
9479         * expression.cs (Invocation.OverloadResolve): Flag error if we are
9480         calling an unsafe method from a safe location.
9481
9482 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
9483
9484         Fix #69167
9485         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
9486
9487 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
9488
9489         * namespace.cs (VerifyUsing): use GetPartialName instead of
9490         ToString. 
9491
9492 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
9493
9494         * statement.cs (Return.Resolve): Fix regression in typo: if
9495         `in_exc', we have to request a NeedReturnLabel, this was a typo
9496         introduced in the anonymous method check-in.  Fixes #69131.
9497
9498         * Indexers were using the ShortName when defining themselves,
9499         causing a regression in the compiler bootstrap when applying the
9500         patch from 2004-11-02 (first part), now they use their full name
9501         and the bug is gone.
9502
9503 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
9504
9505         * driver.cs: Strip the path from the names of embedded resources. Fixes
9506         #68519.
9507
9508 2004-11-04  Raja R Harinath  <rharinath@novell.com>
9509
9510         Fix error message regression: cs0104-2.cs.
9511         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
9512         (AliasEntry.Resolve): Update.
9513         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
9514         'silent' flag.
9515         (RootContext.LookupType): Update.
9516
9517 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
9518
9519         * cs-parser.jay: Add support for handling accessor modifiers
9520         * class: Add support port accessor modifiers and error checking,
9521         define PropertyMethod.Define as virtual (not abstract anymore)
9522         * ecore.cs: Add checking for proeprties access with access modifiers
9523         * iterators.cs: Modify Accessor constructor call based in the modified
9524         constructor
9525 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
9526
9527         * expression.cs (StringConcat): Handle being called twice,
9528         as when we have a concat in a field init with more than two
9529         ctors in the class
9530
9531 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
9532
9533         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
9534         special case explicit implementations, we should always produce
9535         the .property or .event declaration.
9536         
9537         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
9538         since it will not return correct data if people use this
9539         unresolved in the presence of using statements (see test-313).
9540
9541         * class.cs (MethodData.Define): If we are an explicit interface
9542         implementation, set the method name to the full name of the
9543         interface plus the name of the method.  
9544
9545         Notice that using the method.MethodName.GetFullName() does not
9546         work, as it will only contain the name as declared on the source
9547         file (it can be a shorthand in the presence of using statements)
9548         and not the fully qualifed type name, for example:
9549
9550         using System;
9551
9552         class D : ICloneable {
9553                 object ICloneable.Clone ()  {
9554                 }
9555         }
9556
9557         Would produce a method called `ICloneable.Clone' instead of
9558         `System.ICloneable.Clone'.
9559
9560         * namespace.cs (Alias.Resolve): Use GetPartialName.
9561         
9562 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9563
9564         * cs-parser.jay: Add error 1055 report.
9565
9566 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
9567
9568         * assign.cs (Assign.DoResolve): Only do the transform of
9569         assignment into a New if the types are compatible, if not, fall
9570         through and let the implicit code deal with the errors and with
9571         the necessary conversions. 
9572
9573 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9574
9575         * cs-parser.jay: Add error 1031 report.
9576
9577         * cs-tokenizer.cs: Add location for error 1038.
9578
9579 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9580
9581         * cs-parser.jay: Add error 1016 report.
9582
9583 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9584
9585         * cs-parser.jay: Add errors 1575,1611 report.
9586
9587 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9588
9589         * cs-parser.jay: Add error 1001 report.
9590
9591 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9592
9593         Fix #68850
9594         * attribute.cs (GetMarshal): Add method argument for
9595         caller identification.
9596
9597         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
9598         agument for GetMarshal and RuntimeMissingSupport.
9599
9600 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9601
9602         * attribute.cs (ExtractSecurityPermissionSet): Removed
9603         TypeManager.code_access_permission_type.
9604
9605         * typemanager.cs: Removed TypeManager.code_access_permission_type.
9606
9607 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
9608
9609         * expression.cs (LocalVariableReference.DoResolveLValue): Check
9610         for obsolete use of a variable here.   Fixes regression on errors
9611         cs0619-25 and cs0619-26.
9612
9613 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
9614
9615         Fix #62358, implemented security attribute encoding.
9616
9617         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
9618         Tests permitted SecurityAction for assembly or other types.
9619         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
9620         data from SecurityPermissionAttribute to PermisionSet class.
9621
9622         * class.cs (ApplyAttributeBuilder): Added special handling
9623         for System.Security.Permissions.SecurityAttribute based types.
9624
9625         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
9626         special handling for System.Security.Permissions.SecurityAttribute
9627         based types.
9628
9629         * enum.cs (ApplyAttributeBuilder): Added special handling
9630         for System.Security.Permissions.SecurityAttribute based types.
9631
9632         * parameter.cs (ApplyAttributeBuilder): Added special handling
9633         for System.Security.Permissions.SecurityAttribute based types.
9634
9635         * rootcontext.cs: Next 2 core types.
9636
9637         * typemanager.cs (TypeManager.security_permission_attr_type):
9638         Built in type for the SecurityPermission Attribute.
9639         (code_access_permission_type): Build in type.
9640
9641 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
9642
9643         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9644         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9645         all of this information into
9646         EmitContext.EmitCapturedVariableInstance.
9647         
9648         * codegen.cs (EmitCapturedVariableInstance): move here the
9649         funcionality of emitting an ldarg.0 in the presence of a
9650         remapping.   This centralizes the instance emit code.
9651
9652         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9653         then emit a load of this: it means that we have reached the
9654         topmost ScopeInfo: the one that contains the pointer to the
9655         instance of the class hosting the anonymous method.
9656
9657         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9658         captures to the topmost CaptureContext.
9659
9660 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
9661
9662         * expression.cs (LocalVariableReference): Move the knowledge about
9663         the iterators into codegen's EmitCapturedVariableInstance.
9664
9665 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
9666
9667         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9668         all code paths return a value from an anonymous method (it is the
9669         same as the 161 error, but for anonymous methods).
9670
9671 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
9672
9673         The introduction of anonymous methods in the compiler changed
9674         various ways of doing things in the compiler.  The most
9675         significant one is the hard split between the resolution phase
9676         and the emission phases of the compiler.
9677
9678         For instance, routines that referenced local variables no
9679         longer can safely create temporary variables during the
9680         resolution phase: they must do so from the emission phase,
9681         since the variable might have been "captured", hence access to
9682         it can not be done with the local-variable operations from the runtime.
9683         
9684         * statement.cs 
9685
9686         (Block.Flags): New flag `IsTopLevel' to indicate that this block
9687         is a toplevel block.
9688
9689         (ToplevelBlock): A new kind of Block, these are the blocks that
9690         are created by the parser for all toplevel method bodies.  These
9691         include methods, accessors and anonymous methods.
9692
9693         These contain some extra information not found in regular blocks:
9694         A pointer to an optional CaptureContext (for tracking captured
9695         local variables and parameters).  A pointer to the parent
9696         ToplevelBlock.
9697         
9698         (Return.Resolve): Catch missmatches when returning a value from an
9699         anonymous method (error 1662).
9700         Invoke NeedReturnLabel from the Resolve phase instead of the emit
9701         phase.
9702
9703         (Break.Resolve): ditto.
9704
9705         (SwitchLabel): instead of defining the labels during the
9706         resolution phase, we now turned the public ILLabel and ILLabelCode
9707         labels into methods called GetILLabelCode() and GetILLabel() that
9708         only define the label during the Emit phase.
9709
9710         (GotoCase): Track the SwitchLabel instead of the computed label
9711         (its contained therein).  Emit the code by using
9712         SwitchLabel.GetILLabelCode ().
9713
9714         (LocalInfo.Flags.Captured): A new flag has been introduce to track
9715         whether the Local has been captured or not.
9716
9717         (LocalInfo.IsCaptured): New property, used to tell whether the
9718         local has been captured.
9719         
9720         * anonymous.cs: Vastly updated to contain the anonymous method
9721         support.
9722
9723         The main classes here are: CaptureContext which tracks any
9724         captured information for a toplevel block and ScopeInfo used to
9725         track the activation frames for various local variables.   
9726
9727         Each toplevel block has an optional capture context associated
9728         with it.  When a method contains an anonymous method both the
9729         toplevel method and the anonymous method will create a capture
9730         context.   When variables or parameters are captured, they are
9731         recorded on the CaptureContext that owns them, for example:
9732
9733         void Demo () {
9734              int a;
9735              MyDelegate d = delegate {
9736                  a = 1;
9737              }
9738         }
9739
9740         Here `a' will be recorded as captured on the toplevel
9741         CapturedContext, the inner captured context will not have anything
9742         (it will only have data if local variables or parameters from it
9743         are captured in a nested anonymous method.
9744
9745         The ScopeInfo is used to track the activation frames for local
9746         variables, for example:
9747
9748         for (int i = 0; i < 10; i++)
9749                 for (int j = 0; j < 10; j++){
9750                    MyDelegate d = delegate {
9751                         call (i, j);
9752                    }
9753                 }
9754
9755         At runtime this captures a single captured variable `i', but it
9756         captures 10 different versions of the variable `j'.  The variable
9757         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9758         recorded on a child.  
9759
9760         The toplevel ScopeInfo will also track information like the `this'
9761         pointer if instance variables were referenced (this is necessary
9762         as the anonymous method lives inside a nested class in the host
9763         type of the method). 
9764
9765         (AnonymousMethod): Expanded to track the Toplevel, implement
9766         `AnonymousMethod.Compatible' to tell whether an anonymous method
9767         can be converted to a target delegate type. 
9768
9769         The routine now also produces the anonymous method content
9770
9771         (AnonymousDelegate): A helper class that derives from
9772         DelegateCreation, this is used to generate the code necessary to
9773         produce the delegate for the anonymous method that was created. 
9774
9775         * assign.cs: API adjustments for new changes in
9776         Convert.ImplicitStandardConversionExists.
9777
9778         * class.cs: Adjustments to cope with the fact that now toplevel
9779         blocks are of type `ToplevelBlock'. 
9780
9781         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9782         insteda of standard blocks.
9783
9784         Flag errors if params arguments are passed to anonymous methods.
9785
9786         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9787         `CurrentAnonymousMethod' which points to the current Anonymous
9788         Method.  The variable points to the AnonymousMethod class that
9789         holds the code being compiled.  It is set in the new EmitContext
9790         created for the anonymous method.
9791
9792         (EmitContext.Phase): Introduce a variable and an enumeration to
9793         assist in enforcing some rules about when and where we are allowed
9794         to invoke certain methods (EmitContext.NeedsReturnLabel is the
9795         only one that enfonces this right now).
9796
9797         (EmitContext.HaveCaptureInfo): new helper method that returns
9798         whether we have a CapturedContext initialized.
9799
9800         (EmitContext.CaptureVariable): New method used to register that a
9801         LocalInfo must be flagged for capturing. 
9802
9803         (EmitContext.CapturedParameter): New method used to register that a
9804         parameters must be flagged for capturing. 
9805         
9806         (EmitContext.CapturedField): New method used to register that a
9807         field must be flagged for capturing. 
9808
9809         (EmitContext.HaveCapturedVariables,
9810         EmitContext.HaveCapturedFields): Return whether there are captured
9811         variables or fields. 
9812
9813         (EmitContext.EmitMethodHostInstance): This is used to emit the
9814         instance for the anonymous method.  The instance might be null
9815         (static methods), this (for anonymous methods that capture nothing
9816         and happen to live side-by-side with the current method body) or a
9817         more complicated expression if the method has a CaptureContext.
9818
9819         (EmitContext.EmitTopBlock): Routine that drives the emission of
9820         code: it will first resolve the top block, then emit any metadata
9821         and then emit the code.  The split is done so that we can extract
9822         any anonymous methods and flag any captured variables/parameters.
9823         
9824         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9825         during this phase, the ILGenerator should not be used as labels
9826         and local variables declared here might not be accessible to any
9827         code that is part of an anonymous method.  
9828
9829         Exceptions to this include the temporary variables that are
9830         created by some statements internally for holding temporary
9831         variables. 
9832         
9833         (EmitContext.EmitMeta): New routine, in charge of emitting all the
9834         metadata for a cb
9835
9836         (EmitContext.TemporaryReturn): This method is typically called
9837         from the Emit phase, and its the only place where we allow the
9838         ReturnLabel to be defined other than the EmitMeta.  The reason is
9839         that otherwise we would have to duplicate a lot of logic in the
9840         Resolve phases of various methods that today is on the Emit
9841         phase. 
9842
9843         (EmitContext.NeedReturnLabel): This no longer creates the label,
9844         as the ILGenerator is not valid during the resolve phase.
9845
9846         (EmitContext.EmitThis): Extended the knowledge in this class to
9847         work in anonymous methods in addition to iterators. 
9848
9849         (EmitContext.EmitCapturedVariableInstance): This emits whatever
9850         code is necessary on the stack to access the instance to a local
9851         variable (the variable will be accessed as a field).
9852
9853         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9854         EmitContext.EmitAddressOfParameter): Routines to support
9855         parameters (not completed at this point). 
9856         
9857         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9858         will also remove the parameters.
9859
9860         * convert.cs (Convert): Define a `ConstantEC' which points to a
9861         null.  This is just to prefity some code that uses
9862         ImplicitStandardConversion code and do not have an EmitContext
9863         handy.
9864
9865         The idea is to flag explicitly that at that point in time, it is
9866         known that the conversion will not trigger the delegate checking
9867         code in implicit conversions (which requires a valid
9868         EmitContext). 
9869
9870         Everywhere: pass new EmitContext parameter since
9871         ImplicitStandardConversionExists now requires it to check for
9872         anonymous method conversions. 
9873
9874         (Convert.ImplicitStandardConversionExists): If the type of an
9875         expression is the anonymous_method_type, and the type is a
9876         delegate, we invoke the AnonymousMethod.Compatible method to check
9877         whether an implicit conversion is possible. 
9878
9879         (Convert.ImplicitConversionStandard): Only do implicit method
9880         group conversions if the language level is not ISO_1.
9881
9882         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9883         MethodInfo for the Invoke method.  used by Delegate and
9884         AnonymousDelegate.
9885
9886         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9887         method conversions if the target type is a delegate.
9888
9889         Removed extra debugging nops.
9890
9891         (LocalVariableReference): Turn the `local_info' into a public
9892         field. 
9893
9894         Add `prepared' field, the same hack used for FieldExprs to cope
9895         with composed assignments, as Local variables do not necessarily
9896         operate purely on the stack as they used to: they can be captured
9897         fields. 
9898
9899         Add `temp' for a temporary result, like fields.
9900
9901         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9902
9903         It now copes with Local variables that are captured and emits the
9904         proper instance variable to load it from a field in the captured
9905         case. 
9906
9907         (ParameterReference.DoResolveBase): During the resolve phase,
9908         capture parameters if we are in an anonymous method.
9909
9910         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9911         anonymous method, use the EmitContext helper routines to emit the
9912         parameter reference.
9913
9914         * iterators.cs: Set RemapToProxy to true/false during the
9915         EmitDispose class.
9916
9917         * parameters.cs (GetParameterByName): New helper method. 
9918
9919         * typemanager.cs (anonymous_method_type) a new type that
9920         represents an anonyous method.  This is always an internal type,
9921         used as a fencepost to test against the anonymous-methodness of an
9922         expression. 
9923         
9924 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9925
9926         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9927         561 report.
9928         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9929
9930 2004-10-18  Martin Baulig  <martin@ximian.com>
9931
9932         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9933         `Type' directly, but call ResolveType() on it.
9934         (Catch.Resolve): Likewise.
9935         (Foreach.Resolve): Likewise.
9936
9937 2004-10-18  Martin Baulig  <martin@ximian.com>
9938
9939         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9940         `Type' directly, but call ResolveType() on it.
9941         (Probe.DoResolve): Likewise.
9942         (ArrayCreation.LookupType): Likewise.
9943         (TypeOf.DoResolve): Likewise.
9944         (SizeOf.DoResolve): Likewise.
9945
9946 2004-10-18  Martin Baulig  <martin@ximian.com>
9947
9948         * expression.cs (Invocation.BetterFunction): Put back
9949         TypeManager.TypeToCoreType().
9950
9951 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9952
9953         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9954         the ResolveType.
9955
9956 2004-10-18  Martin Baulig  <martin@ximian.com>
9957
9958         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
9959         `Type' directly, but call ResolveType() on it.
9960
9961 2004-10-18  Martin Baulig  <martin@ximian.com>
9962
9963         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9964         `Type' directly, but call ResolveType() on it.
9965         (MemberBase.DoDefine): Likewise.
9966
9967         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9968         `Type' directly, but call ResolveType() on it.
9969         (ComposedCast.DoResolveAsTypeStep): Likewise.
9970
9971         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9972         `Type' directly, but call ResolveType() on it.
9973
9974 2004-10-17  John Luke  <john.luke@gmail.com>
9975
9976         * class.cs (Operator.GetSignatureForError): use CSharpName
9977
9978         * parameter.cs (Parameter.GetSignatureForError): Returns
9979         correct name even if was not defined.
9980
9981 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9982
9983         Fix #65816.
9984         * class.cs (TypeContainer.EmitContext): New property.
9985         (DefineNestedTypes): Create an emitcontext for each part.
9986         (MethodCore.DoDefineParameters): Use container's emitcontext.
9987         Pass type array to InternalParameters.
9988         (MemberBase.DoDefine): Use container's emitcontext.
9989         (FieldMember.Define): Likewise.
9990         (Event.Define): Likewise.
9991         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9992         Pass type array to InternalParameters.
9993         (SetIndexerMethod.GetParameterInfo): Likewise.
9994         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9995         * delegate.cs (Define): Pass emitcontext to
9996         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9997         array to InternalParameters.
9998         * expression.cs (ParameterReference.DoResolveBase): Pass
9999         emitcontext to GetParameterInfo.
10000         (ComposedCast.DoResolveAsTypeStep): Remove check on
10001         ec.ResolvingTypeTree.
10002         * parameter.cs (Parameter.Resolve): Change argument to
10003         EmitContext.  Use ResolveAsTypeTerminal.
10004         (Parameter.GetSignature): Change argument to EmitContext.
10005         (Parameters.ComputeSignature): Likewise.
10006         (Parameters.ComputeParameterTypes): Likewise.
10007         (Parameters.GetParameterInfo): Likewise.
10008         (Parameters.ComputeAndDefineParameterTypes): Likewise.
10009         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
10010         * support.cs (InternalParameters..ctor): Remove variant that takes
10011         a DeclSpace.
10012         * typemanager.cs (system_intptr_expr): New.
10013         (InitExpressionTypes): Initialize it.
10014
10015 2004-10-12  Chris Toshok  <toshok@ximian.com>
10016
10017         * cs-parser.jay: fix location for try_statement and catch_clause.
10018
10019 2004-10-11  Martin Baulig  <martin@ximian.com>
10020
10021         * report.cs: Don't make --fatal abort on warnings, we have
10022         -warnaserror for that.
10023
10024 2004-10-07  Raja R Harinath  <rharinath@novell.com>
10025
10026         More DeclSpace.ResolveType avoidance.
10027         * decl.cs (MemberCore.InUnsafe): New property.
10028         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
10029         with newly created EmitContext.
10030         (FieldMember.Define): Likewise.
10031         * delegate.cs (Delegate.Define): Likewise.
10032         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
10033         only if normal name-lookup fails.
10034         (TypeExpr.DoResolve): Enable error-checking.
10035         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
10036         (SizeOf.DoResolve): Likewise.
10037         (ComposedCast.DoResolveAsTypeStep): Likewise.
10038         (StackAlloc.DoResolve): Likewise.
10039         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
10040         (Block.Unsafe): New property.
10041         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
10042         (Unsafe): Set 'unsafe' flag of contained block.
10043         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
10044         (Fixed.Resolve): Likewise.
10045         (Catch.Resolve): Likewise.
10046         (Using.ResolveLocalVariableDecls): Likewise.
10047         (Foreach.Resolve): Likewise.
10048
10049 2004-10-05  John Luke <john.luke@gmail.com>
10050
10051         * cs-parser.jay: add location to error CS0175
10052
10053 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
10054
10055         * ecore.cs (Expression.Constantity): Add support for turning null
10056         into a constant.
10057
10058         * const.cs (Const.Define): Allow constants to be reference types
10059         as long as the value is Null.
10060
10061 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
10062
10063         * namespace.cs (NamespaceEntry.Using): No matter which warning
10064         level is set, check if this namespace name has already been added.
10065
10066 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
10067
10068         * expression.cs: reftype [!=]= null should always use br[true,false].
10069         # 67410
10070
10071 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
10072
10073         Fix #67108
10074         * attribute.cs: Enum conversion moved to 
10075         GetAttributeArgumentExpression to be applied to the all
10076         expressions.
10077
10078 2004-10-01  Raja R Harinath  <rharinath@novell.com>
10079
10080         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
10081         * class.c (TypeContainer.DefineType): Flag error if
10082         base types aren't accessible due to access permissions.
10083         * decl.cs (DeclSpace.ResolveType): Move logic to
10084         Expression.ResolveAsTypeTerminal.
10085         (DeclSpace.ResolveTypeExpr): Thin layer over
10086         Expression.ResolveAsTypeTerminal.
10087         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
10088         Refactor code into NestedAccess.  Use it.
10089         (DeclSpace.NestedAccess): New.
10090         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
10091         argument to silence errors.  Check access permissions.
10092         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
10093         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
10094         (Cast.DoResolve): Likewise.
10095         (New.DoResolve): Likewise.
10096         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
10097         (TypeOf.DoResolve): Likewise.
10098
10099         * expression.cs (Invocation.BetterConversion): Return the Type of
10100         the better conversion.  Implement section 14.4.2.3 more faithfully.
10101         (Invocation.BetterFunction): Make boolean.  Make correspondence to
10102         section 14.4.2.2 explicit.
10103         (Invocation.OverloadResolve): Update.
10104         (Invocation): Remove is_base field.
10105         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
10106         (Invocation.Emit): Likewise.
10107
10108 2004-09-27  Raja R Harinath  <rharinath@novell.com>
10109
10110         * README: Update to changes.
10111
10112 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
10113
10114         * cs-parser.jay: Reverted 642 warning fix.
10115
10116 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10117
10118         Fix bug #66615
10119         * decl.cs (FindMemberWithSameName): Indexer can have more than
10120         1 argument.
10121
10122 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10123
10124         * expression.cs (LocalVariableReference.DoResolveLValue):
10125         Do not report warning 219 for out values.
10126         (EmptyExpression.Null): New member to avoid extra allocations.
10127
10128 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10129
10130         * cs-parser.jay: Fix wrong warning 642 report.
10131
10132         * cs-tokenizer.cs (CheckNextToken): New helper;
10133         Inspect next character if is same as expected.
10134
10135 2004-09-23  Martin Baulig  <martin@ximian.com>
10136
10137         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
10138         (Convert.ImplicitReferenceConversionExists): Likewise.
10139
10140 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
10141
10142         * class.cs (Operator.Define): Add error 448 and 559 report.
10143
10144 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10145
10146         * class.cs (MemberBase.IsTypePermitted): New protected
10147         method for checking error CS0610.
10148
10149 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10150
10151         * class.cs (TypeContainer.HasExplicitLayout): New property
10152         Returns whether container has StructLayout attribute set Explicit.
10153         (FieldMember): New abstract class for consts and fields.
10154         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
10155         (Field): Reuse FieldMember.
10156
10157         * const.cs (Const): Reuse FieldMember.
10158
10159         * rootcontext.cs: EmitConstants call moved to class.
10160
10161 2004-09-22  Martin Baulig  <martin@ximian.com>
10162
10163         Thanks to Peter Sestoft for this bug report.
10164
10165         * expression.cs (Conditional): If both the `trueExpr' and the
10166         `falseExpr' is a NullLiteral, return a NullLiteral.
10167
10168 2004-09-22  Martin Baulig  <martin@ximian.com>
10169
10170         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
10171         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
10172         for the "get_Current" call.
10173
10174 2004-09-22  Martin Baulig  <martin@ximian.com>
10175
10176         Marek and me just fixed one of our oldest bugs: #28562 :-)
10177
10178         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
10179
10180         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
10181         we're an EnumConstant, just return that.
10182         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
10183         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
10184         to get the value which'll actually be written into the attribute.
10185         However, we have to use GetValue() to access the attribute's value
10186         in the compiler.        
10187
10188 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
10189
10190         * constant.cs (Constant.IsNegative): New abstract property
10191         IsNegative.
10192
10193         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
10194         (StackAlloc.DoResolve): Reused IsNegative.
10195
10196 2004-09-21  Martin Baulig  <martin@ximian.com>
10197
10198         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
10199         if we're used in an iterator, we may be called from different
10200         methods.
10201
10202         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
10203         we actually have an exception block.
10204
10205 2004-09-20  John Luke <jluke@cfl.rr.com>
10206
10207         * class.cs, cs-parser.jay: Improve the error report for 1520:
10208         report the actual line where the error happens, not where the
10209         class was declared.
10210
10211         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
10212         Pass location information that was available elsewhere.
10213
10214 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
10215
10216         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
10217         runtime to delay sign assemblies.
10218
10219 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
10220
10221         * cs-parser.jay: Do not report the stack trace, this is barely
10222         used nowadays.
10223
10224 2004-08-22  John Luke  <john.luke@gmail.com>
10225  
10226         * driver.cs : check that a resource id is not already used
10227         before adding it, report CS1508 if it is, bug #63637
10228
10229 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
10230
10231         * ecore.cs: Removed dead code.
10232
10233 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
10234
10235         * class.cs: Do not report warning CS0067 on the interfaces.
10236
10237 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10238
10239         * cs-parser.jay: Add error 504 report.
10240
10241 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10242
10243         * rootcontext.cs: WarningLevel is 4 by default now.
10244
10245         * statement.cs (Fixed.Resolve): Do not null
10246         VariableInfo.
10247
10248 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
10249
10250         Fixed bug #55780
10251         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
10252         deep search when property is not virtual.
10253         (PropertyExpr.ResolveAccessors): Make one call for both
10254         accessors.
10255
10256 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10257
10258         Fixed bug #65766
10259         * statement.cs: Error 152 report constains also location.
10260
10261 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10262
10263         Fixed bug #65766
10264         * const.cs: Explicitly set constant as static.
10265
10266 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10267
10268         Fixed bug #64226
10269         * cs-parser.jay: Add error 1017 report.
10270
10271 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10272
10273         Fixed bug #59980, #64224
10274         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
10275
10276         * typemanager.cs (IsSpecialMethod): Simplified
10277
10278 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10279
10280         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
10281         condition with better params.
10282
10283 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10284
10285         Fixed bug #65238
10286         * attribute.cs (Resolve): Property has to have both
10287         accessors.
10288
10289 2004-09-14  Martin Baulig  <martin@ximian.com>
10290
10291         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
10292
10293 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10294
10295         Fixed bug #61902
10296         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
10297         called and is obsolete then this member suppress message
10298         when call is inside next [Obsolete] method or type.
10299
10300         * expression.cs: Use TestObsoleteMethodUsage member.
10301
10302 2004-09-14  Martin Baulig  <martin@ximian.com>
10303
10304         * cs-parser.jay: Sync a bit with the GMCS version.
10305
10306 2004-09-14  Martin Baulig  <martin@ximian.com>
10307
10308         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
10309         (CSharpParser.yacc_verbose_flag): New public field.
10310
10311         * genericparser.cs: Removed.
10312
10313 2004-09-14  Raja R Harinath  <rharinath@novell.com>
10314
10315         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
10316
10317 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
10318
10319         * class.cs (MethodCore.CheckBase): Fix bug #65757.
10320
10321 2004-09-10  Martin Baulig  <martin@ximian.com>
10322
10323         Backported my MemberName changes from GMCS into MCS.
10324
10325         - we are now using a special `MemberName' class instead of using
10326         strings; in GMCS, the `MemberName' also contains the type
10327         arguments.
10328
10329         - changed the grammar rules a bit:
10330           * the old `member_name' is now a `namespace_or_type_name':
10331             The rule is that we use `namespace_or_type_name' everywhere
10332             where we expect either a "member name" (GetEnumerator) or a
10333             "member name" with an explicit interface name
10334             (IEnumerable.GetEnumerator).
10335             In GMCS, the explicit interface name may include type arguments
10336             (IEnumerable<T>.GetEnumerator).
10337           * we use `member_name' instead of just `IDENTIFIER' for
10338             "member names":
10339             The rule is that we use `member_name' wherever a member may
10340             have type parameters in GMCS.       
10341
10342         * decl.cs (MemberName): New public class.
10343         (MemberCore.MemberName): New public readonly field.
10344         (MemberCore.ctor): Take a `MemberName' argument, not a string.
10345         (DeclSpace): Likewise.
10346
10347         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
10348         * enum.cs (Enum.ctor): Likewise.
10349
10350         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
10351         MemberName.     
10352         (AliasEntry.ctor): Take a MemberName, not an Expression.
10353         (AliasEntry.UsingAlias): Likewise.
10354
10355         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
10356         (IMethodData.MemberName): Changed type from string to MemberName.
10357         (MemberBase.ExplicitInterfaceName): Likewise.
10358         (AbstractPropertyEventMethod.SetupName): Make this private.
10359         (AbstractPropertyEventMethod.ctor): Added `string prefix'
10360         argument; compute the member name here.
10361         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
10362         on the `member.MemberName' and the `prefix'.
10363
10364         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
10365         not `type_name'.
10366         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
10367         thus, we get a `MemberName' instead of a `string'.  These
10368         declarations may have type parameters in GMCS.
10369         (interface_method_declaration, delegate_declaration): Likewise.
10370         (class_declaration, interface_declaration): Likewise.
10371         (method_header): Use `namespace_or_type_name' instead of
10372         `member_name'.  We may be an explicit interface implementation.
10373         (property_declaration, event_declaration): Likewise.
10374         (member_name): This is now just an `IDENTIFIER', not a
10375         `namespace_or_type_name'.
10376         (type_name, interface_type): Removed.
10377         (namespace_or_type_name): Return a MemberName, not an Expression.
10378         (primary_expression): Use `member_name' instead of `IDENTIFIER';
10379         call GetTypeExpression() on the MemberName to get an expression.
10380         (IndexerDeclaration.interface_type): Changed type from string to
10381         MemberName.
10382         (MakeName): Operate on MemberName's instead of string's.
10383
10384 2004-09-13  Raja R Harinath  <rharinath@novell.com>
10385
10386         Fix bug #55770.
10387         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
10388         (NamespaceEntry.Lookup): Add new argument to flag if we want the
10389         lookup to avoid symbols introduced by 'using'.
10390         * rootcontext.cs (NamespaceLookup): Update.
10391
10392 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10393
10394         * class.cs (TypeContainer.DoDefineMembers): Do not call
10395         DefineDefaultConstructor for static classes.
10396
10397 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10398
10399         * attribute.cs (Attribute.Resolve): Add error 653 report.
10400
10401         * class.cs (Class.ApplyAttributeBuilder): Add error 641
10402         report.
10403         (Method.ApplyAttributeBuilder): Add error 685 report.
10404         (Operator.Define): Add error 564 report.
10405
10406         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
10407
10408         * expression.cs (Invocation.DoResolve): Add error
10409         245 and 250 report.
10410
10411         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
10412         error 674 report.
10413
10414 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10415
10416         * class.cs (ConstructorInitializer.Resolve):
10417         Wrong error number (515->516).
10418
10419 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10420
10421         * class.cs (Indexer.Define): Add error 631 report.
10422
10423 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10424
10425         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
10426
10427 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10428
10429         * expression.cs (Probe.DoResolve): Add error CS0241 report.
10430
10431 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
10432
10433         * cs-parser.jay: Added error CS0241 report.
10434
10435 2004-09-10  Raja R Harinath  <rharinath@novell.com>
10436
10437         * cs-parser.jay (fixed_statement): Introduce a scope for the
10438         declaration in the 'fixed' statement.
10439
10440 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10441
10442         * cs-parser.jay: Added CS0230 error report.
10443
10444 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10445
10446         * cs-parser.jay: Added errors CS0231 and CS0257 report.
10447
10448 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10449
10450         * expression.cs (Argument.Resolve): Added error CS0192 and
10451         CS0199 report.
10452
10453 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10454
10455         C# 2.0 #pragma warning feature
10456
10457         * cs-tokenizer.cs (PreProcessPragma): New method; 
10458         Handles #pragma directive.
10459
10460         * report.cs (WarningRegions): New class; Support
10461         class for #pragma warning directive. It tests whether
10462         warning is enabled for a given line.
10463
10464 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
10465
10466         * const.cs: Add more descriptive error report, tahnks to
10467         Sebastien. 
10468
10469 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
10470
10471         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
10472
10473 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
10474
10475         * expression.cs: Apply patch from Ben: Remove dead code from
10476         ArrayCreation, and remove the TurnintoConstant call in const.cs,
10477         as that code just threw an exception anwyays.
10478
10479         * const.cs: Remove the call to the turnintoconstant, for details
10480         see bug: #63144
10481         
10482         * literal.cs: The type of the null-literal is the null type;  So
10483         we use a placeholder type (literal.cs:System.Null, defined here)
10484         for it.
10485
10486         * expression.cs (Conditional.DoResolve): Remove some old code that
10487         is no longer needed, conversions have been fixed.
10488
10489         (ArrayCreationExpression.DoResolve): Return false if we fail to
10490         resolve the inner expression.
10491
10492 2004-09-07  Raja R Harinath  <rharinath@novell.com>
10493
10494         Fix test-290.cs.
10495         * cs-parser.jay (delegate_declaration): Record a delegate
10496         declaration as a type declaration.
10497         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
10498
10499 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
10500
10501         * parameter.cs: Do not crash if the type can not be resolved. 
10502
10503         * expression.cs: Report errors with unsafe pointers, fixes #64896
10504
10505 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10506
10507         * expression.cs: Pointer arith always needs to do a conv.i
10508         if the operand is a long. fix 65320
10509
10510 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10511
10512         Fixed cs0619-37.cs, cs0619-38.cs
10513
10514         * enum.cs (GetObsoleteAttribute): Removed.
10515
10516         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
10517         on Enum member is double staged. The first is tested member
10518         and then enum.
10519
10520 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10521
10522         Fixed #56986, #63631, #65231
10523
10524         * class.cs: (TypeContainer.AddToMemberContainer): New method,
10525         adds member to name container.
10526         (TypeContainer.AddToTypeContainer): New method, adds type to
10527         name container.
10528         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
10529         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
10530         AddOperator): Simplified by reusing AddToMemberContainer.
10531         (TypeContainer.UserDefinedStaticConstructor): Changed to property
10532         instead of field.
10533         (Method.CheckForDuplications): Fixed implementation to test all
10534         possibilities.
10535         (MemberBase): Detection whether member is explicit interface
10536         implementation is now in constructor.
10537         (MemberBase.UpdateMemberName): Handles IndexerName.
10538         (Accessor): Changed to keep also location information.
10539         (AbstractPropertyEventMethod): Is derived from MemberCore.
10540         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
10541         will be emited or not.
10542         (PropertyBase.AreAccessorsDuplicateImplementation):
10543         Tests whether accessors are not in collision with some method.
10544         (Operator): Is derived from MethodCore to simplify common
10545         operations.
10546
10547         * decl.cs (Flags.TestMethodDuplication): Test for duplication
10548         must be performed.
10549         (DeclSpace.AddToContainer): Adds the member to defined_names
10550         table. It tests for duplications and enclosing name conflicts.
10551
10552         * enum.cs (EnumMember): Clean up to reuse the base structures
10553
10554 2004-09-03  Martin Baulig  <martin@ximian.com>
10555
10556         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
10557         into TypeContainer, to make partial classes work again.
10558
10559 2004-09-03  Martin Baulig  <martin@ximian.com>
10560
10561         * rootcontext.cs (RootContext.V2): Removed.
10562
10563 2004-03-23  Martin Baulig  <martin@ximian.com>
10564
10565         * expression.cs (Invocation.OverloadResolve): Added `bool
10566         may_fail' argument and use it instead of the Location.IsNull() hack.
10567
10568 2004-09-03  Martin Baulig  <martin@ximian.com>
10569
10570         Merged latest changes into gmcs.  Please keep this comment in
10571         here, it makes it easier for me to see what changed in MCS since
10572         the last time I merged.
10573
10574 2004-09-03  Raja R Harinath  <rharinath@novell.com>
10575
10576         Fix #61128.
10577         * expression.cs (BetterConversion): Don't allow either conversion 
10578         to be null.  Remove redundant implicit conversion test when 'q ==
10579         null' -- when this function is invoked, we already know that the
10580         implicit conversion exists.
10581         (BetterFunction): Assume that 'best' is non-null.  Remove
10582         redundant reimplementation of IsApplicable when 'best' is null.
10583         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
10584         number of arguments.
10585         (IsAncestralType): Extract from OverloadResolve.
10586         (OverloadResolve): Make robust to the MethodGroupExpr being
10587         unsorted.  Implement all the logic of Section 14.5.5.1, and
10588         support overloading of methods from multiple applicable types.
10589         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
10590
10591         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
10592         (RealError, Warning): Append type of report to related symbol.
10593
10594 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
10595
10596         * enum.cs: Fixed CLS-Compliance checks for enum members.
10597         Error tests cs3008-8.cs, cs3014-8.cs
10598
10599 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10600
10601         Fixed bug #62342, #63102
10602         * class.cs: ImplementIndexer uses member.IsExplicitImpl
10603         like ImplementMethod.
10604
10605 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10606
10607         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10608         Fixed bug #65170.
10609
10610 2004-09-02  Martin Baulig  <martin@ximian.com>
10611
10612         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
10613         TypeManager.GetArgumentTypes() rather than calling GetParameters()
10614         on the MethodBase.
10615
10616 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
10617
10618         C# 2.0 Static classes implemented
10619
10620         * class.cs (TypeContainer): instance_constructors,
10621         initialized_fields, initialized_static_fields,
10622         default_constructor, base_inteface_types are protected to be
10623         accessible from StaticClass.
10624         (TypeContainer.DefineDefaultConstructor): New virtual method
10625         for custom default constructor generating
10626         (StaticClass): New class to handle "Static classes" feature.
10627
10628         * cs-parser.jay: Handle static keyword on class like instance
10629         of StaticClass.
10630
10631         * driver.cs: Added "/langversion" command line switch with two
10632         options (iso-1, default).
10633
10634 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
10635
10636         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
10637
10638 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
10639
10640         * delegate.cs: Style.
10641
10642 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10643
10644         * delegate.cs: Add seperate instance expr field for miguel.
10645
10646 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10647
10648         * PointerArithmetic (Resolve): make sure we are not doing
10649         pointer arith on void*. Also, make sure we are resolved
10650         by not setting eclass until resolve.
10651
10652         All callers: Make sure that PointerArithmetic gets resolved.
10653
10654 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10655
10656         * ArrayCreation (LookupType): If the type does not resolve 
10657         to an array, give an error.
10658
10659 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
10660
10661         * statement.cs (Try.Resolve): Fixed bug #64222
10662
10663 2004-08-27  Martin Baulig  <martin@ximian.com>
10664
10665         * class.cs
10666         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10667         crash here.     
10668
10669 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10670
10671         * ecore.cs (Constantify): Get underlying type via
10672         System.Enum.GetUnderlyingType to avoid StackOverflow on the
10673         Windows in special cases.
10674
10675 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10676
10677         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10678         for obtaining also private methods.
10679         (GetRemoveMethod): Used GetRemoveMethod (true)
10680         for obtaining also private methods.
10681
10682 2004-08-24  Martin Baulig  <martin@ximian.com>
10683
10684         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10685         MethodAttributes.HideBySig for operators.
10686
10687 2004-08-23  Martin Baulig  <martin@ximian.com>
10688
10689         Back to the old error reporting system :-)
10690
10691         * report.cs (Message): Removed.
10692         (Report.MessageData, ErrorData, WarningData): Removed.
10693         (Report.Error, Warning): Back to the old system.
10694
10695 2004-08-23  Martin Baulig  <martin@ximian.com>
10696
10697         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10698
10699         * class.cs (TypeContainer.ParentContainer): New public virtual
10700         method; replaces the explicit interface implementation.
10701         (ClassPart.ParentContainer): Override.
10702
10703 2004-08-23  Martin Baulig  <martin@ximian.com>
10704
10705         * statement.cs (Switch): Added support for constant switches; see
10706         #59428 or test-285.cs.
10707
10708 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10709
10710         Fixed bug #62740.
10711         * statement.cs (GetEnumeratorFilter): Removed useless
10712         logic because C# specs is strict. GetEnumerator must be
10713         public.
10714
10715 2004-08-22  Martin Baulig  <martin@ximian.com>
10716
10717         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10718         a switch and may break, reset the barrier.  Fixes #59867.
10719
10720 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10721
10722         CLS-Compliance speed up (~5% for corlib)
10723
10724         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10725         New method. Tests container for CLS-Compliant names
10726
10727         * class.cs (TypeContainer.VerifyClsName): New method.
10728         Checks whether container name is CLS Compliant.
10729         (Constructor): Implements IMethodData.
10730
10731         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10732         low-case table for CLS Compliance test.
10733         (MemberCache.VerifyClsParameterConflict): New method.
10734         Checks method parameters for CS3006 error.
10735
10736         * enum.cs (EnumMember): Is derived from MemberCore.
10737         (Enum.VerifyClsName): Optimized for better performance.
10738
10739 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10740
10741         * report.cs: Renamed Error_T to Error and changed all
10742         references.
10743
10744 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10745
10746         * class.cs (TypeContainer.IndexerArrayList): New inner class
10747         container for indexers.
10748         (TypeContainer.DefaultIndexerName): New constant for default
10749         indexer name. Replaced all "Item" with this constant.
10750         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10751
10752         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10753         DefaultMemberAttribute constructor.
10754
10755 2004-08-05  Martin Baulig  <martin@ximian.com>
10756
10757         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10758         Fix bug #59429.
10759
10760 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10761
10762         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10763         multi platforms problem.
10764
10765         * compiler.csproj: Included shared files.
10766
10767 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10768
10769         Fix bug 60333, 55971 in the more general way
10770         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10771         Added arg_type argument for constant conversion.
10772         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10773
10774 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10775
10776         Fix bug #59760
10777         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10778         OperatorArrayList, MethodCoreArrayList for typecontainer
10779         containers. Changed class member types to these new types.
10780         (MethodArrayList.DefineMembers): Added test for CS0659.
10781
10782 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10783
10784         * cfold.cs: Synchronize the folding with the code in expression.cs
10785         Binary.DoNumericPromotions for uint operands.
10786
10787         * attribute.cs: Revert patch from Raja, it introduced a regression
10788         while building Blam-1.2.1 (hard to isolate a test case).
10789
10790 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10791
10792         Fix for #55382
10793         * class.cs:
10794         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10795         name collision.
10796         (MethodCore.parent_method): New member. The method we're overriding
10797         if this is an override method.
10798         (MethodCore.CheckBase): Moved from Method class and made common.
10799         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10800         private.
10801         (MethodCore.CheckForDuplications): New abstract method. For custom
10802         member duplication search in a container
10803         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10804         method and its return type.
10805         (Event.conflict_symbol): New member. Symbol with same name in the
10806         parent class.
10807
10808         * decl.cs:
10809         (MemberCache.FindMemberWithSameName): New method. The method
10810         is looking for conflict with inherited symbols.
10811
10812 2004-08-04  Martin Baulig  <martin@ximian.com>
10813
10814         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10815
10816         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10817
10818 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10819
10820         * report.cs (Message): New enum for better error, warning reference in
10821         the code.
10822         (MessageData): New inner abstract class. It generally handles printing of
10823         error and warning messages.
10824         Removed unused Error, Warning, Message methods.
10825
10826 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10827
10828         Fix for cs0592-8.cs test
10829         * attribute.cs
10830         (Attributable.ValidAttributeTargets): Made public.
10831         (Attribute.ExplicitTarget): New member for explicit target value.
10832         (Attribute.CheckTargets): Now we translate explicit attribute
10833         target to Target here.
10834
10835 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10836
10837         * ecore.cs (MethodGroupExpr): new IsBase property.
10838
10839         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10840
10841         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10842         rather than an instance expr.
10843
10844         (DelegateCreation.Emit): Use the method group rather than
10845         the instance expression. Also, if you have base.Foo as the
10846         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10847
10848         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10849
10850         (NewDelegate.DoResolve): Only check for the existance of Invoke
10851         if the method is going to be needed. Use MethodGroupExpr.
10852
10853         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10854
10855         * expression.cs: For pointer arith., make sure to use
10856         the size of the type, not the size of the pointer to
10857         the type.
10858
10859 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10860
10861         Fix for #60722
10862         * class.cs (Class): Added error CS0502 test.
10863
10864 2004-08-03  John Luke  <jluke@cfl.rr.com>
10865             Raja R Harinath  <rharinath@novell.com>
10866
10867         Fix for #60997.
10868         * attribute.cs (Attribute.complained_before): New flag.
10869         (Attribute.ResolveType, Attribute.Resolve),
10870         (Attribute.DefinePInvokeMethod): Set it.
10871         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10872         
10873 2004-08-03  Martin Baulig  <martin@ximian.com>
10874
10875         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10876         use a user-defined operator; we still need to do numeric
10877         promotions in case one argument is a builtin type and the other
10878         one has an implicit conversion to that type.  Fixes #62322.
10879
10880 2004-08-02  Martin Baulig  <martin@ximian.com>
10881
10882         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10883         (LocalInfo.IsThis): New public property.
10884         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10885
10886 2004-08-01  Martin Baulig  <martin@ximian.com>
10887
10888         * class.cs (TypeContainer.GetClassBases): Don't set the default
10889         here since we may get called from GetPartialBases().
10890         (TypeContainer.DefineType): If GetClassBases() didn't return a
10891         parent, use the default one.
10892
10893 2004-07-30  Duncan Mak  <duncan@ximian.com>
10894
10895         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10896
10897 2004-07-30  Martin Baulig  <martin@ximian.com>
10898
10899         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10900
10901         * class.cs (SourceMethod): New public class, derive from the
10902         symbol writer's ISourceMethod.
10903         (Method): Use the new symbol writer API.
10904
10905         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10906         as argument and use the new symbol writer.
10907
10908         * location.cs
10909         (SourceFile): Implement the symbol writer's ISourceFile.
10910         (Location.SymbolDocument): Removed.
10911         (Location.SourceFile): New public property.
10912
10913         * symbolwriter.cs: Use the new symbol writer API.
10914
10915 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10916
10917         * Makefile (install-local): Remove.  Functionality moved to
10918         executable.make.
10919
10920 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10921
10922         * Makefile: Install mcs.exe.config file together with mcs.exe.
10923         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10924         correct runtime version.
10925         
10926 2004-07-25  Martin Baulig  <martin@ximian.com>
10927
10928         * class.cs
10929         (TypeContainer.RegisterOrder): Removed, this was unused.
10930         (TypeContainer, interface_order): Removed.
10931         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10932         TypeContainer as argument since we can also be called with a
10933         `PartialContainer' for a partial class/struct/interface.
10934         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10935         of checking whether we're an `Interface' - we could be a
10936         `PartialContainer'.
10937         (PartialContainer.Register): Override; call
10938         AddClass()/AddStruct()/AddInterface() on our parent.
10939
10940         * cs-parser.jay (interface_member_declaration): Add things to the
10941         `current_container', not the `current_class'.
10942
10943         * rootcontext.cs (RegisterOrder): The overloaded version which
10944         takes an `Interface' was unused, removed.
10945
10946         * typemanager.cs (TypeManager.LookupInterface): Return a
10947         `TypeContainer', not an `Interface'.
10948         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10949         contain a `PartialContainer' for an interface, so check it's
10950         `Kind' to figure out what it is.
10951
10952 2004-07-25  Martin Baulig  <martin@ximian.com>
10953
10954         * class.cs (Class.DefaultTypeAttributes): New public constant.
10955         (Struct.DefaultTypeAttributes): Likewise.
10956         (Interface.DefaultTypeAttributes): Likewise.
10957         (PartialContainer.TypeAttr): Override this and add the
10958         DefaultTypeAttributes.
10959
10960 2004-07-25  Martin Baulig  <martin@ximian.com>
10961
10962         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10963         we can just use the `Parent' field instead.
10964
10965 2004-07-25  Martin Baulig  <martin@ximian.com>
10966
10967         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10968
10969 2004-07-25  Martin Baulig  <martin@ximian.com>
10970
10971         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10972         our parts before defining any methods.
10973         (TypeContainer.VerifyImplements): Make this virtual.
10974         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10975         on our PartialContainer.
10976
10977 2004-07-25  Martin Baulig  <martin@ximian.com>
10978
10979         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10980
10981         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10982         argument, we can just use the `Parent' field instead.
10983
10984         * class.cs
10985         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10986         (MemberBase.DoDefine): Likewise.
10987
10988 2004-07-24  Martin Baulig  <martin@ximian.com>
10989
10990         * decl.cs (MemberCore.Parent): New public field.
10991         (DeclSpace.Parent): Moved to MemberCore.
10992
10993         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10994         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10995         parent's .ctor.
10996         (FieldBase, Field, Operator): Likewise.
10997         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10998         (EventField, Event): Likewise.
10999
11000 2004-07-23  Martin Baulig  <martin@ximian.com>
11001
11002         * class.cs (PartialContainer): New public class.
11003         (ClassPart): New public class.
11004         (TypeContainer): Added support for partial classes.
11005         (TypeContainer.GetClassBases): Splitted some of the functionality
11006         out into GetNormalBases() and GetPartialBases().
11007
11008         * cs-tokenizer.cs (Token.PARTIAL): New token.
11009         (Tokenizer.consume_identifier): Added some hacks to recognize
11010         `partial', but only if it's immediately followed by `class',
11011         `struct' or `interface'.
11012
11013         * cs-parser.jay: Added support for partial clases.
11014
11015 2004-07-23  Martin Baulig  <martin@ximian.com>
11016
11017         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
11018         a `DeclSpace' and also made it readonly.
11019         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
11020         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
11021         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
11022
11023         * cs-parser.jay: Pass the `current_class', not the
11024         `current_container' (at the moment, this is still the same thing)
11025         to a new Method, Property, Event, Indexer or Constructor.
11026
11027 2004-07-23  Martin Baulig  <martin@ximian.com>
11028
11029         * cs-parser.jay (CSharpParser): Added a new `current_class' field
11030         and removed the `current_interface' one.
11031         (struct_declaration, class_declaration, interface_declaration):
11032         Set `current_class' to the newly created class/struct/interface;
11033         set their `Bases' and call Register() before parsing their body.
11034
11035 2004-07-23  Martin Baulig  <martin@ximian.com>
11036
11037         * class.cs (Kind): New public enum.
11038         (TypeContainer): Made this class abstract.
11039         (TypeContainer.Kind): New public readonly field.
11040         (TypeContainer.CheckDef): New public method; moved here from
11041         cs-parser.jay.
11042         (TypeContainer.Register): New public abstract method.
11043         (TypeContainer.GetPendingImplementations): New public abstract
11044         method.
11045         (TypeContainer.GetClassBases): Removed the `is_class' and
11046         `is_iface' parameters.
11047         (TypeContainer.DefineNestedTypes): Formerly known as
11048         DoDefineType().
11049         (ClassOrStruct): Made this class abstract.
11050
11051         * tree.cs (RootTypes): New public type. 
11052
11053 2004-07-20  Martin Baulig  <martin@ximian.com>
11054
11055         * tree.cs (Tree.RecordNamespace): Removed.
11056         (Tree.Namespaces): Removed.
11057
11058         * rootcontext.cs (RootContext.IsNamespace): Removed.
11059
11060         * cs-parser.jay (namespace_declaration): Just create a new
11061         NamespaceEntry here.
11062
11063 2004-07-20  Martin Baulig  <martin@ximian.com>
11064
11065         * statement.cs (ExceptionStatement): New abstract class.  This is
11066         now used as a base class for everyone who's using `finally'.
11067         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
11068         our local variables before using them.
11069
11070         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
11071         virtual method.  This is used by Yield.Resolve() to "steal" an
11072         outer block's `finally' clauses.
11073         (FlowBranchingException): The .ctor now takes an ExceptionStatement
11074         argument.
11075
11076         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
11077         version which takes an ExceptionStatement.  This version must be
11078         used to create exception branchings.
11079
11080         * iterator.cs
11081         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
11082         (Iterator.EmitMoveNext): Added exception support; protect the
11083         block with a `fault' clause, properly handle 'finally' clauses.
11084         (Iterator.EmitDispose): Run all the `finally' clauses here.
11085
11086 2004-07-20  Martin Baulig  <martin@ximian.com>
11087
11088         * iterator.cs: This is the first of a set of changes in the
11089         iterator code.  Match the spec more closely: if we're an
11090         IEnumerable, then GetEnumerator() must be called.  The first time
11091         GetEnumerator() is called, it returns the current instance; all
11092         subsequent invocations (if any) must create a copy.
11093
11094 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
11095
11096         * expression.cs: Resolve the constant expression before returning
11097         it. 
11098
11099 2004-07-19  Martin Baulig  <martin@ximian.com>
11100
11101         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
11102         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
11103         the return type of the new EmitContext.
11104
11105 2004-07-18  Martin Baulig  <martin@ximian.com>
11106
11107         * class.cs (Property.Define): Fix iterators.
11108
11109         * iterators.cs (Iterator.Define): Moved the
11110         `container.AddInterator (this)' call here from the .ctor; only do
11111         it if we resolved successfully.
11112
11113 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
11114
11115         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
11116         `true' for preprocessing directives that we parse.  The return
11117         value indicates whether we should return to regular tokenizing or
11118         not, not whether it was parsed successfully.
11119
11120         In the past if we were in: #if false ... #line #endif, we would
11121         resume parsing after `#line'.  See bug 61604.
11122
11123         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
11124         building: IsEnumType should return true only for enums, not for
11125         enums or System.Enum itself.  This fixes #61593.
11126
11127         Likely what happened is that corlib was wrong: mcs depended on
11128         this bug in some places.  The bug got fixed, we had to add the
11129         hack, which caused bug 61593.
11130
11131         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
11132         that was a workaround for the older conditions.
11133
11134 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
11135
11136         * assign.cs: IAssignMethod has a new interface, as documented
11137         inline. All assignment code now uses this new api.
11138
11139         * ecore.cs, expression.cs: All classes which implement
11140         IAssignMethod now use the new interface.
11141
11142         * expression.cs (Invocation): add a hack to EmitCall so that
11143         IndexerAccess can be the target of a compound assignment without
11144         evaluating its arguments twice.
11145
11146         * statement.cs: Handle changes in Invocation api.
11147
11148 2004-07-16  Martin Baulig  <martin@ximian.com>
11149
11150         * iterators.cs: Rewrote this.  We're now using one single Proxy
11151         class for both the IEnumerable and the IEnumerator interface and
11152         `Iterator' derives from Class so we can use the high-level API.
11153
11154         * class.cs (TypeContainer.AddIterator): New method.
11155         (TypeContainer.DoDefineType): New protected virtual method, which
11156         is called from DefineType().
11157         (TypeContainer.DoDefineMembers): Call DefineType() and
11158         DefineMembers() on all our iterators.
11159         (TypeContainer.Emit): Call Emit() on all our iterators.
11160         (TypeContainer.CloseType): Call CloseType() on all our iterators.
11161
11162         * codegen.cs (EmitContext.CurrentIterator): New public field.
11163
11164 2004-07-15  Martin Baulig  <martin@ximian.com>
11165
11166         * typemanager.cs
11167         (TypeManager.not_supported_exception_type): New type.   
11168
11169 2004-07-14  Martin Baulig  <martin@ximian.com>
11170
11171         * iterators.cs: Use real error numbers.
11172
11173 2004-07-14  Martin Baulig  <martin@ximian.com>
11174
11175         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
11176         requires this to be a System.Collection.IEnumerable and not a
11177         class implementing that interface.
11178         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
11179
11180 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
11181
11182         * class.cs: Fixed previous fix, it broke some error tests.
11183
11184 2004-07-12  Martin Baulig  <martin@ximian.com>
11185
11186         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
11187         Fixes #61293.
11188
11189 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
11190
11191         * assign.cs (LocalTemporary): Add new argument: is_address,If
11192         `is_address' is true, then the value that we store is the address
11193         to the real value, and not the value itself.
11194         
11195         * ecore.cs (PropertyExpr): use the new local temporary
11196         stuff to allow us to handle X.Y += z (where X is a struct)
11197
11198 2004-07-08  Martin Baulig  <martin@ximian.com>
11199
11200         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
11201         not always return, just like we're doing in Using.Resolve().
11202
11203 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
11204
11205         * cs-parser.jay (fixed_statement): flag this as Pinned.
11206
11207 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
11208
11209         * typemanager.cs (TypeManager): Removed MakePinned method, this
11210         mechanism is replaced with the .NET 2.x compatible mechanism of
11211         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
11212
11213         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
11214         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
11215         `IsFixed' property which has a different meaning.
11216
11217 2004-07-02  Raja R Harinath  <rharinath@novell.com>
11218
11219         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
11220         visible from inside a nested class, not just the names of the
11221         immediately enclosing class.
11222         Fix for bug #60730.
11223
11224 2004-06-24  Raja R Harinath  <rharinath@novell.com>
11225
11226         * expression.cs (BetterConversion): Remove buggy special-case
11227         handling of "implicit constant expression conversions".  At this
11228         point, we already know that the conversion is possible -- we're
11229         only checking to see which is better.
11230
11231 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11232
11233         * cs-parser.jay: Added error CS0210 test.
11234
11235 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11236
11237         * cs-parser.jay: Added error CS0134 test.
11238
11239 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11240
11241         Fix bug #52507
11242         * cs-parser.jay: Added error CS0145 test.
11243
11244 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
11245
11246         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
11247
11248 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
11249         
11250         * expression.cs (StackAlloc.Resolve): The argument may not
11251         be a constant; deal with this case.
11252         
11253 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
11254
11255         * attribute.cs (IndexerName_GetIndexerName): Renamed to
11256         GetIndexerAttributeValue.
11257         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
11258
11259         * class.cs (Indexer.Define): Added error tests for CS0415,
11260         CS0609.
11261
11262 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
11263
11264         * attribute.cs (Attribute.Resolve): Keep field code in sync with
11265         property code.
11266
11267 2004-06-23  Martin Baulig  <martin@ximian.com>
11268
11269         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
11270         neither return nor throw, reset the barrier as well.  Fixes #60457.
11271
11272 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
11273
11274         * class.cs : EventAttributes is now set to None by default.
11275           This fixes bug #60459.
11276
11277 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11278
11279         Fix bug #60219
11280         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11281         Don't throw exception but return null (it's sufficient now).
11282
11283 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11284
11285         * typemanager.cs (GetArgumentTypes): Faster implementation.
11286
11287 2004-06-18  Martin Baulig  <martin@ximian.com>
11288
11289         * attribute.cs (Attribute.Resolve): Check whether we're an
11290         EmptyCast which a Constant child.  Fixes #60333.
11291
11292 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
11293
11294         * statement.cs (EmitCollectionForeach): Account for the fact that
11295         not all valuetypes are in areas which we can take the address of.
11296         For these variables, we store to a temporary variable. Also, make
11297         sure that we dont emit a `callvirt' on a valuetype method.
11298
11299 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11300
11301         * expression.cs (StackAlloc.DoReSolve): Added test for
11302         negative parameter (CS0247).
11303
11304 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11305
11306         Fix bug #59792
11307         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
11308
11309 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11310
11311         Fix bug #59781
11312         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
11313         ulong.
11314
11315 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11316
11317         Fix bug #58254 & cs1555.cs, cs1556.cs
11318         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
11319
11320 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11321
11322         * cs-parser.jay: Added error CS1669 test for indexers.
11323
11324 2004-06-11  Martin Baulig  <martin@ximian.com>
11325
11326         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
11327         call this twice: for params and varargs methods.
11328
11329 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11330
11331         * class.cs:
11332         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
11333
11334 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11335
11336         * attribute.cs (Attribute.GetValidTargets): Made public.
11337
11338         * class.cs: 
11339         (AbstractPropertyEventMethod): New class for better code sharing.
11340         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
11341         CS1667 report.
11342         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
11343
11344 2004-06-11  Raja R Harinath  <rharinath@novell.com>
11345
11346         Fix bug #59477.
11347         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
11348         that the call to Resolve is part of a MemberAccess.
11349         (Expression.Resolve): Use it for SimpleName resolution.
11350         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
11351         Add 'intermediate' boolean argument.
11352         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
11353         error message when the SimpleName can be resolved ambiguously
11354         between an expression and a type.
11355         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
11356         public.
11357         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
11358         call on the left-side.
11359
11360 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11361
11362         * class.cs:
11363         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
11364
11365 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11366
11367         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
11368
11369 2004-06-11  Martin Baulig  <martin@ximian.com>
11370
11371         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
11372         varargs methods if applicable.
11373
11374 2004-06-11  Martin Baulig  <martin@ximian.com>
11375
11376         * expression.cs (Invocation.EmitCall): Don't use
11377         `method.CallingConvention == CallingConventions.VarArgs' since the
11378         method could also have `CallingConventions.HasThis'.
11379
11380 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11381
11382         * class.cs (Event.GetSignatureForError): Implemented.
11383         Fixed crash in error test cs3010.cs
11384
11385 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
11386
11387         * cs-tokenizer.cs: Change the way we track __arglist to be
11388         consistent with the other keywords.
11389
11390 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
11391
11392         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
11393         tomorrow.
11394
11395 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
11396
11397         * codegen.cs: Check that all referenced assemblies have a strongname
11398         before strongnaming the compiled assembly. If not report error CS1577.
11399         Fix bug #56563. Patch by Jackson Harper.
11400         * typemanager.cs: Added a method to return all referenced assemblies.
11401         Fix bug #56563. Patch by Jackson Harper.
11402
11403 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11404
11405         * class.cs:
11406         (Method.ApplyAttributeBuilder): Moved and added conditional
11407         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
11408
11409         * delegate.cs:
11410         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
11411
11412 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11413
11414         Fixed #59640
11415         * class.cs: (EventField.attribute_targets): Changed default target.
11416
11417 2004-06-08  Martin Baulig  <martin@ximian.com>
11418
11419         * expression.cs (Invocation.EmitCall): Enable varargs methods.
11420
11421 2004-06-08  Martin Baulig  <martin@ximian.com>
11422
11423         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
11424
11425 2004-06-07  Martin Baulig  <martin@ximian.com>
11426
11427         Added support for varargs methods.
11428
11429         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
11430         keyword.
11431
11432         * cs-parser.jay: Added support for `__arglist'.
11433
11434         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
11435
11436         * expression.cs (Argument.AType): Added `ArgList'.
11437         (Invocation): Added support for varargs methods.
11438         (ArglistAccess): New public class.
11439         (Arglist): New public class.
11440
11441         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
11442
11443         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
11444         a method's top-level block if the method has varargs.
11445
11446         * support.cs (ReflectionParameters, InternalParameters): Added
11447         support for varargs methods.    
11448
11449 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
11450
11451         * class.cs: Provide location in indexer error report.
11452
11453         * driver.cs: Use standard names.
11454
11455         * namespace.cs: Catch the use of using after a namespace has been
11456         declared also on using aliases.
11457
11458 2004-06-03  Raja R Harinath  <rharinath@novell.com>
11459
11460         Bug #50820.
11461         * typemanager.cs (closure_private_ok, closure_invocation_type)
11462         (closure_qualifier_type, closure_invocation_assembly)
11463         (FilterWithClosure): Move to ...
11464         (Closure): New internal nested class.
11465         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
11466         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
11467         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
11468         (MemberLookup, MemberLookupFailed): Use it.
11469         * expression.cs (New.DoResolve): Treat the lookup for the
11470         constructor as being qualified by the 'new'ed type.
11471         (Indexers.GetIndexersForTypeOrInterface): Update.
11472
11473 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
11474
11475         * attribute.cs
11476         (GetConditionalAttributeValue): New method. Returns
11477         condition of ConditionalAttribute.
11478         (SearchMulti): New method.  Returns all attributes of type 't'.
11479         Use it when attribute is AllowMultiple = true.
11480         (IsConditionalMethodExcluded): New method.
11481
11482         * class.cs
11483         (Method.IsExcluded): Implemented. Returns true if method has conditional
11484         attribute and the conditions is not defined (method is excluded).
11485         (IMethodData): Extended interface for ConditionalAttribute support.
11486         (PropertyMethod.IsExcluded): Implemented.
11487
11488         * decl.cs
11489         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
11490
11491         * expression.cs
11492         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
11493         on the method.
11494
11495 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11496
11497         * expression.cs (ArrayCreationExpression): Make this just an
11498         `expression'. It can't be a statement, so the code here was
11499         dead.
11500
11501 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11502
11503         Fixed #59072
11504         * typemanager.cs (GetFullNameSignature): New method for
11505         MethodBase types.
11506
11507 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11508
11509         Fixed #56452
11510         * class.cs (MemberBase.GetSignatureForError): New virtual method.
11511         Use this method when MethodBuilder is null.
11512         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
11513         Added test for error CS0626 (MONO reports error for this situation).
11514         (IMethodData.GetSignatureForError): Extended interface.
11515
11516 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11517
11518         * attribute.cs
11519         (AttributeTester.GetObsoleteAttribute): Returns instance of
11520         ObsoleteAttribute when type is obsolete.
11521
11522         * class.cs
11523         (TypeContainer.VerifyObsoleteAttribute): Override.
11524         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
11525         (MethodCode.VerifyObsoleteAttribute): Override.
11526         (MemberBase.VerifyObsoleteAttribute): Override.
11527
11528         * decl.cs
11529         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
11530         and report proper error.
11531
11532         *delegate.cs
11533         Delegate.VerifyObsoleteAttribute): Override.
11534
11535         * ecore.cs
11536         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
11537         and report proper error.
11538         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
11539
11540         * enum.cs
11541         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
11542         and enum member.
11543
11544         * expression.cs
11545         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
11546         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
11547         Added test for ObsoleteAttribute.
11548
11549         * statement.cs
11550         (Catch): Derived from Statement.
11551
11552 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11553  
11554         Fixed bug #59071 & cs0160.cs
11555  
11556         * statement.cs (Try.Resolve): Check here whether order of catch
11557         clauses matches their dependencies.
11558
11559 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
11560
11561         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
11562         caused a regression: #59343.  Referencing nested classes from an
11563         assembly stopped working.
11564
11565 2004-05-31  Martin Baulig  <martin@ximian.com>
11566
11567         MCS is now frozen for beta 2.
11568
11569 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11570
11571         * convert.cs: add a trivial cache for overload operator resolution.
11572
11573 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11574
11575         * decl.cs: If possible, use lookuptypedirect here. We can only do
11576         this if there is no `.' after the namespace. Avoids using
11577         LookupType, which does lots of slow processing.
11578         (FindNestedType) New method, does what it says :-).
11579         * namespace.cs: use LookupTypeDirect.
11580         * rootcontext.cs: use membercache, if possible.
11581         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
11582
11583 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11584
11585         * expression.cs:
11586         According to the spec, 
11587
11588         In a member access of the form E.I, if E is a single identifier,
11589         and if the meaning of E as a simple-name (§7.5.2) is a constant,
11590         field, property, localvariable, or parameter with the same type as
11591         the meaning of E as a type-name (§3.8), then both possible
11592         meanings of E are permitted.
11593
11594         We did not check that E as a simple-name had the same type as E as
11595         a type name.
11596
11597         This trivial check gives us 5-7% on bootstrap time.
11598
11599 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11600
11601         * expression.cs (Invocation.OverloadResolve): Avoid the
11602         use of hashtables and boxing here by allocating on demand.
11603
11604 2004-05-30  Martin Baulig  <martin@ximian.com>
11605
11606         * rootcontext.cs (RootContext.LookupType): Don't cache things if
11607         we're doing a silent lookup.  Don't try to lookup nested types in
11608         TypeManager.object_type (thanks to Ben Maurer).
11609
11610 2004-05-30  Martin Baulig  <martin@ximian.com>
11611
11612         Committing a patch from Ben Maurer.
11613
11614         * rootcontext.cs (RootContext.LookupType): Cache negative results.
11615
11616 2004-05-29  Martin Baulig  <martin@ximian.com>
11617
11618         * class.cs (IMethodData.ShouldIgnore): New method.
11619
11620         * typemanager.cs (TypeManager.MethodFlags): Don't take a
11621         `Location' argument, we don't need it anywhere.  Use
11622         `IMethodData.ShouldIgnore ()' instead of
11623         `MethodData.GetMethodFlags ()'.
11624         (TypeManager.AddMethod): Removed.
11625         (TypeManager.AddMethod2): Renamed to AddMethod.
11626
11627 2004-05-29  Martin Baulig  <martin@ximian.com>
11628
11629         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
11630
11631         * convert.cs (Convert.ImplicitReferenceConversion): If we're
11632         converting from a class type S to an interface type and we already
11633         have an object on the stack, don't box it again.  Fixes #52578.
11634
11635 2004-05-29  Martin Baulig  <martin@ximian.com>
11636
11637         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11638         Added support for `params' parameters.  Fixes #59267.
11639
11640 2004-05-29  Martin Baulig  <martin@ximian.com>
11641
11642         * literal.cs (NullPointer): Provide a private .ctor which sets
11643         `type' to TypeManager.object_type.  Fixes #59048.
11644
11645 2004-05-29  Martin Baulig  <martin@ximian.com>
11646
11647         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11648         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
11649
11650         * ecore.cs (EventExpr.instance_expr): Make the field private.
11651
11652 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
11653
11654         Fixed bug #50080 & cs0214-2.cs
11655         * expression.cs (Cast.DoResolve): Check unsafe context here.
11656         
11657         * statement.cs (Resolve.DoResolve): Likewise.
11658
11659 2004-05-26  Martin Baulig  <martin@ximian.com>
11660
11661         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11662
11663         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11664         (RootContext.LookupType): Pass down the `silent' flag.
11665
11666 2004-05-25  Martin Baulig  <martin@ximian.com>
11667
11668         * expression.cs
11669         (MethodGroupExpr.IdenticalTypeName): New public property.
11670         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11671         expression actually refers to a type.
11672
11673 2004-05-25  Martin Baulig  <martin@ximian.com>
11674
11675         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11676         for #56176 and made it actually work.
11677
11678 2004-05-25  Martin Baulig  <martin@ximian.com>
11679
11680         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11681         (FieldExpr, PropertyExpr): Override and implement
11682         CacheTemporaries.  Fixes #52279.
11683
11684 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
11685
11686         * location.cs: In the new compiler listing a file twice is a
11687         warning, not an error.
11688
11689 2004-05-24  Martin Baulig  <martin@ximian.com>
11690
11691         * enum.cs (Enum.DefineType): For the `BaseType' to be a
11692         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
11693
11694 2004-05-24  Martin Baulig  <martin@ximian.com>
11695
11696         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11697         walking the `using' list.  Fixes #53921.
11698
11699 2004-05-24  Martin Baulig  <martin@ximian.com>
11700
11701         * const.cs (Const.LookupConstantValue): Added support for
11702         EmptyCast's; fixes #55251.
11703
11704 2004-05-24  Martin Baulig  <martin@ximian.com>
11705
11706         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11707         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11708         which does the CS0135 check.  The reason is that we first need to
11709         check whether the variable actually exists.
11710
11711 2004-05-24  Martin Baulig  <martin@ximian.com>
11712
11713         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11714         than RootContext.LookupType() to find the explicit interface
11715         type.  Fixes #58584.
11716
11717 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11718
11719         * Makefile: Simplify.  Use executable.make.
11720         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11721
11722 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11723
11724         * decl.cs:
11725         * enum.cs:
11726         Use the invariant culture when doing String.Compare for CLS case
11727         sensitivity.
11728         
11729 2004-05-23  Martin Baulig  <martin@ximian.com>
11730
11731         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11732         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11733
11734         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11735         
11736 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11737
11738         * class.cs (MemberBase.Define): Reuse MemberType member for 
11739         resolved type. Other methods can use it too.
11740
11741 2004-05-23  Martin Baulig  <martin@ximian.com>
11742
11743         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11744         the variable also exists in the current block (otherwise, we need
11745         to report a CS0103).  Fixes #58670.
11746
11747 2004-05-23  Martin Baulig  <martin@ximian.com>
11748
11749         * flowanalysis.cs (Reachability.Reachable): Compute this
11750         on-the-fly rather than storing it as a field.
11751
11752 2004-05-23  Martin Baulig  <martin@ximian.com>
11753
11754         * flowanalysis.cs (Reachability.And): Manually compute the
11755         resulting `barrier' from the reachability.      
11756        
11757 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11758
11759         Fix bug #57835
11760         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11761         instance of ObsoleteAttribute when symbol is obsolete.
11762
11763         * class.cs
11764         (IMethodData): Extended interface for ObsoleteAttribute support.
11765
11766 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11767
11768         * attribute.cs: Fix bug #55970
11769
11770 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11771
11772         Fix bug #52705
11773         * attribute.cs
11774         (GetObsoleteAttribute): New method. Creates the instance of
11775         ObsoleteAttribute.
11776         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11777         ObsoleteAttribute when member is obsolete.
11778         (AttributeTester.Report_ObsoleteMessage): Common method for
11779         Obsolete error/warning reporting.
11780
11781         * class.cs
11782         (TypeContainer.base_classs_type): New member for storing parent type.
11783
11784         * decl.cs
11785         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11786         for this MemberCore.
11787
11788 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11789
11790         * attribute.cs, const.cs: Fix bug #58590
11791
11792 2004-05-21  Martin Baulig  <martin@ximian.com>
11793
11794         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11795         out parameters if the end of the method is unreachable.  Fixes
11796         #58098. 
11797
11798 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11799
11800         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11801         Hari was right, why extra method.
11802
11803 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11804
11805         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11806
11807 2004-05-20  Martin Baulig  <martin@ximian.com>
11808
11809         Merged this back from gmcs to keep the differences to a minumum.
11810
11811         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11812         instead of a Declspace.
11813         (Attribute.ResolveType): Likewise.
11814         (Attributes.Search): Likewise.
11815         (Attributes.Contains): Likewise.
11816         (Attributes.GetClsCompliantAttribute): Likewise.
11817
11818         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11819         argument.
11820         (MethodData.ApplyAttributes): Take an EmitContext instead of a
11821         DeclSpace.
11822
11823 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11824
11825         Fix bug #58688 (MCS does not report error when the same attribute
11826         is assigned twice)
11827
11828         * attribute.cs (Attribute.Emit): Distinction between null and default.
11829
11830 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11831
11832         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11833         of a top-level attribute without an attribute target.
11834         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11835         Make non-static.
11836         (Attribute.Conditional_GetConditionName), 
11837         (Attribute.Obsolete_GetObsoleteMessage): Update.
11838         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11839         part of ScanForIndexerName.
11840         (Attribute.CanIgnoreInvalidAttribute): New function.
11841         (Attribute.ScanForIndexerName): Move to ...
11842         (Attributes.ScanForIndexerName): ... here.
11843         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11844         (Attributes.Search): New internal variant that can choose not to
11845         complain if types aren't resolved.  The original signature now
11846         complains.
11847         (Attributes.GetClsCompliantAttribute): Use internal variant, with
11848         complaints suppressed.
11849         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11850         only if it not useful.
11851         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11852         top-level for attributes that are shared between the assembly
11853         and a top-level class.
11854         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11855         * class.cs: Update to reflect changes.
11856         (DefineIndexers): Fuse loops.
11857         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11858         a couple more variants of attribute names.
11859
11860 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11861
11862         Fix bug #52585 (Implemented explicit attribute declaration)
11863
11864         * attribute.cs:
11865         (Attributable.ValidAttributeTargets): New abstract method. It gets
11866         list of valid attribute targets for explicit target declaration.
11867         (Attribute.Target): It holds target itself.
11868         (AttributeSection): Removed.
11869         (Attribute.CheckTargets): New method. It checks whether attribute
11870         target is valid for the current element.
11871
11872         * class.cs:
11873         (EventProperty): New class. For events that are declared like
11874         property (with add and remove accessors).
11875         (EventField): New class. For events that are declared like field.
11876         class.cs
11877
11878         * cs-parser.jay: Implemented explicit attribute target declaration.
11879
11880         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11881         Override ValidAttributeTargets.
11882
11883         * parameter.cs:
11884         (ReturnParameter): Class for applying custom attributes on 
11885         the return type.
11886         (ParameterAtribute): New class. Class for applying custom
11887         attributes on the parameter type.
11888
11889 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11892         definitions. 
11893
11894         (Method): Allow UNSAFE here.
11895
11896         * modifiers.cs: Support unsafe reporting.
11897
11898 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11899
11900         * decl.cs: Fix bug #58478.
11901
11902 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11903
11904         * statement.cs: When checking for unreachable code on an EmptyStatement,
11905         set the location. Fixes bug #58488.
11906
11907 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11908
11909         * driver.cs: Add -pkg handling.
11910
11911         From Gonzalo: UseShelLExecute=false
11912
11913 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11914
11915         * attribute.cs:
11916         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11917         for attribute.
11918         (Attribute.IsClsCompliaceRequired): Moved to base for better
11919         accesibility.
11920         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11921         when attribute is AttributeUsageAttribute.
11922         (Attribute.GetValidTargets): Simplified.
11923         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11924         attribute for this type.
11925         (Attribute.ApplyAttributes): Method renamed to Emit and make
11926         non-static.
11927         (GlobalAttributeSection): New class for special handling of global
11928         attributes (assembly, module).
11929         (AttributeSection.Emit): New method.
11930
11931         * class.cs: Implemented Attributable abstract methods.
11932         (MethodCore.LabelParameters): Moved to Parameter class.
11933         (Accessor): Is back simple class.
11934         (PropertyMethod): Implemented Attributable abstract class.
11935         (DelegateMethod): Implemented Attributable abstract class.
11936         (Event): New constructor for disctintion between normal Event
11937         and Event with accessors.
11938
11939         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11940
11941         * codegen.cs, const.cs, decl.cs, delegate.cs:
11942         (CommonAssemblyModulClass): Implemented Attributable abstract class
11943         and simplified.
11944
11945         * enum.cs: Implement IAttributeSupport interface.
11946         (EnumMember): New class for emum members. Implemented Attributable
11947         abstract class
11948
11949         * parameter.cs:
11950         (ParameterBase): Is abstract.
11951         (ReturnParameter): New class for easier [return:] attribute handling.
11952
11953         * typemanager.cs: Removed builder_to_attr.
11954
11955 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11956
11957         Fix bug #57151.
11958         * attribute.cs (Attribute.GetPositionalValue): New function.
11959         * class.cs (TypeContainer.VerifyMembers): New function.
11960         (TypeContainer.Emit): Use it.
11961         (ClassOrStruct): New base class for Class and Struct.
11962         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11963         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11964         class.
11965         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11966         then each non-static field should have a FieldOffset attribute.
11967         Otherwise, none of the fields should have a FieldOffset attribute.
11968         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11969         and FieldOffset attributes.
11970         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11971         (TypeManager.field_offset_attribute_type): New core types.
11972         (TypeManager.InitCoreTypes): Initialize them.
11973
11974 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11975
11976         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11977         Return correct type.
11978         From bug #58270.
11979
11980 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11981
11982         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11983         be implicitly converted to ulong.
11984         
11985         * expression.cs: The logic for allowing operator &, | and ^ worked
11986         was wrong, it worked before because we did not report an error in
11987         an else branch.  Fixes 57895.
11988
11989         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11990         allow volatile fields to be reference types.
11991
11992 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11993
11994         * driver.cs: Add support for /debug-
11995
11996 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11997
11998         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11999         Add a 'complain' parameter to silence errors.
12000         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
12001         silently overlooked type-resolutions.
12002         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
12003         to reflect changes.
12004         (Attributes.Search): New function.
12005         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
12006         (Attributes.GetAttributeFullName): Remove hack.
12007         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
12008         Update to reflect changes.
12009         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12010         Use Attributes.Search instead of nested loops.
12011
12012 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
12013
12014         * decl.cs:
12015         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
12016         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
12017         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
12018
12019         * report.cs: (Report.Warning): Renamed to Warning_T because of
12020         parameter collision.
12021
12022 2004-05-05  Raja R Harinath  <rharinath@novell.com>
12023
12024         * expression.cs (MemberAccess.ResolveMemberAccess):
12025         Exit with non-zero status after Report.Error.
12026         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
12027         Likewise.
12028         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
12029
12030 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
12031
12032         * support.cs: Don't hang when the file is empty.
12033
12034 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
12035
12036         * support.cs: In SeekableStreamReader, compute the preamble size of the
12037           underlying stream. Position changes should take into account that initial
12038           count of bytes.
12039
12040 2004-05-03  Todd Berman  <tberman@sevenl.net>
12041
12042         * driver.cs: remove unused GetSysVersion function.
12043
12044 2004-05-03  Todd Berman  <tberman@sevenl.net>
12045
12046         * driver.cs: Remove the hack from saturday, as well as the hack
12047         from jackson (LoadAssemblyFromGac), also adds the CWD to the
12048         link_paths to get that bit proper.
12049
12050 2004-05-01  Todd Berman  <tberman@sevenl.net>
12051
12052         * driver.cs: Try a LoadFrom before a Load, this checks the current
12053         path. This is currently a bug in mono that is be fixed, however, this
12054         provides a workaround for now. This will be removed when the bug
12055         is fixed.
12056
12057 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
12058
12059         * CryptoConvert.cs: Updated to latest version. Fix issue with 
12060         incomplete key pairs (#57941).
12061
12062 2004-05-01  Todd Berman  <tberman@sevenl.net>
12063
12064         * driver.cs: Remove '.' from path_chars, now System.* loads properly
12065         from the GAC
12066
12067 2004-04-30  Jackson Harper  <jackson@ximian.com>
12068
12069         * codegen.cs: Open keys readonly.
12070         
12071 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12072
12073         * typemanager.cs: don't report cyclic struct layout when a struct
12074         contains 2 or more fields of the same type. Failed for Pango.AttrShape
12075         which has 2 Pango.Rectangle fields.
12076
12077 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12078
12079         * expression.cs: Handle IntPtr comparisons with IL code
12080         rather than a method call.
12081
12082 2004-04-29  Martin Baulig  <martin@ximian.com>
12083
12084         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
12085         the list of PropertyInfo's in class hierarchy and find the
12086         accessor.  Fixes #56013.
12087
12088 2004-04-29  Martin Baulig  <martin@ximian.com>
12089
12090         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
12091
12092 2004-04-29  Martin Baulig  <martin@ximian.com>
12093
12094         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12095
12096         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
12097
12098 2004-04-29  Martin Baulig  <martin@ximian.com>
12099
12100         * class.cs (ConstructorInitializer.Resolve): Check whether the
12101         parent .ctor is accessible.  Fixes #52146.
12102
12103 2004-04-29  Martin Baulig  <martin@ximian.com>
12104
12105         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12106
12107         * statement.cs (Using.EmitLocalVariableDecls): Use
12108         TypeManager.idisposable_type, not typeof (IDisposable).
12109         (Foreach.EmitCollectionForeach): Added support for valuetypes.
12110
12111 2004-04-29  Martin Baulig  <martin@ximian.com>
12112
12113         * class.cs (Event.Define): Don't emit the field and don't set
12114         RTSpecialName and SpecialName for events on interfaces.  Fixes
12115         #57703. 
12116
12117 2004-04-29  Raja R Harinath  <rharinath@novell.com>
12118
12119         Refactor Attribute.ApplyAttributes.
12120         * attribute.cs (Attributable): New base class for objects that can
12121         have Attributes applied on them.
12122         (Attribute): Make AttributeUsage fields public.
12123         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
12124         (Attribute.IsInternalCall): New property.
12125         (Attribute.UsageAttr): Convert to a public read-only property.
12126         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
12127         (Attribute.ResolveType, Attribute.Resolve)
12128         (Attribute.ScanForIndexerName): Update to reflect changes.
12129         (Attribute.CheckAttributeTarget): Re-format.
12130         (Attribute.ApplyAttributes): Refactor, to various
12131         Attributable.ApplyAttributeBuilder methods.
12132         * decl.cs (MemberCore): Make Attributable.
12133         * class.cs (Accessor): Make Attributable.
12134         (MethodData.ApplyAttributes): Use proper attribute types, not
12135         attribute names.
12136         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
12137         (TypeContainer.ApplyAttributeBuilder)
12138         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
12139         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
12140         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
12141         (Operator.ApplyAttributeBuilder): New factored-out methods.
12142         * const.cs (Const.ApplyAttributeBuilder): Likewise.
12143         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
12144         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
12145         * parameter.cs (ParameterBase): New Attributable base class
12146         that can also represent Return types.
12147         (Parameter): Update to the changes.
12148
12149 2004-04-29  Jackson Harper  <jackson@ximian.com>
12150
12151         * driver.cs: Prefer the corlib system version when looking for
12152         assemblies in the GAC. This is still a hack, but its a better hack
12153         now.
12154         
12155 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
12156
12157         * decl.cs, enum.cs: Improved error 3005 reporting.
12158   
12159         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
12160         (related_symbols): New private member for list of symbols
12161         related to reported error/warning.
12162         
12163         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
12164
12165 2004-04-29  Martin Baulig  <martin@ximian.com>
12166
12167         * ecore.cs (Expression.Constantify): If we're an enum and
12168         TypeManager.TypeToCoreType() doesn't give us another type, use
12169         t.UnderlyingSystemType.  Fixes #56178.  
12170
12171 2004-04-29  Martin Baulig  <martin@ximian.com>
12172
12173         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
12174         interfaces and for each interface, only add members directly
12175         declared in that interface.  Fixes #53255.
12176
12177 2004-04-28  Martin Baulig  <martin@ximian.com>
12178
12179         * expression.cs (ConditionalLogicalOperator): Use a temporary
12180         variable for `left' to avoid that we evaluate it more than once;
12181         bug #52588.
12182
12183 2004-04-28  Martin Baulig  <martin@ximian.com>
12184
12185         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
12186         `void[]' (CS1547).
12187
12188 2004-04-28  Martin Baulig  <martin@ximian.com>
12189
12190         * statement.cs (LocalInfo.Resolve): Check whether the type is not
12191         void (CS1547).
12192
12193         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
12194         whether the type is not void (CS1547).
12195
12196 2004-04-28  Martin Baulig  <martin@ximian.com>
12197
12198         * expression.cs (Unary.DoResolveLValue): Override this and report
12199         CS0131 for anything but Operator.Indirection.
12200
12201 2004-04-28  Martin Baulig  <martin@ximian.com>
12202
12203         Committing a patch from Ben Maurer; see bug #50820.
12204
12205         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12206         check for classes.
12207
12208         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12209         classes.        
12210
12211 2004-04-28  Martin Baulig  <martin@ximian.com>
12212
12213         Committing a patch from Ben Maurer; see bug #50820.
12214
12215         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12216         check for classes.
12217
12218         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12219         classes.        
12220
12221 2004-04-28  Martin Baulig  <martin@ximian.com>
12222
12223         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
12224         (Block.AddLabel): Call DoLookupLabel() to only search in the
12225         current block.
12226
12227 2004-04-28  Martin Baulig  <martin@ximian.com>
12228
12229         * cfold.cs (ConstantFold.BinaryFold): Added special support for
12230         comparing StringConstants and NullLiterals in Equality and Inequality.
12231
12232 2004-04-28  Jackson Harper  <jackson@ximian.com>
12233
12234         * driver.cs: Attempt to load referenced assemblies from the
12235         GAC. This is the quick and dirty version of this method that
12236         doesnt take into account versions and just takes the first
12237         canidate found. Will be good enough for now as we will not have more
12238         then one version installed into the GAC until I update this method.
12239
12240 2004-04-28  Martin Baulig  <martin@ximian.com>
12241
12242         * typemanager.cs (TypeManager.CheckStructCycles): New public
12243         static method to check for cycles in the struct layout.
12244
12245         * rootcontext.cs (RootContext.PopulateTypes): Call
12246         TypeManager.CheckStructCycles() for each TypeContainer.
12247         [Note: We only need to visit each type once.]
12248
12249 2004-04-28  Martin Baulig  <martin@ximian.com>
12250
12251         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
12252
12253         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
12254         success and added `out object value'.  Use a `bool resolved' field
12255         to check whether we've already been called rather than
12256         `ConstantValue != null' since this breaks for NullLiterals.
12257
12258 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12259
12260         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
12261         setting of this flag, since the 'set' method may be non-public.
12262
12263 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12264
12265         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
12266         check on current_vector.Block.
12267
12268 2004-04-27  Martin Baulig  <martin@ximian.com>
12269
12270         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
12271         a field initializer.  Fixes #56459.
12272
12273 2004-04-27  Martin Baulig  <martin@ximian.com>
12274
12275         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
12276         we're not attempting to use an indexer.  Fixes #52154.
12277
12278 2004-04-27  Martin Baulig  <martin@ximian.com>
12279
12280         * statement.cs (Return): Don't create a return label if we don't
12281         need it; reverts my change from January 20th.  Thanks to Ben
12282         Maurer for this.
12283
12284 2004-04-27  Martin Baulig  <martin@ximian.com>
12285
12286         According to the spec, `goto' can only leave a nested scope, but
12287         never enter it.
12288
12289         * statement.cs (Block.LookupLabel): Only lookup in the current
12290         block, don't recurse into parent or child blocks.
12291         (Block.AddLabel): Check in parent and child blocks, report
12292         CS0140/CS0158 if we find a duplicate.
12293         (Block): Removed this indexer for label lookups.
12294         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
12295         this already does the error reporting for us.
12296
12297         * flowanalysis.cs
12298         (FlowBranching.UsageVector.Block): New public variable; may be null.
12299         (FlowBranching.CreateSibling): Added `Block' argument.
12300         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
12301         label for the target of a `goto' and check whether we're not
12302         leaving a `finally'.
12303
12304 2004-04-27  Martin Baulig  <martin@ximian.com>
12305
12306         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12307         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
12308         just for returns).
12309
12310 2004-04-27  Martin Baulig  <martin@ximian.com>
12311
12312         * statement.cs (Block.AddLabel): Also check for implicit blocks
12313         and added a CS0158 check.
12314
12315 2004-04-27  Martin Baulig  <martin@ximian.com>
12316
12317         * flowanalysis.cs (FlowBranchingLoop): New class.
12318         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
12319         UsageVector's instead of an ArrayList.
12320         (FlowBranching.Label): Likewise.
12321         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
12322         (FlowBranching.AddBreakVector): New method.
12323
12324 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
12325
12326         * attribute.cs: Small regression fix: only convert the type if we
12327         the type is different, fixes System.Drawing build.
12328
12329 2004-04-27  Martin Baulig  <martin@ximian.com>
12330
12331         * attribute.cs (Attribute.Resolve): If we have a constant value
12332         for a named field or property, implicity convert it to the correct
12333         type.
12334
12335 2004-04-27  Raja R Harinath  <rharinath@novell.com>
12336
12337         * statement.cs (Block.Block): Implicit blocks share
12338         'child_variable_names' fields with parent blocks.
12339         (Block.AddChildVariableNames): Remove.
12340         (Block.AddVariable): Mark variable as "used by a child block" in
12341         every surrounding block.
12342         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
12343         been used in a child block, complain about violation of "Invariant
12344         meaning in blocks" rule.
12345         * cs-parser.jay (declare_local_variables): Don't use
12346         AddChildVariableNames.
12347         (foreach_statement): Don't create an implicit block: 'foreach'
12348         introduces a scope.
12349
12350 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
12351
12352         * convert.cs (ImplicitNumericConversion): 0 is also positive when
12353         converting from 0L to ulong.  Fixes 57522.
12354
12355 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12356
12357         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
12358         derived class hides via 'new' keyword field from base class (test-242.cs).
12359         TODO: Handle this in the more general way.
12360         
12361         * class.cs (CheckBase): Ditto.
12362
12363 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12364
12365         * decl.cs (caching_flags): New member for storing cached values
12366         as bit flags.
12367         (MemberCore.Flags): New enum where bit flags for caching_flags
12368         are defined.
12369         (MemberCore.cls_compliance): Moved to caching_flags.
12370         (DeclSpace.Created): Moved to caching_flags.
12371
12372         * class.cs: Use caching_flags instead of DeclSpace.Created
12373         
12374 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
12375
12376         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
12377         if we are only a derived class, not a nested class.
12378
12379         * typemanager.cs: Same as above, but do this at the MemberLookup
12380         level (used by field and methods, properties are handled in
12381         PropertyExpr).   Allow for the qualified access if we are a nested
12382         method. 
12383
12384 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
12385
12386         * class.cs: Refactoring.
12387         (IMethodData): New inteface; Holds links to parent members
12388         to avoid member duplication (reduced memory allocation).
12389         (Method): Implemented IMethodData interface.
12390         (PropertyBase): New inner classes for get/set methods.
12391         (PropertyBase.PropertyMethod): Implemented IMethodData interface
12392         (Event): New inner classes for add/remove methods.
12393         (Event.DelegateMethod): Implemented IMethodData interface.
12394
12395         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
12396         EmitContext (related to class.cs refactoring).
12397
12398 2004-04-21  Raja R Harinath  <rharinath@novell.com>
12399
12400         * delegate.cs (Delegate.VerifyApplicability): If the number of
12401         arguments are the same as the number of parameters, first try to
12402         verify applicability ignoring  any 'params' modifier on the last
12403         parameter.
12404         Fixes #56442.
12405
12406 2004-04-16  Raja R Harinath  <rharinath@novell.com>
12407
12408         * class.cs (TypeContainer.AddIndexer): Use
12409         'ExplicitInterfaceName' to determine if interface name was
12410         explicitly specified.  'InterfaceType' is not initialized at this time.
12411         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
12412         Indexers array is already in the required order.  Initialize
12413         'IndexerName' only if there are normal indexers.
12414         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
12415         (TypeContainer.Emit): Emit DefaultMember attribute only if
12416         IndexerName is initialized.
12417         Fixes #56300.
12418
12419 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
12420
12421         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
12422         Fixes #57007
12423
12424 2004-04-15  Raja R Harinath  <rharinath@novell.com>
12425
12426         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
12427         attributes.
12428         Fix for #56456.
12429
12430         * attribute.cs (Attribute.Resolve): Check for duplicate named
12431         attributes.
12432         Fix for #56463.
12433
12434 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
12435
12436         * iterators.cs (MarkYield): track whether we are in an exception,
12437         and generate code accordingly.  Use a temporary value to store the
12438         result for our state.
12439
12440         I had ignored a bit the interaction of try/catch with iterators
12441         since their behavior was not entirely obvious, but now it is
12442         possible to verify that our behavior is the same as MS .NET 2.0
12443
12444         Fixes 54814
12445
12446 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
12447
12448         * iterators.cs: Avoid creating temporaries if there is no work to
12449         do. 
12450
12451         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
12452         Enumerations, use TypeManager.EnumToUnderlying and call
12453         recursively. 
12454
12455         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
12456         bug #57013
12457
12458         (This.Emit): Use EmitContext.EmitThis to emit our
12459         instance variable.
12460
12461         (This.EmitAssign): Ditto.
12462
12463         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
12464         codepaths, we will move all the functionality into
12465         Mono.CSharp.This 
12466
12467         (FieldExpr.EmitAssign): Ditto.
12468
12469         This fixes several hidden bugs that I uncovered while doing a code
12470         review of this today.
12471
12472         * codegen.cs (EmitThis): reworked so the semantics are more clear
12473         and also support value types "this" instances.
12474
12475         * iterators.cs: Changed so that for iterators in value types, we
12476         do not pass the value type as a parameter.  
12477
12478         Initialization of the enumerator helpers is now done in the caller
12479         instead of passing the parameters to the constructors and having
12480         the constructor set the fields.
12481
12482         The fields have now `assembly' visibility instead of private.
12483
12484 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * expression.cs (Argument.Resolve): Check if fields passed as ref
12487         or out are contained in a MarshalByRefObject.
12488
12489         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
12490         another compiler type.
12491
12492 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12493
12494         * class.cs (Indexer.Define): use the new name checking method.
12495         Also, return false on an error.
12496         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
12497         (is_identifier_[start/part]_character): make static.
12498
12499 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
12500
12501         * expression.cs (Binary.ResolveOperator): Do no append strings
12502         twice: since we can be invoked more than once (array evaluation)
12503         on the same concatenation, take care of this here.  Based on a fix
12504         from Ben (bug #56454)
12505
12506 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
12507
12508         * codegen.cs: Fix another case where CS1548 must be reported (when 
12509         delay-sign isn't specified and no private is available #56564). Fix
12510         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
12511         error when MCS is used on the MS runtime and we need to delay-sign 
12512         (which seems unsupported by AssemblyBuilder - see #56621).
12513
12514 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
12515
12516         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
12517         (TypeManager.ComputeNamespaces): Faster implementation for
12518         Microsoft runtime.
12519
12520         * compiler.csproj: Updated AssemblyName to mcs.
12521
12522 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12523
12524         * rootcontext.cs: Add new types to the boot resolution.
12525
12526         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12527         MulticastDelegate is not allowed.
12528
12529         * typemanager.cs: Add new types to lookup: System.TypedReference
12530         and ArgIterator.
12531
12532         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12533         check for TypedReference or ArgIterator, they are not allowed. 
12534
12535         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12536         makes us properly catch 1510 in some conditions (see bug 56016 for
12537         details). 
12538
12539 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12540
12541         * CryptoConvert.cs: update from corlib version
12542         with endian fixes.
12543
12544 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12545
12546         * class.cs (Indexer.Define): Check indexername declaration
12547
12548 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12549
12550         * attribute.cs (IsClsCompliant): Fixed problem with handling
12551         all three states (compliant, not-compliant, undetected).
12552
12553 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12554
12555         * attribute.cs (Attribute): Location is now public.
12556         (Resolve): Store resolved arguments (pos_values) in attribute class.
12557         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12558         (GetClsCompliantAttributeValue): New method that gets
12559         CLSCompliantAttribute value.
12560         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12561         if exists else null.
12562         (AttributeTester): New class for CLS-Compliant verification routines.
12563
12564         * class.cs (Emit): Add CLS-Compliant verification.
12565         (Method.GetSignatureForError): Implemented.
12566         (Constructor.GetSignatureForError): Implemented
12567         (Constructor.HasCompliantArgs): Returns if constructor has
12568         CLS-Compliant arguments.
12569         (Constructor.Emit): Override.
12570         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12571         is needed to test only parameters.
12572         (FieldBase.GetSignatureForError): Implemented.
12573         (TypeContainer): New member for storing base interfaces.
12574         (TypeContainer.FindMembers): Search in base interfaces too.
12575
12576         * codegen.cs (GetClsComplianceAttribute): New method that gets
12577         assembly or module CLSCompliantAttribute value.
12578         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12579         for assembly.
12580         (ModuleClass.Emit): Add error 3012 test.
12581
12582         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12583
12584         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12585         state for all decl types.
12586         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12587         if CLS-Compliant tests are required.
12588         (IsClsCompliaceRequired): New method. Analyze whether code
12589         must be CLS-Compliant.
12590         (IsExposedFromAssembly): New method. Returns true when MemberCore
12591         is exposed from assembly.
12592         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12593         value or gets cached value.
12594         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12595         is explicitly marked with CLSCompliantAttribute.
12596         (IsIdentifierClsCompliant): New abstract method. This method is
12597         used to testing error 3005.
12598         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12599         for identifier and parameters CLS-Compliant testing.
12600         (VerifyClsCompliance): New method. The main virtual method for
12601         CLS-Compliant verifications.
12602         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12603         null. I don't know why is null (too many public members !).
12604         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12605         and get value of first CLSCompliantAttribute that found.
12606
12607         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12608         (VerifyClsCompliance): Override and add extra tests.
12609
12610         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12611         clscheck- disable CLS-Compliant verification event if assembly is has
12612         CLSCompliantAttribute(true).
12613
12614         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12615         ApllyAttribute is now called in emit section as in the other cases.
12616         Possible future Emit integration.
12617         (IsIdentifierClsCompliant): New override.
12618         (VerifyClsCompliance): New override.
12619         (GetEnumeratorName): Returns full enum name.
12620
12621         * parameter.cs (GetSignatureForError): Implemented.
12622
12623         * report.cs (WarningData): New struct for Warning message information.
12624         (LocationOfPreviousError): New method.
12625         (Warning): New method. Reports warning based on the warning table.
12626         (Error_T): New method. Reports error based on the error table.
12627
12628         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12629         verifications are done here.
12630
12631         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12632
12633         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12634         CLSCompliantAttribute.
12635         (all_imported_types): New member holds all imported types from other
12636         assemblies.
12637         (LoadAllImportedTypes): New method fills static table with exported types
12638         from all referenced assemblies.
12639         (Modules): New property returns all assembly modules.
12640
12641 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12644         throwing a parser error.
12645
12646         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12647         which removes the hardcoded get_/set_ prefixes for properties, as
12648         IL allows for the properties to be named something else.  
12649
12650         Bug #56013
12651
12652         * expression.cs: Do not override operand before we know if it is
12653         non-null.  Fix 56207
12654
12655 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12656
12657         * typemanager.cs: support for pinned variables.
12658
12659 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12660
12661         * decl.cs, typemanager.cs: Avoid using an arraylist
12662         as a buffer if there is only one result set.
12663
12664 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12665
12666         * expression.cs: Make sure you cant call a static method
12667         with an instance expression, bug #56174.
12668
12669 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12670
12671         * class.cs (IsDuplicateImplementation): Improve error reporting to
12672         flag 663 (method only differs in parameter modifier).
12673
12674         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12675         in preprocessor directives.
12676
12677         * location.cs (LookupFile): Allow for the empty path.
12678
12679         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12680         better approach for some of that patch, but its failing with the
12681         CharSet enumeration.  For now try/catch will do.
12682
12683         * typemanager.cs: Do not crash if a struct does not have fields.
12684         Fixes 56150.
12685
12686 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12687
12688         * expression.cs: cs0213, cant fix a fixed expression.
12689         fixes 50231.
12690
12691 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12692
12693         * cs-parser.jay: detect invalid embeded statements gracefully.
12694         bug #51113.
12695
12696 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12697
12698         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12699         As a regex:
12700         s/
12701         the invocation type may not be a subclass of the tye of the item/
12702         The type of the item must be a subclass of the invocation item.
12703         /g
12704
12705         Fixes bug #50820.
12706
12707 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12708
12709         * attribute.cs: Added methods to get a string and a bool from an
12710         attribute. Required to information from AssemblyKeyFileAttribute,
12711         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12712         * codegen.cs: Modified AssemblyName creation to include support for
12713         strongnames. Catch additional exceptions to report them as CS1548.
12714         * compiler.csproj: Updated include CryptoConvert.cs.
12715         * compiler.csproj.user: Removed file - user specific configuration.
12716         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12717         Mono.Security assembly. The original class is maintained and tested in
12718         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12719         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12720         like CSC 8.0 (C# v2) supports.
12721         * Makefile: Added CryptoConvert.cs to mcs sources.
12722         * rootcontext.cs: Added new options for strongnames.
12723
12724 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12725
12726         * driver.cs: For --expect-error, report error code `2'
12727         if the program compiled with no errors, error code `1' if
12728         it compiled with an error other than the one expected.
12729
12730 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12731
12732         * compiler.csproj: Updated for Visual Studio .NET 2003.
12733         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12734         * compiler.sln: Updated for Visual Studio .NET 2003.
12735
12736 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12737
12738         * expression.cs: Fix bug #47234. We basically need to apply the
12739         rule that we prefer the conversion of null to a reference type
12740         when faced with a conversion to 'object' (csc behaviour).
12741
12742 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12743
12744         * statement.cs: Shorter form for foreach, eliminates
12745         a local variable. r=Martin.
12746
12747 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12748
12749         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12750         checks if we can use brtrue/brfalse to test for 0.
12751         * expression.cs: use the above in the test for using brtrue/brfalse.
12752         cleanup code a bit.
12753
12754 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12755
12756         * expression.cs: Rewrite string concat stuff. Benefits:
12757
12758         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12759         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12760         rather than a concat chain.
12761
12762         * typemanager.cs: Add lookups for more concat overloads.
12763
12764 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12765
12766         * expression.cs: Emit shorter il code for array init.
12767
12768         newarr
12769         dup
12770         // set 1
12771
12772         // set 2
12773
12774         newarr
12775         stloc.x
12776
12777         ldloc.x
12778         // set 1
12779
12780         ldloc.x
12781         // set 2
12782
12783 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12784
12785         * statement.cs: Before, two switch blocks would be merged if the
12786         total size of the blocks (end_item - begin_item + 1) was less than
12787         two times the combined sizes of the blocks.
12788
12789         Now, it will only merge if after the merge at least half of the
12790         slots are filled.
12791
12792         fixes 55885.
12793
12794 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12795
12796         * class.cs : csc build fix for GetMethods(). See bug #52503.
12797
12798 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12799
12800         * expression.cs: Make sure fp comparisons work with NaN.
12801         This fixes bug #54303. Mig approved this patch a long
12802         time ago, but we were not able to test b/c the runtime
12803         had a related bug.
12804
12805 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12806
12807         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12808
12809 2004-03-19  Martin Baulig  <martin@ximian.com>
12810
12811         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12812         error here and not in our caller.
12813
12814 2004-03-19  Martin Baulig  <martin@ximian.com>
12815
12816         * interface.cs: Completely killed this file.
12817         (Interface): We're now a TypeContainer and live in class.cs.
12818
12819         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12820         argument; we're now also called for interfaces.
12821         (TypeContainer.DefineMembers): Allow this method being called
12822         multiple times.
12823         (TypeContainer.GetMethods): New public method; formerly known as
12824         Interface.GetMethod().  This is used by PendingImplementation.
12825         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12826         it's now private and non-static.
12827         (Interface): Moved this here; it's now implemented similar to
12828         Class and Struct.
12829         (Method, Property, Event, Indexer): Added `bool is_interface'
12830         argument to their .ctor's.
12831         (MemberBase.IsInterface): New public field.
12832
12833         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12834         instances instead of InterfaceMethod, InterfaceProperty, etc.
12835         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12836         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12837
12838 2004-03-19  Martin Baulig  <martin@ximian.com>
12839
12840         * class.cs (MethodCore.IsDuplicateImplementation): New private
12841         method which does the CS0111 checking.
12842         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12843         Use IsDuplicateImplementation().
12844
12845 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12846
12847         * decl.cs (FindMemberToOverride): New method to find the correct
12848         method or property to override in the base class.
12849         * class.cs
12850             - Make Method/Property use the above method to find the
12851               version in the base class.
12852             - Remove the InheritableMemberSignatureCompare as it is now
12853               dead code.
12854
12855         This patch makes large code bases much faster to compile, as it is
12856         O(n) rather than O(n^2) to do this validation.
12857
12858         Also, it fixes bug 52458 which is that nested classes are not
12859         taken into account when finding the base class member.
12860
12861         Reviewed/Approved by Martin.
12862
12863 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12864
12865         * interface.cs: In all interface classes removed redundant
12866         member initialization.
12867
12868 2004-03-16  Martin Baulig  <martin@ximian.com>
12869
12870         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12871
12872 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12873
12874         * decl.cs (DefineTypeAndParents): New helper method to define a
12875         type's containers before the type itself is defined;  This is a
12876         bug exposed by the recent changes to Windows.Forms when an
12877         implemented interface was defined inside a class that had not been
12878         built yet.   
12879
12880         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12881
12882         (Check): Loop correctly to report errors modifiers
12883         (UNSAFE was not in the loop, since it was the same as TOP).
12884
12885         * interface.cs: Every interface member now takes a ModFlags,
12886         instead of a "is_new" bool, which we set on the base MemberCore. 
12887
12888         Every place where we called "UnsafeOk" in the interface, now we
12889         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12890         the unsafe settings from the member declaration instead of the
12891         container interface. 
12892
12893         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12894
12895         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12896         `set_indexer_name' to the pending bits (one per type).
12897
12898         We fixed a bug today that was picking the wrong method to
12899         override, since for properties the existing InterfaceMethod code
12900         basically ignored the method name.  Now we make sure that the
12901         method name is one of the valid indexer names.
12902
12903 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12904  
12905         * support.cs (SeekableStreamReader): Keep track of stream byte
12906         positions and don't mix them with character offsets to the buffer.
12907
12908         Patch from Gustavo Giráldez
12909
12910 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12911
12912         * interface.cs (InterfaceSetGetBase): Removed double member
12913         initialization, base class does it as well.
12914
12915 2004-03-13  Martin Baulig  <martin@ximian.com>
12916
12917         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12918         when compiling corlib.
12919
12920 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12921
12922         * convert.cs (ExplicitConversion): We were reporting an error on
12923         certain conversions (object_type source to a value type, when the
12924         expression was `null') before we had a chance to pass it through
12925         the user defined conversions.
12926
12927         * driver.cs: Replace / and \ in resource specifications to dots.
12928         Fixes 50752
12929
12930         * class.cs: Add check for duplicate operators.  Fixes 52477
12931
12932 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12933
12934         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12935         that are in the middle of the statements, not only at the end.
12936         Fixes #54987
12937
12938         * class.cs (TypeContainer.AddField): No longer set the
12939         `HaveStaticConstructor' flag, now we call it
12940         `UserDefineStaticConstructor' to diferentiate the slightly
12941         semantic difference.
12942
12943         The situation is that we were not adding BeforeFieldInit (from
12944         Modifiers.TypeAttr) to classes that could have it.
12945         BeforeFieldInit should be set to classes that have no static
12946         constructor. 
12947
12948         See:
12949
12950         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12951
12952         And most importantly Zoltan's comment:
12953
12954         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12955
12956         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12957          before its static fields are used', i.e. initialization does not need
12958          to be triggered by the first access to the type. Setting this flag
12959          helps the JIT to compile better code, since it can run the static
12960          constructor at JIT time, and does not need to generate code to call it
12961          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12962          this flag for lots of classes like String. 
12963          
12964          csc sets this flag if the type does not have an explicit static 
12965          constructor. The reasoning seems to be that if there are only static
12966          initalizers for a type, and no static constructor, then the programmer
12967          does not care when this initialization happens, so beforefieldinit
12968          can be used.
12969          
12970          This bug prevents the AOT compiler from being usable, since it 
12971          generates so many calls to mono_runtime_class_init that the AOT code
12972          is much slower than the JITted code. The JITted code is faster, 
12973          because it does not generate these calls if the vtable is type is
12974          already initialized, which is true in the majority of cases. But the
12975          AOT compiler can't do this."
12976
12977 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12978
12979         * class.cs (MethodData.Emit): Refactor the code so symbolic
12980         information is generated for destructors;  For some reasons we
12981         were taking a code path that did not generate symbolic information
12982         before. 
12983
12984 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12985
12986         * class.cs: Create a Constructor.CheckBase method that
12987         takes care of all validation type code. The method
12988         contains some code that was moved from Define.
12989
12990         It also includes new code that checks for duplicate ctors.
12991         This fixes bug #55148.
12992
12993 2004-03-09  Joshua Tauberer <tauberer@for.net>
12994
12995         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12996         a { ... }-style array creation invokes EmitStaticInitializers
12997         which is not good for reference-type arrays.  String, decimal
12998         and now null constants (NullCast) are not counted toward
12999         static initializers.
13000
13001 2004-03-05  Martin Baulig  <martin@ximian.com>
13002
13003         * location.cs (SourceFile.HasLineDirective): New public field;
13004         specifies whether the file contains or is referenced by a "#line"
13005         directive.
13006         (Location.DefineSymbolDocuments): Ignore source files which
13007         either contain or are referenced by a "#line" directive.        
13008
13009 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
13010
13011         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
13012         direct access to our parent, so check the method inline there.
13013
13014 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13015
13016         * expression.cs (Invocation.EmitCall): Miguel's last commit
13017         caused a regression. If you had:
13018
13019             T t = null;
13020             t.Foo ();
13021
13022         In Foo the implict this would be null.
13023
13024 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
13025
13026         * expression.cs (Invocation.EmitCall): If the method is not
13027         virtual, do not emit a CallVirt to it, use Call.
13028
13029         * typemanager.cs (GetFullNameSignature): Improve the method to
13030         cope with ".ctor" and replace it with the type name.
13031
13032         * class.cs (ConstructorInitializer.Resolve): Now the method takes
13033         as an argument the ConstructorBuilder where it is being defined,
13034         to catch the recursive constructor invocations.
13035
13036 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
13037
13038         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
13039         routines to check if a type is an enumerable/enumerator allow
13040         classes that implement the IEnumerable or IEnumerator interfaces.
13041
13042         * class.cs (Property, Operator): Implement IIteratorContainer, and
13043         implement SetYields.
13044
13045         (Property.Define): Do the block swapping for get_methods in the
13046         context of iterators.   We need to check if Properties also
13047         include indexers or not.
13048
13049         (Operator): Assign the Block before invoking the
13050         OperatorMethod.Define, so we can trigger the Iterator code
13051         replacement. 
13052
13053         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
13054         Property and Operator classes are not created when we parse the
13055         declarator but until we have the block completed, so we use a
13056         singleton SimpleIteratorContainer.Simple to flag whether the
13057         SetYields has been invoked.
13058
13059         We propagate this setting then to the Property or the Operator to
13060         allow the `yield' to function.
13061
13062 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
13063
13064         * codegen.cs: Implemented attribute support for modules.
13065         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
13066         Assembly/Module functionality.
13067
13068         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
13069         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
13070         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
13071
13072 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
13073
13074         * interface.cs (FindMembers): The operation is performed on all base
13075         interfaces and not only on the first. It is required for future CLS Compliance patch.
13076
13077 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13078
13079         * statement.cs, codegen.cs:
13080         This patch deals with patterns such as:
13081
13082         public class List : IEnumerable {
13083
13084                 public MyEnumerator GetEnumerator () {
13085                         return new MyEnumerator(this);
13086                 }
13087
13088                 IEnumerator IEnumerable.GetEnumerator () {
13089                         ...
13090                 }
13091                 
13092                 public struct MyEnumerator : IEnumerator {
13093                         ...
13094                 }
13095         }
13096
13097         Before, there were a few things we did wrong:
13098         1) we would emit callvirt on a struct, which is illegal
13099         2) we emited ldarg when we needed to emit ldarga
13100         3) we would mistakenly call the interface methods on an enumerator
13101         type that derived from IEnumerator and was in another assembly. For example:
13102
13103         public class MyEnumerator : IEnumerator
13104
13105         Would have the interface methods called, even if there were public impls of the
13106         method. In a struct, this lead to invalid IL code.
13107
13108 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
13109
13110         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
13111           renamed to Emit.
13112
13113         * delegate.cs (Define): Fixed crash when delegate type is undefined.
13114
13115 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
13116
13117         * cs-parser.jay: Fix small regression: we were not testing V2
13118         compiler features correctly.
13119
13120         * interface.cs: If the emit context is null, then create one
13121
13122 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
13123
13124         * decl.cs (GetSignatureForError): New virtual method to get full name
13125           for error messages.
13126
13127         * attribute.cs (IAttributeSupport): New interface for attribute setting.
13128           Now it is possible to rewrite ApplyAttributes method to be less if/else.
13129
13130         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
13131           Duplicated members and code in these classes has been removed.
13132           Better encapsulation in these classes.
13133
13134 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
13135
13136         * assign.cs (Assign.DoResolve): When dealing with compound
13137         assignments, there is a new rule in ECMA C# 2.4 (might have been
13138         there before, but it is documented here) that states that in:
13139
13140         a op= b;
13141
13142         If b is of type int, and the `op' is a shift-operator, then the
13143         above is evaluated as:
13144
13145         a = (int) a op b 
13146
13147         * expression.cs (Binary.ResolveOperator): Instead of testing for
13148         int/uint/long/ulong, try to implicitly convert to any of those
13149         types and use that in pointer arithmetic.
13150
13151         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
13152         method to print information for from the type, not from the
13153         null-method we were given.
13154
13155 2004-02-01  Duncan Mak  <duncan@ximian.com>
13156
13157         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
13158         parsing for cmd, fixes bug #53694.
13159
13160 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
13161
13162         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
13163         in the member name duplication tests. Property and operator name duplication
13164         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
13165
13166 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
13167
13168         * interface.cs (PopulateMethod): Fixed crash when interface method
13169         returns not existing type (error test cs0246-3.cs).
13170
13171 2004-02-02  Ravi Pratap M <ravi@ximian.com>
13172
13173         * cs-parser.jay (interface_accessors): Re-write actions to also
13174         store attributes attached to get and set methods. Fix spelling
13175         while at it.
13176
13177         (inteface_property_declaration): Modify accordingly.
13178
13179         (InterfaceAccessorInfo): New helper class to store information to pass
13180         around between rules that use interface_accessors.
13181
13182         * interface.cs (Emit): Apply attributes on the get and set
13183         accessors of properties and indexers too.
13184
13185         * attribute.cs (ApplyAttributes): Modify accordingly to use the
13186         right MethodBuilder when applying attributes to the get and set accessors.
13187
13188 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
13189
13190         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
13191
13192 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
13193
13194         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13195
13196 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
13197
13198         * cs-parser.jay: Remove YIELD token, instead use the new grammar
13199         changes that treat `yield' specially when present before `break'
13200         or `return' tokens.
13201
13202         * cs-tokenizer.cs: yield is no longer a keyword.
13203
13204 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
13205
13206         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13207         setting for default constructors.
13208         For default constructors are almost every time set wrong Modifier. The
13209         generated IL code has been alright. But inside mcs this values was
13210         wrong and this was reason why several of my CLS Compliance tests
13211         failed.
13212
13213 2004-01-22  Martin Baulig  <martin@ximian.com>
13214
13215         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13216         not a QualifiedIdentifier.  This is what `type_name_expression'
13217         was previously doing.
13218         (type_name_expression): Removed; the code is now in
13219         `namespace_or_type_name'.
13220         (qualified_identifier): Removed, use `namespace_or_type_name'
13221         instead.
13222         (QualifiedIdentifier): Removed this class.      
13223
13224 2004-01-22  Martin Baulig  <martin@ximian.com>
13225
13226         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13227         not a string as alias name.
13228
13229 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13230
13231         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13232         #52730 bug, and instead compute correctly the need to use a
13233         temporary variable when requesting an address based on the
13234         static/instace modified of the field and the constructor.
13235  
13236 2004-01-21  Martin Baulig  <martin@ximian.com>
13237
13238         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13239         class and namespace before looking up aliases.  Fixes #52517.
13240
13241 2004-01-21  Martin Baulig  <martin@ximian.com>
13242
13243         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13244         assinged in a 'try'; fixes exception4.cs.
13245
13246 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13247         * class.cs : Implemented parameter-less constructor for TypeContainer
13248
13249         * decl.cs: Attributes are now stored here. New property OptAttributes
13250
13251         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13252
13253         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13254
13255 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13256
13257         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13258           (CSharpSignature): New method for indexer and property signature.
13259
13260 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13261
13262         * pending.cs (IsVirtualFilter): Faster implementation.
13263
13264 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13265
13266         * typemanager.cs: Avoid inclusion of same assembly more than once.
13267
13268 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13269
13270         * cs-parser.jay: Fixed problem where the last assembly attribute
13271           has been applied also to following declaration (class, struct, etc.)
13272           
13273 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13274
13275         * class.cs: Added error CS0538, CS0539 reporting.
13276         Fixed crash on Microsoft runtime when field type is void.
13277
13278         * cs-parser.jay: Added error CS0537 reporting.
13279
13280         * pending.cs: Added error CS0535 reporting.
13281         Improved error report for errors CS0536, CS0534.
13282
13283 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13284
13285         Merge a few bits from the Anonymous Method MCS tree.
13286
13287         * statement.cs (ToplevelBlock): New class for toplevel methods,
13288         will hold anonymous methods, lifted variables.
13289
13290         * cs-parser.jay: Create toplevel blocks for delegates and for
13291         regular blocks of code. 
13292
13293 2004-01-20  Martin Baulig  <martin@ximian.com>
13294
13295         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13296         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13297         and `NeedExplicitReturn'; added `IsLastStatement'.
13298         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13299         have a `ReturnLabel' or we're not unreachable.
13300
13301         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13302         child's reachability; don't just override ours with it.  Fixes
13303         #58058 (lluis's example).
13304         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13305         InFinally(), InLoop(), InSwitch() and
13306         BreakCrossesTryCatchBoundary() methods.
13307
13308         * statement.cs (Return): Do all error checking in Resolve().
13309         Unless we are the last statement in a top-level block, always
13310         create a return label and jump to it.
13311         (Break, Continue): Do all error checking in Resolve(); also make
13312         sure we aren't leaving a `finally'.
13313         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13314         statement in a top-level block.
13315         (Block.Flags): Added `IsDestructor'.
13316         (Block.IsDestructor): New public property.
13317
13318 2004-01-20  Martin Baulig  <martin@ximian.com>
13319
13320         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13321
13322 2004-01-20  Martin Baulig  <martin@ximian.com>
13323
13324         * statement.cs (Statement.ResolveUnreachable): New public method.
13325         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13326         (Block.Resolve): Resolve unreachable statements.
13327
13328 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13329
13330         * expression.cs: We need to fix the case where we do
13331         not have a temp variable here.
13332
13333         * assign.cs: Only expression compound assignments need
13334         temporary variables.
13335
13336 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13337
13338         * flowanalysis.cs: Reduce memory allocation in a few ways:
13339           - A block with no variables should not allocate a bit
13340             vector for itself.
13341           - A method with no out parameters does not need any tracking
13342             for assignment of the parameters, so we need not allocate
13343             any data for it.
13344           - The arrays:
13345                 public readonly Type[] VariableTypes;
13346                 public readonly string[] VariableNames;
13347             Are redundant. The data is already stored in the variable
13348             map, so we need not allocate another array for it.
13349           - We need to add alot of checks for if (params | locals) == null
13350             due to the first two changes.
13351
13352 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13355         implement IMemoryLocation, we store a copy on a local variable and
13356         take the address of it.  Patch from Benjamin Jemlich
13357
13358         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13359         to use a special "type_name_expression" rule which reduces the
13360         number of "QualifiedIdentifier" classes created, and instead
13361         directly creates MemberAccess expressions.
13362
13363 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13364
13365         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13366         that fixes #52853.  Null literal assignment to ValueType
13367
13368         * class.cs (MethodData.Emit): Instead of checking the name of the
13369         method to determine if its a destructor, create a new derived
13370         class from Method called Destructor, and test for that.  
13371
13372         * cs-parser.jay: Create a Destructor object instead of a Method.  
13373
13374         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13375
13376         Fixes: 52933
13377
13378 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13379
13380         * expression.cs (Binary.ResolveOperator): Perform an implicit
13381         conversion from MethodGroups to their delegate types on the
13382         Addition operation.
13383
13384         * delegate.cs: Introduce a new class DelegateCreation that is the
13385         base class for `NewDelegate' and `ImplicitDelegateCreation',
13386         factor some code in here.
13387
13388         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13389         conversion from MethodGroups to compatible delegate types. 
13390
13391         * ecore.cs (Expression.Resolve): Do not flag error 654
13392         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13393         we allow conversions from MethodGroups to delegate types now.
13394
13395         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13396         assignments in v2 either.
13397
13398 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13399
13400         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13401         static read-only fields in ctors.
13402
13403         Applied patch from Benjamin Jemlich 
13404
13405         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13406
13407 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13410         here to return true, as they can be used like this:
13411
13412                 (XXX) int.MEMBER ()
13413
13414         Fixed 49836 and all the other dups
13415
13416 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13417
13418         * driver.cs: Implement /win32res and /win32icon.
13419
13420 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13421
13422         * cs-parser.jay: Add a rule to improve error handling for the
13423         common mistake of placing modifiers after the type.
13424
13425 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13426
13427         * cs-parser.jay (interface_event_declaration): Catch
13428         initialization of events on interfaces, and report cs0068
13429
13430         * cs-parser.jay (interface_event_declaration): Catch
13431         initialization of events. 
13432
13433         * ecore.cs: Better report missing constructors.
13434
13435         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13436         the error reporting done in the wrong place.  Fix.
13437
13438         * expression.cs (Binary.ResolveOperator): Catch the 
13439         operator + (E x, E y) error earlier, and later allow for implicit
13440         conversions in operator +/- (E e, U x) from U to the underlying
13441         type of E.
13442
13443         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13444         52596, if the container class is abstract, the default constructor
13445         is protected otherwise its public (before, we were always public).
13446
13447         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13448         fixed statement.
13449
13450         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13451         Jemlich that fixes bug #52597, MCS was generating invalid code for
13452         idisposable structs.   Thanks to Ben for following up with this
13453         bug as well.
13454
13455 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13456
13457         * driver.cs: Allow assemblies without code to be generated, fixes
13458         52230.
13459
13460 2004-01-07  Nick Drochak <ndrochak@gol.com>
13461
13462         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13463
13464 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13465
13466         * cs-parser.jay: Add rules to improve error reporting if fields or
13467         methods are declared at the namespace level (error 116)
13468
13469         * Add rules to catch event add/remove
13470
13471 2004-01-04  David Sheldon <dave-mono@earth.li>
13472
13473   * expression.cs: Added matching ")" to error message for 
13474   CS0077
13475
13476 2004-01-03 Todd Berman <tberman@gentoo.org>
13477
13478         * ecore.cs, attribute.cs:
13479         Applying fix from #52429.
13480
13481 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13482
13483         * ecore.cs, expression.cs, statement.cs:
13484         Total rewrite of how we handle branching. We
13485         now handle complex boolean expressions with fewer
13486         jumps. As well if (x == 0) no longer emits a ceq.
13487
13488         if (x is Foo) is much faster now, because we generate
13489         better code.
13490
13491         Overall, we get a pretty big improvement on our benchmark
13492         tests. The code we generate is smaller and more readable.
13493
13494         I did a full two-stage bootstrap. The patch was reviewed
13495         by Martin and Miguel.
13496
13497 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13498
13499         * cs-parser.jay: Make primary_expression not take a QI.
13500         we dont need this because the member_access rule covers
13501         us here. So we replace the rule with just IDENTIFIER.
13502
13503         This has two good effects. First, we remove a s/r conflict.
13504         Second, we allocate many fewer QualifiedIdentifier objects.
13505
13506 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13507
13508         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13509         set the correct information via SRE. This prevents
13510         hanging on the MS runtime. Fixes #29374.
13511
13512 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13513
13514         * convert.cs: correctly handle conversions to value types
13515         from Enum and ValueType as unboxing conversions.
13516
13517         Fixes bug #52569. Patch by Benjamin Jemlich.
13518
13519 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13520
13521         * expression.cs (BetterConversion): Prefer int -> uint
13522         over int -> ulong (csc's behaviour). This fixed bug #52046.
13523
13524 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13525
13526         * decl.cs (MemberCache.FindMembers): now returns a
13527         MemberInfo [].
13528
13529         * typemanager.cs: In general, go with with ^^.
13530         (CopyNewMethods): take an IList.
13531         (RealMemberLookup): Only allocate an arraylist
13532         if we copy from two sets of methods.
13533
13534         This change basically does two things:
13535         1) Fewer array lists allocated due to CopyNewMethods.
13536         2) the explicit cast in MemberList costed ALOT.
13537
13538 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13539
13540         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13541         a hashtable to avoid needless string allocations when an identifier is
13542         used more than once (the common case).
13543
13544 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13545
13546         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13547         is broken, it will not return anything. So, we
13548         have to use the information we have in mcs to
13549         do the task.
13550
13551         * typemanager.cs: Add a cache for GetInterfaces,
13552         since this will now be used more often (due to ^^)
13553
13554         (GetExplicitInterfaces) New method that gets the
13555         declared, not effective, interfaces on a type
13556         builder (eg, if you have interface IFoo, interface
13557         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13558         { IBar }.
13559
13560         This patch makes MCS able to bootstrap itself on
13561         Windows again.
13562
13563 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13564
13565         * expression.cs: Remove the Nop's that Miguel put
13566         in by mistake.
13567
13568 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13569
13570         * report.cs, codegen.cs: Give the real stack trace to
13571         the error when an exception is thrown.
13572
13573 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13574
13575         * decl.cs: only allocate hashtables for ifaces if 
13576         it is an iface!
13577
13578 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13579
13580         * expression.cs: fix the error from cs0121-2.cs
13581         (a parent interface has two child interfaces that
13582         have a function with the same name and 0 params
13583         and the function is called through the parent).
13584
13585 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13586
13587         * class.cs, rootcontext.cs, typmanager.cs: do not
13588         leak pointers.
13589
13590 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13591
13592         * codegen.cs: remove stack for the ec flow branching.
13593         It is already a linked list, so no need.
13594
13595 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13596
13597         * Makefile: Allow custom profiler here.
13598
13599 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13600
13601         * typemanager.cs (LookupType):
13602           - Use a static char [], because split takes
13603             a param array for args, so it was allocating
13604             every time.
13605           - Do not store true in a hashtable, it boxes.
13606
13607 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13608
13609         * flowanalysis.cs: bytify common enums.
13610
13611 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13612
13613         * modifiers.cs: Add a new set of flags for the
13614         flags allowed on explicit interface impls.
13615         * cs-parser.jay: catch the use of modifiers in
13616         interfaces correctly.
13617         * class.cs: catch private void IFoo.Blah ().
13618
13619         All related to bug #50572.
13620
13621 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13622
13623         * decl.cs: Rewrite the consistant accessability checking.
13624         Accessability is not linear, it must be implemented in
13625         a tableish way. Fixes #49704.
13626
13627 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13628
13629         * expression.cs: Handle negation in a checked context.
13630         We must use subtraction from zero. Fixes #38674.
13631
13632 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13633
13634         * class.cs: Ignore static void main in DLLs.
13635         * rootcontext.cs: Handle the target type here,
13636         since we are have to access it from class.cs
13637         * driver.cs: account for the above.
13638
13639 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13640
13641         * report.cs: Give line numbers and files if available.
13642
13643 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13644
13645         * driver.cs: Implement /addmodule.
13646
13647         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13648         ModuleBuilders.
13649
13650 2003-12-20  Martin Baulig  <martin@ximian.com>
13651
13652         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13653         (FieldBase.IsAssigned): Removed this field.
13654         (FieldBase.SetAssigned): New public method.
13655         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13656
13657 2003-12-20  Martin Baulig  <martin@ximian.com>
13658
13659         * expression.cs (LocalVariableReference.DoResolve): Don't set
13660         `vi.Used' if we're called from DoResolveLValue().
13661
13662         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13663         returns the usage vector it just merged into the current one -
13664         pass this one to UsageWarning().
13665         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13666         of the `EmitContext', don't call this recursively on our children.
13667
13668 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13669
13670         * driver.cs: Implement /target:module.
13671
13672 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13673
13674         * support.cs (CharArrayHashtable): New helper class.
13675
13676         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13677         char arrays, not strings, so we can avoid creating a string in
13678         consume_identifier if the identifier is a keyword.
13679
13680 2003-12-16  Martin Baulig  <martin@ximian.com>
13681
13682         * statement.cs (LocalInfo.Assigned): Removed this property.
13683         (LocalInfo.Flags): Removed `Assigned'.
13684         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13685         and uses flow analysis.
13686         (Block.UsageWarning): Made this method private.
13687         (Block.Resolve): Call UsageWarning() if appropriate.
13688
13689         * expression.cs (LocalVariableReference.DoResolve): Always set
13690         LocalInfo.Used here.
13691
13692 2003-12-13  Martin Baulig  <martin@ximian.com>
13693
13694         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13695         any value here; we're now using flow analysis to figure out
13696         whether a statement/block returns a value.
13697
13698 2003-12-13  Martin Baulig  <martin@ximian.com>
13699
13700         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13701         working again.
13702         (FlowBranching.MergeFinally): Don't call
13703         `branching.CheckOutParameters()' here, this is called in
13704         MergeTopBlock().
13705         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13706         when adding the `finally' vector.       
13707
13708 2003-12-13  Martin Baulig  <martin@ximian.com>
13709
13710         * flowanalysis.cs
13711         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13712         actually work and also fix #48962.
13713
13714 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13715
13716         * decl.cs: Do not check System.Object for nested types,
13717         since we know it does not have any. Big bang for buck:
13718
13719         BEFORE:
13720            Run 1:   8.35 seconds
13721            Run 2:   8.32 seconds
13722            corlib:  17.99 seconds
13723         AFTER:
13724            Run 1:   8.17 seconds
13725            Run 2:   8.17 seconds
13726            corlib:  17.39 seconds
13727
13728 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13729
13730         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13731         time we are returning 0 members, so we save alot here.
13732
13733 2003-12-11  Martin Baulig  <martin@ximian.com>
13734
13735         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13736         `MergeChild()', also just take the `FlowBranching' as argument;
13737         call Merge() on it and return the result.
13738         (FlowBranching.Merge): We don't need to do anything if we just
13739         have one sibling.
13740
13741 2003-12-11  Martin Baulig  <martin@ximian.com>
13742
13743         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13744         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13745         Maurer for this idea.
13746
13747 2003-12-11  Martin Baulig  <martin@ximian.com>
13748
13749         * flowanalysis.cs (MergeResult): This class is now gone; we now
13750         use the `UsageVector' for this.  The reason for this is that if a
13751         branching just has one sibling, we don't need to "merge" them at
13752         all - that's the next step to do.
13753         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13754         `MergeResult'.
13755
13756 2003-12-11  Martin Baulig  <martin@ximian.com>
13757
13758         Reworked flow analyis and made it more precise and bug-free.  The
13759         most important change is that we're now using a special `Reachability'
13760         class instead of having "magic" meanings of `FlowReturns'.  I'll
13761         do some more cleanups and optimizations and also add some more
13762         documentation this week.
13763
13764         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13765         largely reworked this class.
13766         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13767         the new `Reachability' class instead of having "magic" values here.
13768         (FlowBranching): We're now using an instance of `Reachability'
13769         instead of having separate `Returns', `Breaks' etc. fields.
13770
13771         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13772         based on flow analysis; ignore the return value of block.Emit ().
13773
13774 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13775
13776         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13777         if they are private.
13778
13779 2003-12-09  Martin Baulig  <martin@ximian.com>
13780
13781         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13782         call them directly on the UsageVector.
13783
13784 2003-12-09  Martin Baulig  <martin@ximian.com>
13785
13786         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13787         Changed return type from `FlowReturns' to `Reachability'.
13788
13789 2003-12-09  Martin Baulig  <martin@ximian.com>
13790
13791         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13792         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13793         `Reachable' fields with a single `Reachability' one.
13794
13795 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13796
13797         * class.cs (FindMembers): Remove foreach's.
13798
13799         Bootstrap times:
13800
13801         BEFORE
13802                 Run 1:   8.74 seconds
13803                 Run 2:   8.71 seconds
13804
13805         AFTER
13806                 Run 1:   8.64 seconds
13807                 Run 2:   8.58 seconds
13808
13809
13810 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13811
13812         * cs-parser.jay:
13813         * gen-treedump.cs:
13814         * statement.cs:
13815         This patch does a few things:
13816                 1. EmptyStatement is now a singleton, so it is never reallocated.
13817                 2. All blah is EmptyStatement constructs have been changed to
13818                    blah == EmptyStatement.Value, which is much faster and valid
13819                    now that EmptyStatement is a singleton.
13820                 3. When resolving a block, rather than allocating a new array for
13821                    the non-empty statements, empty statements are replaced with
13822                    EmptyStatement.Value
13823                 4. Some recursive functions have been made non-recursive.
13824         Mainly the performance impact is from (3), however (1) and (2) are needed for
13825         this to work. (4) does not make a big difference in normal situations, however
13826         it makes the profile look saner.
13827
13828         Bootstrap times:
13829
13830         BEFORE
13831         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13832         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13833         Total memory allocated: 56397 KB
13834
13835         AFTER
13836         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13837         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13838         Total memory allocated: 55666 KB
13839
13840 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13841
13842         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13843         than the hashtable in a hashtable version
13844
13845         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13846         we always end up concating a string. This results in a huge perf
13847         loss, because many strings have to be tracked by the GC. In this
13848         patch, we first use a hashtable that works with two keys, so that
13849         the strings do not need to be concat'ed.
13850
13851         Bootstrap times:
13852         BEFORE
13853                 Run 1:   8.74 seconds
13854                 Run 2:   8.71 seconds
13855
13856         AFTER
13857                 Run 1:   8.65 seconds
13858                 Run 2:   8.56 seconds
13859
13860 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13861
13862         * Makefile: Add a new target `do-time' that does a quick and simple
13863         profile, leaving easy to parse output.
13864
13865 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13866
13867         * codegen.cs (Init): Create the dynamic assembly with 
13868         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13869
13870 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13871
13872         * support.cs: Make the PtrHashtable use only one
13873         instance of its comparer.
13874
13875 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13876
13877         * typemanager.cs: Fix lookup of GetNamespaces.
13878
13879 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13880
13881         * expression.cs: Removed redundant line.
13882
13883         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13884         ArrayLists, use for loops with bounds.  
13885
13886         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13887         arraylist.
13888
13889         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13890         arraylists, use for loop with bounds.
13891
13892         The above three changes give us a 0.071 second performance
13893         improvement out of 3.294 seconds down to 3.223.  On my machine
13894         the above changes reduced the memory usage by 1,387 KB during
13895         compiler bootstrap.
13896
13897         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13898         QualifiedIdentifiers.  Before we created a new string through
13899         concatenation, and mostly later on, the result would be
13900         manipulated by DecomposeQI through string manipulation.
13901
13902         This reduced the compiler memory usage for bootstrapping from
13903         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13904         compile times in 0.05 seconds.
13905
13906 2003-11-28  Dick Porter  <dick@ximian.com>
13907
13908         * support.cs: Do string compares with the Invariant culture.
13909
13910         * rootcontext.cs: 
13911         * gen-treedump.cs: 
13912         * expression.cs: 
13913         * driver.cs: 
13914         * decl.cs: 
13915         * codegen.cs: 
13916         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13917         the comparison is done with the Invariant culture.
13918
13919 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13920
13921         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13922         GetEnumerator method.
13923
13924         (ProbeCollectionType): Iterate starting at the most specific type
13925         upwards looking for a GetEnumerator
13926
13927         * expression.cs: Shift count can be up to 31 for int/uint and 63
13928         for long/ulong.
13929
13930 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13931
13932         * statement.cs (Block.LookupLabel): Also look for the label on the
13933         children blocks.  Use a hash table to keep track of visited
13934         nodes. 
13935
13936         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13937         we actually did transform the other operand, otherwise fall back
13938         to the common codepath that casts to long.
13939
13940         * cs-tokenizer.cs: Use the same code pattern as the int case.
13941         Maybe I should do the parsing myself, and avoid depending on the
13942         Parse routines to get this done.
13943
13944 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13945
13946         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13947         which fixes bug 51347.  This time test it.
13948
13949         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13950         attributes for example can not tell the difference between these.
13951         The difference was only a syntax feature of the language. 
13952
13953         * attribute.cs: Apply attributes to delegates.
13954
13955         * delegate.cs: Call the apply attributes method.
13956
13957 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13958
13959         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13960         comparing 0 vs Byte.MinValue, not the value
13961
13962         (ImplicitConversionRequired): When reporting a conversion error,
13963         use error 31 to print out the constant error instead of the
13964         simpler 29.
13965
13966         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13967         which fixes bug 51347.
13968
13969 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13970
13971         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13972         which fixes the -warnaserror command line option.
13973
13974 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * cfold.cs (DoNumericPromotions): During constant folding of
13977         additions on UIntConstant, special case intconstants with
13978         IntConstants like we do on the expression binary operator. 
13979
13980 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13981
13982         * convert.cs (ImplicitReferenceConversion): We were missing a case
13983         (System.Enum are not value types or class types, so we need to
13984         classify them separatedly).
13985
13986         * driver.cs: We do not support error 2007.
13987
13988 2003-11-12 Jackson Harper <jackson@ximian.com>
13989
13990         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13991         system directory. Also use the full file name so users can
13992         libraries names mscorlib-o-tron.dll in a non system dir.
13993
13994 2003-11-10  Martin Baulig  <martin@ximian.com>
13995
13996         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13997         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13998         calling `ResolveType()' on them, directly assign their `Type'.
13999
14000 2003-11-08  Martin Baulig  <martin@ximian.com>
14001
14002         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
14003         return value and the `out parent' parameter.
14004         (TypeContainer.DefineType): Moved the CS0644 check into
14005         GetClassBases().  Don't pass the interface types to the
14006         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
14007         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
14008
14009         * ecore.cs (TypeExpr.IsAttribute): New property.
14010         (TypeExpr.GetInterfaces): New method.
14011
14012         * interface.cs (Interface.GetInterfaceTypeByName): Return a
14013         TypeExpr instead of a Type.
14014         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
14015         (Interface.DefineType): Don't pass the interface types to the
14016         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
14017         them later and then call `TypeBulider.AddInterfaceImplementation()'.
14018
14019         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
14020         instead of a `Type[]'.
14021         (TypeManager.RegisterBuilder): Likewise.
14022         (TypeManager.AddUserInterface): Likewise.
14023         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
14024         `Type[]' and also return a `TypeExpr[]'.
14025         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14026
14027 2003-11-08  Martin Baulig  <martin@ximian.com>
14028
14029         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14030         Expression.     
14031
14032 2003-11-08  Martin Baulig  <martin@ximian.com>
14033
14034         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14035         TypeManager.ResolveExpressionTypes().
14036
14037         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14038         instead of an Expression.
14039         (TypeExpr): This is now an abstract base class for `TypeExpression'.
14040         (TypeExpression): New public class; formerly known as `TypeExpr'.
14041
14042         * expression.cs (ComposedCast): Derive from TypeExpr.
14043
14044         * typemanager.cs (TypeManager.system_*_expr): These are now
14045         TypExpr's instead of Expression's.
14046         (TypeManager.ResolveExpressionTypes): New public static function;
14047         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14048         of them.        
14049
14050 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
14051
14052         * expression.cs (New.DoResolve): Do not dereference value that
14053         might be a null return.
14054
14055         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14056         sure that the constant value has the right type.  Fixes an
14057         unreported bug, similar to 50425.
14058
14059         * const.cs (Const.LookupConstantValue): Call
14060         ImplicitStandardConversionExists before doing a conversion to
14061         avoid havng the TypeManager.ChangeType do conversions.
14062
14063         Reduced the number of casts used
14064
14065         (Const.ChangeType): New routine to enable reuse of the constant
14066         type changing code from statement.
14067
14068         * typemanager.cs (ChangeType): Move common initialization to
14069         static global variables.
14070
14071         Fixes #50425.
14072
14073         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14074         every value type to go through, even if it was void.  Fix that. 
14075
14076         * cs-tokenizer.cs: Use is_identifier_start_character on the start
14077         character of the define, and the is_identifier_part_character for
14078         the rest of the string.
14079
14080 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
14081
14082         * expression.cs (UnaryMutator.EmitCode): When I updated
14083         LocalVariableReference.DoResolve, I overdid it, and dropped an
14084         optimization done on local variable references.
14085
14086 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * ecore.cs: Convert the return from Ldlen into an int.
14089
14090 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
14091
14092         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14093         the accessibility, this is a special case for toplevel non-public
14094         classes (internal for instance).
14095
14096 2003-10-20  Nick Drochak <ndrochak@gol.com>
14097
14098         * ecore.cs: Fix typo and build.  Needed another right paren.
14099
14100 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
14101
14102         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
14103         `internal' case regular and protected, but not allowing protected
14104         to be evaluated later.  Bug 49840
14105
14106 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
14107
14108         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14109         to kb.Nlast, and not the kb.nFirst to isolate the switch
14110         statement.
14111
14112         Extract the underlying type, so enumerations of long/ulong are
14113         treated like long/ulong.
14114
14115 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14116
14117         * expression.cs (New): Overload the meaning of RequestedType to
14118         track the possible creation of the NewDelegate type, since
14119         DoResolve is invoked more than once for new constructors on field
14120         initialization.
14121
14122         See bugs: #48800 and #37014
14123
14124         * cs-parser.jay (declare_local_constants): Take an arraylist
14125         instead of a single constant.
14126
14127         (local_constant_declaration): It should take a
14128         constant_declarators, not a constant_declarator.  Fixes 49487
14129
14130         * convert.cs: Fix error report.
14131
14132 2003-10-13 Jackson Harper <jackson@ximian.com>
14133
14134         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14135         bug #49611
14136
14137 2003-10-09  Martin Baulig  <martin@ximian.com>
14138
14139         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14140         to the .ctor.
14141         (MethodCore.DoDefineParameters): Removed the TypeContainer
14142         argument; use the DeclSpace which was passed to the .ctor instead.
14143         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14144         TypeContainer; we only need a DeclSpace here.
14145
14146 2003-10-09  Martin Baulig  <martin@ximian.com>
14147
14148         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14149         to the .ctor.
14150         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14151         EmitContext's .ctor.    
14152
14153 2003-10-09  Martin Baulig  <martin@ximian.com>
14154
14155         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14156         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14157         AsAccessible(), moved them as well.
14158
14159         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14160
14161 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14162
14163         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14164
14165 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14166
14167         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14168         generation for >=, as spotted by Paolo, bug 48679.  
14169         Patch from David Waite.
14170
14171         * cs-tokenizer.cs: Add handling for #pragma.
14172
14173         * cs-parser.jay: Allow for both yield and yield return in the
14174         syntax.  The anti-cobolization of C# fight will go on!
14175
14176         * class.cs (TypeBuilder.DefineType): Catch error condition here
14177         (Parent.DefineType erroring out and returning null).
14178
14179         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14180         coping with enumerations variables, we were mistakenly processing
14181         them as a regular value type instead of built-in types.  Fixes the
14182         bug #48063
14183
14184         * typemanager.cs (IsBuiltinOrEnum): New method.
14185
14186 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14187
14188         * cs-parser.jay: Upgrade: yield now needs the return clause.
14189
14190 2003-09-19  Martin Baulig  <martin@ximian.com>
14191
14192         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14193         `MemberCache parent' argument.  Normally, an interface doesn't
14194         have a parent type except System.Object, but we use this in gmcs
14195         for generic type parameters.
14196
14197 2003-09-18  Martin Baulig  <martin@ximian.com>
14198
14199         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14200         on `type.IsInterface'; don't check whether the type has a parent
14201         to determine whether it's an interface.
14202
14203 2003-09-15  Martin Baulig  <martin@ximian.com>
14204
14205         * class.cs (TypeContainer.DefineType): Added an error flag to
14206         avoid reporting duplicate CS0146's ("class definition is
14207         circular.").
14208
14209         * driver.cs (Driver.MainDriver): Abort if
14210         RootContext.ResolveTree() reported any errors.
14211
14212 2003-09-07  Martin Baulig  <martin@ximian.com>
14213
14214         * report.cs (Error, Warning): Added overloaded versions which take
14215         a `params object[] args' and call String.Format().
14216
14217 2003-09-07  Martin Baulig  <martin@ximian.com>
14218
14219         * decl.cs (DeclSpace..ctor): Don't call
14220         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14221         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14222         (DeclSpace.RecordDecl): New method.
14223
14224         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14225
14226 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14227
14228         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14229         value attributes to be applied to ParameterBuilders.
14230
14231         * class.cs (MethodCore.LabelParameters): Make static and more
14232         generic so that it can be used from other places - like interface
14233         methods, for instance.
14234
14235         * interface.cs (Interface.Emit): Call LabelParameters before
14236         emitting attributes on the InterfaceMethod.
14237
14238 2003-08-26  Martin Baulig  <martin@ximian.com>
14239
14240         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14241         resolving aliases; fixes #47927.
14242
14243 2003-08-26  Martin Baulig  <martin@ximian.com>
14244
14245         * statement.cs (Using.DoResolve): This is internally emitting a
14246         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14247         do not always return.  Fixes #47681.
14248
14249 2003-08-26  Martin Baulig  <martin@ximian.com>
14250
14251         * decl.cs (MemberCore): Moved WarningNotHiding(),
14252         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14253         into MemberBase.
14254         (AdditionResult): Make this nested in DeclSpace.
14255         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14256         argument; call NamespaceEntry.Define() unless we're nested in a
14257         class or struct.
14258
14259         * namespace.cs (Namespace.DefineName): New public function.  This
14260         is called from DeclSpace's .ctor to add 
14261         (Namespace.Lookup): Include DeclSpaces in the lookup.
14262
14263         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14264
14265         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14266
14267 2003-08-25  Martin Baulig  <martin@ximian.com>
14268
14269         * convert.cs (Convert.ExplicitReferenceConversion): When
14270         converting from an interface type to a class, unbox if the target
14271         type is a struct type.  Fixes #47822.
14272
14273 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14274
14275         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14276         #47854.
14277
14278 2003-08-22  Martin Baulig  <martin@ximian.com>
14279
14280         * class.cs (TypeManager.DefineType): When defining a nested type,
14281         call DefineType() on our parent; fixes #47801.
14282
14283 2003-08-22  Martin Baulig  <martin@ximian.com>
14284
14285         * class.cs (MethodData.Define): While checking if a method is an
14286         interface implementation, improve the test a bit more to fix #47654.
14287
14288 2003-08-22  Martin Baulig  <martin@ximian.com>
14289
14290         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14291         correctly; fixes #47722.
14292
14293 2003-08-22  Martin Baulig  <martin@ximian.com>
14294
14295         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14296         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14297
14298         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14299
14300 2003-08-22  Martin Baulig  <martin@ximian.com>
14301
14302         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14303         can only be assigned in static constructors.  Fixes #47161.
14304
14305 2003-08-22  Martin Baulig  <martin@ximian.com>
14306
14307         Rewrote and improved the flow analysis code.
14308
14309         * flowbranching.cs (FlowBranching): Make this class abstract.
14310         (FlowBranching.CreateBranching): New static function to create a
14311         new flow branching.
14312         (FlowBranchingBlock, FlowBranchingException): New classes.
14313         (FlowBranching.UsageVector.Type): New public readonly field.
14314         (FlowBranching.UsageVector.Breaks): Removed the setter.
14315         (FlowBranching.UsageVector.Returns): Removed the setter.
14316         (FlowBranching.UsageVector): Added Break(), Return(),
14317         NeverReachable() and Throw() methods to modify the reachability.
14318         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14319         done by FlowBranching.Merge().
14320         (FlowBranching.UsageVector.MergeChild): New method; merges the
14321         merge result into the current vector.
14322         (FlowBranching.Merge): New abstract method to merge a branching.
14323
14324 2003-08-12  Martin Baulig  <martin@ximian.com>
14325
14326         * expression.cs (Indirection.CacheTemporaries): Create the
14327         LocalTemporary with the pointer type, not its element type.
14328
14329 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14330
14331         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14332         token was a keyword or not.
14333
14334         Add `error' options where an IDENTIFIER was expected;  Provide
14335         CheckToken and CheckIdentifierToken convenience error reporting
14336         functions. 
14337
14338         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14339
14340         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14341         NameSpaceEntry NameSpaceEntry.
14342
14343         (LookupInterfaceOrClass): Avoid creating a full qualified name
14344         from namespace and name: avoid doing lookups when we know the
14345         namespace is non-existant.   Use new Tree.LookupByNamespace which
14346         looks up DeclSpaces based on their namespace, name pair.
14347
14348         * driver.cs: Provide a new `parser verbose' to display the
14349         exception thrown during parsing.  This is turned off by default
14350         now, so the output of a failure from mcs is more graceful.
14351
14352         * namespace.cs: Track all the namespaces defined in a hashtable
14353         for quick lookup.
14354
14355         (IsNamespace): New method
14356
14357 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14358
14359         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14360         we know that we need to concatenate (full typename can never be
14361         null). 
14362
14363         * class.cs: ditto.
14364
14365         * statement.cs: Use a bitfield;  Do not initialize to null things
14366         which are done by the constructor by default.
14367
14368         * cs-parser.jay: bug fix, parameter was 4, not 3.
14369
14370         * expression.cs: Just use the property;
14371
14372         * statement.cs: No need for GetVariableInfo method.
14373
14374 2003-08-08  Martin Baulig  <martin@ximian.com>
14375
14376         * flowanalysis.cs (FlowReturns): This is now nested in the
14377         `FlowBranching' class.
14378         (MyBitVector): Moved this here from statement.cs.
14379         (FlowBranching.SiblingType): New enum type.
14380         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14381
14382 2003-08-07  Martin Baulig  <martin@ximian.com>
14383
14384         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14385         `FlowBranching' class and called `BranchingType'.
14386
14387 2003-08-07  Martin Baulig  <martin@ximian.com>
14388
14389         * flowanalysis.cs: Moved all the control flow analysis code into
14390         its own file.
14391
14392 2003-08-07  Martin Baulig  <martin@ximian.com>
14393
14394         * assign.cs (Assign.DoResolve): `target' must either be an
14395         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14396         #37319.
14397
14398 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14399
14400         * expression.cs (BinaryMethod): This kind of expression is created by the
14401         Binary class if it determines that the operator has to be handled
14402         by a method.
14403
14404         (BinaryDelegate): This kind of expression is created if we are
14405         dealing with a + or - operator on delegates.
14406
14407         (Binary): remove method, argumetns, and DelegateOperator: when
14408         dealing with methods, 
14409
14410         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14411
14412         * statement.cs (Block): use bitfields for the three extra booleans
14413         we had in use.   Remove unused topblock parameter.
14414
14415         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14416
14417         * assign.cs: Drop extra unneeded tests.
14418
14419 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14420
14421         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14422
14423         * statement.cs (Foreach): Use VariableStorage instead of
14424         LocalBuilders.   
14425
14426         * codegen.cs (VariableStorage): New class used by clients that
14427         require a variable stored: locals or fields for variables that
14428         need to live across yield.
14429
14430         Maybe provide a convenience api for EmitThis+EmitLoad?
14431
14432         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14433         these bad boys.
14434
14435 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14436
14437         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14438         RemapParameterLValue): New methods that are used to turn a
14439         precomputed FieldInfo into an expression like this:
14440
14441                 instance.FieldInfo
14442
14443         The idea is to use this instead of making LocalVariableReference
14444         have more than one meaning.
14445
14446         * cs-parser.jay: Add error production to BASE.
14447
14448         * ecore.cs: Deal with TypeManager.GetField returning null, which
14449         is now a valid return value.
14450
14451         (FieldExprNoAddress): New expression for Fields whose address can
14452         not be taken.
14453
14454         * expression.cs (LocalVariableReference): During the resolve
14455         phases, create new expressions if we are in a remapping context.
14456         Remove code that dealt with remapping here.
14457
14458         (ParameterReference): same.
14459
14460         (ProxyInstance): New expression, like the `This' expression, but
14461         it is born fully resolved.  We know what we are doing, so remove
14462         the errors that are targeted to user-provided uses of `this'.
14463
14464         * statement.cs (Foreach): our variable is now stored as an
14465         Expression;  During resolution, follow the protocol, dont just
14466         assume it will return this.
14467
14468 2003-08-06  Martin Baulig  <martin@ximian.com>
14469
14470         * support.cs (SeekableStreamReader.cs): New public class.
14471
14472         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14473         SeekableStreamReader instead of the normal StreamReader.
14474
14475 2003-08-04  Martin Baulig  <martin@ximian.com>
14476
14477         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14478         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14479         deambiguate casts and delegate invocations.
14480         (parenthesized_expression): Use the new tokens to ensure this is
14481         not a cast of method invocation.
14482
14483         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14484         when reading a `)' and Deambiguate_CloseParens () was previously
14485         called.
14486
14487         * expression.cs (ParenthesizedExpression): New class.  This is
14488         just used for the CS0075 test.
14489         (Binary.DoResolve): Check for CS0075.   
14490
14491 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14492
14493         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14494         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14495         reference comparison.
14496
14497         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14498         examine the ReturnType for equality - this is necessary in the
14499         cases of implicit and explicit operators whose signature also
14500         includes the return type.
14501
14502 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14503
14504         * namespace.cs: Cache the result of the namespace computation,
14505         instead of computing it every time.
14506
14507 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * decl.cs: Use a global arraylist that we reuse over invocations
14510         to avoid excesive memory consumption.  Reduces memory usage on an
14511         mcs compile by one meg (45 average).
14512
14513         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14514         private, work around that.
14515
14516 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14517
14518         * literal.cs (IntLiteral): Define Zero and One static literals. 
14519
14520         * cs-parser.jay (integer_literal): use static literals to reduce
14521         memory usage for the most used literals (0, 1 and -1).  211kb
14522         reduced in memory usage.
14523
14524         Replace all calls to `new ArrayList' with `new
14525         ArrayList(4)' which is a good average number for most allocations,
14526         and also requires only 16 bytes of memory for its buffer by
14527         default. 
14528
14529         This reduced MCS memory usage in seven megabytes for the RSS after
14530         bootstrapping.
14531
14532 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14533
14534         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14535         handle params methods the correct way by forming only one
14536         applicable set with params and normal methods in them. Earlier we
14537         were looking at params methods only if we found no normal methods
14538         which was not the correct thing to do.
14539
14540         (Invocation.BetterFunction): Take separate arguments indicating
14541         when candidate and the best method are params methods in their
14542         expanded form.
14543
14544         This fixes bugs #43367 and #46199.
14545
14546         * attribute.cs: Documentation updates.
14547
14548         (CheckAttribute): Rename to CheckAttributeTarget.
14549         (GetValidPlaces): Rename to GetValidTargets.
14550
14551         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14552         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14553
14554         Fixes bug #44468.
14555
14556 2003-07-28  Martin Baulig  <martin@ximian.com>
14557
14558         * class.cs (TypeContainer.DefineMembers): Use the base type's full
14559         name when looking up the base class of a nested class.  Fixes #46977.
14560
14561 2003-07-26  Martin Baulig  <martin@ximian.com>
14562
14563         * expression.cs (Indexers.Indexer): New nested struct; contains
14564         getter, setter and the indexer's type.
14565         (Indexers.Properties): This is now an ArrayList of
14566         Indexers.Indexer's.
14567         (IndexerAccess.DoResolveLValue): Correctly set the type if the
14568         indexer doesn't have any getters.
14569
14570         * assign.cs (Assign.DoResolve): Also do the implicit conversions
14571         for embedded property and indexer assignments.
14572
14573 2003-07-26  Martin Baulig  <martin@ximian.com>
14574
14575         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
14576         preprocessor directive is not the first non-whitespace character
14577         on a line.
14578
14579 2003-07-26  Martin Baulig  <martin@ximian.com>
14580
14581         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
14582         namespace parsing, follow the spec more closely.
14583
14584         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
14585         NamespaceEntry.Lookup().
14586
14587 2003-07-25  Martin Baulig  <martin@ximian.com>
14588
14589         * MethodCore.cs (OverridesSomething): New public field; it's set
14590         from TypeContainer.DefineMembers if this method overrides
14591         something (which doesn't need to be a method).  Fix #39462.
14592
14593 2003-07-25  Ravi Pratap  <ravi@ximian.com>
14594
14595         * typemanager.cs (GetMembers): Ensure that the list of members is
14596         reversed. This keeps things in sync.
14597
14598         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
14599         find an AttributeUsage attribute.
14600
14601         * expression.cs (Invocation.OverloadResolve): Perform the check
14602         which disallows Invoke to be directly called on a Delegate.
14603
14604         (Error_InvokeOnDelegate): Report error cs1533.
14605
14606 2003-07-25  Martin Baulig  <martin@ximian.com>
14607
14608         * expression.cs (Indexers.GetIndexersForType): Only look in the
14609         interface hierarchy if the requested type is already an
14610         interface.  Fixes #46788 while keeping #46502 fixed.
14611
14612 2003-07-25  Martin Baulig  <martin@ximian.com>
14613
14614         * class.cs (TypeContainer.DefineMembers): Check whether all
14615         readonly fields have been assigned and report warning CS0649 if
14616         not.
14617
14618         * statement.cs (LocalInfo.IsFixed): Always return true if this is
14619         a valuetype.
14620
14621 2003-07-24  Ravi Pratap  <ravi@ximian.com>
14622
14623         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
14624         returned from GetMethods to make things consistent with the
14625         assumptions MCS makes about ordering of methods.
14626
14627         This should comprehensively fix bug #45127 and it does :-)
14628
14629         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
14630         ordering is actually reverse.
14631
14632         * Clean up some debug messages I left lying around.
14633
14634         * interface.cs (Populate*): Get rid of code which emits attributes
14635         since the stage in which we emit attributes is the 'Emit' stage,
14636         not the define stage.
14637
14638         (Emit): Move attribute emission for interface members here.
14639
14640 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14641
14642         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14643         closely: we eliminate methods in base types when we have an
14644         applicable method in a top-level type.
14645
14646         Please see section 14.5.5.1 for an exact description of what goes
14647         on. 
14648
14649         This fixes bug #45127 and a host of other related to corlib compilation.
14650
14651         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14652         array is the method corresponding to the top-level type (this is
14653         because of the changes made to icall.c) so we change this
14654         accordingly.
14655
14656         (MethodGroupExpr.Name): This too.
14657
14658         * typemanager.cs (GetElementType): New method which does the right
14659         thing when compiling corlib. 
14660
14661         * everywhere: Make use of the above in the relevant places.
14662
14663 2003-07-22  Martin Baulig  <martin@ximian.com>
14664
14665         * cs-parser.jay (invocation_expression): Moved
14666         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14667         `cast_expression', but create a InvocationOrCast which later
14668         resolves to either an Invocation or a Cast.
14669
14670         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14671         method; call this before EmitStatement() to make sure that this
14672         expression can be used as a statement.
14673
14674         * expression.cs (InvocationOrCast): New class; resolves to either
14675         an Invocation or a Cast.
14676
14677         * statement.cs (StatementExpression): Call ResolveStatement() on
14678         the ExpressionStatement before emitting it.
14679
14680 2003-07-21  Martin Baulig  <martin@ximian.com>
14681
14682         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14683         `ref' and `out' attributes match; fixes #46220.
14684         (MemberAccess.ResolveMemberAccess): You can't reference a type
14685         through an expression; fixes #33180.
14686         (Indexers.GetIndexersForType): Don't return the indexers from
14687         interfaces the class implements; fixes #46502.
14688
14689 2003-07-21  Martin Baulig  <martin@ximian.com>
14690
14691         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14692         CS0661 checks; fixes bug #30442.
14693
14694 2003-07-21  Martin Baulig  <martin@ximian.com>
14695
14696         * decl.cs (AdditionResult): Added `Error'.
14697
14698         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14699
14700         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14701         makes cs0031.cs actually work.
14702
14703 2003-07-20  Martin Baulig  <martin@ximian.com>
14704
14705         * namespace.cs: Fixed that bug which caused a crash when compiling
14706         the debugger's GUI.
14707
14708 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14709
14710         * typemanager.cs (LookupTypeReflection): Never expose types which
14711         are NotPublic, NestedPrivate, NestedAssembly, or
14712         NestedFamANDAssem.  We used to return these, and later do a check
14713         that would report a meaningful error, but the problem is that we
14714         would not get the real match, if there was a name override.
14715
14716 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14717
14718         * namespace.cs (Namespace, Name): Do not compute the namespace
14719         name dynamically, compute it in the constructor.  This reduced
14720         memory usage by 1697 KB.
14721
14722         * driver.cs: Use --pause to pause at the end.
14723
14724 2003-07-17  Peter Williams  <peter@newton.cx>
14725
14726         * Makefile: Change the name of the test target so that it doesn't
14727         conflict with the recursive test target.
14728
14729 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14730
14731         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14732         AddressOf): Do not use EmitThis, that was wrong, use the actual
14733         this pointer.
14734
14735 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * class.cs (MethodData.Define): While checking if a method is an
14738         interface implementation, improve the test: If we are not public
14739         (use new test here: use the computed MethodAttributes directly,
14740         instead of the parsed modifier flags) check if the `implementing'
14741         method comes from an interface or not.
14742
14743         * pending.cs (VerifyPendingMethods): Slightly better error
14744         message.
14745
14746         * makefile: add test target that does the mcs bootstrap.
14747
14748 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14749
14750         * interface.cs (Define): Do nothing here since there are no
14751         members to populate etc. Move the attribute emission out of here
14752         since this was just totally the wrong place to put it. Attribute
14753         application happens during the 'Emit' phase, not in the 'Define'
14754         phase.
14755
14756         (Emit): Add this method and move the attribute emission here
14757
14758         * rootcontext.cs (EmitCode): Call the Emit method on interface
14759         types too.
14760
14761 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14762
14763         * expression.cs (OverloadResolve): Report error only if Location
14764         is not 'Null' which means that there was a probe going on.
14765
14766 2003-07-14  Martin Baulig  <martin@ximian.com>
14767
14768         * expression.cs (ConditionalLogicalOperator): New public class to
14769         implement user defined conditional logical operators.
14770         This is section 14.11.2 in the spec and bug #40505.
14771
14772 2003-07-14  Martin Baulig  <martin@ximian.com>
14773
14774         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14775
14776 2003-07-14  Martin Baulig  <martin@ximian.com>
14777
14778         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14779
14780         * ecore.cs (IVariable.VerifyFixed): New interface method.
14781
14782         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14783         operator, check whether the variable is actually fixed.  Fixes bug
14784         #36055.  Set a variable definitely assigned when taking its
14785         address as required by the spec.
14786
14787         * statement.cs (LocalInfo.IsFixed): New field.
14788         (LocalInfo.MakePinned): Set `IsFixed' to true.
14789
14790 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14791
14792         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14793         for .ctors, ensure that we only ask for members declared in the
14794         attribute type (BindingFlags.DeclaredOnly).
14795
14796         Fixes bug #43632.
14797
14798         * expression.cs (Error_WrongNumArguments): Report error 1501
14799         correctly the way CSC does.
14800
14801 2003-07-13  Martin Baulig  <martin@ximian.com>
14802
14803         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14804         lookup on the fully qualified name, to make things like "X.X" work
14805         where "X.X" is a fully qualified type name, but we also have a
14806         namespace "X" in the using list.  Fixes #41975.
14807
14808 2003-07-13  Martin Baulig  <martin@ximian.com>
14809
14810         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14811         function. If we're a CompoundAssign, we need to create an embedded
14812         CompoundAssign, not an embedded Assign.
14813         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14814         Fixes #45854.
14815
14816 2003-07-13  Martin Baulig  <martin@ximian.com>
14817
14818         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14819         work to fix bug #46088.
14820
14821 2003-07-13  Ravi Pratap <ravi@ximian.com>
14822
14823         * class.cs (Operator.Emit): Do not emit attributes here - it is
14824         taken care of by the Method class that we delegate too. This takes
14825         care of bug #45876.
14826
14827 2003-07-10  Martin Baulig  <martin@ximian.com>
14828
14829         * expression.cs (TypeOfVoid): New class.
14830         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14831
14832 2003-07-10  Martin Baulig  <martin@ximian.com>
14833
14834         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14835         bug #35957.
14836
14837 2003-07-10  Martin Baulig  <martin@ximian.com>
14838
14839         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14840         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14841
14842         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14843
14844         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14845
14846 2003-07-10  Martin Baulig  <martin@ximian.com>
14847
14848         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14849         of decimal.  Fixes #42850.
14850
14851         NOTE: I also fixed the created byte blob, but this doesn't work on
14852         the MS runtime and csc never produces any byte blobs for decimal
14853         arrays.
14854
14855 2003-07-10  Martin Baulig  <martin@ximian.com>
14856
14857         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14858         structs; fixes #32068.
14859         (Block.AddChildVariableNames): Fixed #44302.
14860
14861 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14862
14863         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14864
14865 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14866
14867         * attribute.cs: And this test is onger needed.
14868
14869 2003-07-08  Martin Baulig  <martin@ximian.com>
14870
14871         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14872         inaccessible types.  Fixes #36313.
14873
14874         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14875
14876         * namespace.cs (NamespaceEntry): Create implicit entries for all
14877         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14878         implicit entries for N1.N2 and N1.
14879
14880 2003-07-08  Martin Baulig  <martin@ximian.com>
14881
14882         Rewrote the handling of namespaces to fix a lot of the issues
14883         wrt. `using' aliases etc.
14884
14885         * namespace.cs (Namespace): Splitted this class into a
14886         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14887
14888         * typemanager.cs (TypeManager.IsNamespace): Removed.
14889         (TypeManager.ComputeNamespaces): Only compute namespaces from
14890         loaded assemblies here, not the namespaces from the assembly we're
14891         currently compiling.
14892
14893 2003-07-08  Martin Baulig  <martin@ximian.com>
14894
14895         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14896
14897 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14898
14899         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14900         already fixed it.  
14901
14902         I thought about the memory savings here, but LookupTypeReflection
14903         is used under already very constrained scenarios.  Compiling
14904         corlib or mcs only exposes one hit, so it would not really reduce
14905         any memory consumption.
14906
14907 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14908
14909         * typemanager.cs: fixes bug #45889 by only adding public types from
14910         other assemblies to the list of known types.
14911
14912 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14913
14914         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14915         on the type we resolved.
14916
14917 2003-07-05  Martin Baulig  <martin@ximian.com>
14918
14919         * pending.cs (PendingImplementation.ParentImplements): Don't
14920         create the proxy if the parent is abstract.
14921
14922         * class.cs (TypeContainer.DefineIndexers): Process explicit
14923         interface implementations first.  Fixes #37714.
14924
14925 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14926
14927         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14928         defined recursively;  but since we modify the input parameters
14929         (left is set to `this' temporarily), we reset this value if the
14930         left_is_explicit is false, which gives the original semantics to
14931         the code.  
14932
14933         * literal.cs (NullPointer): new class used to represent a null
14934         literal in a pointer context.
14935
14936         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14937         type is a pointer, use a NullPointer object instead of a
14938         NullLiteral.   Closes 43687
14939
14940         (ExplicitConversion): Convert pointer values using
14941         the conv opcode to the proper type.
14942
14943         * ecore.cs (New): change ValueTypeVariable property into a method,
14944         that returns whether the valuetype is suitable for being used.
14945
14946         * expression.cs (Binary.DoNumericPromotions): Only return if we
14947         the int constant was a valid uint, and we can return both left and
14948         right as uints.  If not, we continue processing, to trigger the
14949         type conversion.  This fixes 39018.
14950
14951         * statement.cs (Block.EmitMeta): During constant resolution, set
14952         the CurrentBlock property on the emitcontext, so that we resolve
14953         constants propertly.
14954
14955 2003-07-02  Martin Baulig  <martin@ximian.com>
14956
14957         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14958         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14959
14960         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14961         than emitting it here.
14962
14963         * statement.cs: Fixed some more flow analysis bugs.
14964
14965 2003-07-02  Martin Baulig  <martin@ximian.com>
14966
14967         * class.cs (MethodData.Define): When implementing interface
14968         methods, set Final unless we're Virtual.
14969
14970         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14971         check work for interface methods.
14972
14973 2003-07-01  Martin Baulig  <martin@ximian.com>
14974
14975         * ecore.cs (EmitContext.This): Replaced this property with a
14976         GetThis() method which takes a Location argument.  This ensures
14977         that we get the correct error location for a CS0188.
14978
14979 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14980
14981         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14982         ImplicitStandardConversion.
14983
14984         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14985
14986 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14987
14988         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14989         optimization.
14990
14991 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14992
14993         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14994         constructors.
14995
14996         (MethodData.Define): Turn off initlocals for unsafe methods.
14997
14998 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14999
15000         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15001         complete;  Fixes #37521.
15002
15003         * delegate.cs: Use Modifiers.TypeAttr to compute the
15004         TypeAttributes, instead of rolling our own.  This makes the flags
15005         correct for the delegates.
15006
15007 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15008
15009         * class.cs (Constructor.Define): Set the private flag for static
15010         constructors as well.
15011
15012         * cs-parser.jay (statement_expression): Set the return value to
15013         null, to avoid a crash when we catch an error.
15014
15015 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15016
15017         * cs-parser.jay: Applied patch from Jackson that adds support for
15018         extern and unsafe modifiers to destructor declarations.
15019
15020         * expression.cs: Report error 21 if the user is trying to index a
15021         System.Array.
15022
15023         * driver.cs: Add an error message, suggested by the bug report.
15024
15025         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15026         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15027
15028 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15029
15030         * namespace.cs: Add some information to reduce FAQs.
15031
15032 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15033
15034         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15035         underlying enumeration types.  Fixes #43915.
15036
15037         * expression.cs: Treat ushort/short as legal values to be used in
15038         bitwise operations.
15039
15040 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15041
15042         * delegate.cs: transfer custom attributes for paramenters from
15043         the delegate declaration to Invoke and BeginInvoke.
15044
15045 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15046
15047         * attribute.cs: handle custom marshalers and emit marshal info
15048         for fields, too.
15049
15050 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15051
15052         * makefile.gnu: Added anonymous.cs to the compiler sources.
15053
15054 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15055
15056         * iterators.cs: Change the name of the proxy class to include two
15057         underscores.
15058
15059         * cs-parser.jay: Update grammar to include anonymous methods.
15060
15061         * anonymous.cs: new file.
15062
15063 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * class.cs (Field.Define): Add missing test for pointers and
15066         safety. 
15067
15068 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15069
15070         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15071         we use the stobj opcode.
15072
15073         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15074         since it wasn't the correct fix. 
15075
15076         It still is puzzling that we are required to use stobj for IntPtr
15077         which seems to be a ValueType.
15078
15079 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15080
15081         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15082         during regular simple name resolution.   Now, the trick is that
15083         instead of returning for processing the simplename, we do a
15084         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15085         contextual lookup type).   If a match is found, return that, if
15086         not, return for further composition.
15087
15088         This fixes long-standing 30485.
15089
15090         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15091         using the address to initialize an object, do an Stobj instead of
15092         using the regular Stelem.
15093
15094         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15095         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15096         Because if we are a BaseIndexerAccess that value will be true.
15097         Fixes 43643.
15098
15099         * statement.cs (GotoCase.Resolve): Return after reporting an
15100         error, do not attempt to continue. 
15101
15102         * expression.cs (PointerArithmetic.Emit): If our operand is a
15103         long, convert our constants to match the operand before
15104         multiplying.  Convert to I type before adding.   Fixes 43670.
15105
15106 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15107
15108         * enum.cs (ImplicitConversionExists) : Rename to
15109         ImplicitEnumConversionExists to remove ambiguity. 
15110
15111         * ecore.cs (NullCast): New type of cast expression class which
15112         basically is very similar to EmptyCast with the difference being
15113         it still is a constant since it is used only to cast a null to
15114         something else
15115         (eg. (string) null)
15116
15117         * convert.cs (ImplicitReferenceConversion): When casting a null
15118         literal, we return a NullCast.
15119
15120         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15121         should be around anymore.
15122
15123         The renaming (reported was slightly wrong). Corrections:
15124
15125         ConvertImplicitStandard -> ImplicitConversionStandard
15126         ConvertExplicitStandard -> ExplicitConversionStandard
15127
15128         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15129         before passing them in !
15130
15131         * convert.cs (ImplicitConversionStandard): When comparing for
15132         equal expr and target types, ensure that expr is not a
15133         NullLiteral.
15134
15135         In general, we must not be checking (expr_type ==
15136         target_type) in the top level conversion methods
15137         (ImplicitConversion, ExplicitConversion etc). This checking is
15138         done in the methods that they delegate to.
15139
15140 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15141
15142         * convert.cs: Move Error_CannotConvertType,
15143         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15144         ImplicitNumericConversion, ImplicitConversionExists,
15145         ImplicitUserConversionExists, StandardConversionExists,
15146         FindMostEncompassedType, FindMostSpecificSource,
15147         FindMostSpecificTarget, ImplicitUserConversion,
15148         ExplicitUserConversion, GetConversionOperators,
15149         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15150         TryImplicitIntConversion, Error_CannotConvertImplicit,
15151         ConvertImplicitRequired, ConvertNumericExplicit,
15152         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15153         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15154         its own file.
15155
15156         Perform the following renames:
15157
15158         StandardConversionExists -> ImplicitStandardConversionExists
15159         ConvertImplicit -> ImplicitConversion
15160         ConvertImplicitStandard -> ImplicitStandardConversion
15161         TryImplicitIntConversion -> ImplicitIntConversion
15162         ConvertImplicitRequired -> ImplicitConversionRequired
15163         ConvertNumericExplicit -> ExplicitNumericConversion
15164         ConvertReferenceExplicit -> ExplicitReferenceConversion
15165         ConvertExplicit -> ExplicitConversion
15166         ConvertExplicitStandard -> ExplicitStandardConversion
15167
15168 2003-05-19  Martin Baulig  <martin@ximian.com>
15169
15170         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15171         (TypeInfo): Added support for structs having structs as fields.
15172
15173         * ecore.cs (FieldExpr): Implement IVariable.
15174         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15175         VariableInfo for the field.
15176
15177 2003-05-18  Martin Baulig  <martin@ximian.com>
15178
15179         * expression.cs (This.DoResolve): Report a CS0027 if we're
15180         emitting a field initializer.
15181
15182 2003-05-18  Martin Baulig  <martin@ximian.com>
15183
15184         * expression.cs (This.ResolveBase): New public function.
15185         (This.DoResolve): Check for CS0188.
15186
15187         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15188         This.Resolve().
15189
15190         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15191         `instance_expression' to null if we don't have any non-static
15192         methods.
15193
15194 2003-05-18  Martin Baulig  <martin@ximian.com>
15195
15196         Reworked the way how local variables and parameters are handled by
15197         the flow analysis code.
15198
15199         * statement.cs (TypeInfo, VariableMap): New public classes.
15200         (VariableInfo): New public class.  This is now responsible for
15201         checking whether a variable has been assigned.  It is used for
15202         parameters and local variables.
15203         (Block.EmitMeta): Take the InternalParameters as argument; compute
15204         the layout of the flow vectors here.
15205         (Block.LocalMap, Block.ParameterMap): New public properties.
15206         (FlowBranching): The .ctor doesn't get the InternalParameters
15207         anymore since Block.EmitMeta() now computes the layout of the flow
15208         vector.
15209         (MyStructInfo): This class is now known as `StructInfo' and nested
15210         in `TypeInfo'; we don't access this directly anymore.
15211
15212         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15213         property and removed IsAssigned(), IsFieldAssigned(),
15214         SetAssigned() and SetFieldAssigned(); we now call them on the
15215         VariableInfo so we don't need to duplicate this code everywhere.
15216
15217         * expression.cs (ParameterReference): Added `Block block' argument
15218         to the .ctor.
15219         (LocalVariableReference, ParameterReference, This): The new
15220         VariableInfo class is now responsible for all the definite
15221         assignment stuff.
15222
15223         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15224         IsParameterAssigned, SetParameterAssigned): Removed.
15225
15226 2003-05-18  Martin Baulig  <martin@ximian.com>
15227
15228         * typemanager.cs (InitCoreTypes): Try calling
15229         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15230         the 3-args-version.  Corlib now also needs our `void_type'.
15231         (GetMethod): Added overloaded version which takes an optional
15232         `bool report_errors' to allow lookups of optional methods.
15233
15234 2003-05-12  Martin Baulig  <martin@ximian.com>
15235
15236         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15237         only used for locals and not for parameters.
15238
15239 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15240
15241         * support.cs (InternalParameters.ParameterType): Return the
15242         ExternalType of the parameter.
15243
15244         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15245         they were unused.
15246
15247 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15248
15249         * class.cs (MethodData.Define): Do not set the `newslot' on
15250         interface members, if they are also flagged as "override".
15251
15252         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15253         better code for ++i and i++.  This only works for static fields
15254         and local variables.
15255
15256         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15257         want to pull the DeclSpace out of the builder_to_declspace instead
15258         of the TypeBuilder (like in TypeContainer.FindMembers).
15259
15260         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15261         instead of LookupTypeContainer.  Fixes the crash on .NET for
15262         looking up interface members.
15263
15264         * const.cs: Create our own emit context during the Definition
15265         stage, so that constants are evaluated in the proper context, when
15266         a recursive definition happens.
15267
15268 2003-05-11  Martin Baulig  <martin@ximian.com>
15269
15270         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15271         new block for a switch section.
15272         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15273         the adding/lookup in the switch block.  Fixes #39828.
15274
15275 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15276
15277         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15278         functionality: I needed to convert the data after I had performed
15279         the add/sub operation into the operands type size.
15280
15281         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15282         pass the type for the box operation, otherwise the resulting
15283         object would have been of type object.
15284
15285         (BoxedCast): Add constructor to specify the type to box as.
15286
15287 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15288
15289         * iterators.cs: I was reusing the `count' variable inadvertently,
15290         take steps to not allow this to happen.
15291
15292 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15293
15294         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15295         by creating an array at the point where the params starts and
15296         putting all those arguments there, then adjusting the size of the
15297         array.
15298
15299 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15300
15301         * expression.cs (New.AddressOf): Implement interface
15302         IMemoryLocation.  This is used when the `new' operator is used in
15303         the context of an invocation to a method on a value type.
15304
15305         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15306         example. 
15307
15308         * namespace.cs: Also check the using aliases here.
15309
15310         * driver.cs: Move the test for using validity after the types have
15311         been entered, so we do a single pass that also includes the using
15312         aliases. 
15313
15314         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15315         in the regular case.   CreateSiblingForFinally is doing extra
15316         error checking.
15317
15318         * attribute.cs (GetAttributeArgumentExpression): Store the result
15319         on an out value, and use the return value to indicate failure
15320         instead of using null (which is a valid return for Constant.GetValue).
15321
15322         * statement.cs: Perform the analysis flow for the increment
15323         portion after the statement, because this will be the real flow of
15324         execution.  Fixes #42385
15325
15326         * codegen.cs (EmitContext.EmitArgument,
15327         EmitContext.EmitStoreArgument): New helper functions when the
15328         RemapToProxy flag is set.
15329
15330         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15331         function.
15332
15333         Add support for remapping parameters. 
15334
15335         * iterators.cs: Propagate parameter values;  Store parameter
15336         values in the proxy classes.
15337
15338 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15339
15340         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15341         need a proxy reference;  I do not know what I was thinking
15342
15343         * cs-parser.jay (constructor_initializer): catch another error,
15344         and display nice message.
15345
15346         (field_declaration): catch void field declaration
15347         to flag a better error. 
15348
15349         * class.cs (MemberBase.CheckBase): Report an error instead of a
15350         warning if a new protected member is declared in a struct. 
15351         (Field.Define): catch the error of readonly/volatile.
15352
15353         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15354
15355         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15356         volatile variable is taken
15357
15358 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15359
15360         * statement.cs (Fixed.Resolve): Report an error if we are not in
15361         an unsafe context.
15362
15363 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15364
15365         * typemanager.cs: reuse the code that handles type clashes for
15366         delegates and enumerations.
15367
15368         * class.cs (Report28): Always report.
15369
15370         * expression.cs (EncodeAsAttribute): Allow nulls here.
15371
15372 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15373
15374         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15375         the functionality for testing whether an expression is valid for
15376         an attribute here.  Also handle the case of arrays of elements
15377         being stored. 
15378
15379         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15380         encoding a linear array into an array of objects that are suitable
15381         to be passed to an CustomAttributeBuilder.
15382
15383         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15384
15385         * ecore.cs: (FieldExpr): Handle field remapping here.
15386
15387         * iteratators.cs: Pass the instance variable (if the method is an
15388         instance method) to the constructors, so we can access the field
15389         variables on the class.
15390
15391         TODO: Test this with structs.  I think the THIS variable on
15392         structs might have to be a pointer, and not a refenrece
15393
15394 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15395
15396         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15397         local variables to fields in a proxy class.
15398
15399         * iterators.cs (PopulateProxy): Rename our internal fields to
15400         <XXX>.  
15401         Create a <THIS> field if we are an instance method, so we can
15402         reference our parent container variables.
15403         (MapVariable): Called back from the EmitContext code to enter a
15404         new variable to field mapping into the proxy class (we just create
15405         a FieldBuilder).
15406
15407         * expression.cs
15408         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15409         for using the remapped locals to fields.
15410
15411         I placed the code here, because that gives the same semantics to
15412         local variables, and only changes the Emit code.
15413
15414         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15415         statements inside iterators.
15416         (VariableInfo): Add a FieldBuilder for the cases when we are
15417         remapping local variables to fields in a proxy class
15418
15419         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15420         current_block != null.
15421
15422         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15423         not cope with strings, as it has been moved to the
15424         TableSwitchEmit.  Fixed bug in switch generation.
15425
15426         * expression.cs (New.DoResolve): Provide more context for the user
15427         when reporting an error.
15428
15429         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15430         pointers. 
15431
15432         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15433         check the permissions for it.  Note than in a type-resolution
15434         context the check was already present in DeclSpace.ResolveType,
15435         but was missing from the MemberAccess.
15436
15437         (ArrayCreation.CheckIndices): warn if the user has
15438         more nested levels of expressions, but there are no more
15439         dimensions specified.  Avoids crash on bug 41906.
15440
15441 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15442
15443         * statement.cs (Block): replace Implicit bool, for a generic
15444         flags.   
15445         New flag: `Unchecked'.  This is used during the EmitMeta phase
15446         (which is out-of-line with the regular Resolve/Emit process for a
15447         statement, as this is done ahead of time, but still gets a chance
15448         to call constant resolve).
15449
15450         (Block.Flags): new enum for adding a new flag.
15451
15452         (Block.EmitMeta): track the state of unchecked.
15453
15454         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15455         to enable constant resolution to work there as well.
15456
15457 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15458
15459         * typemanager.cs (ienumerable_type): Also look up
15460         System.Collections.IEnumerable. 
15461
15462 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15463
15464         TODO: Test more than one conditional per method.
15465
15466         * class.cs (Indexer.Define): Report the location where the user is
15467         referencing the unsupported feature.
15468
15469         (MethodData): Overload the use of `conditionals' to
15470         minimize the creation of needless ArrayLists.   This saves roughly
15471         212kb on my machine.
15472
15473         (Method): Implement the new IIteratorContainer interface.
15474         (Method.SetYields): Implement the method by setting the ModFlags
15475         to contain METHOD_YIELDS.
15476
15477         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15478         which just got set to null.
15479
15480         * iterators.cs: New file.
15481
15482         (Yield, YieldBreak): New statements.
15483
15484         * statement.cs (Return.Resolve): Flag an error if we are used in
15485         an iterator method.
15486
15487         * codegen.cs (InIterator): New flag set if the code is being
15488         compiled in an iterator method.
15489
15490         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15491         internal modifier, and we just use it to avoid adding extra
15492         fields, as this is seldom used.  
15493
15494         * cs-parser.jay: Add yield_statement (yield and yield break).
15495
15496         * driver.cs: New flag -v2 to turn on version 2 features. 
15497
15498         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15499         hashtable when v2 is enabled.
15500
15501 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15502
15503         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15504         there is already a namespace defined with this name.
15505
15506         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15507         people upgraded their corlibs.
15508
15509         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15510         always use fully qualified types, no need to use the compiler
15511         front end.
15512
15513         (TypeManager.IsNamespace): Use binarysearch.
15514
15515         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15516         AddDelegate): I did not quite use the new IsValid API properly: I
15517         have to pass the short-name and the fullname.  I was passing only
15518         the basename instead of the fullname sometimes. 
15519
15520         (TypeContainer.DefineType): call NamespaceClash.
15521
15522         * interface.cs (Interface.DefineType): use NamespaceClash before
15523         defining the type.
15524
15525         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15526         defining the type.
15527
15528         * enum.cs: (Enum.DefineType): use NamespaceClash before
15529         defining the type.
15530
15531         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15532         speed increase.  First, use the negative_hits cache when we get a
15533         negative.  Second, add the type with its full original name
15534         instead of the new . and + encoded name (reflection uses + to
15535         separate type from a nested type).  Use LookupTypeReflection
15536         directly which bypasses the type->name hashtable (that we already
15537         know does not contain the type.
15538
15539         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15540         location/container type. 
15541
15542         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15543
15544 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15547
15548         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15549         method is being referenced in the method group from a static
15550         context, and report error 120 if so.
15551
15552         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15553         Error118. 
15554
15555         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15556         is created, we create the A namespace).
15557
15558         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15559         Fixes #41591
15560
15561 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15562
15563         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15564         invocation to ModuleBuilder.GetType with the same values will
15565         return a new type instance, so we need to cache its return
15566         values. 
15567
15568         * expression.cs (Binary.ResolveOperator): Only allow the compare
15569         operators on enums if they are of the same type.
15570
15571         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15572         types of ValueType on their own case.  Before we were giving them
15573         the same treatment as objects.
15574
15575         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15576         fullname.  Short name is used to compare against container name.
15577         Fullname is used to check against defined namespace names.
15578
15579         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15580         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15581
15582         (Method.CheckBase): Call parent.
15583         (MemberBase.CheckBase): Check for protected members on sealed
15584         classes.
15585         (PropertyBase.CheckBase): Call parent.
15586         (Field.Define): Call parent.
15587
15588         * report.cs: Negative error codes are now mapped to 8000 - code,
15589         so that the display is render more nicely.
15590
15591         * typemanager.cs: Do not use try/catch, instead report a regular
15592         error. 
15593
15594         (GetPointerType, GetReferenceType): These methods provide
15595         mechanisms to obtain the T* and T& from a T.  We had the code
15596         previously scattered around the code base, and it also used
15597         TypeManager.LookupType that would go through plenty of caches.
15598         This one goes directly to the type source.
15599
15600         In some places we did the Type.GetType followed by
15601         ModuleBuilder.GetType, but not in others, so this unifies the
15602         processing as well.
15603
15604         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15605         statements now that we have namespace information.
15606
15607         * typemanager.cs (IsNamespace): New method, returns whether the
15608         string presented is a namespace or not.
15609
15610         (ComputeNamespaces): New public entry point, computes the list of
15611         available namespaces, using the GetNamespaces API call in Mono, or
15612         the slower version in MS.NET.   
15613
15614         Now before we start the semantic analysis phase, we have a
15615         complete list of namespaces including everything that the user has
15616         provided.
15617
15618         Deleted old code to cache namespaces in .nsc files.
15619
15620 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15621
15622         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15623         class/struct location definition Location for the implicit
15624         constructor location.
15625
15626         (Operator.Define): Use the location of the operator for the
15627         implicit Method definition.
15628
15629         (Constructor.Emit): use the constructor location for the implicit
15630         base initializer constructor.
15631
15632         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15633         and the Expression class now contains two new methods:
15634
15635         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15636         isolate type lookup from the rest of the resolution process.
15637
15638         Since we use Expressions to hold type definitions due to the way
15639         we parse the input we have historically overloaded Resolve to
15640         perform the Type lookups if a special flag is passed.  Now this is
15641         eliminated and two methods take their place. 
15642
15643         The differences in the two methods between xStep and xTerminal is
15644         that xStep is involved in our current lookup system that uses
15645         SimpleNames to compose a name, while xTerminal is used just to
15646         catch the case where the simplename lookup failed.
15647
15648 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15649
15650         * expression.cs (ResolveMemberAccess): Remove redundant code.
15651         TypeExpr expressions are always born fully resolved.
15652
15653         * interface.cs (PopulateMethod): Do not lookup the types twice.
15654         We were doing it once during SemanticAnalysis and once during
15655         PopulateMethod.
15656
15657         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15658         in local variable type definitions, were being returned as a
15659         SimpleName (we decomposed everything into a string), that is
15660         because primary_expression was being used instead of a type in the
15661         grammar (reduce/reduce conflicts).
15662
15663         The part that was wrong is that we converted the expression into a
15664         string (an oversimplification in one hand, compounded with primary
15665         expressions doing string concatenation).
15666
15667         So things like:
15668
15669         A.B.C [] x;
15670
15671         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15672         using clauses from working on this particular context.  And a type
15673         was being matched directly against "A.B.C[]".
15674
15675         We now use the correct approach, and allow for ComposedCast to be
15676         part of the unary expression.  So the "A.B.C []" become a composed
15677         cast of "A.B.C" (as a nested group of MemberAccess with a
15678         SimpleName at the end) plus the rank composition "[]". 
15679
15680         Also fixes 35567
15681
15682 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15683
15684         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15685         for the access level checking.
15686
15687         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15688         `TypeContainer container', because I kept getting confused when I
15689         was debugging this code.
15690
15691         * expression.cs (Indexers): Instead of tracking getters/setters,
15692         we now track them in parallel.  We create one arraylist less, but
15693         most importantly it is possible now for the LValue code to find a
15694         matching get for a set.
15695
15696         (IndexerAccess.DoResolveLValue): Update the code.
15697         GetIndexersForType has been modified already to extract all the
15698         indexers from a type.  The code assumed it did not.
15699
15700         Also make the code set the correct return type for the indexer.
15701         This was fixed a long time ago for properties, but was missing for
15702         indexers.  It used to be void_type.
15703
15704         (Binary.Emit): Test first for doubles instead of
15705         floats, as they are more common.
15706
15707         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15708         when dealing with floats and the <=, >= operators.  This fixes bug
15709         #39314 
15710
15711         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15712         to load the array value by emitting a load on the foreach variable
15713         type.  This was incorrect.  
15714
15715         We now emit the code to load an element using the the array
15716         variable type, and then we emit the conversion operator.
15717
15718         Fixed #40176
15719
15720 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15721
15722         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15723
15724 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15725
15726         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15727         test for protection before we test for signatures. 
15728
15729         (MethodSignature.ToString): implement.
15730
15731         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15732         to the case where we reduced into a LongConstant.
15733
15734         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15735         depend on whether the information is acurrate, because the
15736         Microsoft runtime will always claim that the array type is public,
15737         regardless of the real state.
15738
15739         If the type is a pointer, another problem happens: the type is
15740         reported as non-public in Microsoft.  
15741
15742         In both cases we have to call CheckAccessLevel recursively with
15743         the underlying type as the argument to be tested.
15744
15745 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15746
15747         * assign.cs (Assign.Emit): If we are dealing with a compound
15748         assignment expression, we should use the code path that stores the
15749         intermediate result in a temporary value.  This fixes #40903.
15750
15751         *expression.cs (Indirection.ToString): Provide ToString method for
15752         debugging. 
15753
15754 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15755
15756         * class.cs: Null out fields holding references to Block objects so
15757         they can be garbage collected.
15758
15759         * expression.cs (OverloadResolve): Remove unused local.
15760
15761 2003-04-07  Martin Baulig  <martin@ximian.com>
15762
15763         * codegen.cs (EmitContext.CurrentFile): New public field.
15764         (EmitContext.Mark): Use the CurrentFile to check whether the
15765         location is in the correct file.
15766         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15767
15768 2003-04-07  Martin Baulig  <martin@ximian.com>
15769
15770         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15771
15772         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15773         location.  [FIXME: The location argument which gets passed to this
15774         method is sometimes wrong!]
15775
15776 2003-04-07  Nick Drochak <ndrochak@gol.com>
15777
15778         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15779
15780 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15781
15782         * expression.cs (Indirection.EmitAssign): We were using the
15783         temporary, but returning immediately instead of continuing the
15784         EmitAssing flow.
15785
15786 2003-04-06  Martin Baulig  <martin@ximian.com>
15787
15788         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15789         if it's a nested child, but also deriving from the outer class.
15790         See test 190.cs.
15791
15792         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15793         nested child, but also deriving from the outer class.  See
15794         test-190.cs.
15795         (FilterWithClosure): We may access private members of the outer
15796         class if we're a nested child and deriving from the outer class.
15797         (RealMemberLookup): Only set `closure_private_ok' if the
15798         `original_bf' contained BindingFlags.NonPublic.
15799
15800 2003-04-05  Martin Baulig  <martin@ximian.com>
15801
15802         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15803
15804 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15805
15806         * class.cs (Event.Define): Do not allow abstract events to have
15807         initializers. 
15808
15809 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15810
15811         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15812         block in event declarations.
15813
15814         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15815         value type, get its address.
15816
15817         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15818         leaving a class on the stack instead of a boolean value (int
15819         0/1).  Change the code so we compare against null, and then the
15820         result against zero.
15821
15822         * class.cs (TypeContainer.GetClassBases): We were checking for the
15823         parent class being sealed too late.
15824
15825         * expression.cs (Binary.Emit): For <= and >= when dealing with
15826         floating point values, use cgt.un and clt.un instead of cgt and
15827         clt alone.
15828
15829 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15830
15831         * statement.cs: Apply the same optimization as MS: skip the 
15832         GetEnumerator returning an IEnumerator, and use the one returning a 
15833         CharEnumerator instead. This allows us to avoid the try-finally block 
15834         and the boxing.
15835
15836 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15837
15838         * cs-parser.jay: Attributes cannot be applied to
15839                          namespaces. Fixes #40473
15840
15841 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15842
15843         * class.cs:
15844         (Add*): check if the name is valid using the full name for constants,
15845         fields, properties and events.
15846
15847 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15848
15849         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15850         char constants to be part of the enumeration.
15851
15852         * expression.cs (Conditional.DoResolve): Add support for operator
15853         true. Implements the missing functionality from 14.12
15854
15855         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15856         operator true/false as required by the spec.
15857
15858         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15859         implicit conversion to boolean.
15860
15861         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15862         also one where the type implements `operator true'. 
15863
15864         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15865         get an expression that will invoke operator true based on an
15866         expression.  
15867
15868         (GetConversionOperators): Removed the hack that called op_True
15869         here.  
15870
15871         (Expression.ResolveBoolean): Move this from Statement.
15872
15873 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15874
15875         * ecore.cs (FieldExpr): do not allow initialization of initonly
15876         fields on derived classes
15877
15878 2003-03-13  Martin Baulig  <martin@ximian.com>
15879
15880         * statement.cs (Block.Emit): Call ig.BeginScope() and
15881         ig.EndScope() when compiling with debugging info; call
15882         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15883
15884 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15885
15886         * expression.cs (Indexers): Do not construct immediately, allow
15887         for new members to be appended as we go.  Fixes 38143
15888
15889 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15890
15891         * expression.cs: save/restore context when resolving an unchecked
15892         expression.
15893
15894 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15895
15896         * cfold.cs: Catch division by zero in modulus operator during
15897         constant folding.
15898
15899 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15900
15901         * interface.cs (Interface.DefineMembers): Avoid defining members
15902         twice. 
15903
15904 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15905
15906         * driver.cs: handle the +/- options for -noconfig
15907
15908         * statement.cs (Unckeched.Resolve): Also track the state of
15909         unchecked in the Resolve phase.
15910
15911 2003-02-27  Martin Baulig  <martin@ximian.com>
15912
15913         * ecore.cs (Expression.MemberLookup): Don't create a
15914         MethodGroupExpr for something which is not a method.  Fixes #38291.
15915
15916 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15917
15918         * class.cs (MemberBase.CheckParameters): Also check that the type
15919         is unmanaged if it is a pointer.
15920
15921         * expression.cs (SizeOf.Resolve): Add location information.
15922
15923         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15924         a managed type is declared.
15925
15926         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15927         parameter modifiers as well.  Fixes bug 38606
15928
15929         * class.cs: Very sad.  Am backing out the speed up changes
15930         introduced by the ArrayList -> Array in the TypeContainer, as they
15931         were not actually that much faster, and introduced a bug (no error
15932         reports on duplicated methods).
15933
15934         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15935         source first, this will guarantee that we have a valid expression
15936         before calling in lower levels functions that will require a
15937         resolved object.  Then use this original_source in the
15938         target.ResolveLValue instead of the original source that was
15939         passed to us.
15940
15941         Another change.  Use target.Resolve instead of LValueResolve.
15942         Although we are resolving for LValues, we will let the Assign code
15943         take care of that (it will be called again from Resolve).  This
15944         basically allows code like this:
15945
15946         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15947         class Y { void A (X x) { x [0] += o; }
15948
15949         The problem was that the indexer was trying to resolve for
15950         set_Item (idx, object o) and never finding one.  The real set_Item
15951         was set_Item (idx, X).  By delaying the process we get the right
15952         semantics. 
15953
15954         Fixes bug 36505
15955
15956 2003-02-23  Martin Baulig  <martin@ximian.com>
15957
15958         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15959         while calling DoEmit ().
15960
15961         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15962         source files; if you use the #line directive inside a method, the
15963         compiler stops emitting line numbers for the debugger until it
15964         reaches the end of the method or another #line directive which
15965         restores the original file.
15966
15967 2003-02-23  Martin Baulig  <martin@ximian.com>
15968
15969         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15970
15971 2003-02-23  Martin Baulig  <martin@ximian.com>
15972
15973         * statement.cs (Block.AddChildVariableNames): We need to call this
15974         recursively, not just for our immediate children.
15975
15976 2003-02-23  Martin Baulig  <martin@ximian.com>
15977
15978         * class.cs (Event.Define): Always make the field private, like csc does.
15979
15980         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15981         actually work, fixes bug #37521.
15982
15983 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15984
15985         * delegate.cs: When creating the various temporary "Parameters"
15986         classes, make sure that we call the ComputeAndDefineParameterTypes
15987         on those new parameters (just like we do with the formal ones), to
15988         allow them to be resolved in the context of the DeclSpace.
15989
15990         This fixes the bug that Dick observed in Bugzilla #38530.
15991
15992 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15993
15994         * expression.cs (ResolveMemberAccess): When resolving a constant,
15995         do not attempt to pull a constant if the value was not able to
15996         generate a valid constant.
15997
15998         * const.cs (LookupConstantValue): Do not report more errors than required.
15999
16000 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16001
16002         * expression.cs: fixes bug #38328.
16003
16004 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16005
16006         * class.cs: Changed all the various members that can be part of a
16007         class from being an ArrayList to be an Array of the right type.
16008         During the DefineType type_list, interface_list, delegate_list and
16009         enum_list are turned into types, interfaces, delegates and enums
16010         arrays.  
16011
16012         And during the member population, indexer_list, event_list,
16013         constant_list, field_list, instance_constructor_list, method_list,
16014         operator_list and property_list are turned into their real arrays.
16015
16016         Although we could probably perform this operation earlier, for
16017         good error reporting we need to keep the lists and remove the
16018         lists for longer than required.
16019
16020         This optimization was triggered by Paolo profiling the compiler
16021         speed on the output of `gen-sample-program.pl' perl script. 
16022
16023         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16024         not crash in methods like MemberLookupFailed that use this field.  
16025
16026         This problem arises when the compiler fails to resolve a type
16027         during interface type definition for example.
16028
16029 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16030
16031         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16032         inherit from System.Object, so we have to stop at null, not only
16033         when reaching System.Object.
16034
16035 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16036
16037         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16038         DeclaredOnly because the parent indexer might have had a different
16039         name, but did not loop until the top of the hierarchy was reached.
16040
16041         The problem this one fixes is 35492: when a class implemented an
16042         indexer from an interface, we were getting the interface method
16043         (which was abstract) and we were flagging an error (can not invoke
16044         abstract method).
16045
16046         This also keeps bug 33089 functioning, and test-148 functioning.
16047
16048         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16049         out if a method is special is to see if it is declared in a
16050         property or event, or whether it is one of the predefined operator
16051         names.   This should fix correctly #36804.
16052
16053 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16054
16055         The goal here is to remove the dependency on EmptyCast.Peel ().
16056         Killing it completely.
16057
16058         The problem is that currently in a number of places where
16059         constants are expected, we have to "probe" for an EmptyCast, and
16060         Peel, which is not the correct thing to do, as this will be
16061         repetitive and will likely lead to errors. 
16062
16063         The idea is to remove any EmptyCasts that are used in casts that
16064         can be reduced to constants, so we only have to cope with
16065         constants. 
16066
16067         This bug hunt was triggered by Bug 37363 and the desire to remove
16068         the duplicate pattern where we were "peeling" emptycasts to check
16069         whether they were constants.  Now constants will always be
16070         constants.
16071
16072         * ecore.cs: Use an enumconstant here instead of wrapping with
16073         EmptyCast.  
16074
16075         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16076         throwing me off.  By handling this we can get rid of a few hacks.
16077
16078         * statement.cs (Switch): Removed Peel() code.
16079
16080 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16081
16082         * class.cs: Location information for error 508
16083
16084         * expression.cs (New.DoResolve): Add a guard against double
16085         resolution of an expression.  
16086
16087         The New DoResolve might be called twice when initializing field
16088         expressions (see EmitFieldInitializers, the call to
16089         GetInitializerExpression will perform a resolve on the expression,
16090         and later the assign will trigger another resolution
16091
16092         This leads to bugs (#37014)
16093
16094         * delegate.cs: The signature for EndInvoke should contain any ref
16095         or out parameters as well.  We were not doing this in the past. 
16096
16097         * class.cs (Field.Define): Do not overwrite the type definition
16098         inside the `volatile' group.  Turns out that volatile enumerations
16099         were changing the type here to perform a validity test, which
16100         broke conversions. 
16101
16102 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16103
16104         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16105         and structs, we do not want to load the instance variable
16106
16107         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16108         enum_type has to be handled like an object reference (implicit
16109         conversions exists from this to object), but the regular IsClass
16110         and IsValueType tests will never return true for this one.
16111
16112         Also we use TypeManager.IsValueType instead of type.IsValueType,
16113         just for consistency with the rest of the code (this is only
16114         needed if we ever use the construct exposed by test-180.cs inside
16115         corlib, which we dont today).
16116
16117 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16118
16119         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16120         just InternalCall.
16121
16122 2003-02-09  Martin Baulig  <martin@ximian.com>
16123
16124         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16125         (Namespace.DefineNamespaces): New static public method; this is
16126         called when we're compiling with debugging to add all namespaces
16127         to the symbol file.
16128
16129         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16130         pass it to the Namespace's .ctor.
16131
16132         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16133         and MethodBase arguments; pass the namespace ID to the symwriter;
16134         pass the MethodBase instead of the token to the symwriter.
16135         (SymbolWriter.DefineNamespace): New method to add a namespace to
16136         the symbol file.
16137
16138 2003-02-09  Martin Baulig  <martin@ximian.com>
16139
16140         * symbolwriter.cs: New file.  This is a wrapper around
16141         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16142         methods here in near future.
16143
16144 2003-02-09  Martin Baulig  <martin@ximian.com>
16145
16146         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16147         ILGenerator.MarkSequencePoint() which are actually used by the
16148         symbol writer.
16149
16150 2003-02-09  Martin Baulig  <martin@ximian.com>
16151
16152         * location.cs (SourceFile): New public sealed class.  This
16153         contains the name and an index which is used in the location's token.
16154         (Location): Reserve an appropriate number of bits in the token for
16155         the source file instead of walking over that list, this gives us a
16156         really huge performance improvement when compiling with debugging.
16157
16158         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16159         `SourceFile' argument instead of a string.
16160         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16161         but don't parse/tokenize here, we need to generate the list of all
16162         source files before we do that.
16163         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16164         the files.
16165
16166         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16167         instead of a string.
16168
16169         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16170         of a string.
16171
16172 2003-02-09  Martin Baulig  <martin@ximian.com>
16173
16174         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16175         filename on `#line default'.
16176
16177 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16178
16179         * statement.cs: don't clear the pinned var when the fixed statement
16180         returns from the method (fixes bug#37752).
16181
16182 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16183
16184         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16185         to IsValueType.
16186
16187 2003-02-07  Martin Baulig  <martin@ximian.com>
16188
16189         * driver.cs: Removed the `--debug-args' command line argument.
16190
16191         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16192         automatically by the AsssemblyBuilder.
16193         (CodeGen.InitializeSymbolWriter): We don't need to call any
16194         initialization function on the symbol writer anymore.  This method
16195         doesn't take any arguments.
16196
16197 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16198
16199         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16200         from referenced assemblies as well.
16201
16202 2003-02-02  Martin Baulig  <martin@ximian.com>
16203
16204         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16205
16206 2003-02-02  Martin Baulig  <martin@ximian.com>
16207
16208         * class.cs (Constructor.Emit): Open the symbol writer before
16209         emitting the constructor initializer.
16210         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16211         single-stepping through constructor initializers.
16212
16213 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16214
16215         * class.cs: Handle error 549: do not allow virtual methods in
16216         sealed classes. 
16217
16218 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16219
16220         * decl.cs: Check access levels when resolving types
16221
16222 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16223
16224         * statement.cs: Add parameters and locals set in catch blocks that might 
16225         return to set vector
16226
16227 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16228
16229         * class.cs (Operator): Set the SpecialName flags for operators.
16230
16231         * expression.cs (Invocation.DoResolve): Only block calls to
16232         accessors and operators on SpecialName methods.
16233
16234         (Cast.TryReduce): Handle conversions from char constants.
16235
16236
16237 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16238
16239         * statement.cs: small memory and time optimization in FlowBranching.
16240
16241 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16242
16243         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16244         problem that the last fix but in the other sid (Set).
16245
16246         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16247         access when there is no indexer in the hierarchy.
16248
16249 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16250
16251         * class.cs: Combine some if statements.
16252
16253 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16254
16255         * driver.cs: fixed bug #37187.
16256
16257 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16258
16259         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16260         any indexer, it's needed to build a list with all the indexers in the
16261         hierarchy (AllGetters), else we have problems. Fixes #35653.
16262
16263 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16264
16265         * class.cs (MethodData.Define): It is wrong for an interface
16266         implementation to be static in both cases: explicit and implicit.
16267         We were only handling this in one case.
16268
16269         Improve the if situation there to not have negations.
16270
16271         * class.cs (Field.Define): Turns out that we do not need to check
16272         the unsafe bit on field definition, only on usage.  Remove the test.
16273
16274 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16275
16276         * driver.cs: use assembly.Location instead of Codebase (the latest
16277         patch made mcs fail when using MS assemblies).
16278
16279 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16280
16281         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16282         get the path to *corlib.dll.
16283
16284 2003-01-21  Nick Drochak <ndrochak@gol.com>
16285
16286         * cs-tokenizer.cs:
16287         * pending.cs:
16288         * typemanager.cs: Remove compiler warnings
16289
16290 2003-01-20  Duncan Mak  <duncan@ximian.com>
16291
16292         * AssemblyInfo.cs: Bump the version number to 0.19.
16293
16294 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16295
16296         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16297
16298 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16299
16300         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16301
16302 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16303
16304         * cs-parser.jay: Small fix: we were not comparing the constructor
16305         name correctly.   Thanks to Zoltan for the initial pointer.
16306
16307 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16308
16309         * cs-tokenizer.cs: Set file name when specified with #line
16310
16311 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16312
16313         * cs-parser.jay: Only perform the constructor checks here if we
16314         are named like the class;  This will help provider a better
16315         error.  The constructor path is taken when a type definition is
16316         not found, but most likely the user forgot to add the type, so
16317         report that rather than the constructor error.
16318
16319 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16320
16321         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16322         allocations.
16323
16324 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16325
16326         * cs-parser.jay: Add cleanup call.
16327
16328 2003-01-13  Duncan Mak  <duncan@ximian.com>
16329
16330         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16331         consistent with other methods.
16332
16333 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16334
16335         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16336
16337 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16338
16339         * attribute.cs: only set GuidAttr to true when we have a
16340         GuidAttribute.
16341
16342 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16343
16344         * ecore.cs:
16345         * expression.cs:
16346         * typemanager.cs: fixes to allow mcs compile corlib with the new
16347         Type.IsSubclassOf fix.
16348
16349 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16350
16351         * expression.cs (LocalVariableReference.DoResolve): Classify a
16352         constant as a value, not as a variable.   Also, set the type for
16353         the variable.
16354
16355         * cs-parser.jay (fixed_statement): take a type instead of a
16356         pointer_type, so we can produce a better error message later.
16357
16358         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16359         as an error.  
16360
16361         (For.DoEmit): Make inifinite loops have a
16362         non-conditional branch back.
16363
16364         (Fixed.DoEmit): First populate the pinned variables, then emit the
16365         statement, then clear the variables.  Before I was emitting the
16366         code once for each fixed piece.
16367
16368
16369 2003-01-08  Martin Baulig  <martin@ximian.com>
16370
16371         * statement.cs (FlowBranching.MergeChild): A break in a
16372         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16373
16374 2003-01-08  Martin Baulig  <martin@ximian.com>
16375
16376         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16377         lives in the same number space than `param_map'.  Fixes #36154.
16378
16379 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16380
16381         * cs-parser.jay (constructor_declaration): Set the
16382         Constructor.ModFlags before probing for it.  This makes the
16383         compiler report 514, 515 and 132 (the code was there, but got
16384         broken). 
16385
16386         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16387         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16388         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16389
16390 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16391
16392         * enum.cs: create the enum static fields using the enum type.
16393
16394 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16395
16396         * class.cs: don't try to create the ParamBuilder for the return
16397         type if it's not needed (and handle it breaking for the ms runtime
16398         anyway).
16399
16400 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16401
16402         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16403
16404 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16405
16406         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16407         the command.   This showed up while compiling the JANET source
16408         code, which used \r as its only newline separator.
16409
16410 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16411
16412         * class.cs (Method.Define): If we are an operator (because it
16413         reuses our code), then set the SpecialName and HideBySig.  #36128
16414
16415 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16416
16417         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16418         exception, report error 120 `object reference required'.
16419
16420         * driver.cs: Add --pause option, used during to measure the size
16421         of the process as it goes with --timestamp.
16422
16423         * expression.cs (Invocation.DoResolve): Do not allow methods with
16424         SpecialName to be invoked.
16425
16426 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16427
16428         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16429         number before adding it.
16430
16431 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16432
16433         * ecore.cs (StandardImplicitConversion): When in an unsafe
16434         context, we allow conversion between void * to any other pointer
16435         type. This fixes bug #35973.
16436
16437 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16438
16439         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16440         is not thrown when extensionless outputs are used 
16441
16442 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16443
16444         * rootcontext.cs: fixed compilation of corlib.
16445
16446 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16447
16448         * attribute.cs (Attributes.Contains): Add new method.
16449
16450         * class.cs (MethodCore.LabelParameters): if the parameter is an
16451         `out' parameter, check that no attribute `[In]' has been passed.
16452
16453         * enum.cs: Handle the `value__' name in an enumeration.
16454
16455 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16456
16457         * decl.cs: Added special case to allow overrides on "protected
16458         internal" methods
16459
16460 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16461
16462         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16463         since it makes much more sense.
16464
16465         (Attributes.ctor): Don't require a Location parameter.
16466
16467         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16468
16469         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16470         since we already have that information per attribute.
16471
16472         * everywhere : make appropriate changes.
16473
16474         * class.cs (LabelParameters): Write the code which actually
16475         applies attributes to the return type. We can't do this on the MS
16476         .NET runtime so we flag a warning in the case an exception is
16477         thrown.
16478
16479 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16480
16481         * const.cs: Handle implicit null conversions here too.
16482
16483 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16484
16485         * class.cs (MethodCore.LabelParameters): Remove the extra
16486         Type [] parameter since it is completely unnecessary. Instead
16487         pass in the method's attributes so that we can extract
16488         the "return" attribute.
16489
16490 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16491
16492         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16493         of ignoring it and letting the compile continue.
16494
16495         * typemanager.cs (ChangeType): use an extra argument to return an
16496         error condition instead of throwing an exception.
16497
16498 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16499
16500         * expression.cs (Unary.TryReduce): mimic the code for the regular
16501         code path.  Perform an implicit cast in the cases where we can
16502         implicitly convert to one of the integral types, and then reduce
16503         based on that constant.   This fixes bug #35483.
16504
16505 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16506
16507         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16508
16509 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16510
16511         * namespace.cs: fixed bug #35489.
16512
16513 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16514
16515         * class.cs: Remove some dead code.
16516
16517         * cs-parser.jay: Estimate the number of methods needed
16518         (RootContext.MethodCount);
16519
16520         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16521         numbers instead of StringBuilders.
16522
16523         * support.cs (PtrHashtable): Add constructor with initial size;
16524         We can now reduce reallocations of the method table.
16525
16526 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16527
16528         * attribute.cs (ApplyAttributes): Keep track of the emitted
16529         attributes on a per-target basis. This fixes bug #35413.
16530
16531 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16532
16533         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16534         default to the Windows 1252 encoding.
16535
16536         (UnixParseOption): Support version, thanks to Alp for the missing
16537         pointer. 
16538
16539         * AssemblyInfo.cs: Add nice assembly information.
16540
16541         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16542         (bug 35169).
16543
16544         * cs-parser.jay: Allow a trailing comma before the close bracked
16545         in the attribute_section production.
16546
16547         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16548         address of the instance was being taken, I will take this out,
16549         because we take the address of the object immediately here.
16550
16551 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16552
16553         * typemanager.cs (AreMultipleAllowed): Take care of the most
16554         obvious case where attribute type is not in the current assembly -
16555         stupid me ;-)
16556
16557 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16558
16559         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16560         definitions, instead of doing that afterwards.  
16561
16562         Also we use a nice little hack, depending on the constructor, we
16563         know if we are a "composed" name or a simple name.  Hence, we
16564         avoid the IndexOf test, and we avoid 
16565
16566         * codegen.cs: Add code to assist in a bug reporter to track down
16567         the source of a compiler crash. 
16568
16569 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16570
16571         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16572         types have been emitted for a given element and flag an error
16573         if something which does not have AllowMultiple set is used more
16574         than once.
16575
16576         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16577         attribute types and their corresponding AllowMultiple properties
16578
16579         (AreMultipleAllowed): Check the property for a given type.
16580
16581         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16582         property in the case we have a TypeContainer.
16583
16584         (Attributes.AddAttribute): Detect duplicates and just skip on
16585         adding them. This trivial fix catches a pretty gross error in our
16586         attribute emission - global attributes were being emitted twice!
16587
16588         Bugzilla bug #33187 is now fixed.
16589
16590 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16591
16592         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16593         instead of pp_and).
16594
16595         * expression.cs (Binary.ResolveOperator): I can only use the
16596         Concat (string, string, string) and Concat (string, string,
16597         string, string) if the child is actually a concatenation of
16598         strings. 
16599
16600 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16601
16602         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16603         context where we need a 2-character lookahead.
16604
16605         * pending.cs (PendingImplementation): Rework so we can keep track
16606         of interface types all the time, and flag those which were
16607         implemented by parents as optional.
16608
16609 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16610
16611         * expression.cs (Binary.ResolveOperator): Use
16612         String.Concat(string,string,string) or
16613         String.Concat(string,string,string,string) when possible. 
16614
16615         * typemanager: More helper methods.
16616
16617
16618 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16619
16620         * pending.cs: remove the bogus return from GetMissingInterfaces()
16621         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16622
16623 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16624
16625         * namespace.cs: avoid duplicated 'using xxx' being added to
16626         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16627         when we get more than one 'using' statement for the same namespace.
16628         Report a CS0105 warning for it.
16629
16630 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16631
16632         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16633         of calling getChar/putback, uses internal knowledge of it.    
16634
16635         (xtoken): Reorder tokenizer so most common patterns are checked
16636         first.  This reduces the compilation time in another 5% (from 8.11s
16637         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16638
16639         The parsing time is 22% of the compilation in mcs, and from that
16640         64% is spent on the tokenization process.  
16641
16642         I tried using a binary search for keywords, but this is slower
16643         than the hashtable.  Another option would be to do a couple of
16644         things:
16645
16646                 * Not use a StringBuilder, instead use an array of chars,
16647                   with a set value.  Notice that this way we could catch
16648                   the 645 error without having to do it *afterwards*.
16649
16650                 * We could write a hand-parser to avoid the hashtable
16651                   compares altogether.
16652
16653         The identifier consumption process takes 37% of the tokenization
16654         time.  Another 15% is spent on is_number.  56% of the time spent
16655         on is_number is spent on Int64.Parse:
16656
16657                 * We could probably choose based on the string length to
16658                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16659                   computations. 
16660
16661         Another 3% is spend on wrapping `xtoken' in the `token' function.
16662
16663         Handle 0xa0 as whitespace (#34752)
16664
16665 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16666
16667         * typemanager.cs (IsCLRType): New routine to tell whether a type
16668         is one of the builtin types.  
16669
16670         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16671         typecode in more places instead of doing pointer comparissions.
16672         We could leverage some knowledge about the way the typecodes are
16673         laid out.
16674
16675         New code to cache namespaces in assemblies, it is currently not
16676         invoked, to be used soon.
16677
16678         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16679
16680         * expression.cs (Binary.ResolveOperator): specially handle
16681         strings, and do not perform user-defined operator overloading for
16682         built-in types.
16683
16684 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16685
16686         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16687         internalcall as it is a pretty simple operation;  Avoid whenever
16688         possible to call Char.IsLetter.
16689
16690         (consume_identifier): Cut by half the number of
16691         hashtable calls by merging the is_keyword and GetKeyword behavior.
16692
16693         Do not short-circuit, because if we do, we
16694         report errors (ie, #if false && true would produce an invalid
16695         directive error);
16696
16697
16698 2002-11-24  Martin Baulig  <martin@ximian.com>
16699
16700         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16701         check constant ranges and report a CS0221.  Fixes #33186.
16702
16703 2002-11-24  Martin Baulig  <martin@ximian.com>
16704
16705         * cs-parser.jay: Make this work for uninitialized variable
16706         declarations in the `for' initializer.  Fixes #32416.
16707
16708 2002-11-24  Martin Baulig  <martin@ximian.com>
16709
16710         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16711         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16712
16713 2002-11-24  Martin Baulig  <martin@ximian.com>
16714
16715         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16716         argument; if true, we also check for user-defined conversions.
16717         This is only needed if both arguments are of a user-defined type.
16718         Fixes #30443, added test-175.cs.
16719         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16720
16721         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16722
16723 2002-11-24  Martin Baulig  <martin@ximian.com>
16724
16725         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16726         function to get the store opcode.
16727         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16728         only emit the Ldelema if the store opcode is Stobj.  You must run
16729         both test-34 and test-167 to test this.  Fixes #34529.
16730
16731 2002-11-23  Martin Baulig  <martin@ximian.com>
16732
16733         * ecore.cs (Expression.MemberLookup): Added additional
16734         `qualifier_type' argument which is used when we're being called
16735         from MemberAccess.DoResolve() and null if we're called from a
16736         SimpleName lookup.
16737         (Expression.MemberLookupFailed): New method to report errors; this
16738         does the CS1540 check and reports the correct error message.
16739
16740         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16741         argument for the CS1540 check and redone the way how we're dealing
16742         with private members.  See the comment in the source code for details.
16743         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16744         `closure_start_type' to `closure_qualifier_type' and check whether
16745         it's not null.  It was not this filter being broken, it was just
16746         being called with the wrong arguments.
16747
16748         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16749         and pass it the correct `qualifier_type'; this also does the error
16750         handling for us.
16751
16752 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16753
16754         * expression.cs (Invocation.EmitParams): If the we are dealing
16755         with a non-built-in value type, load its address as well.
16756
16757         (ArrayCreation): Use a a pretty constant instead
16758         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16759         static initializers.  
16760
16761         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16762         because they are not really value types, just glorified integers. 
16763
16764         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16765
16766         * ecore.cs: Remove redundant code for enumerations, make them use
16767         the same code path as everything else, fixes the casting issue
16768         with enumerations in Windows.Forms.
16769
16770         * attribute.cs: Do only cast to string if it is a string, the
16771         validation happens later.
16772
16773         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16774         people upgrade their corlibs.
16775
16776         * ecore.cs: Oops, enumerations were not following the entire code path
16777
16778 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * typemanager.cs (FilterWithClosure): Commented out the test for
16781         1540 in typemanager.cs, as it has problems when accessing
16782         protected methods from a parent class (see test-174.cs). 
16783
16784         * attribute.cs (Attribute.ValidateGuid): new method.
16785         (Attribute.Resolve): Use above.
16786
16787 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16788
16789         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16790
16791         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16792         handling for enumerations, as we only needed the TypeContainer
16793         functionality to begin with (this is required for the fix below to
16794         work for enums that reference constants in a container class for
16795         example). 
16796
16797         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16798
16799         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16800         a valid TypeBuilder to perform lookups on.o
16801
16802         * class.cs (InheritableMemberSignatureCompare): Use true in the
16803         call to GetGetMethod and GetSetMethod, because we are comparing
16804         the signature, and we need to get the methods *even* if they are
16805         private. 
16806
16807         (PropertyBase.CheckBase): ditto.
16808
16809         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16810         GotoCase.Resolve): Use Peel on EmpytCasts.
16811
16812         * ecore.cs (EmptyCast): drop child, add Peel method.
16813
16814 2002-11-17  Martin Baulig  <martin@ximian.com>
16815
16816         * ecore.cs (EmptyCast.Child): New public property.
16817
16818         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16819         label resolved to an EmptyCast.  Fixes #34162.
16820         (GotoCase.Resolve): Likewise.
16821         (Block.EmitMeta): Likewise.
16822
16823 2002-11-17  Martin Baulig  <martin@ximian.com>
16824
16825         * expression.cs (Invocation.BetterConversion): Prefer int over
16826         uint; short over ushort; long over ulong for integer literals.
16827         Use ImplicitConversionExists instead of StandardConversionExists
16828         since we also need to check for user-defined implicit conversions.
16829         Fixes #34165.  Added test-173.cs.
16830
16831 2002-11-16  Martin Baulig  <martin@ximian.com>
16832
16833         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16834         with the `true' and `false' literals.  Fixes #33151.
16835
16836 2002-11-16  Martin Baulig  <martin@ximian.com>
16837
16838         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16839         October 22nd; don't do the cs1540 check for static members.
16840
16841         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16842         now using our own filter here and doing the cs1540 check again.
16843
16844 2002-11-16  Martin Baulig  <martin@ximian.com>
16845
16846         * support.cs (InternalParameters): Don't crash if we don't have
16847         any fixed parameters.  Fixes #33532.
16848
16849 2002-11-16  Martin Baulig  <martin@ximian.com>
16850
16851         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16852         when looking up static methods to make this work on Windows.
16853         Fixes #33773.
16854
16855 2002-11-16  Martin Baulig  <martin@ximian.com>
16856
16857         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16858         a setter rather than using PropertyInfo.CanWrite.
16859
16860 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16861
16862         * class.cs: Allow acces to block member by subclasses. Fixes build
16863         breaker.
16864
16865 2002-11-14  Martin Baulig  <martin@ximian.com>
16866
16867         * class.cs (Constructor.Emit): Added the extern/block check.
16868         Fixes bug #33678.
16869
16870 2002-11-14  Martin Baulig  <martin@ximian.com>
16871
16872         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16873         iteration while looking for indexers, this is needed because the
16874         indexer may have a different name in our base classes.  Fixed the
16875         error reporting (no indexers at all, not get accessor, no
16876         overloaded match).  Fixes bug #33089.
16877         (IndexerAccess.DoResolveLValue): Likewise.
16878
16879 2002-11-14  Martin Baulig  <martin@ximian.com>
16880
16881         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16882         indexers.  Fixes the first part of bug #33089.
16883         (MethodSignature.InheritableMemberSignatureCompare): Added support
16884         for properties.
16885
16886 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16887
16888         * attribute.cs (Attribute.Resolve): Catch the
16889         NullReferenceException and report it since it isn't supposed to
16890         happen. 
16891
16892 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16893
16894         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16895         LogicalOr and LogicalAnd that can benefit from recursively
16896         handling EmitBranchable.  The code now should be nice for Paolo.
16897
16898 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16899
16900         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16901         the Type lookups, as we perform quite a number of lookups on
16902         non-Types.  This can be removed once we can deterministically tell
16903         whether we have a type or a namespace in advance.
16904
16905         But this might require special hacks from our corlib.
16906
16907         * TODO: updated.
16908
16909         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16910         and double which avoids a conversion from an integer to a double.
16911
16912         * expression.cs: tiny optimization, avoid calling IsConstant,
16913         because it effectively performs the lookup twice.
16914
16915 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16916
16917         But a bogus return here to keep the semantics of the old code
16918         until the Mono runtime is fixed.
16919
16920         * pending.cs (GetMissingInterfaces): New method used to remove all
16921         the interfaces that are already implemented by our parent
16922         classes from the list of pending methods. 
16923
16924         * interface.cs: Add checks for calls after ResolveTypeExpr.
16925
16926 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16927
16928         * class.cs (Class.Emit): Report warning 67: event not used if the
16929         warning level is beyond 3.
16930
16931         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16932         being a NullLiteral.
16933
16934         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16935         specifiers. 
16936
16937         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16938         path that might fail if a type can not be resolved.
16939
16940         * expression.cs (Binary.Emit): Emit unsigned versions of the
16941         operators. 
16942
16943         * driver.cs: use error 5.
16944
16945 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16946
16947         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16948
16949 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16950
16951         * cs-parser.jay (switch_section): A beautiful patch from Martin
16952         Baulig that fixed 33094.
16953
16954 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16955
16956         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16957         Check whether the base is abstract and report an error if so.
16958
16959         * expression.cs (IndexerAccess.DoResolveLValue,
16960         IndexerAccess.DoResolve): ditto. 
16961
16962         (Invocation.DoResolve): ditto.
16963
16964         (Invocation.FullMethodDesc): Improve the report string.
16965
16966         * statement.cs (Block): Eliminate IsVariableDefined as it is
16967         basically just a wrapper for GetVariableInfo.
16968
16969         * ecore.cs (SimpleName): Use new 
16970
16971         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16972         type, as we return the actual parameter ref/unref state on a
16973         different call.
16974
16975 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16976
16977         * support.cs: Return proper flags REF/OUT fixing the previous
16978         commit.  
16979
16980         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16981         not used to mean `ref' but `ref or out' in ParameterReference
16982
16983         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16984         full type signature instead of calling TypeManger.CSharpName
16985         ourselves. 
16986
16987         * support.cs (InternalParameters.ParameterDesc): Do not compare
16988         directly to the modflags, because REF/OUT will actually be bitsets
16989         if set. 
16990
16991         * delegate.cs (VerifyMethod): Check also the modifiers.
16992
16993         * cs-tokenizer.cs: Fix bug where floating point values with an
16994         exponent where a sign was missing was ignored.
16995
16996         * driver.cs: Allow multiple assemblies to be specified in a single
16997         /r: argument
16998
16999 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17000
17001         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17002         because identifiers after a parenthesis would end up in this kind
17003         of production, and we needed to desamiguate it for having casts
17004         like:
17005
17006                 (UserDefinedType *) xxx
17007
17008 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17011         we should set on the Bindingflags.NonPublic, but not turn on
17012         private_ok.  private_ok controls whether a Private member is
17013         returned (this is chekced on the filter routine), while the
17014         BindingFlags.NonPublic just controls whether private/protected
17015         will be allowed.   This fixes the problem part of the problem of
17016         private properties being allowed to be used in derived classes.
17017
17018         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17019         so we can call the children DoResolveLValue method (this will
17020         properly signal errors on lvalue assignments to base properties)
17021
17022         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17023         getter are null, and we have a property info, we know that this
17024         happened because the lookup failed, so we report an error 122 for
17025         protection level violation.
17026
17027         We also silently return if setter and getter are null in the
17028         resolve functions, this condition only happens if we have flagged
17029         the error before.  This is the other half of the problem. 
17030
17031         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17032         not have accessibility information, that is why we were returning
17033         true in the filter function in typemanager.cs.
17034
17035         To properly report 122 (property is inaccessible because of its
17036         protection level) correctly, we report this error in ResolveAccess
17037         by failing if both the setter and the getter are lacking (ie, the
17038         lookup failed). 
17039
17040         DoResolve and DoLResolve have been modified to check for both
17041         setter/getter being null and returning silently, the reason being
17042         that I did not want to put the knowledge about this error in upper
17043         layers, like:
17044
17045         int old = Report.Errors;
17046         x = new PropertyExpr (...);
17047         if (old != Report.Errors)
17048                 return null;
17049         else
17050                 return x;
17051
17052         So the property expr is returned, but it is invalid, so the error
17053         will be flagged during the resolve process. 
17054
17055         * class.cs: Remove InheritablePropertySignatureCompare from the
17056         class, as we no longer depend on the property signature to compute
17057         whether it is possible to implement a method or not.
17058
17059         The reason is that calling PropertyInfo.GetGetMethod will return
17060         null (in .NET, in Mono it works, and we should change this), in
17061         cases where the Get Method does not exist in that particular
17062         class.
17063
17064         So this code:
17065
17066         class X { public virtual int A { get { return 1; } } }
17067         class Y : X { }
17068         class Z : Y { public override int A { get { return 2; } } }
17069
17070         Would fail in Z because the parent (Y) would not have the property
17071         defined.  So we avoid this completely now (because the alternative
17072         fix was ugly and slow), and we now depend exclusively on the
17073         method names.
17074
17075         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17076         reference method, instead of using the property.
17077
17078         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17079         routines are gone now.
17080
17081         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17082         names, they were incorrectly named.
17083
17084         * cs-tokenizer.cs: Return are more gentle token on failure. 
17085
17086         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17087         had an out-of-sync index variable, which caused it to remove from
17088         the list of pending methods the wrong method sometimes.
17089
17090 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17091
17092         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17093         CanWrite, because those refer to this particular instance of the
17094         property, and do not take into account the fact that we can
17095         override single members of a property.
17096
17097         Constructor requires an EmitContext.  The resolution process does
17098         not happen here, but we need to compute the accessors before,
17099         because the resolution does not always happen for properties.
17100
17101         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17102         subclass, before we did not update this flag, but we did update
17103         bindingflags. 
17104
17105         (GetAccessors): Drop this routine, as it did not work in the
17106         presence of partially overwritten set/get methods. 
17107
17108         Notice that this broke the cs1540 detection, but that will require
17109         more thinking. 
17110
17111 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17112
17113         * class.cs:
17114         * codegen.cs:
17115         * driver.cs: issue a warning instead of an error if we don't support
17116         debugging for the platform. Also ignore a couple of errors that may
17117         arise when trying to write the symbols. Undo my previous patch.
17118
17119 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17120
17121         * driver.cs: ignore /debug switch except for Unix platforms.
17122
17123 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17124
17125         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17126
17127 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * driver.cs: Do not make mcs-debug conditional, so we do not break
17130         builds that use it.
17131
17132         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17133         review this patch.  But basically after all the children variables
17134         have been merged, the value of "Breaks" was not being set to
17135         new_breaks for Switch blocks.  I think that it should be set after
17136         it has executed.  Currently I set this to the value of new_breaks,
17137         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17138         conservative, but I do not understand this code very well.
17139
17140         I did not break anything in the build, so that is good ;-)
17141
17142         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17143
17144 2002-10-20  Mark Crichton  <crichton@gimp.org>
17145
17146         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17147
17148 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17149
17150         * cfold.cs: Fixed compile blocker.
17151
17152 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17153
17154         * driver.cs: I was chekcing the key, not the file.
17155
17156 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17157
17158         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17159         message that we were generating - we just need to silently return
17160         a null.
17161
17162 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17163
17164         * class.cs (Event.Define): Change my previous commit, as this
17165         breaks the debugger.  This is a temporary hack, as it seems like
17166         the compiler is generating events incorrectly to begin with.
17167
17168         * expression.cs (Binary.ResolveOperator): Added support for 
17169         "U operator - (E x, E y)"
17170
17171         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17172         y)".
17173
17174         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17175         init-only variables, but this path did not take into account that
17176         there might be also instance readonly variables.  Correct this
17177         problem. 
17178
17179         This fixes bug 32253
17180
17181         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17182         delegates as well.
17183
17184         * driver.cs: Change the extension for modules to `netmodule'
17185
17186         * cs-parser.jay: Improved slightly the location tracking for
17187         the debugger symbols.
17188
17189         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17190         modifiers that were specified instead of the hardcoded value
17191         (FamAndAssem).  This was basically ignoring the static modifier,
17192         and others.  Fixes 32429.
17193
17194         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17195         fixed a bug in the process (32476)
17196
17197         * expression.cs (ArrayAccess.EmitAssign): Patch from
17198         hwang_rob@yahoo.ca that fixes bug 31834.3
17199
17200 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17201
17202         * driver.cs: Make the module extension .netmodule.
17203
17204 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17205
17206         * driver.cs: Report an error if the resource file is not found
17207         instead of crashing.
17208
17209         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17210         false, like Emit does.
17211
17212 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17213
17214         * typemanager.cs: Remove unused private member.  Also reported mcs
17215         bug to report this as a warning like csc.
17216
17217 2002-10-15  Martin Baulig  <martin@gnome.org>
17218
17219         * statement.cs (Statement.Emit): Made this a virtual method; emits
17220         the line number info and calls DoEmit().
17221         (Statement.DoEmit): New protected abstract method, formerly knows
17222         as Statement.Emit().
17223
17224         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17225
17226 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17227
17228         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17229         have fixed a remaining problem: not every AddXXXX was adding a
17230         fully qualified name.  
17231
17232         Now everyone registers a fully qualified name in the DeclSpace as
17233         being defined instead of the partial name.  
17234
17235         Downsides: we are slower than we need to be due to the excess
17236         copies and the names being registered this way.  
17237
17238         The reason for this is that we currently depend (on the corlib
17239         bootstrap for instance) that types are fully qualified, because
17240         we dump all the types in the namespace, and we should really have
17241         types inserted into the proper namespace, so we can only store the
17242         basenames in the defined_names array.
17243
17244 2002-10-10  Martin Baulig  <martin@gnome.org>
17245
17246         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17247         from bug #31834, see the bug report for a testcase which is
17248         miscompiled.
17249
17250 2002-10-10  Martin Baulig  <martin@gnome.org>
17251
17252         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17253         flow analysis code for this.
17254
17255         * statement.cs (Do, While, For): Tell the flow analysis code about
17256         infinite loops.
17257         (FlowBranching.UsageVector): Added support for infinite loops.
17258         (Block.Resolve): Moved the dead code elimination here and use flow
17259         analysis to do it.
17260
17261 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17262
17263         * class.cs (Field.Define): Catch cycles on struct type
17264         definitions. 
17265
17266         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17267         fields if the fields are static.  We only need to check instance
17268         fields. 
17269
17270         * expression.cs (As.DoResolve): Test for reference type.
17271
17272         * statement.cs (Using.ResolveExpression): Use
17273         ConvertImplicitRequired, not ConvertImplicit which reports an
17274         error on failture
17275         (Using.ResolveLocalVariableDecls): ditto.
17276
17277         * expression.cs (Binary.ResolveOperator): Report errors in a few
17278         places where we had to.
17279
17280         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17281
17282 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17283
17284         * expression.cs: Use StoreFromPtr instead of extracting the type
17285         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17286
17287         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17288         an enumeration value to a System.Enum, but System.Enum is not a
17289         value type, but an class type, so we need to box.
17290
17291         (Expression.ConvertExplicit): One codepath could return
17292         errors but not flag them.  Fix this.  Fixes #31853
17293
17294         * parameter.cs (Resolve): Do not allow void as a parameter type.
17295
17296 2002-10-06  Martin Baulig  <martin@gnome.org>
17297
17298         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17299         if it's a class type and not a struct.  Fixes #31815.
17300
17301 2002-10-06  Martin Baulig  <martin@gnome.org>
17302
17303         * statement.cs: Reworked the flow analysis code a bit to make it
17304         usable for dead code elimination.
17305
17306 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17307
17308         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17309
17310 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17311
17312         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17313         to fix the test 165, will investigate deeper.
17314
17315 2002-10-04  Martin Baulig  <martin@gnome.org>
17316
17317         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17318         finally blocks actually work.
17319         (Try.Resolve): We don't need to create a sibling for `finally' if
17320         there is no finally block.
17321
17322 2002-10-04  Martin Baulig  <martin@gnome.org>
17323
17324         * class.cs (Constructor.Define): The default accessibility for a
17325         non-default constructor is private, not public.
17326
17327 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17328
17329         * class.cs (Constructor): Make AllowedModifiers public, add
17330         EXTERN.
17331
17332         * cs-parser.jay: Perform the modifiers test here, as the
17333         constructor for the Constructor class usually receives a zero
17334         because of the way we create it (first we create, later we
17335         customize, and we were never checking the modifiers).
17336
17337         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17338         is a version of LookupTypeReflection that includes the type-name
17339         cache.  This can be used as a fast path for functions that know
17340         the fully qualified name and are only calling into *.GetType() to
17341         obtain a composed type.
17342
17343         This is also used by TypeManager.LookupType during its type
17344         composition.
17345
17346         (LookupType): We now also track the real type name, as sometimes
17347         we can get a quey for the real type name from things like
17348         ComposedCast.  This fixes bug 31422.
17349
17350         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17351         complete type fullname, it does not have to go through the type
17352         resolution system to obtain the composed version of the type (for
17353         obtaining arrays or pointers).
17354
17355         (Conditional.Emit): Use the EmitBoolExpression to
17356         generate nicer code, as requested by Paolo.
17357
17358         (ArrayCreation.CheckIndices): Use the patch from
17359         hwang_rob@yahoo.ca to validate the array initializers. 
17360
17361 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17362
17363         * class.cs (ConstructorInitializer.Emit): simplify code by using
17364         Invocation.EmitCall, and at the same time, fix the bugs in calling
17365         parent constructors that took variable arguments. 
17366
17367         * ecore.cs (Expression.ConvertNumericExplicit,
17368         Expression.ImplicitNumericConversion): Remove the code that
17369         manually wrapped decimal (InternalTypeConstructor call is now gone
17370         as well).
17371
17372         * expression.cs (Cast.TryReduce): Also handle decimal types when
17373         trying to perform a constant fold on the type.
17374
17375         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17376
17377         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17378         that only turned off an error report, and did nothing else. 
17379
17380 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17381
17382         * driver.cs: Handle and ignore /fullpaths
17383
17384 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17385
17386         * expression.cs (Binary.ResolveOperator): Catch the case where
17387         DoNumericPromotions returns true, 
17388
17389         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17390
17391 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17392
17393         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17394         report error 70.
17395
17396 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17397
17398         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17399         conversion exists, but it is also required that the conversion be
17400         performed.  This manifested in "(Type64Enum) 2".  
17401
17402         * class.cs (TypeManager.AddMethod): The fix is not to change
17403         AddEnum, because that one was using a fully qualified name (every
17404         DeclSpace derivative does), but to change the AddMethod routine
17405         that was using an un-namespaced name.  This now correctly reports
17406         the duplicated name.
17407
17408         Revert patch until I can properly fix it.  The issue
17409         is that we have a shared Type space across all namespaces
17410         currently, which is wrong.
17411
17412         Options include making the Namespace a DeclSpace, and merge
17413         current_namespace/current_container in the parser.
17414
17415 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17416
17417         * cs-parser.jay: Improve error reporting when we get a different
17418         kind of expression in local_variable_type and
17419         local_variable_pointer_type. 
17420
17421         Propagate this to avoid missleading errors being reported.
17422
17423         * ecore.cs (ImplicitReferenceConversion): treat
17424         TypeManager.value_type as a target just like object_type.   As
17425         code like this:
17426
17427         ValueType v = 1;
17428
17429         Is valid, and needs to result in the int 1 being boxed before it
17430         is assigned to the value type v.
17431
17432         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17433         to validate the enumeration name.
17434
17435         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17436         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17437         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17438
17439         * ecore.cs (TryImplicitIntConversion): When doing an
17440         implicit-enumeration-conversion, check if the type is 64-bits and
17441         perform a conversion before passing to EnumConstant.
17442
17443 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17444
17445         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17446         report ambiguous type references.  Unlike the MS version, we
17447         report what the ambiguity is.   Innovation at work ;-)
17448
17449         (DeclSpace.FindType): Require a location argument to
17450         display when we display an ambiguous error.
17451
17452         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17453
17454         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17455
17456         * expression.cs (EmitDynamicInitializers): Apply patch from
17457         hwang_rob@yahoo.ca that fixes the order in which we emit our
17458         initializers. 
17459
17460 2002-09-21  Martin Baulig  <martin@gnome.org>
17461
17462         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17463         delegate takes no arguments.
17464
17465 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17466
17467         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17468         from integers.
17469
17470         * expression.cs: Extract the underlying type.
17471
17472         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17473
17474         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17475
17476 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17477
17478         * class.cs (TypeContainer.DefineType): We can not use the nice
17479         PackingSize with the size set to 1 DefineType method, because it
17480         will not allow us to define the interfaces that the struct
17481         implements.
17482
17483         This completes the fixing of bug 27287
17484
17485         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17486         means also structs.  This fixes part of the problem. 
17487         (Expresion.ImplicitReferenceConversionExists): ditto.
17488
17489         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17490         error if there were no errors reported during the type lookup
17491         process, to avoid duplicates or redundant errors.  Without this
17492         you would get an ambiguous errors plus a type not found.  We have
17493         beaten the user enough with the first error.  
17494
17495         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17496         reference. 
17497
17498         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17499         during the resolution process, stop the lookup, this avoids
17500         repeated error reports (same error twice).
17501
17502         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17503
17504         * typemanager.cs (LookupType): Redo the type lookup code to match
17505         the needs of System.Reflection.  
17506
17507         The issue is that System.Reflection requires references to nested
17508         types to begin with a "+" sign instead of a dot.  So toplevel
17509         types look like: "NameSpace.TopLevelClass", and nested ones look
17510         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17511         levels. 
17512
17513 2002-09-19  Martin Baulig  <martin@gnome.org>
17514
17515         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17516         says that a method always returns or always throws an exception,
17517         don't report the CS0161.
17518
17519         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17520         set `Returns = new_returns'.
17521
17522 2002-09-19  Martin Baulig  <martin@gnome.org>
17523
17524         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17525         to an enum constant, check for a CS0176.
17526
17527 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17528
17529         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17530         for operators that must be in pairs and report errors.
17531
17532         * ecore.cs (SimpleName.DoResolveType): During the initial type
17533         resolution process, when we define types recursively, we must
17534         check first for types in our current scope before we perform
17535         lookups in the enclosing scopes.
17536
17537         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17538
17539         (Invocation.VerifyArgumentsCompat): Call
17540         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17541         I thought we were supposed to always call this, but there are a
17542         few places in the code where we dont do it.
17543
17544 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17545
17546         * driver.cs: Add support in -linkres and -resource to specify the
17547         name of the identifier.
17548
17549 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17550
17551         * ecore.cs (StandardConversionExists): Sync with the conversion
17552         code: allow anything-* to void* conversions.
17553
17554         (FindMostSpecificSource): Use an Expression argument
17555         instead of a Type, because we might be handed over a Literal which
17556         gets a few more implicit conversions that plain types do not.  So
17557         this information was being lost.
17558
17559         Also, we drop the temporary type-holder expression when not
17560         required.
17561
17562 2002-09-17  Martin Baulig  <martin@gnome.org>
17563
17564         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17565         this is an explicit interface implementation.
17566
17567 2002-09-17  Martin Baulig  <martin@gnome.org>
17568
17569         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17570         different `IndexerName' attributes.
17571
17572         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17573         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17574         virtual CommonResolve().
17575
17576 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17577
17578         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17579         and convert that to the UnderlyingType.
17580
17581         * statement.cs (Foreach.Resolve): Indexers are just like variables
17582         or PropertyAccesses.
17583
17584         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17585         inside quoted strings, we were not doing this before.
17586
17587 2002-09-16  Martin Baulig  <martin@gnome.org>
17588
17589         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17590         resolve it.  This is needed for the definite assignment check of the
17591         instance expression, fixes bug #29846.
17592         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17593
17594 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17595
17596         * parameter.cs: Fix compile error.  Cannot reference static member
17597         from an instance object.  Is this an mcs bug?
17598
17599 2002-09-14  Martin Baulig  <martin@gnome.org>
17600
17601         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17602         multiple times.  Fixes bug #30295, added test-166.cs.
17603
17604 2002-09-14  Martin Baulig  <martin@gnome.org>
17605
17606         * statement.cs (Block.Emit): Don't emit unreachable code.
17607         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17608         `break' statements.
17609         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17610
17611 2002-09-14  Martin Baulig  <martin@gnome.org>
17612
17613         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17614         is set.
17615
17616 2002-09-14  Martin Baulig  <martin@gnome.org>
17617
17618         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17619         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17620         be false on the ms runtime.
17621
17622 2002-09-13  Martin Baulig  <martin@gnome.org>
17623
17624         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17625         the CS0038 error message.
17626
17627 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17628
17629         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17630         constant inside, return it.
17631
17632 2002-09-12  Martin Baulig  <martin@gnome.org>
17633
17634         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17635         implicit conversion can be done between enum types.
17636
17637         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17638         check whether an implicit conversion to the current enum's UnderlyingType
17639         exists and report an error if not.
17640
17641         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17642         without debugging support.
17643
17644         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17645         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17646
17647 2002-09-12  Martin Baulig  <martin@gnome.org>
17648
17649         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17650
17651         * ecore.cs (IMemberExpr.DeclaringType): New property.
17652         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17653         nonstatic member of an outer type (CS0038).
17654
17655 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * driver.cs: Activate the using-error detector at warning level
17658         4 (at least for MS-compatible APIs).
17659
17660         * namespace.cs (VerifyUsing): Small buglett fix.
17661
17662         * pending.cs (PendingImplementation): pass the container pointer. 
17663
17664         * interface.cs (GetMethods): Allow for recursive definition.  Long
17665         term, I would like to move every type to support recursive
17666         definitions, not the current ordering mechanism that we have right
17667         now.
17668
17669         The situation is this: Attributes are handled before interfaces,
17670         so we can apply attributes to interfaces.  But some attributes
17671         implement interfaces, we will now handle the simple cases
17672         (recursive definitions will just get an error).  
17673
17674         * parameter.cs: Only invalidate types at the end if we fail to
17675         lookup all types.  
17676
17677 2002-09-09  Martin Baulig  <martin@gnome.org>
17678
17679         * ecore.cs (PropertyExpr.Emit): Also check for
17680         TypeManager.system_int_array_get_length so this'll also work when
17681         compiling corlib.  Fixes #30003.
17682
17683 2002-09-09  Martin Baulig  <martin@gnome.org>
17684
17685         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17686         and throw an exception if we can't get the type's size.  Fixed #30040,
17687         added test-165.cs.
17688
17689 2002-09-09  Martin Baulig  <martin@gnome.org>
17690
17691         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17692
17693         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17694         context.  Fixes bug #30027.
17695
17696         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17697         virtual functions.  Fixes bug #30043, added test-164.cs.
17698
17699 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17700
17701         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17702
17703 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17704
17705         * driver.cs: Use an object to get the windows codepage since it's not a
17706         static property.
17707
17708 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17709
17710         * statement.cs (For.Emit): for infinite loops (test == null)
17711         return whether there is a break inside, not always "true".
17712
17713         * namespace.cs (UsingEntry): New struct to hold the name of the
17714         using definition, the location where it is defined, and whether it
17715         has been used in a successful type lookup.
17716
17717         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17718         strings.
17719
17720         * decl.cs: ditto.
17721
17722 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17723
17724         * attribute.cs : Fix incorrect code which relied on catching
17725         a NullReferenceException to detect a null being passed in
17726         where an object was expected.
17727
17728 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17729
17730         * statement.cs (Try): flag the catch variable as assigned
17731
17732         * expression.cs (Cast): Simplified by using ResolveType instead of
17733         manually resolving.
17734
17735         * statement.cs (Catch): Fix bug by using ResolveType.
17736
17737 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17738
17739         * expression.cs (BetterConversion): Special case for when we have
17740         a NullLiteral as the argument and we have to choose between string
17741         and object types - we choose string the way csc does.
17742
17743         * attribute.cs (Attribute.Resolve): Catch the
17744         NullReferenceException and report error #182 since the Mono
17745         runtime no more has the bug and having this exception raised means
17746         we tried to select a constructor which takes an object and is
17747         passed a null.
17748
17749 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17750
17751         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17752         message (1502, 1503) when we can't locate a method after overload
17753         resolution. This is much more informative and closes the bug
17754         Miguel reported.
17755
17756         * interface.cs (PopulateMethod): Return if there are no argument
17757         types. Fixes a NullReferenceException bug.
17758
17759         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17760         expressions too. Previously we were checking only in one place for
17761         positional arguments leaving out named arguments.
17762
17763         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17764         type to the enum type is not allowed. Remove code corresponding to
17765         that.
17766
17767         (ConvertNumericExplicit): Allow explicit conversions from
17768         the underlying type to enum type. This precisely follows the spec
17769         and closes a bug filed by Gonzalo.
17770
17771 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17772
17773         * compiler.csproj:
17774         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17775
17776 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17777
17778         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17779         it was important that we stored the right value after the
17780         reduction in `converted'.
17781
17782 2002-09-04  Martin Baulig  <martin@gnome.org>
17783
17784         * location.cs (Location.SymbolDocument): Use full pathnames for the
17785         source files.
17786
17787 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17788
17789         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17790         of the expression resolve mechanism, because that will catch the
17791         SimpleName error failures.
17792
17793         (Conditional): If we can not resolve the
17794         expression, return, do not crash.
17795
17796 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17797
17798         * cs-tokenizer.cs:
17799         (location): display token name instead of its number.
17800
17801 2002-08-28  Martin Baulig  <martin@gnome.org>
17802
17803         * expression.cs (Binary.ResolveOperator): Don't silently return
17804         but return an error if an operator cannot be applied between two
17805         enum types.
17806
17807 2002-08-28  Martin Baulig  <martin@gnome.org>
17808
17809         * class.cs (Constructor.Define): Set the permission attributes
17810         correctly instead of making all constructors public.
17811
17812 2002-08-28  Martin Baulig  <martin@gnome.org>
17813
17814         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17815         for private members before reporting a CS0103; if we find anything,
17816         it's a CS0122.
17817
17818 2002-08-28  Martin Baulig  <martin@gnome.org>
17819
17820         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17821         to check whether `closure_start_type == closure_invocation_type',
17822         we also need to check whether `m.DeclaringType == closure_invocation_type'
17823         before bypassing the permission checks.  We might be accessing
17824         protected/private members from the base class.
17825         (TypeManager.RealMemberLookup): Only set private_ok if private
17826         members were requested via BindingFlags.NonPublic.
17827
17828         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17829
17830         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17831         MethodGroupExpr.IsExplicitImpl if appropriate.
17832         (Invocation.DoResolve): Don't report the CS0120 for explicit
17833         interface implementations.
17834
17835 2002-08-27  Martin Baulig  <martin@gnome.org>
17836
17837         * expression.cs (Invocation.DoResolve): If this is a static
17838         method and we don't have an InstanceExpression, we must report
17839         a CS0120.
17840
17841 2002-08-25  Martin Baulig  <martin@gnome.org>
17842
17843         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17844         `==' between a valuetype and an object.
17845
17846 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17847
17848         * ecore.cs (TypeExpr): Provide a ToString method.
17849
17850 2002-08-24  Martin Baulig  <martin@gnome.org>
17851
17852         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17853         now called proggie.dbg and it's a binary file.
17854
17855 2002-08-23  Martin Baulig  <martin@gnome.org>
17856
17857         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17858
17859 2002-08-23  Martin Baulig  <martin@gnome.org>
17860
17861         * struct.cs (MyStructInfo.ctor): Make this work with empty
17862         structs; it's not allowed to use foreach() on null.
17863
17864 2002-08-23  Martin Baulig  <martin@gnome.org>
17865
17866         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17867         writer the full pathname of the generated assembly.
17868
17869 2002-08-23  Martin Baulig  <martin@gnome.org>
17870
17871         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17872         A `finally' block never returns or breaks; improved handling of
17873         unreachable code.
17874
17875 2002-08-23  Martin Baulig  <martin@gnome.org>
17876
17877         * statement.cs (Throw.Resolve): Allow `throw null'.
17878
17879 2002-08-23  Martin Baulig  <martin@gnome.org>
17880
17881         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17882         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17883         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17884         MemberLookup would return a wrong event if this is an explicit
17885         interface implementation and the class has an event with the same
17886         name.
17887
17888 2002-08-23  Martin Baulig  <martin@gnome.org>
17889
17890         * statement.cs (Block.AddChildVariableNames): New public method.
17891         (Block.AddChildVariableName): Likewise.
17892         (Block.IsVariableNameUsedInChildBlock): Likewise.
17893         (Block.AddVariable): Check whether a variable name has already
17894         been used in a child block.
17895
17896         * cs-parser.jay (declare_local_variables): Mark all variable names
17897         from the current block as being used in a child block in the
17898         implicit block.
17899
17900 2002-08-23  Martin Baulig  <martin@gnome.org>
17901
17902         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17903         find the symbol writer.
17904
17905         * driver.cs: csc also allows the arguments to /define being
17906         separated by commas, not only by semicolons.
17907
17908 2002-08-23  Martin Baulig  <martin@gnome.org>
17909
17910         * interface.cs (Interface.GetMembers): Added static check for events.
17911
17912 2002-08-15  Martin Baulig  <martin@gnome.org>
17913
17914         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17915         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17916
17917         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17918         why the MethodData.EmitDestructor() change was necessary.
17919
17920 2002-08-20  Martin Baulig  <martin@gnome.org>
17921
17922         * class.cs (TypeContainer.FindMembers): Added static check for events.
17923
17924         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17925
17926         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17927         use Type.GetEvents(), not Type.FindMembers().
17928
17929 2002-08-20  Martin Baulig  <martin@gnome.org>
17930
17931         * decl.cs (MemberCache): Added a special method cache which will
17932         be used for method-only searched.  This ensures that a method
17933         search will return a MethodInfo with the correct ReflectedType for
17934         inherited methods.      
17935
17936 2002-08-20  Martin Baulig  <martin@gnome.org>
17937
17938         * decl.cs (DeclSpace.FindMembers): Made this public.
17939
17940 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17941
17942         * delegate.cs: fixed build on windows.
17943         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17944
17945 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17946
17947         * ecore.cs (StandardConversionExists): Return a false
17948         if we are trying to convert the void type to anything else
17949         since that is not allowed.
17950
17951         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17952         we flag error 70 in the event an event is trying to be accessed
17953         directly from outside the declaring type.
17954
17955 2002-08-20  Martin Baulig  <martin@gnome.org>
17956
17957         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17958         MemberCache from typemanager.cs to decl.cs.
17959
17960 2002-08-19  Martin Baulig  <martin@gnome.org>
17961
17962         * class.cs (TypeContainer): Implement IMemberContainer.
17963         (TypeContainer.DefineMembers): Create the MemberCache.
17964         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17965         return public members if BindingFlags.Public was given, check
17966         whether members are static.
17967
17968 2002-08-16  Martin Baulig  <martin@gnome.org>
17969
17970         * decl.cs (DeclSpace.Define): Splitted this in Define and
17971         DefineMembers.  DefineMembers is called first and initializes the
17972         MemberCache.
17973
17974         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17975         DefineMembers() on all our DeclSpaces.
17976
17977         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17978         but call DefineMembers() on all nested interfaces.  We call their
17979         Define() in our new Define() function.
17980
17981         * interface.cs (Interface): Implement IMemberContainer.
17982         (Interface.Define): Moved all code except the attribute stuf to
17983         DefineMembers().
17984         (Interface.DefineMembers): Initialize the member cache.
17985
17986         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17987         need this anymore since we can use MemberCache.FindMembers directly.
17988
17989 2002-08-19  Martin Baulig  <martin@gnome.org>
17990
17991         * typemanager.cs (MemberCache): When creating the cache for an
17992         interface type, add all inherited members.
17993         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17994         to `out bool used_cache' and documented it.
17995         (TypeManager.MemberLookup): If we already used the cache in the first
17996         iteration, we don't need to do the interfaces check.
17997
17998 2002-08-19  Martin Baulig  <martin@gnome.org>
17999
18000         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18001         here from IMemberFinder and don't implement this interface anymore.
18002         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18003
18004         * typemanager.cs (IMemberFinder): This interface is now only used by
18005         classes which actually support the member cache.
18006         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18007         since we only put DeclSpaces into this Hashtable.
18008         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18009         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18010
18011 2002-08-16  Martin Baulig  <martin@gnome.org>
18012
18013         * typemanager.cs (ICachingMemberFinder): Removed.
18014         (IMemberFinder.MemberCache): New property.
18015         (TypeManager.FindMembers): Merged this with RealFindMembers().
18016         This function will never be called from TypeManager.MemberLookup()
18017         so we can't use the cache here, just the IMemberFinder.
18018         (TypeManager.MemberLookup_FindMembers): Check whether the
18019         IMemberFinder has a MemberCache and call the cache's FindMembers
18020         function.
18021         (MemberCache): Rewrote larger parts of this yet another time and
18022         cleaned it up a bit.
18023
18024 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18025
18026         * driver.cs (LoadArgs): Support quoting.
18027
18028         (Usage): Show the CSC-like command line arguments.
18029
18030         Improved a few error messages.
18031
18032 2002-08-15  Martin Baulig  <martin@gnome.org>
18033
18034         * typemanager.cs (IMemberContainer.Type): New property.
18035         (IMemberContainer.IsInterface): New property.
18036
18037         The following changes are conditional to BROKEN_RUNTIME, which is
18038         defined at the top of the file.
18039
18040         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18041         class'es members, but add all members from TypeHandle.ObjectType
18042         if we're an interface.
18043         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18044         is the current type.
18045         (MemberCache.CacheEntry.Container): Removed this field.
18046         (TypeHandle.GetMembers): Include inherited members.
18047
18048 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18049
18050         * typemanager.cs: fixed compilation and added a comment on a field that
18051         is never used.
18052
18053 2002-08-15  Martin Baulig  <martin@gnome.org>
18054
18055         * class.cs (ConstructorInitializer.Resolve): In the
18056         Expression.MemberLookup call, use the queried_type as
18057         invocation_type.
18058
18059         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18060         declared' attribute, it's always true.
18061         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18062         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18063         temporary wrapper for FindMembers which tells MemberLookup whether
18064         members from the base classes are included in the return value.
18065         This will go away soon.
18066         (TypeManager.MemberLookup): Use this temporary hack here; once the
18067         new MemberCache is completed, we don't need to do the DeclaredOnly
18068         looping here anymore since the MemberCache will take care of this.
18069         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18070         (MemberCache): When creating the MemberCache for a class, get
18071         members from the current class and all its base classes.
18072         (MemberCache.CacheEntry.Container): New field.  This is a
18073         temporary hack until the Mono runtime is fixed to distinguish
18074         between ReflectedType and DeclaringType.  It allows us to use MCS
18075         with both the MS runtime and the unfixed Mono runtime without
18076         problems and without accecting performance.
18077         (MemberCache.SearchMembers): The DeclaredOnly looping from
18078         TypeManager.MemberLookup is now done here.      
18079
18080 2002-08-14  Martin Baulig  <martin@gnome.org>
18081
18082         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18083         Type.GetFields on dynamic types but get the fields from the
18084         corresponding TypeContainer.
18085         (MyStructInfo.GetStructInfo): Added check for enum types.
18086
18087         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18088         (MemberList.SyncRoot): Implemented.
18089         (TypeManager.FilterWithClosure): No need to check permissions if
18090         closure_start_type == closure_invocation_type, don't crash if
18091         closure_invocation_type is null.
18092
18093 2002-08-13  Martin Baulig  <martin@gnome.org>
18094
18095         Rewrote TypeContainer.FindMembers to use a member cache.  This
18096         gives us a speed increase of about 35% for the self-hosting MCS
18097         build and of about 15-20% for the class libs (both on GNU/Linux).
18098
18099         * report.cs (Timer): New class to get enhanced profiling.  This
18100         whole class is "TIMER" conditional since it remarkably slows down
18101         compilation speed.
18102
18103         * class.cs (MemberList): New class.  This is an IList wrapper
18104         which we're now using instead of passing MemberInfo[]'s around to
18105         avoid copying this array unnecessarily.
18106         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18107         (ICachingMemberFinder, IMemberContainer): New interface.
18108         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18109         has already been checked, otherwise use it for the name comparision.
18110         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18111         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18112         if possible.  Returns a MemberList, not a MemberInfo [].
18113         (TypeHandle): New class, implements IMemberContainer.  We create
18114         one instance of this class per type, it contains a MemberCache
18115         which is used to do the member lookups.
18116         (MemberCache): New class.  Each instance of this class contains
18117         all members of a type and a name-based hash table.
18118         (MemberCache.FindMembers): This is our new member lookup
18119         function.  First, it looks up all members of the requested name in
18120         the hash table.  Then, it walks this list and sorts out all
18121         applicable members and returns them.
18122
18123 2002-08-13  Martin Baulig  <martin@gnome.org>
18124
18125         In addition to a nice code cleanup, this gives us a performance
18126         increase of about 1.4% on GNU/Linux - not much, but it's already
18127         half a second for the self-hosting MCS compilation.
18128
18129         * typemanager.cs (IMemberFinder): New interface.  It is used by
18130         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18131         Enum, Delegate or Interface.
18132         (TypeManager.finder_to_member_finder): New PtrHashtable.
18133         (TypeManager.finder_to_container): Removed.
18134         (TypeManager.finder_to_delegate): Removed.
18135         (TypeManager.finder_to_interface): Removed.
18136         (TypeManager.finder_to_enum): Removed.
18137
18138         * interface.cs (Interface): Implement IMemberFinder.
18139
18140         * delegate.cs (Delegate): Implement IMemberFinder.
18141
18142         * enum.cs (Enum): Implement IMemberFinder.
18143
18144         * class.cs (TypeContainer): Implement IMemberFinder.
18145
18146 2002-08-12  Martin Baulig  <martin@gnome.org>
18147
18148         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18149
18150 2002-08-12  Martin Baulig  <martin@gnome.org>
18151
18152         * ecore.cs (ITypeExpression): New interface for expressions which
18153         resolve to a type.
18154         (TypeExpression): Renamed to TypeLookupExpression.
18155         (Expression.DoResolve): If we're doing a types-only lookup, the
18156         expression must implement the ITypeExpression interface and we
18157         call DoResolveType() on it.
18158         (SimpleName): Implement the new ITypeExpression interface.
18159         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18160         hack, the situation that we're only looking up types can't happen
18161         anymore when this method is called.  Moved the type lookup code to
18162         DoResolveType() and call it.
18163         (SimpleName.DoResolveType): This ITypeExpression interface method
18164         is now doing the types-only lookup.
18165         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18166         (ResolveFlags): Added MaskExprClass.
18167
18168         * expression.cs (MemberAccess): Implement the ITypeExpression
18169         interface.
18170         (MemberAccess.DoResolve): Added support for a types-only lookup
18171         when we're called via ITypeExpression.DoResolveType().
18172         (ComposedCast): Implement the ITypeExpression interface.
18173
18174         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18175         Expression.Resolve() with ResolveFlags.Type instead.
18176
18177 2002-08-12  Martin Baulig  <martin@gnome.org>
18178
18179         * interface.cs (Interface.Define): Apply attributes.
18180
18181         * attribute.cs (Attribute.ApplyAttributes): Added support for
18182         interface attributes.
18183
18184 2002-08-11  Martin Baulig  <martin@gnome.org>
18185
18186         * statement.cs (Block.Emit): Only check the "this" variable if we
18187         do not always throw an exception.
18188
18189         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18190         whether the property has a set accessor.
18191
18192 2002-08-11  Martin Baulig  <martin@gnome.org>
18193
18194         Added control flow analysis support for structs.
18195
18196         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18197         with control flow analysis turned off.
18198         (IVariable): New interface.
18199         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18200         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18201         (FieldExpr.DoResolve): Resolve the instance expression with flow
18202         analysis turned off and do the definite assignment check after the
18203         resolving when we know what the expression will resolve to.
18204
18205         * expression.cs (LocalVariableReference, ParameterReference):
18206         Implement the new IVariable interface, only call the flow analysis
18207         code if ec.DoFlowAnalysis is true.
18208         (This): Added constructor which takes a Block argument.  Implement
18209         the new IVariable interface.
18210         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18211         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18212         This does the definite assignment checks for struct members.
18213
18214         * class.cs (Constructor.Emit): If this is a non-static `struct'
18215         constructor which doesn't have any initializer, call
18216         Block.AddThisVariable() to tell the flow analysis code that all
18217         struct elements must be initialized before control returns from
18218         the constructor.
18219
18220         * statement.cs (MyStructInfo): New public class.
18221         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18222         argument to this indexer.  If non-zero, check an individual struct
18223         member, not the whole struct.
18224         (FlowBranching.CheckOutParameters): Check struct members.
18225         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18226         overloaded versions of these methods which take an additional
18227         `int field_idx' argument to check struct members.
18228         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18229         overloaded versions of these methods which take an additional
18230         `string field_name' argument to check struct member.s
18231         (VariableInfo): Implement the IVariable interface.
18232         (VariableInfo.StructInfo): New public property.  Returns the
18233         MyStructInfo instance of the variable if it's a struct or null.
18234         (Block.AddThisVariable): New public method.  This is called from
18235         Constructor.Emit() for non-static `struct' constructor which do
18236         not have any initializer.  It creates a special variable for the
18237         "this" instance variable which will be checked by the flow
18238         analysis code to ensure that all of the struct's fields are
18239         initialized before control returns from the constructor.
18240         (UsageVector): Added support for struct members.  If a
18241         variable/parameter is a struct with N members, we reserve a slot
18242         in the usage vector for each member.  A struct is considered fully
18243         initialized if either the struct itself (slot 0) or all its
18244         members are initialized.
18245
18246 2002-08-08  Martin Baulig  <martin@gnome.org>
18247
18248         * driver.cs (Driver.MainDriver): Only report an error CS5001
18249         if there were no compilation errors.
18250
18251         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18252         `UnsafeContext' property to determine whether the parent is in
18253         unsafe context rather than checking the parent's ModFlags:
18254         classes nested in an unsafe class are unsafe as well.
18255
18256 2002-08-08  Martin Baulig  <martin@gnome.org>
18257
18258         * statement.cs (UsageVector.MergeChildren): Distinguish between
18259         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18260         we return.  Added test17() and test18() to test-154.cs.
18261
18262 2002-08-08  Martin Baulig  <martin@gnome.org>
18263
18264         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18265         Family access, make sure the invoking type isn't a subclass of the
18266         queried type (that'd be a CS1540).
18267
18268         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18269         this method which takes an additional `Type invocation_type'.
18270
18271         * expression.cs (BaseAccess.DoResolve): Use the base type as
18272         invocation and query type.
18273         (MemberAccess.DoResolve): If the lookup failed and we're about to
18274         report a CS0122, try a lookup with the ec.ContainerType - if this
18275         succeeds, we must report a CS1540.
18276
18277 2002-08-08  Martin Baulig  <martin@gnome.org>
18278
18279         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18280         (MethodGroupExpr): Implement the IMemberExpr interface.
18281
18282         * expression (MemberAccess.ResolveMemberAccess): No need to have
18283         any special code for MethodGroupExprs anymore, they're now
18284         IMemberExprs.   
18285
18286 2002-08-08  Martin Baulig  <martin@gnome.org>
18287
18288         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18289         Family, FamANDAssem and FamORAssem permissions.
18290         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18291
18292 2002-08-08  Martin Baulig  <martin@gnome.org>
18293
18294         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18295         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18296         or loop block.
18297
18298 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18299
18300         * driver.cs: implemented /resource option to embed managed resources.
18301
18302 2002-08-07  Martin Baulig  <martin@gnome.org>
18303
18304         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18305         (FieldBase.HasFieldInitializer): New public property.
18306         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18307         returns the field initializer and makes sure it is only resolved once.
18308         (TypeContainer.EmitFieldInitializers): Call
18309         FieldBase.GetInitializerExpression to get the initializer, this ensures
18310         that it isn't resolved multiple times.
18311
18312         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18313         the resolving process (SimpleName/MemberLookup) that we're currently
18314         emitting a field initializer (which must not access any instance members,
18315         this is an error CS0236).
18316
18317         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18318         argument, if the `IsFieldInitializer' flag is set, we must report and
18319         error CS0236 and not an error CS0120.   
18320
18321 2002-08-07  Martin Baulig  <martin@gnome.org>
18322
18323         * ecore.cs (IMemberExpr): New public interface.
18324         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18325         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18326         if the expression is an IMemberExpr.
18327
18328         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18329         to be null, implicitly default to `this' if we're non-static in
18330         this case.  Simplified the code a lot by using the new IMemberExpr
18331         interface.  Also fixed bug #28176 here.
18332
18333 2002-08-06  Martin Baulig  <martin@gnome.org>
18334
18335         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18336         ParameterReferences during semantic analysis so that we can do a
18337         type-only search when resolving Cast, TypeOf and SizeOf.
18338         (block): Pass the `current_local_parameters' to the Block's
18339         constructor.
18340
18341         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18342         argument to the constructor.
18343         (ConstructorInitializer.Resolve): Create a temporary implicit
18344         block with the parameters.
18345
18346         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18347         references here if we aren't doing a type-only search.
18348
18349         * statement.cs (Block): Added constructor which takes a
18350         `Parameters parameters' argument.
18351         (Block.Parameters): New public property.
18352
18353         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18354         to `Parameters' and made it public readonly.
18355
18356 2002-08-06  Martin Baulig  <martin@gnome.org>
18357
18358         * ecore.cs (Expression.Warning): Made this public as well.
18359
18360         * report.cs (Report.Debug): Print the contents of collections.
18361
18362 2002-08-06  Martin Baulig  <martin@gnome.org>
18363
18364         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18365         used to tell Resolve() which kinds of expressions it may return.
18366         (Expression.Resolve): Added overloaded version of this method which
18367         takes a `ResolveFlags flags' argument.  This can be used to tell
18368         Resolve() which kinds of expressions it may return.  Reports a
18369         CS0118 on error.
18370         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18371         ResolveFlags.SimpleName.
18372         (Expression.Error118): Added overloaded version of this method which
18373         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18374         which kinds of expressions are allowed.
18375
18376         * expression.cs (Argument.ResolveMethodGroup): New public method.
18377         Resolves an argument, but allows a MethodGroup to be returned.
18378         This is used when invoking a delegate.
18379
18380         * TODO: Updated a bit.
18381
18382 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18383
18384         Fixed compilation with csc.
18385
18386         * ecore.cs: Expression.Error made public. Is this correct? Should
18387         Warning be made public too?
18388
18389         * expression.cs: use ea.Location instead of ea.loc.
18390         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18391
18392 2002-08-06  Martin Baulig  <martin@gnome.org>
18393
18394         * ecore.cs (Expression.loc): Moved the location here instead of
18395         duplicating it in all derived classes.
18396         (Expression.Location): New public property.
18397         (Expression.Error, Expression.Warning): Made them non-static and
18398         removed the location argument.
18399         (Expression.Warning): Added overloaded version which takes an
18400         `int level' argument.
18401         (Expression.Error118): Make this non-static and removed the
18402         expression and location arguments.
18403         (TypeExpr): Added location argument to the constructor.
18404
18405         * expression.cs (StaticCallExpr): Added location argument to
18406         the constructor.
18407         (Indirection, PointerArithmetic): Likewise.
18408         (CheckedExpr, UnCheckedExpr): Likewise.
18409         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18410         (StringPtr): Likewise.
18411
18412
18413 2002-08-05  Martin Baulig  <martin@gnome.org>
18414
18415         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18416
18417         * assign.cs (Assign.DoResolve): Check whether the source
18418         expression is a value or variable.
18419
18420         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18421         while resolving the corresponding blocks.
18422
18423         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18424         an error, don't silently return null.
18425
18426         * statement.cs (Block.AddVariable): Do the error reporting here
18427         and distinguish between CS0128 and CS0136.
18428         (Block.DoResolve): Report all unused labels (warning CS0164).
18429         (LabeledStatement): Pass the location to the constructor.
18430         (LabeledStatement.HasBeenReferenced): New property.
18431         (LabeledStatement.Resolve): Set it to true here.
18432
18433         * statement.cs (Return.Emit): Return success even after reporting
18434         a type mismatch error (CS0126 or CS0127), this is what csc does and
18435         it avoids confusing the users with any consecutive errors.
18436
18437 2002-08-05  Martin Baulig  <martin@gnome.org>
18438
18439         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18440
18441         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18442
18443         * expression.cs (MemberAccess.DoResolve): Silently return if an
18444         error has already been reported.
18445
18446         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18447         error has already been reported.
18448
18449 2002-08-05  Martin Baulig  <martin@gnome.org>
18450
18451         * statement.cs (UsageVector): Only initialize the `parameters'
18452         vector if we actually have any "out" parameters.
18453
18454 2002-08-05  Martin Baulig  <martin@gnome.org>
18455
18456         * expression.cs (Binary.ResolveOperator): When combining delegates,
18457         they must have the same type.
18458
18459 2002-08-05  Martin Baulig  <martin@gnome.org>
18460
18461         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18462         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18463         work with the ms runtime and we also don't need it: if we're a
18464         PropertyBuilder and not in the `indexer_arguments' hash, then we
18465         are a property and not an indexer.
18466
18467         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18468         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18469         since the latter one doesn't work with the ms runtime.
18470
18471 2002-08-03  Martin Baulig  <martin@gnome.org>
18472
18473         Fixed bugs #27998 and #22735.
18474
18475         * class.cs (Method.IsOperator): New public field.
18476         (Method.CheckBase): Report CS0111 if there's already a method
18477         with the same parameters in the current class.  Report CS0508 when
18478         attempting to change the return type of an inherited method.
18479         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18480         and it's not marked abstract or extern.
18481         (PropertyBase): New abstract base class for Property and Indexer.
18482         (PropertyBase.CheckBase): Moved here from Property and made it work
18483         for indexers.
18484         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18485         the same so we can reuse it there.
18486         (Property, Indexer): Derive from PropertyBase.
18487         (MethodSignature.inheritable_property_signature_filter): New delegate
18488         to find properties and indexers.
18489
18490         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18491         argument and improved error reporting.
18492
18493         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18494         EmptyReadOnlyParameters and made it a property.
18495
18496         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18497         version of this method which takes a `PropertyInfo indexer'.
18498         (TypeManager.RegisterIndexer): New method.
18499
18500         * class.cs: Added myself as author of this file :-)
18501
18502 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18503
18504         * class.cs: fixed compilation on windoze.
18505
18506 2002-08-03  Martin Baulig  <martin@gnome.org>
18507
18508         * interface.cs (Interface.GetInterfaceBases): Check whether all
18509         base interfaces are at least as accessible than the current one.
18510
18511         * class.cs (TypeContainer.GetClassBases): Check whether base types
18512         are at least as accessible than the current type.
18513         (TypeContainer.AsAccessible): Implemented and made non-static.
18514         (MemberBase.CheckParameters): Report errors if the accessibility
18515         checks fail.
18516
18517         * delegate.cs (Delegate.Delegate): The default visibility is
18518         internal for top-level types and private for nested types.
18519         (Delegate.Define): Report errors if the accessibility checks fail.
18520
18521         * enum.cs (Enum.Enum): The default visibility is internal for
18522         top-level types and private for nested types.
18523         (Enum.DefineType): Compute the correct visibility.
18524
18525         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18526         function which takes a `bool is_toplevel' instead of a TypeContainer.
18527
18528         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18529         builtin type.
18530
18531 2002-08-02  Martin Baulig  <martin@gnome.org>
18532
18533         * expression.cs (LocalVariableReferenc): Added constructor which
18534         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18535         (LocalVariableReference.IsReadOnly): New property.
18536         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18537         variable is readonly, use our own readonly flag to do this; you can
18538         use the new constructor to get a writable reference to a read-only
18539         variable.
18540
18541         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18542         reference to the local variable.
18543
18544 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18545
18546         * rootcontext.cs (ResolveCore): Also include System.Exception
18547
18548         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18549         we reach an EmptyStatement.
18550
18551         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18552         is also fine.
18553
18554         * expression.cs (Binary.ResolveOperator): Check error result in
18555         two places.
18556
18557         use brtrue/brfalse directly and avoid compares to null.
18558
18559 2002-08-02  Martin Baulig  <martin@gnome.org>
18560
18561         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18562         Fixes bug #28407, added test-155.cs.
18563
18564 2002-08-01  Martin Baulig  <martin@gnome.org>
18565
18566         * class.cs (Event.EmitDefaultMethod): Make this work with static
18567         events.  Fixes #28311, added verify-3.cs.
18568
18569 2002-08-01  Martin Baulig  <martin@gnome.org>
18570
18571         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18572         `is_disposable' fields.
18573         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18574         `hm.is_disposable' if we're using the collection pattern.
18575         (Foreach.EmitCollectionForeach): Use the correct type for the
18576         enumerator's local variable, only emit the try/finally block if
18577         necessary (fixes #27713).
18578
18579 2002-08-01  Martin Baulig  <martin@gnome.org>
18580
18581         * ecore.cs (Expression.report118): Renamed to Error118 and made
18582         it public static.
18583
18584         * statement.cs (Throw.Resolve): Check whether the expression is of
18585         the correct type (CS0118) and whether the type derives from
18586         System.Exception (CS0155).
18587         (Catch.Resolve): New method.  Do the type lookup here and check
18588         whether it derives from System.Exception (CS0155).
18589         (Catch.CatchType, Catch.IsGeneral): New public properties.
18590
18591         * typemanager.cs (TypeManager.exception_type): Added.
18592
18593 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18594
18595         * driver.cs: Updated About function.
18596
18597 2002-07-31  Martin Baulig  <martin@gnome.org>
18598
18599         Implemented Control Flow Analysis.
18600
18601         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18602         (EmitContext.CurrentBranching): Added.
18603         (EmitContext.StartFlowBranching): Added.
18604         (EmitContext.EndFlowBranching): Added.
18605         (EmitContext.KillFlowBranching): Added.
18606         (EmitContext.IsVariableAssigned): Added.
18607         (EmitContext.SetVariableAssigned): Added.
18608         (EmitContext.IsParameterAssigned): Added.
18609         (EmitContext.SetParameterAssigned): Added.
18610         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18611         Added control flow analysis stuff here.
18612
18613         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18614         resolve the expression as lvalue.
18615         (LocalVariableReference.DoResolve): Check whether the variable has
18616         already been assigned.
18617         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18618         the parameter as assigned here.
18619         (ParameterReference.DoResolve): Check whether the parameter has already
18620         been assigned.
18621         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18622         expression as lvalue.
18623
18624         * statement.cs (FlowBranching): New class for the flow analysis code.
18625         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18626         (LabeledStatement.IsDefined): New public property.
18627         (LabeledStatement.AddUsageVector): New public method to tell flow
18628         analyis that the label may be reached via a forward jump.
18629         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18630         flow analysis.
18631         (VariableInfo.Number): New public field.  This is used by flow analysis
18632         to number all locals of a block.
18633         (Block.CountVariables): New public property.  This is the number of
18634         local variables in this block (including the locals from all parent
18635         blocks).
18636         (Block.EmitMeta): Number all the variables.
18637
18638         * statement.cs: Added flow analysis support to all classes.
18639
18640 2002-07-31  Martin Baulig  <martin@gnome.org>
18641
18642         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18643         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18644         then use this argument.
18645
18646         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18647
18648         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18649         use this to specify /define options.
18650
18651 2002-07-29  Martin Baulig  <martin@gnome.org>
18652
18653         * statement.cs (Fixed): Moved all code that does variable lookups
18654         and resolvings from Emit to Resolve.
18655
18656         * statement.cs (For): Moved all code that does variable lookups
18657         and resolvings from Emit to Resolve.
18658
18659         * statement.cs (Using): Moved all code that does variable lookups
18660         and resolvings from Emit to Resolve.
18661
18662 2002-07-29  Martin Baulig  <martin@gnome.org>
18663
18664         * attribute.cs (Attribute.Resolve): Explicitly catch a
18665         System.NullReferenceException when creating the
18666         CustromAttributeBuilder and report a different warning message.
18667
18668 2002-07-29  Martin Baulig  <martin@gnome.org>
18669
18670         * support.cs (ParameterData.ParameterName): Added method to
18671         get the name of a parameter.
18672
18673         * typemanager.cs (TypeManager.IsValueType): New public method.
18674
18675 2002-07-29  Martin Baulig  <martin@gnome.org>
18676
18677         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18678         is a flag which specifies that it's either ref or out.
18679         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18680         the out parameter to `out Parameter.Modifier mod', also set the
18681         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18682
18683         * support.cs (InternalParameters.ParameterModifier): Distinguish
18684         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18685         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18686
18687         * expression.cs (Argument.GetParameterModifier): Distinguish
18688         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18689         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18690
18691 2002-07-29  Martin Baulig  <martin@gnome.org>
18692
18693         * expression.cs (ParameterReference.ParameterReference): Added
18694         `Location loc' argument to the constructor.
18695
18696         * cs-parser.jay: Pass location to ParameterReference.
18697
18698 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18699
18700         * statement.cs (Try): Initialize the location.
18701
18702         * cs-parser.jay: pass location to Try.
18703
18704         * expression.cs (Unary.Reduce): Change the prototype to return
18705         whether a constant fold could be performed or not.  The result is
18706         returned in an out parameters.  In the case of Indirection and
18707         AddressOf, we want to perform the full tests.
18708
18709 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18710
18711         * statement.cs (Statement.Emit): Flag dead code.
18712
18713 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18714
18715         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18716
18717 2002-07-27  Martin Baulig  <martin@gnome.org>
18718
18719         * class.cs (MethodData.Define): Put back call to
18720         TypeManager.AddMethod(), accidentally commented this out.
18721
18722         * report.cs (Debug): New public method to print debugging information,
18723         this is `[Conditional ("DEBUG")]'.
18724
18725 2002-07-26  Martin Baulig  <martin@gnome.org>
18726
18727         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18728         (switch_statement): Push the current_block to the switch_stack and
18729         pop it again when we're done with the switch.
18730         (switch_section): The new block is a child of the current_block.
18731         Fixes bug #24007, added test-152.cs.
18732
18733 2002-07-27  Martin Baulig  <martin@gnome.org>
18734
18735         * expression.cs (Invocation.EmitArguments): When calling a varargs
18736         function with only its fixed arguments, we need to pass an empty
18737         array.
18738
18739 2002-07-27  Martin Baulig  <martin@gnome.org>
18740
18741         Mono 0.13 has been released.
18742
18743 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18744
18745         * driver.cs: Rename --resource to --linkres, because that is what
18746         we do currently, we dont support --resource yet.
18747
18748         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18749
18750 2002-07-25  Martin Baulig  <martin@gnome.org>
18751
18752         * class.cs (MethodData): New public class.  This is a `method builder'
18753         class for a method or one accessor of a Property/Indexer/Event.
18754         (MethodData.GetMethodFlags): Moved here from MemberBase.
18755         (MethodData.ApplyAttributes): Likewise.
18756         (MethodData.ApplyObsoleteAttribute): Likewise.
18757         (MethodData.ApplyConditionalAttribute): Likewise.
18758         (MethodData.ApplyDllImportAttribute): Likewise.
18759         (MethodData.CheckAbstractAndExternal): Likewise.
18760         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18761         (MethodData.Emit): Formerly known as Method.Emit().
18762         (MemberBase): Moved everything which was specific to a single
18763         accessor/method to MethodData.
18764         (Method): Create a new MethodData and call Define() and Emit() on it.
18765         (Property, Indexer, Event): Create a new MethodData objects for each
18766         accessor and call Define() and Emit() on them.
18767
18768 2002-07-25  Martin Baulig  <martin@gnome.org>
18769
18770         Made MethodCore derive from MemberBase to reuse the code from there.
18771         MemberBase now also checks for attributes.
18772
18773         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18774         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18775         as virtual.
18776         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18777         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18778         (MemberBase.ApplyAttributes): New virtual method; applies the
18779         attributes to a method or accessor.
18780         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18781         (MemberBase.ApplyConditionalAttribute): Likewise.
18782         (MemberBase.ApplyDllImportAttribute): Likewise.
18783         (MemberBase.CheckAbstractAndExternal): Likewise.
18784         (MethodCore.ParameterTypes): This is now a property instead of a
18785         method, it's initialized from DoDefineParameters().
18786         (MethodCore.ParameterInfo): Removed the set accessor.
18787         (MethodCore.DoDefineParameters): New protected virtual method to
18788         initialize ParameterTypes and ParameterInfo.
18789         (Method.GetReturnType): We can now simply return the MemberType.
18790         (Method.GetMethodFlags): Override the MemberBase version and add
18791         the conditional flags.
18792         (Method.CheckBase): Moved some code from Define() here, call
18793         DoDefineParameters() here.
18794         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18795         here to avoid some larger code duplication.
18796         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18797         ensure that abstract and external accessors don't declare a body.
18798
18799         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18800         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18801         lookup in the attribute's parent classes, so we need to abort as soon
18802         as we found the first match.
18803         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18804         the attribute has no arguments.
18805
18806         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18807         of a Method.
18808
18809 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18810
18811         * cs-parser.jay: reverted previous patch.
18812
18813 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18814
18815         * cs-parser.jay: fixed bug #22119.
18816
18817 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18818
18819         * attribute.cs: fixed compilation. The error was:
18820         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18821         be assigned to before control leaves the current method."
18822         [FIXME:  Filed as bug #28186: MCS must report this error.]
18823
18824 2002-07-25  Martin Baulig  <martin@gnome.org>
18825
18826         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18827         method to pull the condition name ouf of a Conditional attribute.
18828         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18829         the obsolete message and error flag out of an Obsolete attribute.
18830
18831         * class.cs (Method.GetMethodFlags): New public method to get the
18832         TypeManager.MethodFlags for this method.
18833         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18834         private methods.
18835         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18836         if we're overriding a virtual function, set the new private variable
18837         `parent_method'; call the new TypeManager.AddMethod().
18838
18839         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18840         the MethodBuilder and the Method in a PtrHashtable.
18841         (TypeManager.builder_to_method): Added for this purpose.
18842         (TypeManager.MethodFlags): Added IsObsoleteError.
18843         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18844         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18845         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18846         the message from the attribute.
18847
18848 2002-07-24  Martin Baulig  <martin@gnome.org>
18849
18850         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18851         preprocessor directives, ensure that the argument to #define/#undef is
18852         exactly one identifier and that it's actually an identifier.
18853
18854         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18855         did not work ....
18856
18857 2002-07-24  Martin Baulig  <martin@gnome.org>
18858
18859         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18860         initialize it to TypeManager.object_type in the constructor.
18861         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18862         of the `hm.get_current' method if we're using the collection pattern.
18863         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18864         for the explicit conversion to make it work when we're using the collection
18865         pattern and the `Current' property has a different return type than `object'.
18866         Fixes #27713.
18867
18868 2002-07-24  Martin Baulig  <martin@gnome.org>
18869
18870         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18871         does not match, but don't report any errors.  This method is called in
18872         order for all methods in a MethodGroupExpr until a matching method is
18873         found, so we don't want to bail out if the first method doesn't match.
18874         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18875         matches, report the 123.  Fixes #28070.
18876
18877 2002-07-24  Martin Baulig  <martin@gnome.org>
18878
18879         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18880         TypeManager.TypeToCoreType() to the top of the method so the
18881         following equality checks will work.  Fixes #28107.
18882
18883 2002-07-24  Martin Baulig  <martin@gnome.org>
18884
18885         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18886         operand is of type uint, and the other operand is of type sbyte,
18887         short or int, the operands are converted to type long." -
18888         Actually do what this comment already told us.  Fixes bug #28106,
18889         added test-150.cs.
18890
18891 2002-07-24  Martin Baulig  <martin@gnome.org>
18892
18893         * class.cs (MethodBase): New abstract class.  This is now a base
18894         class for Property, Indexer and Event to avoid some code duplication
18895         in their Define() and DefineMethods() methods.
18896         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18897         generic methods for Define() and DefineMethods().
18898         (FieldBase): Derive from MemberBase, not MemberCore.
18899         (Property): Derive from MemberBase, not MemberCore.
18900         (Property.DefineMethod): Moved all the code from this method to the
18901         new MethodBase.DefineAccessor(), just call it with appropriate
18902         argumetnts.
18903         (Property.Define): Call the new Property.DoDefine(), this does some
18904         sanity checks and we don't need to duplicate the code everywhere.
18905         (Event): Derive from MemberBase, not MemberCore.
18906         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18907         accessors, this will also make them work with interface events.
18908         (Indexer): Derive from MemberBase, not MemberCore.
18909         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18910         (Indexer.Define): Use the new MethodBase functions.
18911
18912         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18913         argument to the constructor.
18914         (Interface.FindMembers): Added support for interface events.
18915         (Interface.PopluateEvent): Implemented.
18916
18917         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18918
18919 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18922         but this is required to check for a method name being the same as
18923         the containing class.  
18924
18925         Handle this now.
18926
18927 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18928
18929         * interface.cs: initialize variable.
18930
18931 2002-07-23  Martin Baulig  <martin@gnome.org>
18932
18933         Implemented the IndexerName attribute in interfaces.
18934
18935         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18936         name if this is an explicit interface implementation.
18937         (Indexer.InterfaceIndexerName): New public variable.  If we're
18938         implementing an interface indexer, this is the IndexerName in that
18939         interface.  Otherwise, it's the IndexerName.
18940         (Indexer.DefineMethod): If we're implementing interface indexer,
18941         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18942         and Pending.ImplementIndexer methods.
18943         (Indexer.Define): Also define the PropertyBuilder if we're
18944         implementing an interface indexer and this is neither an explicit
18945         interface implementation nor do the IndexerName match the one in
18946         the interface.
18947
18948         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18949         If a method is defined here, then we always need to create a proxy
18950         for it.  This is used when implementing interface indexers.
18951         (Pending.IsInterfaceIndexer): New public method.
18952         (Pending.ImplementIndexer): New public method.
18953         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18954         This is used when implementing interface indexers to define a proxy
18955         if necessary.
18956         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18957         define a proxy if necessary.
18958
18959         * interface.cs (Interface.IndexerName): New public variable.
18960         (Interface.PopulateIndexer): Set the IndexerName.
18961         (Interface.DefineIndexers): New private method.  Populate all the
18962         indexers and make sure their IndexerNames match.
18963
18964         * typemanager.cs (IndexerPropertyName): Added support for interface
18965         indexers.
18966
18967 2002-07-22  Martin Baulig  <martin@gnome.org>
18968
18969         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18970         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18971         ret if HasReturnLabel.
18972         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18973         variables.
18974
18975         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18976         and set the ec.LoopBeginTryCatchLevel.
18977         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18978         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18979         the current ec.TryCatchLevel, the branch goes out of an exception
18980         block.  In this case, we need to use Leave and not Br.
18981
18982 2002-07-22  Martin Baulig  <martin@gnome.org>
18983
18984         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18985         block unless the block does not always return or it is contained in
18986         another try { ... } catch { ... } block.  Fixes bug #26506.
18987         Added verify-1.cs to the test suite.
18988
18989 2002-07-22  Martin Baulig  <martin@gnome.org>
18990
18991         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18992         then we do not always return.  Fixes bug #24985.
18993
18994 2002-07-22  Martin Baulig  <martin@gnome.org>
18995
18996         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18997         lookup on a per-class level; ie. walk up the class hierarchy until we
18998         found at least one applicable method, then choose the best among them.
18999         Fixes bug #24463 and test-29.cs.
19000
19001 2002-07-22  Martin Baulig  <martin@gnome.org>
19002
19003         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19004         return types of the methods.  The return type is not part of the
19005         signature and we must not check it to make the `new' modifier work.
19006         Fixes bug #27999, also added test-147.cs.
19007         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19008
19009         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19010         on the method's return type.
19011
19012 2002-07-21  Martin Baulig  <martin@gnome.org>
19013
19014         * assign.cs: Make this work if the rightmost source is a constant and
19015         we need to do an implicit type conversion.  Also adding a few more tests
19016         to test-38.cs which should have caught this.
19017
19018         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19019         target in the makefile for this.  The makefile.gnu is primarily intended
19020         for end-users who don't want to debug the compiler.
19021
19022 2002-07-21  Martin Baulig  <martin@gnome.org>
19023
19024         * assign.cs: Improved the Assign class so it can now handle embedded
19025         assignments (X = Y = Z = something).  As a side-effect this'll now also
19026         consume less local variables.  test-38.cs now passes with MCS, added
19027         a few new test cases to that test.
19028
19029 2002-07-20  Martin Baulig  <martin@gnome.org>
19030
19031         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19032         instructions.  Fixes bug #27977, also added test-146.cs.
19033
19034 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19035
19036         * cs-tokenizer.cs: fixed getHex ().
19037
19038 2002-07-19  Martin Baulig  <martin@gnome.org>
19039
19040         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19041         not Type.GetType() to lookup the array type.  This is needed when
19042         we're constructing an array of a user-defined type.
19043         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19044         single-dimensional arrays, but also for single-dimensial arrays of
19045         type decimal.
19046
19047 2002-07-19  Martin Baulig  <martin@gnome.org>
19048
19049         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19050         this function is called, it's not allowed to share LocalBuilders
19051         among ILGenerators.
19052
19053 2002-07-19  Martin Baulig  <martin@gnome.org>
19054
19055         * expression.cs (Argument.Resolve): Report an error 118 when trying
19056         to pass a type as argument.
19057
19058 2002-07-18  Martin Baulig  <martin@gnome.org>
19059
19060         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19061         Conv_R_Un for the signed `long' type.
19062
19063 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19064
19065         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19066         `expr' for the temporary result, as that will fail if we do
19067         multiple resolves on the same expression.
19068
19069 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19070
19071         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19072         ec.TypeContainer for looking up aliases. 
19073
19074         * class.cs (TypeContainer): Remove LookupAlias from here.
19075
19076         * decl.cs (DeclSpace); Move here.
19077
19078 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * class.cs (FindMembers): Only call filter if the constructor
19081         bulider is not null.
19082
19083         Also handle delegates in `NestedTypes' now.  Now we will perform
19084         type lookups using the standard resolution process.  This also
19085         fixes a bug.
19086
19087         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19088         This uses Expressions (the limited kind that can be parsed by the
19089         tree) instead of strings.
19090
19091         * expression.cs (ComposedCast.ToString): Implement, used to flag
19092         errors since now we have to render expressions.
19093
19094         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19095         FormArrayType. 
19096
19097         * ecore.cs (SimpleName.ToString): ditto.
19098
19099         * cs-parser.jay: Instead of using strings to assemble types, use
19100         Expressions to assemble the type (using SimpleName, ComposedCast,
19101         MemberAccess).  This should fix the type lookups in declarations,
19102         because we were using a different code path for this.
19103
19104         * statement.cs (Block.Resolve): Continue processing statements
19105         even when there is an error.
19106
19107 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19108
19109         * class.cs (Event.Define): Also remove the `remove' method from
19110         the list of pending items.
19111
19112         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19113         generate more compact code. 
19114
19115 2002-07-17  Martin Baulig  <martin@gnome.org>
19116
19117         * const.cs (Const.LookupConstantValue): Add support for constant
19118         `unchecked' and `checked' expressions.
19119         Also adding test case test-140.cs for this.
19120
19121 2002-07-17  Martin Baulig  <martin@gnome.org>
19122
19123         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19124         check whether mi.ReturnType implements the IEnumerator interface; the
19125         `==' and the IsAssignableFrom() will fail in this situation.
19126
19127 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19128
19129         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19130         here too.
19131
19132 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19133
19134         * expression.cs: fixed bug #27811.
19135
19136 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19137
19138         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19139         Molaro: when we are a ref, the value already contains a pointer
19140         value, do not take the address of it.
19141
19142 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19143         * removed mb-parser.jay and mb-tokenizer.cs
19144
19145 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19146
19147         * expression.cs: check against the building corlib void type.
19148
19149 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19150
19151         * ecore.cs: fix for valuetype static readonly fields: when 
19152         initializing them, we need their address, not the address of a copy.
19153
19154 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19155
19156         * typemanager.cs: register also enum_type in corlib.
19157
19158 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19159
19160         * class.cs: allow calling this (but not base) initializers in structs.
19161
19162 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19163
19164         * ecore.cs: make sure we compare against the building base types
19165         in GetTypeSize ().
19166
19167 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19168
19169         * typemanager.cs: fix TypeToCoreType() to handle void and object
19170         (corlib gets no more typerefs after this change).
19171
19172 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19173
19174         * expression.cs (ArrayCreation.EmitArrayArguments): use
19175         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19176
19177         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19178         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19179         array indexes, the runtime actually forbids them.
19180
19181         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19182         for array arguments here.
19183
19184         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19185         instead of the default for ValueTypes.
19186
19187         (New.DoEmit): Use IsValueType instead of
19188         IsSubclassOf (value_type)
19189         (New.DoResolve): ditto.
19190         (Invocation.EmitCall): ditto.
19191
19192         * assign.cs (Assign): ditto.
19193
19194         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19195         Statements *are* currently doing part of their resolution during
19196         Emit.  
19197
19198         Expressions do always resolve during resolve, but statements are
19199         only required to propagate resolution to their children.
19200
19201 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19202
19203         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19204
19205         (LoadAssembly): Do not add the dll if it is already specified
19206
19207         (MainDriver): Add the System directory to the link path at the end,
19208         after all the other -L arguments. 
19209
19210         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19211         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19212         ldelem.u1) and using the opposite for sbytes.
19213
19214         This fixes Digger, and we can finally run it.
19215
19216         * driver.cs (UnixParseOption): Move the option parsing here.  
19217         (CSCParseOption): Implement CSC-like parsing of options.
19218
19219         We now support both modes of operation, the old Unix way, and the
19220         new CSC-like way.  This should help those who wanted to make cross
19221         platform makefiles.
19222
19223         The only thing broken is that /r:, /reference: and /lib: are not
19224         implemented, because I want to make those have the same semantics
19225         as the CSC compiler has, and kill once and for all the confussion
19226         around this.   Will be doing this tomorrow.
19227
19228         * statement.cs (Unsafe.Resolve): The state is checked during
19229         resolve, not emit, so we have to set the flags for IsUnsfe here.
19230
19231 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19232
19233         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19234         not catch the Error_ObjectRefRequired in SimpleName (as it is
19235         possible to have a class/instance variable name that later gets
19236         deambiguated), we have to check this here.      
19237
19238 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19239
19240         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19241         make static and put into Expression.
19242
19243         (Event.Define): Register the private field of the event with the 
19244         TypeManager so that GetFieldFromEvent can get at it.
19245
19246         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19247         keep track of the private field associated with an event which
19248         has no accessors.
19249
19250         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19251         private field.
19252
19253         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19254
19255 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19256
19257         * expression.cs (Binary.EmitBranchable): this routine emits the
19258         Binary expression in a branchable context.  This basically means:
19259         we need to branch somewhere, not just get the value on the stack.
19260
19261         This works together with Statement.EmitBoolExpression.
19262
19263         * statement.cs (Statement.EmitBoolExpression): Use
19264         EmitBranchable. 
19265
19266 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19267
19268         * statement.cs (For): Reduce the number of jumps in loops.
19269
19270         (For): Implement loop inversion for the For statement.
19271
19272         (Break): We can be breaking out of a Try/Catch controlled section
19273         (foreach might have an implicit try/catch clause), so we need to
19274         use Leave instead of Br.
19275
19276         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19277         now).  If the instace expression supports IMemoryLocation, we use
19278         the AddressOf method from the IMemoryLocation to extract the
19279         address instead of emitting the instance.
19280
19281         This showed up with `This', as we were emitting the instance
19282         always (Emit) instead of the Address of This.  Particularly
19283         interesting when This is a value type, as we dont want the Emit
19284         effect (which was to load the object).
19285
19286 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19287
19288         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19289
19290         * statement.cs (Checked): Set the CheckedState during the resolve
19291         process too, as the ConvCast operations track the checked state on
19292         the resolve process, and not emit.
19293
19294         * cs-parser.jay (namespace_member_declaration): Flag that we have
19295         found a declaration when we do.  This is used to flag error 1529
19296
19297         * driver.cs: Report ok when we display the help only.
19298
19299 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19300
19301         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19302
19303 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19304
19305         * cs-tokenizer.cs (define): We also have to track locally the
19306         defines.  AllDefines is just used for the Conditional Attribute,
19307         but we also need the local defines for the current source code. 
19308
19309 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19310
19311         * statement.cs (While, For, Do): These loops can exit through a
19312         Break statement, use this information to tell whether the
19313         statement is the last piece of code.
19314
19315         (Break): Flag that we break.
19316
19317         * codegen.cs (EmitContexts): New `Breaks' state variable.
19318
19319 2002-07-03  Martin Baulig  <martin@gnome.org>
19320
19321         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19322         modifiers in method declarations in structs.  Otherwise, you won't
19323         be able to override things like Object.Equals().
19324
19325 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19326
19327         * class.cs (Method, Property, Indexer): Do not allow the public
19328         modifier to be used in explicit interface implementations.
19329
19330         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19331         override modifiers in method declarations in structs
19332
19333 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19334
19335         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19336         integer or real overflow, report an error
19337
19338 2002-07-02  Martin Baulig  <martin@gnome.org>
19339
19340         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19341         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19342         to tell the runtime about our newly created System.Object and
19343         System.ValueType types.
19344
19345 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19346
19347         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19348         struct instead of Ldarg/Starg.
19349
19350 2002-07-02  Martin Baulig  <martin@gnome.org>
19351
19352         * expression.cs (Indirection.Indirection): Call
19353         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19354
19355 2002-07-02  Martin Baulig  <martin@gnome.org>
19356
19357         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19358         ValueType, call TypeManager.TypeToCoreType() on it.
19359         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19360         the OpCodes.Newarr argument.
19361
19362 2002-07-02  Martin Baulig  <martin@gnome.org>
19363
19364         * expression.cs (Invocation.EmitCall): When compiling corlib,
19365         replace all calls to the system's System.Array type to calls to
19366         the newly created one.
19367
19368         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19369         System.Array methods.
19370         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19371         from the system's System.Array type which must be replaced.
19372
19373 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19374
19375         * typemanager.cs: load unverifiable_code_ctor so we can build
19376         corlib using the correct type. Avoid using GetTypeCode() with
19377         TypeBuilders.
19378         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19379         TypeManager.object_type to allow building corlib.
19380
19381 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19382
19383         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19384
19385 2002-07-01  Martin Baulig  <martin@gnome.org>
19386
19387         * class.cs: Make the last change actually work, we need to check
19388         whether `ifaces != null' to avoid a crash.
19389
19390 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19391
19392         * class.cs: when we build structs without fields that implement
19393         interfaces, we need to add the interfaces separately, since there is
19394         no API to both set the size and add the interfaces at type creation
19395         time.
19396
19397 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19398
19399         * expression.cs: the dimension arguments to the array constructors
19400         need to be converted if they are a long.
19401
19402 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19403
19404         * class.cs: don't emit ldarg.0 if there is no parent constructor
19405         (fixes showstopper for corlib).
19406
19407 2002-06-29  Martin Baulig  <martin@gnome.org>
19408
19409         MCS now compiles corlib on GNU/Linux :-)
19410
19411         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19412         ie. check for MethodImplOptions.InternalCall.
19413
19414         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19415         and TypeManager.attribute_type are null, so we must explicitly check
19416         whether parent is not null to find out whether it's an attribute type.
19417         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19418         and SetBuilder, not only if the property is neither abstract nor external.
19419         This is necessary to set the MethodImplOptions on the accessor methods.
19420         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19421         SetBuilder, see Property.Emit().
19422
19423         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19424         populate "System.Object", "System.ValueType" and "System.Attribute" since
19425         they've already been populated from BootCorlib_PopulateCoreTypes().
19426
19427 2002-06-29  Martin Baulig  <martin@gnome.org>
19428
19429         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19430         is the NullLiteral, we also need to make sure that target_type is not
19431         an enum type.   
19432
19433 2002-06-29  Martin Baulig  <martin@gnome.org>
19434
19435         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19436         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19437         before calling BootstrapCorlib_ResolveDelegate ().
19438
19439 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19440
19441         * statement.cs: fixed build-breaker. All tests passed ok.
19442
19443 2002-06-27  Martin Baulig  <martin@gnome.org>
19444
19445         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19446         for System.Decimal when compiling corlib.
19447
19448 2002-06-27  Martin Baulig  <martin@gnome.org>
19449
19450         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19451         switch blocks which contain nothing but a default clause.
19452
19453 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19454
19455        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19456
19457 2002-06-27  Martin Baulig  <martin@gnome.org>
19458
19459         * ecore.cs (PropertyExpr.PropertyExpr): Call
19460         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19461
19462         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19463         is already a TypeBuilder.
19464
19465 2002-06-27  Martin Baulig  <martin@gnome.org>
19466
19467         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19468         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19469         the "from an array-type to System.Array" case.  This makes it work
19470         when compiling corlib.
19471
19472 2002-06-27  Martin Baulig  <martin@gnome.org>
19473
19474         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19475         non-static PropertyExpr, set its InstanceExpression.  This makes
19476         the `ICollection.Count' property work in System/Array.cs.
19477
19478 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19479
19480         * driver.cs: Made error handling more consistent.  Errors now
19481         tracked by Report class, so many methods which used to return int
19482         now return void.  Main() now prints success/failure and 
19483         errors/warnings message.
19484
19485         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19486         the magic number return values (123 and 124).  Now, if the
19487         expected error occurs, the compiler exits with success (exit value
19488         0).  If the compilation completes without seeing that particular
19489         error, the compiler exits with failure (exit value 1).  The
19490         makefile in mcs/errors has been changed to handle the new behaviour.
19491
19492         * report.cs: Made 'expected error' number a property and renamed
19493         it from 'Probe' to 'ExpectedError'.
19494
19495         * genericparser.cs: Removed error handling support, since it is
19496         now all done by Report class.
19497
19498         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19499         class, so parse() no longer returns an int.
19500
19501         * namespace.cs: Use Report.Error instead of GenericParser.error
19502
19503 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19504
19505         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19506         TypeContainer.AddOperator): At the front of the list put the
19507         explicit implementations, so they get resolved/defined first. 
19508
19509 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19510
19511         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19512         interface type is implemented by this TypeContainer.  Used during
19513         explicit interface implementation.
19514
19515         (Property.Define, Indexer.Define, Method.Define): Validate that
19516         the given interface in the explicit implementation is one of the
19517         base classes for the containing type.
19518
19519         Also if we are explicitly implementing an interface, but there is
19520         no match in the pending implementation table, report an error.
19521
19522         (Property.Define): Only define the property if we are
19523         not explicitly implementing a property from an interface.  Use the
19524         correct name also for those properties (the same CSC uses,
19525         although that is really not needed).
19526
19527         (Property.Emit): Do not emit attributes for explicitly implemented
19528         properties, as there is no TypeBuilder.
19529
19530         (Indexer.Emit): ditto.
19531
19532         Hiding then means that we do not really *implement* a pending
19533         implementation, which makes code fail.
19534
19535 2002-06-22  Martin Baulig  <martin@gnome.org>
19536
19537         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19538         the return value of Object.GetType().  [FIXME: we need to do this whenever
19539         we get a type back from the reflection library].
19540
19541 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19542
19543         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19544
19545 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19546
19547         * attribute.cs: Return null if we can not look up the type.
19548
19549         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19550         the interface types found.
19551
19552         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19553         interface types found.
19554
19555         * typemanager.cs (GetInterfaces): Make this routine returns alll
19556         the interfaces and work around the lame differences between
19557         System.Type and System.Reflection.Emit.TypeBuilder in the results
19558         result for GetInterfaces.
19559
19560         (ExpandInterfaces): Given an array of interface types, expand and
19561         eliminate repeated ocurrences of an interface.  This expands in
19562         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19563         be IA, IB, IC.
19564
19565 2002-06-21  Martin Baulig  <martin@gnome.org>
19566
19567         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19568         on System.Enum.
19569
19570 2002-06-21  Martin Baulig  <martin@gnome.org>
19571
19572         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19573         and called with one of the core types, return the corresponding typebuilder for
19574         that type.
19575
19576         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19577         element type.
19578
19579 2002-06-21  Martin Baulig  <martin@gnome.org>
19580
19581         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19582         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19583         (Expression.ConvertReferenceExplicit): Likewise.
19584
19585         * expression.cs (ElementAccess.DoResolve): Likewise.
19586         (ElementAccess.DoResolveLValue): Likewise.
19587
19588 2002-06-10  Martin Baulig  <martin@gnome.org>
19589
19590         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19591         add the "value" parameter to the parameter list.
19592
19593         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19594         to our caller.
19595
19596 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19597
19598         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19599         the argument to an int, uint, long or ulong, per the spec.  Also
19600         catch negative constants in array creation.
19601
19602 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19603
19604         * class.cs: do not allow the same interface to appear twice in
19605         the definition list.
19606
19607 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19608
19609         * ecore.cs: don't use ldlen with System.Array.
19610
19611 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19612
19613         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19614
19615 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19616
19617         * modifiers.cs: produce correct field attributes for protected
19618         internal. Easy fix so miguel can work on ther harder stuff:-)
19619
19620 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19621
19622         * pending.cs: New file.  Move the code from class.cs here.
19623         Support clearning the pending flag for all methods (when not doing
19624         explicit interface implementation).
19625
19626 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19627
19628         * rootcontext.cs: added a couple more types needed to bootstrap.
19629
19630 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19631
19632         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19633         constructor in the type, instead of any constructor in the type
19634         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19635         a bug in the Mono runtime when applying the params attribute). 
19636
19637 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19638         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19639
19640 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19641
19642         * expression.cs (Unary.ResolveOperator): Use TypeManager
19643         to resolve the type.
19644
19645 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19646
19647         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19648         attached.
19649
19650         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19651         with each member too.
19652
19653         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19654         field builders too - this takes care of the enum member case.
19655
19656 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19657
19658         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19659         address-of operator on both value types and pointers.
19660
19661 2002-06-10  Martin Baulig  <martin@gnome.org>
19662
19663         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19664         PropertyBuilder to the `property_builders' list.
19665
19666         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19667         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19668         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19669         find any indexers which are inherited from an interface.
19670
19671 2002-06-09  Martin Baulig  <martin@gnome.org>
19672
19673         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19674         the same type as the constant if necessary.  There's also a test-130.cs
19675         for this.
19676
19677         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19678
19679         * typemanager.cs (TypeManager.ChangeType): Previously known as
19680         Enum.ChangeEnumType().
19681
19682 2002-06-09  Martin Baulig  <martin@gnome.org>
19683
19684         * expression.cs (Cast.TryReduce): Added support for consts.
19685
19686 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19687
19688         * class.cs (Accessor): Hold attributes information so we can pass
19689         it along.
19690
19691         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19692         Modify to pass in attributes attached to the methods.
19693
19694         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19695
19696         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19697         to handle the Accessor kind :-)
19698
19699         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19700
19701 2002-06-08  Martin Baulig  <martin@gnome.org>
19702
19703         * expression.cs (Unary.TryReduceNegative): Added support for
19704         ULongConstants.
19705
19706 2002-06-08  Martin Baulig  <martin@gnome.org>
19707
19708         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19709         name can't be found in the `defined_names' - the caller will do a
19710         MemberLookup in this case and thus find methods in System.Enum
19711         such as Enum.IsDefined().
19712
19713 2002-06-08  Martin Baulig  <martin@gnome.org>
19714
19715         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19716         Convert.ChangeType() which works with TypeBuilder created types.
19717         (Enum.LookupEnumValue, Enum.Define): Use it here.
19718
19719         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19720         `TypeBuilder.BaseType != null' check.
19721         (TypeContainer.FindMembers): Only lookup parent members if we
19722         actually have a parent.
19723         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19724         (ConstructorInitializer.Resolve): Likewise.
19725
19726         * interface.cs (Interface.FindMembers): Added
19727         `TypeBuilder.BaseType != null' check.
19728
19729         * rootcontext.cs (RootContext.ResolveCore): Added
19730         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19731         classes_second_stage.
19732
19733         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19734         debug_type and trace_type when compiling with --nostdlib.       
19735
19736 2002-06-07  Martin Baulig  <martin@gnome.org>
19737
19738         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19739         (AddField): Set it to true when adding a non-static field.
19740         (DefineType): Use `have_nonstatic_fields' to find out whether we
19741         have non-static fields, not `Fields != null'.
19742
19743 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19744
19745         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19746         dereferencing a null on the static-field code path)
19747
19748 2002-05-30  Martin Baulig  <martin@gnome.org>
19749
19750         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19751         to take command line arguments.  Use reflection to call the new
19752         custom `Initialize' function on the symbol writer and pass it the
19753         command line arguments.
19754
19755         * driver.cs (--debug-args): New command line argument to pass command
19756         line arguments to the symbol writer.
19757
19758 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19759
19760         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19761         the target type for indexers and properties.  Thanks to Joe for
19762         catching this.
19763
19764 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19765
19766         * typemanager.cs (MethodFlags): returns the method flags
19767         (Obsolete/ShouldIgnore) that control warning emission and whether
19768         the invocation should be made, or ignored. 
19769
19770         * expression.cs (Invocation.Emit): Remove previous hack, we should
19771         not do this on matching a base type, we should do this based on an attribute
19772
19773         Only emit calls to System.Diagnostics.Debug and
19774         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19775         on the command line.
19776
19777         * rootcontext.cs: Global settings for tracing and debugging.
19778
19779         * cs-tokenizer.cs (define): New utility function to track
19780         defines.   Set the global settings for TRACE and DEBUG if found.
19781
19782 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19783
19784         * interface.cs (Populate*): Pass in the TypeContainer as well as
19785         the DeclSpace as parameters so that we can create EmitContexts and
19786         then use that to apply attributes etc.
19787
19788         (PopulateMethod, PopulateEvent, PopulateProperty)
19789         (PopulateIndexer): Apply attributes everywhere.
19790
19791         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19792         etc.
19793
19794         (ApplyAttributes): Update accordingly.
19795
19796         We now apply interface attributes for all members too.
19797
19798 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19799
19800         * class.cs (Indexer.Define); Correctly check if we are explicit
19801         implementation (instead of checking the Name for a ".", we
19802         directly look up if the InterfaceType was specified).
19803
19804         Delay the creation of the PropertyBuilder.
19805
19806         Only create the PropertyBuilder if we are not an explicit
19807         interface implementation.   This means that explicit interface
19808         implementation members do not participate in regular function
19809         lookups, and hence fixes another major ambiguity problem in
19810         overload resolution (that was the visible effect).
19811
19812         (DefineMethod): Return whether we are doing an interface
19813         implementation. 
19814
19815         * typemanager.cs: Temporary hack until we get attributes in
19816         interfaces (Ravi is working on that) and we get IndexerName
19817         support in interfaces.
19818
19819         * interface.cs: Register the indexers as properties.
19820
19821         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19822         warning, I have verified that this is a bug in the .NET runtime
19823         (JavaScript suffers of the same problem).
19824
19825         * typemanager.cs (MemberLookup): When looking up members for
19826         interfaces, the parent of an interface is the implicit
19827         System.Object (so we succeed in searches of Object methods in an
19828         interface method invocation.  Example:  IEnumerable x;  x.ToString
19829         ()) 
19830
19831 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19832
19833         * class.cs (Event): Events should also register if they do
19834         implement the methods that an interface requires.
19835
19836         * typemanager.cs (MemberLookup); use the new GetInterfaces
19837         method. 
19838
19839         (GetInterfaces): The code used to lookup interfaces for a type is
19840         used in more than one place, factor it here. 
19841
19842         * driver.cs: Track the errors at the bottom of the file, we kept
19843         on going.
19844
19845         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19846         instance if the method we are calling is static!
19847
19848 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19849
19850         * attribute.cs (ApplyAttributes): Make this function filter out
19851         the IndexerName attribute (as that attribute in reality is never
19852         applied) and return the string constant for the IndexerName
19853         attribute. 
19854
19855         * class.cs (TypeContainer.Emit): Validate that all the indexers
19856         have the same IndexerName attribute, and if so, set the
19857         DefaultName attribute on the class. 
19858
19859         * typemanager.cs: The return value might contain other stuff (not
19860         only methods).  For instance, consider a method with an "Item"
19861         property and an Item method.
19862
19863         * class.cs: If there is a problem with the parameter types,
19864         return. 
19865
19866 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19867
19868         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19869         looks at user defined conversion after making a call to 
19870         StandardConversionExists - we need this for overload resolution.
19871
19872         * expression.cs : Update accordingly the various method calls.
19873
19874         This fixes 2 bugs filed against implicit user defined conversions 
19875
19876 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19877
19878         * statement.cs: Track the result of the assignment.
19879
19880 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19881
19882         * expression.cs (MemberAccess): Improved error reporting for
19883         inaccessible members.
19884
19885 2002-05-22  Martin Baulig  <martin@gnome.org>
19886
19887         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19888         itself with debugging support.
19889
19890 2002-05-22  Martin Baulig  <martin@gnome.org>
19891
19892         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19893         Removed, this isn't needed anymore.
19894
19895 2002-05-20  Martin Baulig  <martin@gnome.org>
19896
19897         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19898         be underlying type for an enum.
19899
19900 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19901
19902         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19903         that splits out the loading of just the core types.
19904
19905         * rootcontext.cs (ResolveCore): Split the struct resolution in
19906         two, so we can load the enumeration underlying types before any
19907         enums are used.
19908
19909         * expression.cs (Is): Bandaid until we fix properly Switch (see
19910         bug #24985 for details).
19911
19912         * typemanager.cs (ImplementsInterface): The hashtable will contain
19913         a null if there are no interfaces implemented.
19914
19915 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19916
19917         * cs-parser.jay (indexer_declarator): It is fine to have array
19918         parameters
19919
19920 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19921
19922         * typemanager.cs: (RegisterBuilder): New function used to register
19923         TypeBuilders that implement interfaces.  Since
19924         TypeBuilder.GetInterfaces (as usual) does not work with lame
19925         Reflection.Emit. 
19926         (AddUserType): register interfaces.
19927
19928         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19929         dealing with TypeBuilder.  Also, arrays are showing up as
19930         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19931         methods can not be invoked on them!
19932
19933         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19934         (ImplicitReferenceConversionExists): Split out from
19935         StandardConversionExists. 
19936
19937         * expression.cs (As): We were only implementing one of the three
19938         cases for the as operator.  We now implement them all.
19939         (Is): Implement the various other cases for Is as well.
19940
19941         * typemanager.cs (CACHE): New define used to control if we want or
19942         not the FindMembers cache.  Seems to have a negative impact on
19943         performance currently
19944
19945         (MemberLookup): Nested types have full acess to
19946         enclosing type members
19947
19948         Remove code that coped with instance/static returns for events, we
19949         now catch this in RealFindMembers.
19950
19951         (RealFindMembers): only perform static lookup if the instance
19952         lookup did not return a type or an event.  
19953
19954 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19955
19956         * assign.cs (CompoundAssign): We pass more semantic information
19957         now to Compound Assignments than we did before: now we have all
19958         the information at hand, and now we resolve the target *before* we
19959         do the expression expansion, which allows the "CacheValue" method
19960         to have the effect we intended (before, a [x] += 1 would generate
19961         two differen ArrayAccess expressions from the ElementAccess,
19962         during the resolution process).
19963
19964         (CompoundAssign.DoResolve): Resolve target and original_source here.
19965
19966 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19967
19968         * expression.cs (ArrayAccess): dropped debugging information. 
19969
19970         * typemanager.cs: Small bug fix: I was always returning i_members,
19971         instead of one of i_members or s_members (depending on which had
19972         the content).
19973
19974         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19975         method is invoked before any code generation takes place, and it
19976         is a mechanism to inform that the expression will be invoked more
19977         than once, and that the method should use temporary values to
19978         avoid having side effects
19979
19980         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19981
19982         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19983         implementation.
19984
19985         * expression.cs (Indirection, ArrayAccess): Add support for
19986         CacheTemporaries in these two bad boys. 
19987
19988         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19989         ldobj or ldind_ref.  
19990         (StoreFromPtr): Handle stobj as well.
19991
19992         * expression.cs (UnaryMutator): Share more code.
19993
19994         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19995         down: I was not tracking the Filter function as well, which
19996         was affecting the results of the cache.
19997
19998 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19999
20000         * attribute.cs: Remove the hack to handle the CharSet property on
20001         StructLayouts. 
20002
20003 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20004
20005         * attribute.cs (DoResolve): More uglyness, we now only try to
20006         resolve the attribute partially, to extract the CharSet
20007         information (only if we are a StructLayout attribute).  Otherwise 
20008
20009         (GetExtraTypeInfo): Add some code to conditionally kill in the
20010         future this.   I am more and more convinced that the .NET
20011         framework has special code to handle the attribute setting on
20012         certain elements.
20013
20014         * expression.cs (IsParamsMethodApplicable): Revert my previous
20015         foreach change here, it was wrong.
20016
20017 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20018
20019         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20020         (pp_expr): do not abort on unknown input, just return.
20021         (eval): abort if there are pending chars.
20022
20023         * attribute.cs (Attribute.Resolve): Positional parameters are
20024         optional.  Deal with that case.
20025
20026         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20027         the Ansi/Unicode/Auto information for the type.
20028
20029         (TypeContainer.DefineType): instantiate the EmitContext here, as
20030         we will be using it during the type definition (to resolve
20031         attributes) and during the emit phase.
20032
20033         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20034         to pull type information out of the attributes
20035
20036         (Attribute.Resolve): track the constructor builder, and allow for
20037         multiple invocations (structs and classes will use this).
20038
20039         * ecore.cs (MemberLookupFinal): new version with all the
20040         parameters customizable.
20041
20042         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20043         constructors.  Return if the result value is null (as the error
20044         would have been flagged already by MemberLookupFinal)
20045
20046         Do not allow instances of abstract classes or interfaces to be
20047         created.
20048
20049         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20050         We have to compare the assembly property here when dealing with
20051         FamANDAssem and Assembly access modifiers, because we might be
20052         creating an assembly from *modules* (that means that we are not
20053         getting TypeBuilders for types defined in other modules that are
20054         part of this assembly).
20055
20056         (Method.Emit): If the method is marked abstract and has a body,
20057         emit an error. 
20058
20059         (TypeContainer.DefineMembers): If both the defined member and the
20060         parent name match are methods, then do not emit any warnings: let
20061         the Method.Define routine take care of flagging warnings.  But if
20062         there is a mismatch (method overrides something else, or method is
20063         overriwritten by something, then emit warning).
20064
20065         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20066         set to null, this means `do not check for the return type on the
20067         signature'. 
20068
20069         (Method.Define): set the return type for the method signature to
20070         null, so that we get methods with the same name and parameters and
20071         different return types.  This is used to flag warning 114 (you are
20072         hiding a method, and you probably want to use the new/override
20073         keywords instead).
20074
20075         * typemanager.cs (MemberLookup): Implemented proper access
20076         control, closing a long standing set of bug reports.  The problem
20077         was that the Framework only has two bits: Public and NonPublic,
20078         and NonPublic includes private and protected methods, but we need
20079         to enforce the FamANDAssem, FamOrAssem and Family. 
20080
20081 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20082
20083         * statement.cs (GotoCase): Return true: Ammounts to giving up
20084         knowledge on whether we return or not, and letting the other case
20085         be responsible for it.
20086
20087 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * driver.cs: Do not load directories for each file processed, only
20090         do it if there is a pattern.
20091
20092         * ecore.cs: Report readonly assigns here as well, as we might have
20093         been resolved only by MemberAccess.
20094
20095         (SimpleName.SimpleNameResolve): Also be useful for LValue
20096         resolution.   We need this to propagate assign to local readonly variables
20097
20098         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20099         do not want to reuse potential criteria memory.
20100
20101         * class.cs (MyEventBuilder): Set reflected_type;
20102
20103         * ecore.cs (Constantify): Added support for constifying bools.
20104
20105         (RootContext.LookupType): Added a cache for values looked up in
20106         the declaration space.
20107
20108         * typemanager.cs (FindMembers): Now is a front-end to
20109         RealFindMembers, and provides a two-level hashtable-based cache to
20110         the request.  
20111
20112         15% performance improvement: from 22.5 to 19.2 seconds.
20113
20114         * expression.cs (IsParamsMethodApplicable): use foreach.
20115         (Invocation.DoResolve): ditto.
20116         (New.DoResolve): ditto.
20117         (ArrayCreation.DoResolve): ditto.
20118
20119         * ecore.cs (FindMostEncompassingType): use foreach.
20120
20121         * delegate.cs (NewDelegate.DoResolve): Use foreach
20122
20123         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20124         (RemoveMethods): use foreach.
20125
20126         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20127         nested foreach statements instead of for, and also break out of
20128         the inner loop once a match is found.
20129
20130         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20131
20132 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20133
20134         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20135         we actually unwrap the expression to allow for extra information
20136         to be extracted. 
20137
20138         * expression.cs: Use Shr_Un on unsigned operations. 
20139
20140 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20141
20142         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20143         applicable operators was not being considered correctly. This closes
20144         the bug Miguel reported.
20145
20146 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20147
20148         * attribute.cs: check that the type derives from System.Attribute
20149         and report the correct error in that case (moved the duplicate code to
20150         its own method, too).
20151
20152 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20153
20154         * attribute.cs: lookup attribute type name as the spec says: first the
20155         bare attribute name and then name + "Attribute" (nant compiles with
20156         mcs after this fix).
20157
20158 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20159
20160         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20161         Because of the way we parse things, we should try to see if a
20162         UIntConstant can fit in an integer.
20163
20164 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20165
20166         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20167         when we are in an explicit context.
20168
20169         (ConvertReferenceExplicit): When converting from Iface type S to Class
20170         T make sure the rules are implemented as an OR.
20171
20172         * parameter.cs (ParameterType): Make it a property for now although the
20173         purpose really isn't anything immediate.
20174
20175         * expression.cs (Is*Applicable): Do better checking on the parameter type
20176         of a ref/out parameter. The ones from the system assemblies are already 
20177         marked with the correct type so we don't need to do any correction.
20178
20179         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20180         the object type is standard too so include that.
20181
20182 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20183
20184         * ecore.cs (StandardConversionExists): Augment with missing code:
20185         deal with IntConstant, LongConstants and Enumerations.
20186
20187         * assign.cs: Report the error, instead of failing silently
20188
20189         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20190         typecontainer that they are declared, because the
20191         typecontainer/namespace will have the list of using clauses that
20192         need to be applied.
20193
20194         Assembly Attributes were escaping the normal registration
20195         mechanism. 
20196
20197         (EmitCode): Apply attributes within an EmitContext that represents
20198         the container they were declared on.
20199
20200         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20201
20202 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20203
20204         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20205         Revamp completely - make much cleaner as we now operate only
20206         on a set of Types.
20207
20208         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20209         to implement the logic detailed in the spec more correctly.
20210
20211         (UserDefinedConversion): Update accordingly.
20212
20213 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20214
20215         * statement.cs: Return flow analysis information up.
20216
20217         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20218         and the default.
20219
20220         (token): Do not consume an extra character before calling
20221         decimal_digits.
20222
20223 2002-05-06  Piers Haken <piersh@friskit.com>
20224
20225         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20226
20227 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20228
20229         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20230         EmitContext during the instance constructor initializer
20231         resolution, to stop access to instance variables.
20232
20233         This is mandated by the spec, last paragraph of the `constructor
20234         initializers' section. 
20235
20236 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20237
20238         * cs-parser.jay, class.cs (Accessor): new class used to represent
20239         an accessor (get or set).  In the past we used `null' to represent
20240         a missing accessor.  But this is ambiguous because there was no
20241         way to tell in abstract indexers/properties if one of them was
20242         specified.
20243
20244         Now there is a way of addressing that.
20245
20246         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20247         instead of FindMembers.
20248
20249         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20250         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20251
20252         * attribute.cs: Treat indexers and properties as the same in terms
20253         of applying attributes
20254
20255         * ecore.cs (FindMostEncompassedType): Use statically initialized
20256         EmptyExpressions()s like we do elsewhere to avoid creating useless
20257         objects (and we take this out of the tight loop).
20258
20259         (GetConversionOperators): Move the code to extract the actual
20260         operators to a separate routine to clean things up.
20261
20262 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20263
20264         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20265         events are always registered FieldBuilders.
20266
20267         * class.cs (FieldBase): New class shared by Fields 
20268
20269         * delegate.cs: If we are a toplevel delegate, use our full name.
20270         If we are a nested delegate, then only use our tail name.
20271
20272 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20273
20274         * expression.cs (IsApplicable): Ensure that we add the "&" to
20275         ref/out types before comparing it with the type of the argument.
20276
20277         (IsParamsMethodApplicable): Ditto.
20278
20279         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20280         silly me ;-)
20281
20282         * delegate.cs : Handle the case when we have more than one applicable
20283         method. Flag an error only when we finish checking all.
20284
20285 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20286
20287         * expression.cs: Add support for boolean static initializers.
20288
20289 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20292
20293         * parameter.cs (ComputeParameterTypes,
20294         ComputeAndDefineParameterTypes): Better error handling: now we
20295         clear the `types' cache if we fail during any of the type lookups.
20296         We also return the status code correctly to our caller
20297
20298         * delegate.cs: If we fail to define a delegate, abort the extra
20299         steps. 
20300
20301         * expression.cs (Binary.ResolveOperator): for
20302         operator==(object,object) and operator !=(object, object) we also
20303         have to verify that there is an implicit conversion from one to
20304         the other.
20305
20306         (ArrayAccess.DoResolve): Array Access can operate on
20307         non-variables. 
20308
20309 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20310
20311         * assign.cs (CompoundAssign): A new class used as a "flag" that
20312         the assignment actually is happening as part of a compound
20313         assignment operator.
20314
20315         During compound assignment, a few new rules exist to enable things
20316         like:
20317
20318         byte b |= 1 + 2
20319
20320         From the spec:
20321
20322         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20323         to the type of x) if y is implicitly convertible to the type of x,
20324         and the operator is a builtin operator and the return type of the
20325         operator is explicitly convertible to the type of x. 
20326
20327         * rootcontext.cs: Reset warning level to 2.  4 catches various
20328         "interesting" features in mcs, we must clean this up at some
20329         point, but currently am trying to kill other bugs ;-)
20330
20331         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20332         in container classes as well.  
20333
20334         * expression.cs (Binary.ResolveOperator): Handle string case
20335         before anything else (as operator overloading does emit an error
20336         before doing anything else).
20337
20338         This code could go away when we move to a table driven model, but
20339         i could not come up with a good plan last night.
20340
20341 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20342
20343         * typemanager.cs (CSharpName): reimplementation using regex.
20344         * class.cs: added null check for fields in Emit
20345         * rootcontext.cs: set warninglevel to 4
20346
20347 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20348
20349         * typemanager.cs (CSharpName): reimplemented with Lupus
20350         suggestion.
20351
20352 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20353
20354         * statement.cs (If): correclty implement Resolve, because we were
20355         not catching sem errors in there.  The same process is needed
20356         everywhere else. 
20357         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20358
20359
20360         (Statement.Warning_DeadCodeFound): Factorize code.
20361         (While): Report dead code here too.
20362
20363         (Statement): Added Resolve virtual method to allow
20364         for resolution split from the emit code.
20365
20366 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20367
20368         * statement.cs (EmitBoolExpression): No longer try to resolve the
20369         expression here.    
20370         (MakeBoolean): New utility function that resolve, implicitly
20371         converts to boolean and tags the expression. 
20372
20373
20374         (If, Do): Implement dead code elimination.
20375         (While): Implement loop inversion
20376
20377         (Do, While, For, If): Resolve the expression prior to calling our
20378         code generation.
20379
20380 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20381
20382         * class.cs:
20383           - added method Report28 (warning: program has more than one entry point)
20384           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20385           - modified method Method.Define, the part at the end of the method
20386
20387         * rootcontext.cs: added static public Location EntryPointLocation;
20388           
20389         * ../errors/cs0028.cs : Add test case for the above warning.              
20390
20391         * typemanager.cs:
20392           - modified method CSharpName to allow arrays of primitive type to
20393             be printed nicely (e.g. instead of System.Int32[][] it now prints
20394             int[][])
20395           - added method CSharpSignature: returns the signature of a method
20396             in string format to be used in reporting errors, warnings, etc.
20397
20398         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20399         with String.Empty.
20400
20401 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20402
20403         * delegate.cs (Define): Fix extremely silly bug where I was
20404         setting the type of the 'object' parameter of the BeginInvoke
20405         method to System.IAsyncResult instead of System.Object ;-)
20406
20407 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20408
20409         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20410         here. 
20411
20412         (Constructor.Emit): return if we fail to initialize the
20413         constructor.  Another door closed!  
20414
20415         * expression.cs (New.DoResolve): Improve error message (from -6 to
20416         1501).  Use DeclaredOnly lookup to find the exact constructor.
20417
20418         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20419         loop.  This is useful.
20420
20421         * cs-parser.jay: Adjust the default parameters so that destructors
20422         have the proper signature.
20423
20424 2002-04-26  Martin Baulig  <martin@gnome.org>
20425
20426         * driver.cs (LoadAssembly): If `assembly' contains any characters
20427         which are only valid in path names and not in assembly names
20428         (currently slash, backslash and point), use Assembly.LoadFrom ()
20429         instead of Assembly.Load () on the `assembly' (before iteration
20430         over the link_paths).
20431
20432 2002-04-26  Martin Baulig  <martin@gnome.org>
20433
20434         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20435
20436 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20437
20438         * class.cs (Property): use the new typemanager.MemberLookup
20439
20440         (TypeContainer.MemberLookup): Implement using the
20441         TypeManager.MemberLookup now. 
20442
20443         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20444         and return MemberInfos, so that these can be used without an
20445         EmitContext (what we had before).
20446
20447 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20448
20449         * expression.cs: Fix the case where the argument to params if the
20450         type of the params.  I omitted handling this before.   Fixed
20451
20452 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20453
20454         * driver.cs: Call BootCorlib_PopulateCoreType
20455
20456         * class.cs (Property.CheckBase): Check for properties only, not
20457         for all members. 
20458
20459         * interface.cs: Temporary hack: try/catch around the
20460         CustomAttributeBuilder, because I am getting an exception that I
20461         do not understand.
20462
20463         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20464         types whose definitions are required to be there (attributes are
20465         defined before standard types).
20466
20467         Compute definitions as we boot the various types, as they are used
20468         immediately (value_type class will need object_type, but if we do
20469         not initialize object_type, we will pass a null, which will let
20470         the runtime pick the System.Object from the existing corlib, which
20471         is not what we want).
20472
20473 2002-04-22  Patrik Torstensson <totte@labs2.com>
20474
20475         * cs-tokenizer.cs: fixed a number of trim() issues.
20476
20477 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20478
20479         * expression.cs (Argument.Type): Ensure that we return the correct
20480         type when we have out or ref parameters [in which case we 
20481         append a "&"].
20482
20483 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20484
20485         * class.cs (Property, Indexer): Allow extern modifier in there. 
20486
20487         * typemanager.cs (InitBaseTypes): Initializes object_type and
20488         value_type, since those will be used early on during the bootstrap
20489         process to compile corlib.
20490
20491         (InitCoreTypes): Move code from here to InitBaseTypes.
20492
20493 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20494
20495         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20496         single-dimension arrays as using the ldlen opcode.  
20497
20498         Daniel Lewis discovered this optimization.  
20499
20500         * typemanager.cs: Add signature for System.Array::get_Length
20501
20502 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20503
20504         * statement.cs: report the error when the foreach does not apply to an
20505         array nor a collection.
20506
20507 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20508
20509         * expression.cs: Add implicit conversions to the operator ~.
20510
20511         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20512
20513         * typemanager.cs: Locate the decimal constructor.
20514
20515 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20516
20517         * attribute.cs: use the new property of TypeOf.
20518         * expression.cs: added 'get' property around typearg.
20519
20520         These changes fix a build breaker reported by NickD. Is this the
20521         correct way to fix?  If not, please, revert my changes and make it
20522         work :-).
20523
20524 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20525
20526         * attribute.cs: Add support for typeof in attribute invocations.
20527         I am not sure that this is right though.
20528
20529 2002-04-14  Duncan Mak  <duncan@ximian.com>
20530
20531         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20532         Binary.Operator.Division case.
20533
20534 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20535
20536         * class.cs (DefineType): Ensure that we do a proper check on
20537         attribute types and also register it with the TypeManager.
20538
20539         (TypeContainer.Targets): The default for attribute types is
20540         AttributeTargets.All.
20541
20542         * attribute.cs (ApplyAttributes): Registering the attribute type
20543         is done elsewhere, not when we discover we have a Usage attribute.
20544
20545 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20546
20547         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20548         and get rid of is_delegate parameter.
20549
20550         * everywhere : update.
20551
20552 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20553
20554         * cs-parser.jay (compilation_unit): Revamp completely to use
20555         some new ideas that I got from Rhys' grammar to solve the problems
20556         with assembly level attributes.
20557
20558         (outer_declaration): New grammar production.
20559
20560         (attribute_sections): Add.
20561
20562         (opt_attributes): Base on attribute_sections
20563
20564         (namespace_declaration): Allow opt_attributes to tackle the case
20565         when we have assembly level attributes - we are clever in this
20566         regard now ;-)
20567
20568         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20569         attributes in the non-global context.
20570
20571         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20572         instead of SetGlobalAttributes.
20573
20574         * class.cs, rootcontext.cs : Ensure we define and generate 
20575         attribute types before anything else.
20576
20577         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20578         and flag the new error -20 for the case when the attribute type
20579         does not have valid targets specified. csc does not catch this.
20580
20581         * ../errors/errors.txt : update for error # -20
20582
20583 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20584
20585         * support.cs (InternalParameters.ParameterModifier): Do some null
20586         checking and return sane values.
20587
20588         * class.cs (Method.Define): If we are a PInvoke method, ensure
20589         that we are static and extern. Report error # 601
20590
20591         * ../errors/cs0601.cs : Add test case for the above error.
20592
20593 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20594
20595         * rootcontext.cs (attribute_types): We need to keep type of
20596         all attribute types separately and emit code for them first.
20597
20598         (RegisterAttribute) : Implement.
20599
20600         * class.cs (DefineType): Check if the current Type is a custom
20601         attribute type and register it accordingly.
20602
20603         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20604         adding the first attribute twice and rename to
20605
20606         (SetGlobalAttributes): this.
20607
20608         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20609         lookups.
20610
20611         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20612         if we are processing global arguments. Hmm, I am unsure of this.
20613
20614 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20615
20616         * expression.cs: added static array of strings to avoid calling
20617         Enum.ToString () for Operator in Binary. Significant recover of
20618         performance.
20619
20620 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20621
20622         * class.cs (FindMembers): Allow the Builders of the various
20623         members to be null.  If they are skip them.  This only happens
20624         during the PInvoke declaration.
20625
20626 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20627
20628         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20629         failure, so we do not keep going afterwards.
20630
20631         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20632         wanted to pass `false' as the `is_delegate' argument.  If this is
20633         the case, why not use delegate_type == null to mean `is_delegate =
20634         false' and anything else as is_delegate = true.
20635
20636 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20637
20638         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20639         code for the section, not the beginning of the tests.
20640
20641 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20642
20643         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20644
20645         * expression.cs (Binary): same.  Warn about errors where we have
20646         Enum/Enum in operator + as well.
20647
20648 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20649
20650         * statement.cs:
20651                 - added support for switch(bool)
20652                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20653                 - add TableSwitchEmit() to handle table-based switch statements
20654
20655 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20656
20657         * expression.cs (Invocation.OverloadResolve): Factor out code which
20658         does parameter compatibility checking with arguments so that we can 
20659         re-use the code even from Delegate.VerifyApplicability
20660
20661         (VerifyArgumentsCompat): Move above code here.
20662
20663         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20664         and instead make a call to the above method.
20665
20666 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20667
20668         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20669         We use it to keep track of classes which are attribute types.
20670
20671 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20672
20673         * delegate.cs (Delegate.Define): Correctly define the types in the
20674         presence of fixed and array parameters.
20675
20676         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20677         doing FindMembers.
20678
20679         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20680         include NonPublic after the first iteration.
20681
20682         * class.cs (Indexer.CheckBase): Only check if both parents are
20683         non-null. 
20684
20685         * cs-parser.jay (accessor_body): If empty, set to null.
20686
20687         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20688         same code path here to resolve constants names that we did have in
20689         MemberAccess.DoResolve.  There is too much code duplicated here.
20690
20691 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20692
20693         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20694
20695         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20696         to MakeUnionSet.
20697
20698         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20699         tokens, numbers and strings.
20700
20701         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20702         parenthesis.
20703
20704         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20705         asyncronous parameters and the regular parameters.  
20706
20707         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20708         specify the target directory.
20709
20710         * expression.cs: (This.DoResolve): Simplify
20711         (As.Emit): Optimize, do not generate IsInst if the expression is
20712         always of the given type.
20713
20714         (Is.DoResolve): Bug fix, we were reporting both always/never for
20715         the is expression.
20716
20717         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20718         creating too many unnecessary arrays.
20719
20720 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20721
20722         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20723         fields instead of rolling our own initializer.   Takes care of all
20724         implicit conversions, and drops unnecessary static checks/argument.
20725
20726 2002-03-31  Dick Porter  <dick@ximian.com>
20727
20728         * driver.cs: use the GetDirectories() return values properly, and
20729         use "/" as path separator.
20730
20731 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20732
20733         * expression.cs (Unary): Optimize - - expr into expr.
20734         (Binary): Optimize a + (-b) into a -b.
20735
20736         * codegen.cs (CodeGen): Made all methods static.
20737
20738 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20739
20740         * rootcontext.cs: 
20741
20742         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20743         TypeBuilder property.
20744
20745         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20746         instead. 
20747
20748         * tree.cs: Removed the various RecordXXXX, and replaced with a
20749         single RecordDecl.  Removed all the accessor methods, and just
20750         left a single access point Type 
20751
20752         * enum.cs: Rename DefineEnum to DefineType.
20753
20754         * decl.cs: New abstract method `DefineType' used to unify the
20755         Defines for Enumerations, Interfaces, TypeContainers and
20756         Delegates.
20757
20758         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20759         LookupBaseClasses method that used to live in class.cs and
20760         interface.cs here, and renamed to FindType.
20761
20762         * delegate.cs: Implement DefineType.  Take advantage of the
20763         refactored pattern for locating the parent builder without taking
20764         the parent_builder argument (which we know does not work if we are
20765         nested, and triggering a toplevel definition).
20766
20767 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20768
20769         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20770         accessibility of a member has changed during override and report
20771         an error if so.
20772
20773         * class.cs (Method.Define, Property.Define): Only complain on
20774         overrides if the method is private, any other accessibility is
20775         fine (and since we just checked the permission is the same, we are
20776         good to go).
20777
20778         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20779         and elif are processed always.  The other pre-processing
20780         directives are only processed if we are "taking" the path
20781
20782 2002-03-29  Martin Baulig  <martin@gnome.org>
20783
20784         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20785         current location is not Null.
20786
20787         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20788         a separate method so we can profile it.
20789
20790         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20791         `span.Seconds' are just seconds, but no minutes or hours.
20792         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20793
20794 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20795
20796         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20797         Remove the gratuitous set of Final:
20798
20799                                 // If an interface implementation, then we can set Final.
20800                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20801                                     implementing.DeclaringType.IsInterface)
20802                                         flags |= MethodAttributes.Final;
20803
20804         I do not know what I was smoking when I used that.
20805
20806
20807         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20808         step into fixing the name resolution issues for delegates and
20809         unifying the toplevel name resolution.
20810
20811 2002-03-28  Martin Baulig  <martin@gnome.org>
20812
20813         * class.cs (Method.Emit): If we have a symbol writer, call its
20814         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20815         tell it about the current method.
20816
20817         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20818         writer that we're going to emit the first byte of IL code for a new
20819         statement (a new source line).
20820         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20821         EmitContext.Mark() before emitting any code.
20822
20823         * location.cs (SymbolDocument): Return null when we're Null.
20824
20825         * statement.cs (Statement): Moved the `Location loc' variable here.
20826         (Statement.EmitBoolExpression): If we have a symbol writer, call
20827         ec.Mark() before emitting any code to tell it that we're at the
20828         beginning of a new statement.
20829         (StatementExpression): Added `Location' argument to the constructor.
20830         (Block): Added public readonly variable `StartLocation' and public
20831         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20832         (Block): Added constructor which takes a start and end location.
20833         (Block.SetEndLocation): New method. This sets the end location.
20834         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20835         local variables we create.
20836         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20837         each statement and do also mark the begin and end of the block.
20838
20839         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20840         tell it the current lexer.Location, use Location.Null for the end of the
20841         block.
20842         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20843         current block, set its end location using SetEndLocation().
20844         (statement_expression): StatementExpression constructor now takes the
20845         lexer.Location as additional argument.
20846         (for_statement, declare_local_variables): Likewise.
20847         (declare_local_variables): When creating a new implicit block, use the
20848         new Block constructor and pass it the lexer.Location.
20849
20850 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20851
20852         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20853         members also on the parent interfaces recursively.
20854
20855 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20856
20857         * report.cs: Use new formats, since Gonzalo finished the missing
20858         bits. 
20859
20860         * expression.cs (Binary.ResolveOperator): added missing operator|
20861         operator& and operator^ for bool/bool.
20862
20863         * cs-parser.jay: CheckDef now takes a Location argument that is
20864         used to report errors more precisly (instead of reporting the end
20865         of a definition, we try to track something which is a lot closer
20866         to the source of the problem).
20867
20868         * cs-tokenizer.cs: Track global token use, so we can properly flag
20869         the use of #define/#undef after the first token has been seen.
20870
20871         Also, rename the reportXXXX to Error_DescriptiveName
20872
20873         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20874         TypeContainer, so that Enum and Interface can use this too.
20875
20876         * class.cs (TypeContainer.LookupInterfaceOrClass,
20877         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20878         `builder' argument.  Typically this was used to pass the parent
20879         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20880         the definition).  
20881
20882         The problem is that a nested class could trigger the definition of
20883         a toplevel class, and the builder would be obviously wrong in that
20884         case. 
20885
20886         So we drop this argument, and we compute dynamically the
20887         TypeBuilder/ModuleBuilder (the correct information was available
20888         to us anyways from DeclSpace.Parent)
20889
20890         * interface.cs (Interface.DefineInterface): Drop builder
20891         parameter cleanup like class.cs
20892
20893         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20894         like class.cs
20895
20896         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20897         values. 
20898
20899         (Try.Emit): Propagate the returns value from the statement.
20900
20901         (Return.Emit): Even if we are leavning 
20902
20903         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20904
20905         * modifiers.cs: Fix the computation of MethodAttributes flags.
20906
20907 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20908
20909         * driver.cs: allow compilation of files that start with '/'.
20910         Add a default case when checking the argument of --target.
20911
20912 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20913
20914         * interface.cs: Implement the same search algorithm for types in
20915         the interface code.
20916
20917         * delegate.cs: Do not allow multiple definition.
20918
20919         * Recovered ChangeLog that got accidentally amputated
20920
20921         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20922
20923         * rootcontext.cs: Load manually enum to allow core classes to
20924         contain enumerations.
20925
20926         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20927         Update to new static methods in TypeManager.
20928
20929         * typemanager.cs (GetMethod, GetConstructor): Use our
20930         implementation of FindMembers to find the members, since during
20931         corlib compilation, the types are TypeBuilders and GetMethod and
20932         GetConstructor do not work.
20933
20934         Make all methods in TypeManager static.
20935
20936         (InitCodeHelpers): Split the functionality from
20937         the InitCodeTypes function.
20938
20939         * driver.cs: Call InitCodeHelpers after we have populated the
20940         types. 
20941
20942         * cs-parser.jay (delegate_declaration): we did not used to compute
20943         the delegate name correctly for void delegates.
20944
20945 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20946
20947         * rootcontext.cs (RootContext): Init the interface_resolve_order
20948         and type_container_resolve_order always.
20949
20950         (ResolveCore, BootstrapCorlib_ResolveClass,
20951         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20952         compiler when compiling with --nostdlib
20953
20954         * class.cs (TypeContainer.DefineType): Check that our parent is
20955         not null.  This test is most important when we are bootstraping
20956         the core types.
20957
20958         * codegen.cs: Split out the symbol writing code.
20959
20960 2002-03-25  Martin Baulig  <martin@gnome.org>
20961
20962         * driver.cs (-g): Made -g an alias for --debug.
20963
20964 2002-03-24  Martin Baulig  <martin@gnome.org>
20965
20966         * codegen.cs (SymbolWriter): New public variable. Returns the
20967         current symbol writer.
20968         (CodeGen): Added `bool want_debugging_support' argument to the
20969          constructor. If true, tell the ModuleBuild that we want debugging
20970         support and ask it for the ISymbolWriter.
20971         (Save): If we have a symbol writer, call it's Close() method after
20972         saving the assembly.
20973
20974         * driver.c (--debug): New command line argument to create a
20975         debugger information file.
20976
20977         * location.cs (SymbolDocument): New public property. Returns an
20978         ISymbolDocumentWriter object for the current source file or null
20979         if we don't have a symbol writer.
20980
20981 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20982
20983         * driver.cs (LoadAssembly): Correctly return when all the paths
20984         have been tried and not before.
20985
20986         * statement.cs (Switch.Emit): return the actual coverage for this
20987         statement (returns/not-returns)
20988
20989         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20990         switch of the statement if we are the last switch section.  That
20991         kills two problems: try/catch problems (we used to emit an empty
20992         nop at the end) and switch statements where all branches would
20993         return. 
20994
20995 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20996
20997         * driver.cs: Add default assemblies (the equivalent to the
20998         Microsoft CSC.RSP file)
20999
21000         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21001         also update tokens_seen and set it to false.
21002
21003         * driver.cs: Implement --recurse for Mike.
21004
21005         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21006         correctly splitting out the paths.
21007
21008 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21009
21010         * interface.cs (Interface.PopulateProperty): Instead of using
21011         `parent' as the declaration space for the set parameters, use
21012         `this' 
21013
21014         * support.cs (InternalParameters): InternalParameters constructor
21015         takes a DeclSpace instead of a TypeContainer.
21016
21017         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21018         types are being initialized, load the address of it before calling
21019         the function.  
21020
21021         (New): Provide a mechanism to disable the generation of local
21022         value type temporaries when the caller will be providing us with
21023         an address to store it.
21024
21025         (ArrayCreation.EmitDynamicInitializers): Use it.
21026
21027 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21028
21029         * expression.cs (Invocation.EmitArguments): Only probe for array
21030         property if there is more than one argument.  Sorry about that.
21031
21032         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21033         empty param arrays.
21034
21035         * class.cs (Method.LabelParameters): Fix incorrect code path that
21036         prevented the `ParamArrayAttribute' from being applied to the
21037         params attribute.
21038
21039 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21040
21041         * support.cs (ReflectionParameters): Correctly compute whether the
21042         last argument is a params array.  Fixes the problem with
21043         string.Split ('a')
21044
21045         * typemanager.cs: Make the assemblies array always be non-null
21046         (empty, but non-null)
21047
21048         * tree.cs (RecordDecl): New function that abstracts the recording
21049         of names.  This reports error 101, and provides a pointer to the
21050         previous declaration.  Fixes a crash in the compiler.
21051
21052         * cs-parser.jay (constructor_declaration): Update to new grammar,
21053         and provide a constructor_body that can be empty.
21054
21055 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21056
21057         * driver.cs: Add support for --resources.
21058
21059         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21060         Make all types for the various array helper methods be integer.
21061
21062         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21063         CheckState to ConvCast.
21064
21065         (ConvCast): Now it takes a `checked' state argument, to avoid
21066         depending on the emit context for the conversion, and just using
21067         the resolve time setting.
21068
21069         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21070         instead of Invocation.EmitArguments.  We do not emit the original
21071         arguments, instead we emit those which have been converted to
21072         unsigned int expressions.
21073
21074         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21075
21076         * codegen.cs: ditto.
21077
21078         * expression.cs (LocalVariableReference): Drop the use of the
21079         Store function that depended on the variable index.
21080
21081         * statement.cs (VariableInfo): Drop the `Idx' property from this
21082         class, as this is not taking into account the indexes for
21083         temporaries tat we generate during the execution, getting the
21084         indexes wrong.
21085
21086         * class.cs: First emit class initializers, then call the parent
21087         constructor. 
21088
21089         * expression.cs (Binary): Fix opcode emision.
21090         (UnaryMutator.EmitCode): Support checked code generation
21091
21092         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21093         matches for events for both the Static and Instance scans,
21094         pointing to the same element.   Fix that.
21095
21096 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21097
21098         * rootcontext.cs (ResolveTree): Always set the
21099         interface_resolve_order, because nested interfaces will be calling
21100         into us.
21101
21102         * class.cs (GetInterfaceOrClass): Track the same resolution
21103         process used by TypeManager.LookupType.  This fixes the nested
21104         type lookups in class declarations (separate path from
21105         LookupType). 
21106
21107         (TypeContainer.DefineType): Also define nested interfaces.
21108         (TypeContainer.RegisterOrder): New public function used to
21109         register the order in which child interfaces need to be closed.
21110
21111         Nested interfaces need to be closed after their parents have been
21112         created. 
21113
21114         * interface.cs (InterfaceAttr): Put all the logic for computing
21115         the interface attribute here. 
21116
21117         (DefineInterface): Register our interface order with the
21118         RootContext or with the TypeContainer depending on the case.
21119
21120 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21121
21122         * cs-parser.jay: rework foreach statement to work with the new
21123         changes to the policy on SimpleNames.
21124
21125         * report.cs: support Stacktrace on warnings as well.
21126
21127         * makefile: drop --unsafe and /unsafe from the compile.
21128
21129 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21130
21131         * ecore.cs (StandardConversionExists): Modify to take an Expression
21132         as the first parameter. Ensure we do null -> reference type conversion
21133         checking.
21134
21135         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21136         temporary Expression objects.
21137
21138 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21139
21140         * interface.cs: workaround bug in method overloading resolution
21141         (there is already a bugzilla bug for it).
21142
21143 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21144
21145         We could also solve this problem by having a separate path for
21146         performing type lookups, instead of DoResolve, we could have a
21147         ResolveType entry point, and only participating pieces of the
21148         production (simplename, deref, array) would implement this. 
21149
21150         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21151         signal SimpleName to only resolve type names and not attempt to
21152         resolve anything else.
21153
21154         * expression.cs (Cast): Set the flag.
21155
21156         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21157
21158         * class.cs: Only report 108 if there is no `new' modifier.
21159
21160         * cs-parser.jay: rework foreach statement to work with the new
21161         changes to the policy on SimpleNames.
21162
21163         * report.cs: support Stacktrace on warnings as well.
21164
21165         * makefile: drop --unsafe and /unsafe from the compile.
21166
21167 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
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         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21184         makes the use more obvious of the DeclSpace.  The
21185         ec.TypeContainer.TypeBuilder is now only used to pull the
21186         TypeBuilder for it.
21187
21188         My theory is that I can get rid of the TypeBuilder completely from
21189         the EmitContext, and have typecasts where it is used (from
21190         DeclSpace to where it matters).  
21191
21192         The only pending problem is that the code that implements Aliases
21193         is on TypeContainer, and probably should go in DeclSpace.
21194
21195         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21196         lookups here, instead of doing that at parse time.  This means
21197         that our grammar will not introduce `LocalVariableReferences' as
21198         expressions at this point.  That solves the problem of code like
21199         this:
21200
21201         class X {
21202            static void Main ()
21203            { int X = 1;
21204             { X x = null }}}
21205
21206         This is only half the fix.  The full fix requires parameters to
21207         also be handled in this way.
21208
21209         * class.cs (Property.DefineMethod): When implementing an interface
21210         method, set newslot, when implementing an abstract method, do not
21211         set the flag (before we tried never setting it, or always setting
21212         it, which is the difference).
21213         (Indexer.DefineMethod): same.
21214         (Method.DefineMethod): same.
21215
21216         * ecore.cs: Only set the status used flag if we get back a Field.
21217
21218         * attribute.cs: Temporary hack, so Paolo can keep working.
21219
21220 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21221
21222         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21223         the unmanaged type in the case we have a MarshalAs attribute.
21224
21225         (Resolve): Handle the case when we are parsing the special MarshalAs
21226         attribute [we need to store the unmanaged type to use later]
21227
21228         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21229         MarshalAs Attribute.
21230
21231         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21232         on parameters and accordingly set the marshalling info.
21233
21234 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21235
21236         * class.cs: Optimizing slightly by removing redundant code after
21237         we switched to the `NoTypes' return value.
21238         (Property.DefineMethod): use NoTypes here too.
21239
21240         This fixes the bug I introduced in my last batch of changes.
21241
21242 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21243
21244         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21245
21246         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21247         Enums since those are types too. 
21248
21249         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21250
21251         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21252         thanks to a call during the lookup process.
21253
21254 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21255
21256         * statement.cs (Foreach): Lots of work to accomodate a particular
21257         kind of foreach statement that I had not kept in mind.  It is
21258         possible to have foreachs on classes that provide a GetEnumerator
21259         method that return objects that implement the "pattern" for using
21260         a foreach, there is no need to support GetEnumerator
21261         specifically. 
21262
21263         This is needed to compile nant.
21264
21265         * decl.cs: Only report 114 if the member is not `Finalize' and if
21266         the warning level is at least 2.
21267
21268         * class.cs: Moved the compare function from Method to
21269         MethodSignature. 
21270
21271         (MethodSignature.InheritableMemberSignatureCompare): Add new
21272         filter function that is used to extract inheritable methods from a
21273         class. 
21274
21275         (Method.Define): Use the new `inheritable_method_signature_filter'
21276         delegate
21277
21278         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21279         command. 
21280
21281 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21282
21283         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21284
21285         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21286
21287         * expression.cs: Pass location information to
21288         ConvertImplicitStandard. 
21289
21290         * class.cs: Added debugging code to track return values from
21291         interfaces. 
21292
21293 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21294
21295         * expression.cs (Is.DoResolve): If either side of the `is' is an
21296         interface, do not flag the warning.
21297
21298         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21299         for interfaces
21300
21301         * report.cs: Allow for --fatal to be used with --probe.
21302
21303         * typemanager.cs (NoTypes): Move the definition for the empty Type
21304         array here. 
21305
21306         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21307         properties. 
21308         (TypeContainer.DefineProxy): New function used to proxy to parent
21309         implementations when implementing interfaces.
21310         (TypeContainer.ParentImplements): used to lookup if our parent
21311         implements a public function that is required by an interface.
21312         (TypeContainer.VerifyPendingMethods): Hook this up.
21313
21314         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21315         `modules' and `assemblies' arraylists into arrays.  We only grow
21316         these are the very early start up of the program, so this improves
21317         the speedof LookupType (nicely measured).
21318
21319         * expression.cs (MakeByteBlob): Replaced unsafe code with
21320         BitConverter, as suggested by Paolo.
21321
21322         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21323         folding of string concatenation, but if either side is a string,
21324         and the other is not, then return null, and let the runtime use
21325         the concatenation on the string plus the object (using
21326         `Object.ToString'). 
21327
21328 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21329
21330         Constant Folding has been implemented now.
21331
21332         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21333         the error instead on types that are not supported in one's
21334         complement. 
21335
21336         * constant.cs (Constant and all children): New set of functions to
21337         perform implict and explicit conversions.
21338
21339         * ecore.cs (EnumConstant): Implement the new functions to perform
21340         conversion by proxying to the child expression.
21341
21342         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21343         own separate setting that can not be turned off from the command
21344         line using --unchecked or --checked and is only controlled using
21345         the checked/unchecked statements and expressions.  This setting is
21346         used by the constant folder to flag errors.
21347
21348         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21349         ConstantCheckState as well.   
21350
21351         During Resolve, they also have to flag the state, because the
21352         constant folder runs completely in the Resolve phase.
21353
21354         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21355         well.
21356
21357 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21358
21359         * cfold.cs: New file, this file contains the constant folder.
21360
21361         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21362         argument to track whether we are using the resulting address to
21363         load or store a value and provide better error messages. 
21364
21365         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21366         new AddressOf arguments.
21367
21368         * statement.cs (Foreach.EmitCollectionForeach): Update
21369
21370         * expression.cs (Argument.Emit): Call AddressOf with proper
21371         arguments to track usage.
21372
21373         (New.DoEmit): Call AddressOf with new arguments.
21374
21375         (Unary.Emit): Adjust AddressOf call.
21376
21377 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21378
21379         * cs-parser.jay (member_access): Change the case for pre-defined types
21380         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21381         this suggestion.
21382
21383         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21384         a method body.
21385
21386         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21387         essentially like methods and apply attributes like MethodImplOptions to them too.
21388
21389         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21390         not being null.
21391
21392         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21393         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21394         is the DeclSpace.
21395
21396         * Update code everywhere accordingly.
21397
21398         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21399
21400         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21401
21402 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21403
21404         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21405         try performing lookups against those instead of jumping straight into using
21406         the 'using' clauses.
21407
21408         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21409
21410         (LookupType): Perform lookups in implicit parents too.
21411
21412         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21413         sequence as RootContext.LookupType. 
21414
21415         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21416         the various cases of namespace lookups into this method.
21417
21418 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21419
21420         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21421         in positional arguments)
21422
21423         * class.cs (Operator): Update the AllowedModifiers to contain
21424         extern. 
21425
21426         * cs-parser.jay: Update operator declaration to allow for the
21427         operator body to be empty.
21428
21429         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21430         values. 
21431
21432 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21433
21434         * class.cs (Method.Emit): Label parameters.
21435
21436         * driver.cs: Return 1 or 0 as the program exit code.
21437
21438 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21439
21440         * expression.cs: Special case the `null' object when trying to
21441         auto-compute the type, as anything can be explicitly converted to
21442         that. 
21443
21444         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21445         spotting this Paolo.
21446
21447         (Expression.ImplicitNumericConversion): Perform comparissions of
21448         the type using the underlying type in the case of an enumeration
21449         rather than using the enumeration type for the compare.
21450
21451         Cope with the underlying == type case, which is not possible to
21452         catch before. 
21453
21454         (Expression.ConvertNumericExplicit): Perform comparissions of
21455         the type using the underlying type in the case of an enumeration
21456         rather than using the enumeration type for the compare.
21457
21458         * driver.cs: If the user does not supply an extension, assume .exe
21459
21460         * cs-parser.jay (if_statement): Rewrote so that we can track the
21461         location for the if statement.
21462
21463         * expression.cs (Binary.ConstantFold): Only concat strings when
21464         the operation is "+", not everything ;-)
21465
21466         * statement.cs (Statement.EmitBoolExpression): Take a location
21467         argument. 
21468         (If, While, Do): Track location.
21469
21470         * expression.cs (Binary.ResolveOperator): In the object + string
21471         case, I was missing a call to ConvertImplicit
21472
21473 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21474
21475         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21476         Location arguments. Ensure we use RootContext.LookupType to do our work
21477         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21478
21479         * interface.cs (PopulateMethod): Handle the type of the parameter being
21480         null gracefully.
21481
21482         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21483         have a params method with no fixed arguments and a call is made with no
21484         arguments.
21485
21486 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21487
21488         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21489         the verbatim-string-literal
21490
21491         * support.cs (InternalParameters.ParameterModifier): handle null
21492         fixed parameters.
21493         (InternalParameters.ParameterType): ditto.
21494
21495         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21496         duplicating the name of the variable parameter.
21497         (GetParameterByName): Fix bug where we were not looking up array
21498         paramters if they were the only present (thanks Paolo!).
21499         (GetParameterInfo): We only have an empty set of types if both
21500         fixed and array are set to null.
21501         (GetParameterInfo-idx): Handle FixedParameter == null
21502
21503         * cs-parser.jay: Handle the case where there is no catch
21504         statements (missing null test).
21505
21506 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21507
21508         * driver.cs (MainDriver): Be conservative on our command line
21509         handling.
21510
21511         Catch DirectoryNotFoundException when calling GetFiles.
21512
21513         (SplitPathAndPattern): Used to split the input specification into
21514         a path and a pattern that we can feed to Directory.GetFiles.
21515
21516 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21517
21518         * statement.cs (Fixed): Implement the last case of the Fixed
21519         statement (string handling).
21520
21521         * expression.cs (StringPtr): New class used to return a char * to
21522         a string;  Used by the Fixed statement.
21523
21524         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21525
21526         * expression.cs (Binary.ResolveOperator): Remove redundant
21527         MemberLookup pn parent type.
21528         Optimize union call, we do not need a union if the types are the same.
21529         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21530         type.
21531
21532         Specialize the use of MemberLookup everywhere, instead of using
21533         the default settings. 
21534
21535         (StackAlloc): Implement stackalloc keyword.
21536
21537         * cs-parser.jay: Add rule to parse stackalloc.
21538
21539         * driver.cs: Handle /h, /help, /?
21540
21541         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21542         before we supported unsafe code.
21543
21544         * makefile: add --unsafe to the self compilation of mcs.
21545
21546 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21547
21548         * expression.cs (PointerArithmetic): New class that is used to
21549         perform pointer arithmetic.
21550         (Binary.Resolve): Handle pointer arithmetic
21551         Handle pointer comparission.
21552         (ArrayPtr): Utility expression class that is used to take the
21553         address of an array.
21554
21555         (ElementAccess): Implement array access for pointers
21556
21557         * statement.cs (Fixed): Implement fixed statement for arrays, we
21558         are missing one more case before we are done.
21559
21560         * expression.cs (Indirection): Implement EmitAssign and set the
21561         ExprClass to Variable.  This allows pointer dereferences to be
21562         treated as variables, and to have values assigned to them.
21563
21564         * ecore.cs (Expression.StoreFromPtr): New utility function to
21565         store values dereferencing.
21566
21567 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21568
21569         * expression.cs (Binary.ResolveOperator): Ensure that we are
21570         not trying to operate on a void type - this fixes the reported
21571         bug.
21572
21573         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21574         the parent implementation is sealed.
21575
21576         * ../errors/cs0239.cs : Add.
21577
21578         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21579
21580         * typemanager.cs (unverifiable_code_type): Corresponds to 
21581         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21582         which have unsafe code in them.
21583
21584         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21585         unsafe context.
21586
21587 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21588
21589         * cs-tokenizer.cs: Add support for @"litreal strings"
21590
21591         Make tokenizer accept pre-processor directives
21592         on any column (remove the old C-like limitation). 
21593
21594         * rootcontext.cs (EmitCode): Emit any global attributes.
21595         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21596
21597         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21598
21599         * cs-parser.jay: Add support for global attributes.  
21600
21601 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21602
21603         * expression.cs (Indirection): New helper class.  Unary will
21604         create Indirection classes to be able to implement the
21605         IMemoryLocation interface on it.
21606
21607 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21608
21609         * cs-parser.jay (fixed_statement): reference the right statement.
21610
21611         * statement.cs (Fixed.Emit): Finish implementing the fixed
21612         statement for the &x case.
21613
21614 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21615
21616         * class.cs (Property.Define, Method.Define): Remove newslot when
21617         `implementing'.  
21618
21619         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21620         wrong.  NewSlot should only be used if the `new' keyword is present.
21621
21622         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21623         locating our system dir.  Sorry about this.
21624
21625 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21626
21627         * driver.cs (GetSystemDir): Compute correctly the location of our
21628         system assemblies.  I was using the compiler directory instead of
21629         the library directory.
21630
21631 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21632
21633         * expression.cs (BetterFunction): Put back in what Miguel commented out
21634         since it is the correct fix. The problem is elsewhere ;-)
21635
21636         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21637         parameters of the parms method are themselves compatible or not !
21638
21639         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21640         to check that a class implements an interface before saying that an implicit
21641         conversion was allowed. Use ImplementsInterface to do the checking.
21642
21643 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21644
21645         * class.cs (Method.Define): Track whether we are an explicit
21646         implementation or not.  And only call DefineMethodOverride if we
21647         are an explicit implementation.
21648
21649         (Property.DefineMethod): Ditto.
21650
21651 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21652
21653         * expression.cs (BetterFunction): Catch hideous bug which was
21654          preventing us from detecting ambiguous calls due to implicit casts i.e
21655         cs0121.
21656
21657 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21658
21659         * support.cs (Pair): Remove un-needed method.  I figured why I was
21660         getting the error in cs-parser.jay, the variable in a foreach loop
21661         is readonly, and the compiler does not really treat this as a variable.
21662
21663         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21664         instead of EQUALS in grammar.  
21665
21666         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21667
21668         * expression.cs (Unary.DoResolve): Check whether the argument is
21669         managed or not.
21670
21671 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * support.cs: Api for Pair to set a value.  Despite the fact that
21674         the variables are public the MS C# compiler refuses to compile
21675         code that accesses the field if the variable is part of a foreach
21676         statement. 
21677
21678         * statement.cs (Fixed): Begin implementation of the fixed
21679         statement.
21680
21681         (Block.AddVariable): Return the VariableInfo on success and null
21682         on failure instead of true/false. 
21683
21684         * cs-parser.jay (foreach): Catch errors on variables already
21685         defined (we were ignoring this value before) and properly unwind
21686         the block hierarchy
21687
21688         (fixed_statement): grammar for the fixed statement.
21689
21690 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21691
21692         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21693         pointer types to be incretemented.
21694
21695         (SizeOf): Implement.
21696
21697         * cs-parser.jay (pointer_member_access): Implement
21698         expr->IDENTIFIER production.
21699
21700         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21701         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21702         on safe contexts.
21703
21704         (Unary): Implement indirection.
21705
21706         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21707         use in non-unsafe context).
21708
21709         (SimpleName.DoResolve): Check for pointers in field access on safe
21710         contexts. 
21711
21712         (Expression.LoadFromPtr): Factor the load-indirect code in this
21713         function.  This was duplicated in UnboxCast and ParameterReference
21714
21715 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21716
21717         * expression.cs (ComposedCast): report an error if a pointer cast
21718         is used in a safe region.
21719
21720         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21721         pointer type casts in unsafe context.
21722
21723         * codegen.cs (EmitContext): Set up IsUnsafe.
21724
21725         * cs-parser.jay (non_expression_type): Add productions for pointer
21726         casts. 
21727
21728         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21729         code.  We should not use force into static mode if the method is
21730         not virtual.  Fixes bug in MIS
21731
21732         * statement.cs (Do.Emit, While.Emit, For.Emit,
21733         Statement.EmitBoolExpression): Add support to Do and While to
21734         propagate infinite loop as `I do return' semantics.
21735
21736         Improve the For case to also test for boolean constants.
21737
21738         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21739         to the list of attributes we can add.
21740
21741         Remove `EmitContext' argument.
21742
21743         * class.cs (Method.Define): Apply parameter attributes.
21744         (Constructor.Define): Apply parameter attributes.
21745         (MethodCore.LabelParameters): Move here the core of labeling
21746         parameters. 
21747
21748         * support.cs (ReflectionParameters.ParameterModifier,
21749         InternalParameters.ParameterModifier): Use IsByRef on the type and
21750         only return the OUT bit for these parameters instead of in/out/ref
21751         flags.
21752
21753         This is because I miss-understood things.  The ParameterInfo.IsIn
21754         and IsOut represent whether the parameter has the [In] and [Out]
21755         attributes set.  
21756
21757 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21758
21759         * ecore.cs (FieldExpr.Emit): Release temporaries.
21760
21761         * assign.cs (LocalTemporary.Release): new function.
21762
21763         * codegen.cs (EmitContext.GetTemporaryStorage,
21764         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21765         temporary storage.  Now we can "put back" localbuilders when we
21766         are done with them
21767
21768 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21769
21770         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21771         need to make a copy of the variable to generate verifiable code.
21772
21773 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21774
21775         * driver.cs: Compute dynamically the system directory.
21776
21777         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21778         Slower, but more generally useful.  Used by the abstract
21779         registering implementation. 
21780
21781         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21782         the rules for the special rule on Type/instances.  First check if
21783         we have the same name, and if so, try that special static path
21784         rather than the instance path.
21785
21786 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21787
21788         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21789         for, while and if.
21790
21791         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21792         Enum, ValueType, Delegate or Array for non-corlib compiles.
21793
21794         * cs-tokenizer.cs: Catch long identifiers (645)
21795
21796         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21797         piece of code.
21798
21799         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21800         fix, we were returning too early, so we were not registering
21801         pending methods from abstract classes.
21802
21803         Do not register pending methods if the class is abstract.
21804
21805         * expression.cs (Conditional.DoResolve): Report circular implicit
21806         conversions when we neecd to compute it for conditional
21807         expressions. 
21808
21809         (Is.DoResolve): If the expression is always of the provided type,
21810         flag warning 183.  If the expression can not ever be of the
21811         provided type flag warning 184.
21812
21813         * class.cs: Catch 169 as well.
21814
21815         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21816         read. 
21817
21818 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21819
21820         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21821
21822 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21823
21824         * interface.cs: (PopulateMethod): Check for pointers being defined
21825         only if the unsafe context is active.
21826         (PopulateProperty): ditto.
21827         (PopulateIndexer): ditto.
21828
21829         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21830         specified.  If pointers are present, make sure that they are
21831         present in an unsafe context.
21832         (Constructor, Constructor.Define): ditto.
21833         (Field, Field.Define): ditto.
21834         (Property, Property.Define): ditto.
21835         (Event, Event.Define): ditto.
21836
21837         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21838         hashtable if there are classes or structs defined.
21839
21840         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21841         code, as the constant resolution moved.
21842
21843         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21844         the metadata, so we can flag error 133. 
21845
21846         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21847         pointer is being declared in an unsafe context.
21848
21849 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21850
21851         * modifiers.cs (Modifiers.Check): Require a Location argument.
21852         Report error 227 for Unsafe use.
21853
21854         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21855
21856         * statement.cs (For.Emit): If the test is null, then report that
21857         we do `return', as we wont reach anything afterwards.
21858
21859         (Switch.SwitchGoverningType): Track the expression that matched
21860         the conversion.
21861
21862         * driver.cs: Allow negative numbers as an error code to flag.
21863
21864         * cs-parser.jay: Handle 1551.
21865
21866         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21867
21868 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21869
21870         * cs-parser.jay: Report 1518 (type declaration can only contain
21871         class, struct, interface, enum or delegate)
21872
21873         (switch_label): Report 1523 (keywords `case' or `default' must
21874         preced code)
21875
21876         (opt_switch_sections): Report 1522 (empty switch)
21877
21878         * driver.cs: Report 1515 (response file specified multiple times)
21879         Report 1516 (Source file specified multiple times).
21880
21881         * expression.cs (Argument.Resolve): Signal 1510
21882
21883         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21884         access not allowed in static code)
21885
21886 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21887
21888         * typemanager.cs (IsPointerType): Utility method which we are going
21889         to need a lot.
21890
21891         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21892         the object type, so we take care of that.
21893
21894         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21895
21896         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21897         added to non-params parameters :-)
21898
21899         * typemanager.cs (CSharpName): Include 'void' type too. 
21900
21901         (void_ptr_type): Include in the set of core types.
21902
21903         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21904         duplicating code.
21905
21906         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21907         an unsafe context.
21908
21909         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21910         completely forgotten about it.
21911
21912 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21913
21914         * cs-parser.jay (pointer_type): Add. This begins our implementation
21915         of parsing rules for unsafe code.
21916
21917         (unsafe_statement): Implement.
21918
21919         (embedded_statement): Modify to include the above.
21920
21921         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21922
21923         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21924         if the current context is an unsafe one.
21925
21926         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21927         are handled differently, we need separate rules for them.
21928
21929         (local_variable_declaration): Update to use local_variable_pointer_type
21930         to allow variable declarations of unmanaged pointer types.
21931
21932         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21933         in unsafe contexts.
21934
21935         * ../errors/cs0214.cs : Add.
21936
21937 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21938
21939         * makefile: remove 'response' file when cleaning.
21940
21941 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21942
21943         * cs-parser.jay: Report 1524.
21944
21945 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21946
21947         * typemanager.cs (RegisterMethod): drop checking if we have
21948         registered this from here
21949
21950 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21951
21952         * class.cs (Method.EmitDestructor): Implement calling our base
21953         destructor. 
21954
21955         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21956         value of InFinally.
21957
21958         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21959         this routine and will wrap the call in a try/catch block.  Deal
21960         with the case.
21961
21962 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21963
21964         * ecore.cs (Expression.MemberLookup): instead of taking a
21965         parameter `same_type' that was used to tell whether we could
21966         access private members we compute our containing type from the
21967         EmitContext.
21968
21969         (FieldExpr): Added partial support for volatile fields.  This does
21970         not work for volatile fields exposed from assemblies, as I can not
21971         figure out how to extract the modreq from it.
21972
21973         Updated all the source files to use this.
21974
21975         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21976         because it is referenced by MemberLookup very often. 
21977
21978 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21979
21980         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21981         TypeBuilder.GetCustomAttributes to retrieve what we need.
21982
21983         Get rid of redundant default_member_attr_type as this is the same as
21984         default_member_type which already exists.
21985
21986         * interface.cs, attribute.cs : Update accordingly.
21987
21988 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21989
21990         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21991         work for TYpeBuilders though.  Ravi, can you please fix this?
21992
21993         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21994
21995         * expression.cs (Argument.Emit): Handle the case of ref objects
21996         being passed to ref functions;  
21997
21998         (ParameterReference.EmitLoad): Loads the content of the pointer
21999         without dereferencing.
22000
22001 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22002
22003         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22004
22005 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22006
22007         * class.cs (Indexer.DefineMethod): Incorporate the interface
22008         type in the name of the method if we are doing explicit interface
22009         implementation.
22010
22011         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22012
22013         (BetterConversion): Fix extremely trivial bug where we were referring to
22014         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22015         again !
22016
22017         * ../errors/bug16.cs : Add although we have fixed it.
22018
22019 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22020
22021         * expression.cs (BaseIndexer): Begin implementation.
22022
22023         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22024
22025         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22026         production directly to remove a shift/reduce, and implement
22027         explicit interface implementation.
22028
22029         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22030         after a floating point suffix.
22031
22032         * expression.cs (DoNumericPromotions): Improved the conversion for
22033         uint/uint.  If we have a constant, we avoid doing a typecast to a
22034         larger type.
22035
22036         * class.cs (Indexer): Implement explicit interface implementation
22037         for indexers.
22038
22039 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22040
22041         * class.cs: make the default instance constructor public and hidebysig.
22042
22043 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22044
22045         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22046         so we can call it from elsewhere.
22047
22048         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22049         we emit it internally if the class has a defined indexer; otherwise the user
22050         emits it by decorating the class definition with the DefaultMemberAttribute.
22051
22052         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22053         attribute is not used on a type which defines an indexer.
22054
22055         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22056         character when we skip whitespace.
22057
22058         * ../errors/cs0646.cs : Add.
22059
22060 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22061
22062         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22063         again. 
22064
22065         * makefile: Add practical target `mcs3.exe' which builds the third
22066         generation compiler. 
22067
22068         * expression.cs (New): Fix structures constructor calling.
22069
22070         * class.cs (Property, Method, Indexer): Emit Final flag on the
22071         method if we are an interface implementation and we are not
22072         abstract. 
22073
22074         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22075         whether this property is referencing a `base' method.
22076
22077         * expression.cs (Invocation.EmitCall): take an extra argument:
22078         is_base, this is used to determine whether the `call' or
22079         `callvirt' opcode should be used.
22080
22081
22082         * delegate.cs: update EmitCall.
22083
22084         * class.cs (Method.Define): Set NewSlot for the cases where we are
22085         not implementing an interface method.
22086
22087         (Property.Define): ditto.
22088
22089 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22090
22091         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22092         'r'.  Allows mcs to parse itself fully.
22093
22094 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22095
22096         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22097         of the number of initializers that require the InitializeArray method.
22098
22099         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22100         update the above field where necessary.
22101
22102         (MakeByteBlob): Update accordingly.
22103
22104         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22105         greater than 2.
22106
22107         (EmitDynamicInitializers): Update in accordance with the new optimization.
22108
22109         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22110         same OpCode applies.
22111
22112         * cs-parser.jay : Fix some glaring errors I introduced.
22113
22114 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22115
22116         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22117         so that we can check for name clashes there too.
22118
22119         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22120         for interface indexers.
22121
22122         * interfaces.cs (Define): Emit the default member attribute.
22123
22124         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22125         variable was being referred to while setting the value ;-)
22126
22127 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22128
22129         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22130         byte-by-byte information when we know the data is zero.
22131
22132         Make the block always a multiple of 4, because
22133         DefineInitializedData has a bug.
22134
22135         * assign.cs: Fix, we should assign from the temporary, not from
22136         the source. 
22137
22138         * expression.cs (MakeByteBlob): Fix my incorrect code.
22139
22140 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22141
22142         * typemanager.cs (EnumToUnderlying): This function is used to get
22143         the underlying type from an enumeration, because it does not
22144         always work. 
22145
22146         * constant.cs: Use the I4_S form for values between -128 and 127.
22147
22148         * statement.cs (Block.LookupLabel): Looks up a label.
22149         (Block): Drop support for labeled blocks.
22150
22151         (LabeledStatement): New kind of statement that represents a label
22152         only.
22153
22154         (Goto): Finally implement this bad boy.
22155
22156         * cs-parser.jay: Update to reflect new mechanism to implement
22157         labels.
22158
22159 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22160
22161         * codegen.cs (EmitContext.This): a codegen property that keeps the
22162         a single instance of this instead of creating many different this
22163         instances. 
22164
22165         * delegate.cs (Delegate.DoResolve): Update to use the property;
22166
22167         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22168
22169         * expression.cs (BaseAccess.DoResolve): Ditto.
22170
22171 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22172
22173         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22174         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22175
22176         (InitCoreTypes): Update accordingly.
22177
22178         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22179         so we can quickly store the state.
22180
22181         (ApplyAttributes): Set the correct implementation flags
22182         for InternalCall methods.
22183
22184 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22185
22186         * expression.cs (EmitCall): if a method is not virtual, then do
22187         not use callvirt on it.
22188
22189         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22190         user defined stuff) requires the use of stobj, which takes an
22191         address on the stack instead of an array and an index.  So emit
22192         the Ldelema operation for it.
22193
22194         (EmitStoreOpcode): Use stobj for valuetypes.
22195
22196         (UnaryMutator.EmitCode): Use the right 1 value depending on
22197         whether we are dealing with int64/uint64, float or doubles.
22198
22199         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22200         constructors that I implemented last night.
22201
22202         (Constructor.IsDefault): Fix to work properly for static
22203         constructors.
22204
22205         * cs-parser.jay (CheckDef): report method signature errors.
22206         Update error number 103 to be 132.
22207
22208         * decl.cs: New AdditionResult enumeration value: MethodExists.
22209         Although we do this check for methods later on in the semantic
22210         analysis, catching repeated default constructors is so easy that
22211         we catch these here. 
22212
22213         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22214         promotions code.
22215
22216         (ParameterReference.EmitAssign, Emit): handle
22217         bools as bytes.
22218
22219         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22220         (ArrayAccess.EmitStoreOpcode): ditto.
22221
22222         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22223
22224         * expression.cs (MakeByteBlob): Complete all the missing types
22225         (uint, short, ushort, byte, sbyte)
22226
22227         * class.cs: Only init instance field initializers on instance
22228         constructors. 
22229
22230         Rename `constructors' to instance_constructors. 
22231
22232         (TypeContainer.AddConstructor): Only add constructors to the list
22233         if it is not static.
22234
22235         Make sure that we handle default_static_constructor independently
22236         everywhere where we handle instance_constructors
22237
22238 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22239
22240         * class.cs: Do not lookup or create a base initializer for a
22241         static constructor.
22242
22243         (ConstructorInitializer.Resolve): use the proper type to lookup
22244         for constructors.
22245
22246         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22247
22248         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22249         in DeclSpace. 
22250
22251         * decl.cs: CloseType is now an virtual method, the default
22252         implementation just closes this type.
22253
22254 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22255
22256         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22257         to PreserveSig by default. Also emit HideBySig on such methods.
22258
22259         Basically, set the defaults to standard values.
22260
22261         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22262         argument, if candidate is better, it can't be worse than the best !
22263
22264         (Invocation): Re-write bits to differentiate between methods being
22265         applicable in their expanded form and their normal form - for params
22266         methods of course.
22267
22268         Get rid of use_standard everywhere as only standard conversions are allowed
22269         in overload resolution. 
22270
22271         More spec conformance.
22272
22273 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22274
22275         * driver.cs: Add --timestamp, to see where the compiler spends
22276         most of its time.
22277
22278         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22279         `this' in static code.
22280
22281         (SimpleName.DoResolve): Implement in terms of a helper function
22282         that allows static-references to be passed upstream to
22283         MemberAccess.
22284
22285         (Expression.ResolveWithSimpleName): Resolve specially simple
22286         names when called by MemberAccess to implement the special
22287         semantics. 
22288
22289         (Expression.ImplicitReferenceConversion): Handle conversions from
22290         Null to reference types before others, as Null's type is
22291         System.Object. 
22292
22293         * expression.cs (Invocation.EmitCall): Handle the special case of
22294         calling methods declared on a reference type from a ValueType
22295         (Base classes System.Object and System.Enum)
22296
22297         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22298         the left hand side is a TypeExpr, not on every enumeration. 
22299
22300         (Binary.Resolve): If types are reference types, then do a cast to
22301         object on operators != and == of both arguments.
22302
22303         * typemanager.cs (FindMembers): Extract instance and static
22304         members if requested.
22305
22306         * interface.cs (PopulateProperty): Use void_type instead of null
22307         as the return type for the setter method.
22308
22309         (PopulateIndexer): ditto.
22310
22311 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22312
22313         * support.cs (ReflectionParameters): Fix minor bug where we
22314         were examining the wrong parameter for the ParamArray attribute.
22315
22316         Cope with requests for the type of the parameter at position
22317         greater than the params parameter's. We now return the element
22318         type of the params array as that makes more sense.
22319
22320         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22321         accordingly as we no longer have to extract the element type
22322         ourselves.
22323
22324         (Invocation.OverloadResolve): Update.
22325
22326 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22327
22328         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22329         against IEnumerator, test whether the return value is a descendant
22330         of the IEnumerator interface.
22331
22332         * class.cs (Indexer.Define): Use an auxiliary method to implement
22333         the other bits of the method definition.  Begin support for
22334         explicit interface implementation.
22335
22336         (Property.DefineMethod): Use TypeManager.void_type instead of null
22337         for an empty return value.
22338
22339 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22340
22341         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22342         dealing with a FieldExpr which is composed of a FieldBuilder, in
22343         the code path we did extract the constant, but we should have
22344         obtained the underlying value to be able to cast it (otherwise we
22345         end up in an infinite loop, this is what Ravi was running into).
22346
22347         (ArrayCreation.UpdateIndices): Arrays might be empty.
22348
22349         (MemberAccess.ResolveMemberAccess): Add support for section
22350         14.5.4.1 that deals with the special case of E.I when E is a type
22351         and something else, that I can be a reference to a static member.
22352
22353         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22354         handle a particular array type to create byte blobs, it is just
22355         something we dont generate byteblobs for.
22356
22357         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22358         arguments. 
22359
22360         * location.cs (Push): remove the key from the hashtable that we
22361         are about to add.   This happens for empty files.
22362
22363         * driver.cs: Dispose files after we have parsed them.
22364
22365         (tokenize): new function that only runs the tokenizer on its
22366         input, for speed testing.
22367
22368 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22369
22370         * class.cs (Event.Define): Define the private field only if there
22371         are no accessors defined.
22372
22373         * expression.cs (ResolveMemberAccess): If there is no associated
22374         field with the event, that means we have an event defined with its
22375         own accessors and we should flag error cs0070 since transforming
22376         ourselves into a field is not valid in that case.
22377
22378         * ecore.cs (SimpleName.DoResolve): Same as above.
22379
22380         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22381         and charset to sane values.
22382
22383 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22384
22385         * assign.cs (DoResolve): Perform check on events only if they 
22386         are being accessed outside the declaring type.
22387
22388         * cs-parser.jay (event_declarations): Update rules to correctly
22389         set the type of the implicit parameter etc.
22390
22391         (add_accessor, remove_accessor): Set current local parameters.
22392
22393         * expression.cs (Binary): For delegate addition and subtraction,
22394         cast the return value from the method into the appropriate delegate
22395         type.
22396
22397 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22398
22399         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22400         of these as the workaround is unnecessary.
22401
22402         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22403         delegate data - none of that is needed at all.
22404
22405         Re-write bits to extract the instance expression and the delegate method
22406         correctly.
22407
22408         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22409         on delegates too.
22410
22411         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22412         of attaching attributes instead of duplicating code everywhere.
22413
22414         * everywhere : Update code to do attribute emission using the above method.
22415
22416 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22417
22418         * expression.cs (IsParamsMethodApplicable): if there are not
22419         parameters, return immediately.
22420
22421         * ecore.cs: The 0 literal can be implicity converted to an enum
22422         type. 
22423
22424         (SimpleName.DoResolve): First lookup the type, then lookup the
22425         members. 
22426
22427         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22428         want to get its address.  If the InstanceExpression is not
22429         addressable, store the result in a temporary variable, then get
22430         the address of it.
22431
22432         * codegen.cs: Only display 219 errors on warning level or above. 
22433
22434         * expression.cs (ArrayAccess): Make it implement the
22435         IMemoryLocation interface.
22436
22437         (Binary.DoResolve): handle the operator == (object a, object b)
22438         and operator != (object a, object b) without incurring into a
22439         BoxedCast (because 5 != o should never be performed).
22440
22441         Handle binary enumerator operators.
22442
22443         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22444         value type, otherwise use Ldelem_ref.
22445
22446         Use precomputed names;
22447
22448         (AddressOf): Implement address of
22449
22450         * cs-parser.jay (labeled_statement): Fix recursive block
22451         addition by reworking the production.
22452
22453         * expression.cs (New.DoEmit): New has a special case:
22454                 
22455                  If we are dealing with a ValueType, we have a few
22456                  situations to deal with:
22457                 
22458                     * The target of New is a ValueType variable, that is
22459                       easy, we just pass this as the variable reference
22460                 
22461                     * The target of New is being passed as an argument,
22462                       to a boxing operation or a function that takes a
22463                       ValueType.
22464                 
22465                       In this case, we need to create a temporary variable
22466                       that is the argument of New.
22467
22468
22469 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22470
22471         * rootcontext.cs (LookupType): Check that current_type is not null before
22472         going about looking at nested types.
22473
22474         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22475         not implement the IAssignMethod interface any more.
22476
22477         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22478         where we tranform them into FieldExprs if they are being resolved from within
22479         the declaring type.
22480
22481         * ecore.cs (SimpleName.DoResolve): Do the same here.
22482
22483         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22484
22485         * ../errors/bug10.cs : Add.
22486
22487         * ../errors/cs0070.cs : Add.
22488
22489         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22490
22491         * assign.cs : Get rid of EventIsLocal everywhere.
22492
22493 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22494
22495         * ecore.cs (ConvertIntLiteral): finished the implementation.
22496
22497         * statement.cs (SwitchLabel): Convert the value we are using as a
22498         key before looking up the table.
22499
22500 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22501
22502         * codegen.cs (EmitTopBlock): Require a Location argument now.
22503
22504         * cs-parser.jay (constructor_declarator): We need to setup
22505         current_local_parameters before we parse the
22506         opt_constructor_initializer, to allow the variables to be bound
22507         to the constructor arguments.
22508
22509         * rootcontext.cs (LookupType): First lookup nested classes in our
22510         class and our parents before we go looking outside our class.
22511
22512         * expression.cs (ConstantFold): Extract/debox the values at the
22513         beginnning. 
22514
22515         * rootcontext.cs (EmitCode): Resolve the constants first before we
22516         resolve the types.  This is not really needed, but it helps debugging.
22517
22518         * statement.cs: report location.
22519
22520         * cs-parser.jay: pass location to throw statement.
22521
22522         * driver.cs: Small bug fix.
22523
22524         * report.cs: Updated format to be 4-zero filled digits.
22525
22526 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22527
22528         * expression.cs (CheckIndices): Fix minor bug where the wrong
22529         variable was being referred to ;-)
22530
22531         (DoEmit): Do not call EmitStaticInitializers when the 
22532         underlying type is System.Object.
22533
22534 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22535
22536         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22537         and do the usual workaround for SRE.
22538
22539         * class.cs (MyEventBuilder.EventType): New member to get at the type
22540         of the event, quickly.
22541
22542         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22543
22544         * assign.cs (Assign.DoResolve): Handle the case when the target
22545         is an EventExpr and perform the necessary checks.
22546
22547         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22548         interface.
22549
22550         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22551
22552         (EventExpr): Set the type in the constructor itself since we 
22553         are meant to be born fully resolved.
22554
22555         (EventExpr.Define): Revert code I wrote earlier.
22556                 
22557         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22558         instance expression is null. The instance expression is a This in that case
22559         or a null, depending on whether it is a static method or not.
22560
22561         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22562         refers to more than one method.
22563
22564         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22565         and accordingly flag errors.
22566
22567 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22568
22569         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22570
22571 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22572
22573         * location.cs (ToString): Provide useful rutine.
22574
22575 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22576
22577         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22578         objects, return the actual integral boxed.
22579
22580         * statement.cs (SwitchLabel): define an ILLabel for each
22581         SwitchLabel. 
22582
22583         (Switch.CheckSwitch): If the value is a Literal, extract
22584         the underlying literal.
22585
22586         Also in the unused hashtable we had, add the SwitchLabel so we can
22587         quickly look this value up.
22588
22589         * constant.cs: Implement a bunch of new constants.  Rewrite
22590         Literal based on this.  Made changes everywhere to adapt to this.
22591
22592         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22593         dereferencing array only once, and also copes with enumrations.
22594
22595         bytes are two bytes wide, not one.
22596
22597         (Cast): Perform constant conversions.
22598
22599         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22600         wrappers to the literals here.
22601
22602         * expression.cs (DoNumericPromotions): long literals can converted
22603         to ulong implicity (this is taken care of elsewhere, but I was
22604         missing this spot).
22605
22606         * ecore.cs (Expression.Literalize): Make the return type Literal,
22607         to improve type checking.
22608
22609         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22610
22611 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22612
22613         * literal.cs: Revert code from ravi that checked the bounds.  The
22614         bounds are sane by the definition of the type itself. 
22615
22616         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22617         need to actually look up in our parent hierarchy for interfaces
22618         implemented. 
22619
22620         * const.cs: Use the underlying type for enumerations
22621
22622         * delegate.cs: Compute the basename for the delegate creation,
22623         that should fix the delegate test case, and restore the correct
22624         Type Lookup semantics in rootcontext
22625
22626         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22627         referencing a nested type with the Reflection API is using the "+"
22628         sign. 
22629
22630         * cs-parser.jay: Do not require EOF token at the end.
22631
22632 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22633
22634         * rootcontext.cs (LookupType): Concatenate type names with
22635         a '.' instead of a '+' The test suite passes again.
22636
22637         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22638         field of the enumeration.
22639
22640         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22641         the case when the member is an EventExpr.
22642
22643         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22644         static has an associated instance expression.
22645
22646         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22647
22648         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22649
22650         * class.cs (Event.Define): Register event and perform appropriate checks
22651         for error #111.
22652
22653         We define the Add and Remove methods even if the use provides none because
22654         in that case, we provide default implementations ourselves.
22655
22656         Define a private field of the type of the event. This is done by the CSC compiler
22657         and we should be doing it too ;-)
22658
22659         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22660         More methods we use in code we generate.
22661
22662         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22663         is important.
22664
22665         (InitCoreTypes): Update accordingly for the above.
22666
22667         * class.cs (Event.Emit): Generate code for default accessors that we provide
22668
22669         (EmitDefaultMethod): Do the job in the above.
22670
22671         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22672         appropriate place.
22673
22674 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22675
22676         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22677         builders even if we were missing one.
22678
22679         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22680         pass the Basename as our class name instead of the Name.  The
22681         basename will be correctly composed for us.
22682
22683         * parameter.cs (Paramters): Now takes a Location argument.
22684
22685         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22686         make all the code call directly LookupType in RootContext and take
22687         this chance to pass the Location information everywhere.
22688
22689         * Everywhere: pass Location information.
22690
22691 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22692
22693         * class.cs (Constructor.Define): Updated way of detecting the
22694         length of the parameters.
22695
22696         (TypeContainer.DefineType): Use basename as the type name for
22697         nested types.
22698
22699         (TypeContainer.Define): Do not recursively define types here, as
22700         definition is taken care in order by the RootContext.
22701
22702         * tree.cs: Keep track of namespaces in a per-file basis.
22703
22704         * parameter.cs (Parameter.ComputeSignature): Update to use
22705         DeclSpace. 
22706
22707         (Parameters.GetSignature): ditto.
22708
22709         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22710         instead of a TypeContainer.
22711
22712         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22713         resolve names.  Because we need to be resolve in our context, not
22714         our parents.
22715
22716         * driver.cs: Implement response files.
22717
22718         * class.cs (TypeContainer.DefineType): If we are defined, do not
22719         redefine ourselves.
22720
22721         (Event.Emit): Emit the code for add/remove handlers.
22722         (Event.Define): Save the MethodBuilders for add/remove.
22723
22724         * typemanager.cs: Use pair here too.
22725
22726         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22727         DictionaryEntry requires the first argument to be non-null.  
22728
22729         (enum_declaration): Compute full name for registering the
22730         enumeration.
22731
22732         (delegate_declaration): Instead of using
22733         formal_parameter_list, use opt_formal_parameter_list as the list
22734         can be empty.
22735
22736         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22737         (EventParsing): New property that controls whether `add' and
22738         `remove' are returned as tokens or identifiers (for events);
22739
22740 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22741
22742         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22743         use MyEventBuilder only and let it wrap the real builder for us.
22744
22745         (MyEventBuilder): Revamp constructor etc.
22746
22747         Implement all operations that we perform on EventBuilder in precisely the same
22748         way here too.
22749
22750         (FindMembers): Update to use the EventBuilder member.
22751
22752         (Event.Emit): Update accordingly.
22753
22754 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22755
22756         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22757         by calling the appropriate methods.
22758
22759         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22760         useful.
22761
22762         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22763
22764 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22765
22766         * delegate.cs (Delegate.Populate): Check that the return type
22767         and various parameters types are indeed accessible.
22768
22769         * class.cs (Constructor.Define): Same here.
22770
22771         (Field.Define): Ditto.
22772
22773         (Event.Define): Ditto.
22774
22775         (Operator.Define): Check that the underlying Method defined itself
22776         correctly - so it's MethodBuilder should not be null.
22777
22778         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22779         expression happens to be null.
22780
22781         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22782         members but as of now we don't seem to be able to do anything really useful with it.
22783
22784         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22785         not the EventBuilder.
22786
22787 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22788
22789         * cs-tokenizer.cs: Add support for defines.
22790         Add support for #if, #elif, #else, #endif
22791
22792         (eval_var): evaluates a variable.
22793         (eval): stubbed for evaluating functions.
22794
22795         * cs-parser.jay: Pass the defines information
22796
22797         * driver.cs: Add --define command line option.
22798
22799         * decl.cs: Move MemberCore here.
22800
22801         Make it the base class for DeclSpace.  This allows us to catch and
22802         report 108 and 109 for everything now.
22803
22804         * class.cs (TypeContainer.Define): Extract all the members
22805         before populating and emit the warning 108 (new keyword required
22806         to override) instead of having each member implement this.
22807
22808         (MemberCore.Define): New abstract method, we will be using this in
22809         the warning reporting engine in Populate.
22810
22811         (Operator.Define): Adjust to new MemberCore protocol. 
22812
22813         * const.cs (Const): This does not derive from Expression, it is a
22814         temporary object we use to create fields, it is a MemberCore. 
22815
22816         * class.cs (Method.Define): Allow the entry point to be in a
22817         specific class.
22818
22819         * driver.cs: Rewrite the argument handler to clean it up a bit.
22820
22821         * rootcontext.cs: Made it just an auxiliary namespace feature by
22822         making everything static.
22823
22824         * driver.cs: Adapt code to use RootContext type name instead of
22825         instance variable.
22826
22827         * delegate.cs: Remove RootContext argument.
22828
22829         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22830         argument. 
22831
22832         * class.cs (Event.Define): The lookup can fail.
22833
22834         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22835
22836         * expression.cs: Resolve the this instance before invoking the code.
22837
22838 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22839
22840         * cs-parser.jay: Add a production in element_access that allows
22841         the thing to become a "type" reference.  This way we can parse
22842         things like "(string [])" as a type.
22843
22844         Note that this still does not handle the more complex rules of
22845         casts. 
22846
22847
22848         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22849
22850         * ecore.cs: (CopyNewMethods): new utility function used to
22851         assemble the list of methods from running FindMembers.
22852
22853         (MemberLookup): Rework FindMembers so that 
22854
22855 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22856
22857         * class.cs (TypeContainer): Remove Delegates who fail to be
22858         defined.
22859
22860         * delegate.cs (Populate): Verify that we dont get null return
22861         values.   TODO: Check for AsAccessible.
22862
22863         * cs-parser.jay: Use basename to emit error 574 (destructor should
22864         have the same name as container class), not the full name.
22865
22866         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22867         possible representation.  
22868
22869         Also implements integer type suffixes U and L.
22870
22871 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22872
22873         * expression.cs (ArrayCreation.DoResolve): We need to do the
22874         argument resolution *always*.
22875
22876         * decl.cs: Make this hold the namespace.  Hold the root context as
22877         well.
22878         (LookupType): Move here.
22879
22880         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22881
22882         * location.cs (Row, Name): Fixed the code, it was always returning
22883         references to the first file.
22884
22885         * interface.cs: Register properties defined through interfaces.
22886
22887         * driver.cs: Add support for globbing on the command line
22888
22889         * class.cs (Field): Make it derive from MemberCore as well.
22890         (Event): ditto.
22891
22892 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22893
22894         * class.cs (Event::Define): Check that the type of the event is a delegate
22895         type else flag error #66.
22896
22897         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22898         same.
22899
22900         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22901         values of EntryPoint, CharSet etc etc.
22902
22903         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22904
22905         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22906         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22907         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22908         which needs this to do its work.
22909
22910         * ../errors/cs0066.cs : Add.
22911
22912 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22913
22914         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22915         helper functions.
22916
22917         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22918         clears out the parameters field.
22919         (MemberSignatureCompare): Cleanup
22920
22921         (MemberCore): New base class used to share code between MethodCore
22922         and Property.
22923
22924         (RegisterRequiredImplementations) BindingFlags.Public requires
22925         either BindingFlags.Instace or Static.  Use instance here.
22926
22927         (Property): Refactored code to cope better with the full spec.
22928
22929         * parameter.cs (GetParameterInfo): Return an empty array instead
22930         of null on error.
22931
22932         * class.cs (Property): Abstract or extern properties have no bodies.
22933
22934         * parameter.cs (GetParameterInfo): return a zero-sized array.
22935
22936         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22937         method modifier validation to the typecontainer so we can reuse
22938         this on properties.
22939
22940         (MethodCore.ParameterTypes): return an empty sized array of types.
22941
22942         (Property.Define): Test property modifier validity.
22943
22944         Add tests for sealed/override too.
22945
22946         (Method.Emit): abstract or extern methods have no bodies.
22947
22948 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22949
22950         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22951         thing.
22952
22953         (Method::Define, ::Emit): Modify accordingly.
22954
22955         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22956
22957         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22958
22959         * makefile: Pass in /unsafe.
22960
22961 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22962
22963         * class.cs (MakeKey): Kill routine.
22964
22965         * class.cs (TypeContainer.Define): Correctly define explicit
22966         method implementations (they require the full interface name plus
22967         the method name).
22968
22969         * typemanager.cs: Deply the PtrHashtable here and stop using the
22970         lame keys.  Things work so much better.
22971
22972         This of course broke everyone who depended on `RegisterMethod' to
22973         do the `test for existance' test.  This has to be done elsewhere.
22974
22975         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22976         the object stupid Equals method (because, that like fails all over
22977         the place).  We still do not use it.
22978
22979         * class.cs (TypeContainer.SetRequiredInterface,
22980         TypeContainer.RequireMethods): Killed these two routines and moved
22981         all the functionality to RegisterRequiredImplementations.
22982
22983         (TypeContainer.RegisterRequiredImplementations): This routine now
22984         registers all the implementations required in an array for the
22985         interfaces and abstract methods.  We use an array of structures
22986         which can be computed ahead of time to reduce memory usage and we
22987         also assume that lookups are cheap as most classes will not
22988         implement too many interfaces.
22989
22990         We also avoid creating too many MethodSignatures.
22991
22992         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22993         clear the "pending" bit if we find that there are problems with
22994         the declaration.
22995
22996         (TypeContainer.VerifyPendingMethods): Update to report errors of
22997         methods that look like implementations but are not.
22998
22999         (TypeContainer.Define): Add support for explicit interface method
23000         implementation. 
23001
23002 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23003
23004         * typemanager.cs: Keep track of the parameters here instead of
23005         being a feature of the TypeContainer.
23006
23007         * class.cs: Drop the registration of parameters here, as
23008         InterfaceMethods are also interface declarations.
23009
23010         * delegate.cs: Register methods with the TypeManager not only with
23011         the TypeContainer.  This code was buggy.
23012
23013         * interface.cs: Full registation here.
23014
23015 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23016
23017         * expression.cs: Remove reducer for binary expressions, it can not
23018         be done this way.
23019
23020         * const.cs: Put here the code that used to go into constant.cs
23021
23022         * constant.cs: Put here the code for constants, this is a new base
23023         class for Literals.
23024
23025         * literal.cs: Make Literal derive from Constant.
23026
23027 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23028
23029         * statement.cs (Return.Emit): Report error 157 if the user
23030         attempts to return from a finally block.
23031
23032         (Return.Emit): Instead of emitting a return, jump to the end of
23033         the function.
23034
23035         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23036         LocalBuilder to store the result of the function.  ReturnLabel is
23037         the target where we jump.
23038
23039
23040 2001-12-09  Radek Doulik  <rodo@ximian.com>
23041
23042         * cs-parser.jay: remember alias in current namespace
23043
23044         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23045         namespaces
23046
23047         * class.cs (LookupAlias): lookup alias in my_namespace
23048
23049         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23050         aliases hashtable
23051         (LookupAlias): lookup alias in this and if needed in parent
23052         namespaces
23053
23054 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23055
23056         * support.cs: 
23057
23058         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23059         making things static.  I need this to avoid passing the
23060         TypeContainer when calling ParameterType.
23061
23062         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23063         that did string manipulation to compute the type and then call
23064         GetType.  Use Parameter.ParameterType instead.
23065
23066         * cs-tokenizer.cs: Consume the suffix for floating values.
23067
23068         * expression.cs (ParameterReference): figure out whether this is a
23069         reference parameter or not.  Kill an extra variable by computing
23070         the arg_idx during emission.
23071
23072         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23073         function that returns whether a parameter is an out/ref value or not.
23074
23075         (Parameter.ParameterType): The type of the parameter (base,
23076         without ref/out applied).
23077
23078         (Parameter.Resolve): Perform resolution here.
23079         (Parameter.ExternalType): The full type (with ref/out applied).
23080
23081         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23082         support for expressions on the using statement.
23083
23084 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23085
23086         * statement.cs (Using.EmitLocalVariableDecls): Split the
23087         localvariable handling of the using statement.
23088
23089         (Block.EmitMeta): Keep track of variable count across blocks.  We
23090         were reusing slots on separate branches of blocks.
23091
23092         (Try.Emit): Emit the general code block, we were not emitting it. 
23093
23094         Check the type of the declaration to be an IDisposable or
23095         something that can be implicity converted to it. 
23096
23097         Emit conversions if required.
23098
23099         * ecore.cs (EmptyExpression): New utility class.
23100         (Expression.ImplicitConversionExists): New utility function.
23101
23102 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23103
23104         * statement.cs (Using): Implement.
23105
23106         * expression.cs (LocalVariableReference): Support read only variables.
23107
23108         * statement.cs: Remove the explicit emit for the Leave opcode.
23109         (VariableInfo): Add a readonly field.
23110
23111 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * ecore.cs (ConvCast): new class used to encapsulate the various
23114         explicit integer conversions that works in both checked and
23115         unchecked contexts.
23116
23117         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23118         properly generate the overflow opcodes.
23119
23120 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23121
23122         * statement.cs: The correct type for the EmptyExpression is the
23123         element_type, not the variable type.  Ravi pointed this out.
23124
23125 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23126
23127         * class.cs (Method::Define): Handle PInvoke methods specially
23128         by using DefinePInvokeMethod instead of the usual one.
23129
23130         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23131         above to do the task of extracting information and defining the method.
23132
23133 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23134
23135         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23136         of the condition for string type.
23137
23138         (Emit): Move that here. 
23139
23140         (ArrayCreation::CheckIndices): Keep string literals in their expression
23141         form.
23142
23143         (EmitDynamicInitializers): Handle strings appropriately.
23144
23145 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23146
23147         * codegen.cs (EmitContext): Replace multiple variables with a
23148         single pointer to the current Switch statement.
23149
23150         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23151         EmitContext.
23152
23153 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23154
23155         * statement.cs 
23156
23157         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23158         default'.
23159
23160         (Foreach.Emit): Foreach on arrays was not setting
23161         up the loop variables (for break/continue).
23162
23163         (GotoCase): Semi-implented.
23164
23165 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23166
23167         * attribute.cs (CheckAttribute): Handle system attributes by using
23168         Attribute.GetAttributes to examine information we need.
23169
23170         (GetValidPlaces): Same here.
23171
23172         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23173
23174         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23175
23176         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23177
23178         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23179
23180         (Method::Emit): Handle the case when we are a PInvoke method.
23181
23182 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23183
23184         * expression.cs: Use ResolveWithSimpleName on compound names.
23185
23186 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23187
23188         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23189         before trying to reduce it.
23190
23191         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23192
23193         * constant.cs (LookupConstantValue): Implement.
23194
23195         (EmitConstant): Use the above in emitting the constant.
23196
23197         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23198         that are user-defined by doing a LookupConstantValue on them.
23199
23200         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23201         too, like above.
23202
23203 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23204
23205         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23206
23207         (BaseAccess.DoResolve): Implement.
23208
23209         (MemberAccess.DoResolve): Split this routine into a
23210         ResolveMemberAccess routine that can be used independently
23211
23212 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23213
23214         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23215         As that share bits of the implementation.  Is returns a boolean,
23216         while As returns the Type that is being probed.
23217
23218 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23219
23220         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23221         instead of a Literal - much easier.
23222
23223         (EnumInTransit): Remove - utterly useless :-)
23224
23225         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23226
23227         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23228
23229         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23230         chain when we have no associated expression.
23231
23232 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23233
23234         * constant.cs (Define): Use Location while reporting the errror.
23235
23236         Also emit a warning when 'new' is used and there is no inherited
23237         member to hide.
23238
23239         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23240         populated.
23241
23242         (LookupEnumValue): Implement to lookup an enum member's value and define it
23243         if necessary.
23244
23245         (Populate): Re-write accordingly to use the above routine.
23246
23247 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23248
23249         * expression.cs (This): Fix prototype for DoResolveLValue to
23250         override the base class DoResolveLValue.
23251
23252         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23253         declarations) 
23254
23255         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23256         (we need to load the address of the field here).  This fixes
23257         test-22. 
23258
23259         (FieldExpr.DoResolveLValue): Call the DoResolve
23260         function to initialize the Instance expression.
23261
23262         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23263         correctly the GetEnumerator operation on a value type.
23264
23265         * cs-parser.jay: Add more simple parsing error catches.
23266
23267         * statement.cs (Switch): Add support for string switches.
23268         Handle null specially.
23269
23270         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23271
23272 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23273
23274         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23275
23276         (declare_local_constant): New helper function.
23277
23278         * statement.cs (AddConstant): Keep a separate record of constants
23279
23280         (IsConstant): Implement to determine if a variable is a constant.
23281
23282         (GetConstantExpression): Implement.
23283
23284         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23285
23286         * statement.cs (IsVariableDefined): Re-write.
23287
23288 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23289
23290         * class.cs (TypeContainer::FindMembers): Look for constants
23291         in the case when we are looking for MemberTypes.Field
23292
23293         * expression.cs (MemberAccess::DoResolve): Check that in the
23294         case we are a FieldExpr and a Literal, we are not being accessed
23295         by an instance reference.
23296
23297         * cs-parser.jay (local_constant_declaration): Implement.
23298
23299         (declaration_statement): Implement for constant declarations.
23300
23301 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23302
23303         * statement.cs (Switch): Catch double defaults.
23304
23305         (Switch): More work on the switch() statement
23306         implementation.  It works for integral values now, need to finish
23307         string support.
23308
23309
23310 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23311
23312         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23313         integer literals into other integer literals.  To be used by
23314         switch. 
23315
23316 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23317
23318         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23319         some memory.
23320
23321         (EmitDynamicInitializers): Cope with the above since we extract data
23322         directly from ArrayData now.
23323
23324         (ExpectInitializers): Keep track of whether initializers are mandatory
23325         or not.
23326
23327         (Bounds): Make it a hashtable to prevent the same dimension being 
23328         recorded for every element in that dimension.
23329
23330         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23331         from being found.
23332
23333         Also fix bug which was causing the indices to be emitted in the reverse
23334         order.
23335
23336 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23337
23338         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23339         unfinished.  They do not work, because the underlying code is
23340         sloppy.
23341
23342 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23343
23344         * cs-parser.jay: Remove bogus fixme.
23345
23346         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23347         on Switch statement.
23348
23349 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23350
23351         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23352         the same. 
23353
23354         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23355         parameter. Apparently, any expression is allowed. 
23356
23357         (ValidateInitializers): Update accordingly.
23358
23359         (CheckIndices): Fix some tricky bugs thanks to recursion.
23360
23361         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23362         I was being completely brain-dead.
23363
23364         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23365         and re-write acordingly.
23366
23367         (DelegateInvocation): Re-write accordingly.
23368
23369         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23370
23371         (MakeByteBlob): Handle types more correctly.
23372
23373         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23374         initialization from expressions but it is incomplete because I am a complete
23375         Dodo :-|
23376
23377 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23378
23379         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23380         on If.  Basically, we have to return `true' (ie, we do return to
23381         our caller) only if both branches of the if return.
23382
23383         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23384         short-circuit operators, handle them as short circuit operators. 
23385
23386         (Cast.DoResolve): Resolve type.
23387         (Cast.Cast): Take an expression as the target type.
23388
23389         * cs-parser.jay (cast_expression): Remove old hack that only
23390         allowed a limited set of types to be handled.  Now we take a
23391         unary_expression and we resolve to a type during semantic
23392         analysis.
23393
23394         Use the grammar productions from Rhys to handle casts (this is
23395         not complete like Rhys syntax yet, we fail to handle that corner
23396         case that C# has regarding (-x), but we will get there.
23397
23398 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23399
23400         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23401         field which is an array type.
23402
23403         * cs-parser.jay (declare_local_variables): Support array initialization too.
23404
23405         * typemanager.cs (MakeKey): Implement.
23406
23407         (everywhere): Use the above appropriately.
23408
23409         * cs-parser.jay (for_statement): Update for array initialization while
23410         declaring variables.
23411
23412         * ecore.cs : The error message was correct, it's the variable's names that
23413         were misleading ;-) Make the code more readable.
23414
23415         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23416         the correct type etc.
23417
23418         (ConvertExplicit): Handle Enum types by examining the underlying type.
23419
23420 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23421
23422         * parameter.cs (GetCallingConvention): Always return
23423         CallingConventions.Standard for now.
23424
23425 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23426
23427         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23428         and `r' after calling DoNumericPromotions.
23429
23430         * ecore.cs: Fix error message (the types were in the wrong order).
23431
23432         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23433         BindingFlags.Instance as well 
23434
23435         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23436         implicit int literal conversion in an empty cast so that we
23437         propagate the right type upstream.
23438
23439         (UnboxCast): new class used to unbox value types.
23440         (Expression.ConvertExplicit): Add explicit type conversions done
23441         by unboxing.
23442
23443         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23444         the target type before applying the implicit LongLiterals to ULong
23445         literal cast.
23446
23447 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23448
23449         * cs-parser.jay (for_statement): Reworked the way For works: now
23450         we declare manually any variables that are introduced in
23451         for_initializer to solve the problem of having out-of-band code
23452         emition (that is what got for broken).
23453
23454         (declaration_statement): Perform the actual variable declaration
23455         that used to be done in local_variable_declaration here.
23456
23457         (local_variable_declaration): Do not declare anything, just pass
23458         the information on a DictionaryEntry
23459
23460 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23461
23462         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23463         re-write of the logic to now make it recursive.
23464
23465         (UpdateIndices): Re-write accordingly.
23466
23467         Store element data in a separate ArrayData list in the above methods.
23468
23469         (MakeByteBlob): Implement to dump the array data into a byte array.
23470
23471 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23472
23473         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23474         into CheckIndices.
23475
23476         * constant.cs (Define): Implement.
23477
23478         (EmitConstant): Re-write fully.
23479
23480         Pass in location info.
23481
23482         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23483         respectively.
23484
23485         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23486         DictionaryEntry since we need location info too.
23487
23488         (constant_declaration): Update accordingly.
23489
23490         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23491         code into another method : UpdateIndices.
23492
23493 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23494
23495         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23496         some type checking etc.
23497
23498 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23499
23500         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23501         bits to provide dimension info if the user skips doing that.
23502
23503         Update second constructor to store the rank correctly.
23504
23505 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23506
23507         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23508         and try to implement.
23509
23510         * ../errors/cs0150.cs : Add.
23511
23512         * ../errors/cs0178.cs : Add.
23513
23514 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23515
23516         * statement.cs: Implement foreach on multi-dimensional arrays. 
23517
23518         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23519         name of the params argument.
23520
23521         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23522         initializing the array.
23523
23524         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23525         we can use this elsewhere.
23526
23527         * statement.cs: Finish implementation of foreach for single
23528         dimension arrays.
23529
23530         * cs-parser.jay: Use an out-of-band stack to pass information
23531         around, I wonder why I need this.
23532
23533         foreach_block: Make the new foreach_block the current_block.
23534
23535         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23536         function used to return a static Parameters structure.  Used for
23537         empty parameters, as those are created very frequently.
23538
23539         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23540
23541 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23542
23543         * interface.cs : Default modifier is private, not public. The
23544         make verify test passes again.
23545
23546 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23547
23548         * support.cs (ReflectionParameters): Fix logic to determine
23549         whether the last parameter is a params one. Test 9 passes again.
23550
23551         * delegate.cs (Populate): Register the builders we define with
23552         RegisterParameterForBuilder. Test 19 passes again.
23553
23554         * cs-parser.jay (property_declaration): Reference $6 instead
23555         of $$ to get at the location.
23556
23557         (indexer_declaration): Similar stuff.
23558
23559         (attribute): Ditto.
23560
23561         * class.cs (Property): Register parameters for the Get and Set methods
23562         if they exist. Test 23 passes again.
23563
23564         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23565         call to EmitArguments as we are sure there aren't any params arguments. 
23566         Test 32 passes again.
23567
23568         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23569         IndexOutOfRangeException. 
23570
23571         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23572         Test 33 now passes again.
23573
23574 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23575
23576         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23577         broke a bunch of things.  Will have to come up with a better way
23578         of tracking locations.
23579
23580         * statement.cs: Implemented foreach for single dimension arrays.
23581
23582 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23583
23584         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23585         an error.  This removes the lookup from the critical path.
23586
23587         * cs-parser.jay: Removed use of temporary_loc, which is completely
23588         broken. 
23589
23590 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23591
23592         * support.cs (ReflectionParameters.ParameterModifier): Report
23593         whether the argument is a PARAMS argument or not.
23594
23595         * class.cs: Set the attribute `ParamArrayAttribute' on the
23596         parameter argument.
23597
23598         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23599         and cons_param_array_attribute (ConstructorInfo for
23600         ParamArrayAttribute)., 
23601
23602         * codegen.cs: Emit the return using the `Return' statement, that
23603         way we can report the error correctly for missing return values. 
23604
23605         * class.cs (Method.Emit): Clean up.
23606
23607         * expression.cs (Argument.Resolve): Take another argument: the
23608         location where this argument is used.  Notice that this is not
23609         part of the "Argument" class as to reduce the size of the
23610         structure (we know the approximate location anyways).
23611
23612         Test if the argument is a variable-reference, if not, then
23613         complain with a 206.
23614
23615         (Argument.Emit): Emit addresses of variables.
23616
23617         (Argument.FullDesc): Simplify.
23618
23619         (Invocation.DoResolve): Update for Argument.Resolve.
23620
23621         (ElementAccess.DoResolve): ditto.
23622
23623         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23624         method should be virtual, as this method is always virtual.
23625
23626         (NewDelegate.DoResolve): Update for Argument.Resolve.
23627
23628         * class.cs (ConstructorInitializer.DoResolve): ditto.
23629
23630         * attribute.cs (Attribute.Resolve): ditto.
23631
23632 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23633
23634         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23635
23636         * expression.cs (ParameterReference): Drop IStackStorage and implement
23637         IAssignMethod instead. 
23638
23639         (LocalVariableReference): ditto.
23640
23641         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23642         IAssignMethod instead. 
23643
23644 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23645
23646         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23647         enumerations that are used in heavily used structures derive from
23648         byte in a laughable and pathetic attempt to reduce memory usage.
23649         This is the kind of pre-optimzations that you should not do at
23650         home without adult supervision.
23651
23652         * expression.cs (UnaryMutator): New class, used to handle ++ and
23653         -- separatedly from the other unary operators.  Cleans up the
23654         code, and kills the ExpressionStatement dependency in Unary.
23655
23656         (Unary): Removed `method' and `Arguments' from this class, making
23657         it smaller, and moving it all to SimpleCall, so I can reuse this
23658         code in other locations and avoid creating a lot of transient data
23659         strucutres when not required.
23660
23661         * cs-parser.jay: Adjust for new changes.
23662
23663 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23664
23665         * enum.cs (Enum.Populate): If there is a failure during
23666         definition, return
23667
23668         * cs-parser.jay (opt_enum_base): we used to catch type errors
23669         here, but this is really incorrect.  The type error should be
23670         catched during semantic analysis.
23671
23672 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23673
23674         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23675         current_local_parameters as expected since I, in my stupidity, had forgotten
23676         to do this :-)
23677
23678         * attribute.cs (GetValidPlaces): Fix stupid bug.
23679
23680         * class.cs (Method::Emit): Perform check on applicability of attributes.
23681
23682         (Constructor::Emit): Ditto.
23683
23684         (Field::Emit): Ditto.
23685
23686         (Field.Location): Store location information.
23687
23688         (Property, Event, Indexer, Operator): Ditto.
23689
23690         * cs-parser.jay (field_declaration): Pass in location for each field.
23691
23692         * ../errors/cs0592.cs : Add.
23693
23694 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23695
23696         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23697
23698         (InitCoreTypes): Update accordingly.
23699
23700         (RegisterAttrType, LookupAttr): Implement.
23701
23702         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23703         info about the same.
23704
23705         (Resolve): Update to populate the above as necessary.
23706
23707         (Error592): Helper.
23708
23709         (GetValidPlaces): Helper to the above.
23710
23711         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23712
23713         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23714
23715 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23716
23717         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23718
23719         * ../errors/cs0617.cs : Add.
23720
23721 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23722
23723         * enum.cs (Emit): Rename to Populate to be more consistent with what
23724         we expect it to do and when exactly it is called.
23725
23726         * class.cs, rootcontext.cs : Update accordingly.
23727
23728         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23729         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23730
23731         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23732
23733         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23734         of a fieldinfo using the above, when dealing with a FieldBuilder.
23735
23736 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23737
23738         * ../errors/cs0031.cs : Add.
23739
23740         * ../errors/cs1008.cs : Add.
23741
23742         * ../errrors/cs0543.cs : Add.
23743
23744         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23745         enum type.
23746
23747         (FindMembers): Implement.
23748
23749         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23750         enums and delegates too.
23751
23752         (enum_types): Rename to builder_to_enum.
23753
23754         (delegate_types): Rename to builder_to_delegate.
23755
23756         * delegate.cs (FindMembers): Implement.
23757
23758 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23759
23760         * typemanager.cs (IsEnumType): Implement.
23761
23762         * enum.cs (Emit): Re-write parts to account for the underlying type
23763         better and perform checking etc.
23764
23765         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23766         of the underlying type.
23767
23768         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23769         value
23770
23771         * enum.cs (error31): Helper to report error #31.
23772
23773         * cs-parser.jay (enum_declaration): Store location of each member too.
23774
23775         * enum.cs (member_to_location): New hashtable. 
23776
23777         (AddEnumMember): Update location hashtable.
23778
23779         (Emit): Use the location of each member while reporting errors.
23780
23781 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23782
23783         * cs-parser.jay: A for_initializer if is a
23784         local_variable_declaration really ammount to have an implicit
23785         block with the variable declaration and no initializer for for.
23786
23787         * statement.cs (For.Emit): Cope with null initializers.
23788
23789         This fixes the infinite loop on for initializers.
23790
23791 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23792
23793         * enum.cs: More cleanup.
23794
23795         * ecore.cs: Remove dead code.
23796
23797         * class.cs (Property.Emit): More simplification.
23798         (Event.Emit): ditto.
23799
23800         Reworked to have less levels of indentation.
23801
23802 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23803
23804         * class.cs (Property): Emit attributes.
23805
23806         (Field): Ditto.
23807
23808         (Event): Ditto.
23809
23810         (Indexer): Ditto.
23811
23812         (Operator): Ditto.
23813
23814         * enum.cs (Emit): Ditto.
23815
23816         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23817         Enums too.
23818
23819         * class.cs (Field, Event, etc.): Move attribute generation into the
23820         Emit method everywhere.
23821
23822         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23823         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23824         as we had no way of defining nested enums !
23825
23826         * rootcontext.cs : Adjust code accordingly.
23827
23828         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23829
23830 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23831
23832         * expression.cs (EvalConstantExpression): Move into ecore.cs
23833
23834         * enum.cs (Enum): Rename some members and make them public and readonly
23835         according to our convention.
23836
23837         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23838         nothing else.
23839
23840         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23841
23842         (Enum::Emit): Write a simple version for now which doesn't try to compute
23843         expressions. I shall modify this to be more robust in just a while.
23844
23845         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23846
23847         (TypeContainer::CloseType): Create the Enum types too.
23848
23849         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23850
23851         * expression.cs (EvalConstantExpression): Get rid of completely.
23852
23853         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23854         user-defined values and other cases.
23855
23856         (IsValidEnumLiteral): Helper function.
23857
23858         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23859         out there in the case we had a literal FieldExpr.
23860
23861         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23862
23863         (Literalize): Revamp a bit to take two arguments.
23864
23865         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23866
23867 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23868
23869         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23870
23871         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23872
23873         (Resolve): Use the above to ensure we have proper initializers.
23874
23875 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23876
23877         * expression.cs (Expression::EvalConstantExpression): New method to 
23878         evaluate constant expressions.
23879
23880         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23881
23882 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23883
23884         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23885         in an array.
23886
23887         (Binary.ResolveOperator): Handle operator != (object a, object b)
23888         and operator == (object a, object b);
23889
23890         (Binary.DoNumericPromotions): Indicate whether the numeric
23891         promotion was possible.
23892
23893         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23894         Implement.  
23895
23896         Made the ArrayAccess implement interface IAssignMethod instead of
23897         IStackStore as the order in which arguments are passed reflects
23898         this.
23899
23900         * assign.cs: Instead of using expr.ExprClass to select the way of
23901         assinging, probe for the IStackStore/IAssignMethod interfaces.
23902
23903         * typemanager.cs: Load InitializeArray definition.
23904
23905         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23906         static data that can be used to initialize arrays. 
23907
23908 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23909
23910         * expression.cs: Handle operator== and operator!= for booleans.
23911
23912         (Conditioal.Reduce): Implement reducer for the ?: operator.
23913
23914         (Conditional.Resolve): Implement dead code elimination.
23915
23916         (Binary.Resolve): Catch string literals and return a new
23917         concatenated string.
23918
23919         (Unary.Reduce): Implement reduction of unary expressions.
23920
23921         * ecore.cs: Split out the expression core handling here.
23922
23923         (Expression.Reduce): New method used to perform constant folding
23924         and CSE.  This is needed to support constant-expressions. 
23925
23926         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23927         targets, and optimize for !x.
23928
23929 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23930
23931         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23932         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23933         set custom atttributes.
23934
23935         * literal.cs (Literal::GetValue): New abstract method to return the actual
23936         value of the literal, cast as an object.
23937
23938         (*Literal): Implement GetValue method.
23939
23940         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23941         expressions to the arraylist but objects of type Argument.
23942
23943         * class.cs (TypeContainer::Emit): Emit our attributes too.
23944
23945         (Method::Emit, Constructor::Emit): Ditto.
23946
23947         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23948         to be ignoring earlier.
23949
23950 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23951
23952         * attribute.cs (AttributeSection::Define): Implement to do the business
23953         of constructing a CustomAttributeBuilder.
23954
23955         (Attribute): New trivial class. Increases readability of code.  
23956
23957         * cs-parser.jay : Update accordingly.
23958
23959         (positional_argument_list, named_argument_list, named_argument): New rules
23960
23961         (attribute_arguments): Use the above so that we are more correct.
23962
23963 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23964
23965         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23966         to perform all checks for a method with a params parameter.
23967
23968         (Invocation::OverloadResolve): Update to use the above method and therefore
23969         cope correctly with params method invocations.
23970
23971         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23972         params too.
23973
23974         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23975         constructors in our parent too because we can't afford to miss out on 
23976         protected ones ;-)
23977
23978         * attribute.cs (AttributeSection): New name for the class Attribute
23979
23980         Other trivial changes to improve readability.
23981
23982         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23983         use the new class names.
23984
23985 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23986
23987         * class.cs (Method::Define): Complete definition for params types too
23988
23989         (Indexer::Define): Ditto.
23990
23991         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23992         Cope everywhere with a request for info about the array parameter.
23993
23994 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23995
23996         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23997
23998         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23999         local_variable_type to extract the string corresponding to the type.
24000
24001         (local_variable_type): Fixup the action to use the new helper method.
24002
24003         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24004         go.
24005
24006         * expression.cs : Clean out code which uses the above.
24007
24008 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24009
24010         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24011         and bale out if necessary by returning a false.
24012
24013         (RegisterProperty): Ditto.
24014
24015         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24016         and print out appropriate error messages.
24017
24018         * interface.cs (everywhere): Ditto.
24019
24020         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24021         location to constructor.
24022
24023         * class.cs (Property, Event, Indexer): Update accordingly.
24024
24025         * ../errors/cs111.cs : Added.
24026
24027         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24028         of a method, as laid down by the spec.
24029
24030         (Invocation::OverloadResolve): Use the above method.
24031
24032 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24033
24034         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24035         now take a TypeContainer and a Parameters object.
24036
24037         (ParameterData): Modify return type of ParameterModifier method to be 
24038         Parameter.Modifier and not a string.
24039
24040         (ReflectionParameters, InternalParameters): Update accordingly.
24041
24042         * expression.cs (Argument::GetParameterModifier): Same here.
24043
24044         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24045         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24046         symbol in it at all so maybe this is only for now.
24047
24048 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24049
24050         * support.cs (InternalParameters): Constructor now takes an extra argument 
24051         which is the actual Parameters class.
24052
24053         (ParameterDesc): Update to provide info on ref/out modifiers.
24054
24055         * class.cs (everywhere): Update call to InternalParameters to pass in
24056         the second argument too.
24057
24058         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24059         to return the modifier info [ref/out etc]
24060
24061         (InternalParameters, ReflectionParameters): Implement the above.
24062
24063         * expression.cs (Argument::ParameterModifier): Similar function to return
24064         info about the argument's modifiers.
24065
24066         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24067         too.
24068
24069         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24070         a new SetFormalParameters object which we pass to InternalParameters.
24071
24072 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24073
24074         * expression.cs (NewArray): Merge into the ArrayCreation class.
24075
24076 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24077
24078         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24079         NewUserdefinedArray into one as there wasn't much of a use in having
24080         two separate ones.
24081
24082         * expression.cs (Argument): Change field's name to ArgType from Type.
24083
24084         (Type): New readonly property which returns the proper type, taking into 
24085         account ref/out modifiers.
24086
24087         (everywhere): Adjust code accordingly for the above.
24088
24089         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24090         whether we are emitting for a ref or out parameter.
24091
24092         * expression.cs (Argument::Emit): Use the above field to set the state.
24093
24094         (LocalVariableReference::Emit): Update to honour the flag and emit the
24095         right stuff.
24096
24097         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24098
24099         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24100
24101         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24102
24103         (ReflectionParameters, InternalParameters): Implement the above method.
24104
24105         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24106         reporting errors.
24107
24108         (Invocation::FullMethodDesc): Ditto. 
24109
24110 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24111
24112         * cs-parser.jay: Add extra production for the second form of array
24113         creation. 
24114
24115         * expression.cs (ArrayCreation): Update to reflect the above
24116         change. 
24117
24118         * Small changes to prepare for Array initialization.
24119
24120 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24121
24122         * typemanager.cs (ImplementsInterface): interface might be null;
24123         Deal with this problem;
24124
24125         Also, we do store negative hits on the cache (null values), so use
24126         this instead of calling t.GetInterfaces on the type everytime.
24127
24128 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24129
24130         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24131
24132         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24133         split functionality out into different classes.
24134
24135         (New::FormArrayType): Move into NewBuiltinArray.
24136
24137         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24138         quite useless.
24139
24140         (NewBuiltinArray): New class to handle creation of built-in arrays.
24141
24142         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24143         account creation of one-dimensional arrays.
24144
24145         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24146
24147         (NewUserdefinedArray::DoResolve): Implement.
24148
24149         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24150
24151         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24152         we maintain inside the TypeManager. This is necessary to perform lookups on the
24153         module builder.
24154
24155         (LookupType): Update to perform GetType on the module builders too.     
24156
24157         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24158
24159         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24160
24161 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24162
24163         * expression.cs (New::DoResolve): Implement guts of array creation.
24164
24165         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24166
24167 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24168
24169         * expression.cs: Fix bug I introduced lsat night that broke
24170         Delegates. 
24171
24172         (Expression.Resolve): Report a 246 error (can not resolve name)
24173         if we find a SimpleName in the stream.
24174
24175         (Expression.ResolveLValue): Ditto.
24176
24177         (Expression.ResolveWithSimpleName): This function is a variant of
24178         ResolveName, this one allows SimpleNames to be returned without a
24179         warning.  The only consumer of SimpleNames is MemberAccess
24180
24181 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24182
24183         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24184         might arrive here.  I have my doubts that this is correct.
24185
24186         * statement.cs (Lock): Implement lock statement.
24187
24188         * cs-parser.jay: Small fixes to support `lock' and `using'
24189
24190         * cs-tokenizer.cs: Remove extra space
24191
24192         * driver.cs: New flag --checked, allows to turn on integer math
24193         checking. 
24194
24195         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24196         Threading.Monitor.Exit 
24197
24198 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24199
24200         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24201         Expression Class to be IndexerAccess.
24202
24203         Notice that Indexer::DoResolve sets the eclass to Value.
24204
24205 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24206
24207         * class.cs (TypeContainer::Emit): Emit code for indexers.
24208
24209         * assign.cs (IAssignMethod): New interface implemented by Indexers
24210         and Properties for handling assignment.
24211
24212         (Assign::Emit): Simplify and reuse code. 
24213
24214         * expression.cs (IndexerAccess, PropertyExpr): Implement
24215         IAssignMethod, clean up old code. 
24216
24217 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24218
24219         * typemanager.cs (ImplementsInterface): New method to determine if a type
24220         implements a given interface. Provides a nice cache too.
24221
24222         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24223         method.
24224
24225         (ConvertReferenceExplicit): Ditto.
24226
24227         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24228         various methods, with correct names etc.
24229
24230         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24231         Operator.UnaryNegation.
24232
24233         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24234         we have a unary plus or minus operator.
24235
24236         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24237         UnaryMinus.
24238
24239         * everywhere : update accordingly.
24240
24241         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24242         respectively.
24243
24244         * class.cs (Method::Define): For the case where we are implementing a method
24245         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24246         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24247
24248 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24249
24250         * interface.cs (FindMembers): Implement to work around S.R.E
24251         lameness.
24252
24253         * typemanager.cs (IsInterfaceType): Implement.
24254
24255         (FindMembers): Update to handle interface types too.
24256
24257         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24258         use IsAssignableFrom as that is not correct - it doesn't work.
24259
24260         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24261         and accordingly override EmitStatement.
24262
24263         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24264         using the correct logic :-)
24265
24266 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24267
24268         * ../errors/cs-11.cs : Add to demonstrate error -11 
24269
24270 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24271
24272         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24273         then pass this as a hint to ResolveLValue.
24274
24275         * expression.cs (FieldExpr): Add Location information
24276
24277         (FieldExpr::LValueResolve): Report assignment to readonly
24278         variable. 
24279
24280         (Expression::ExprClassFromMemberInfo): Pass location information.
24281
24282         (Expression::ResolveLValue): Add new method that resolves an
24283         LValue. 
24284
24285         (Expression::DoResolveLValue): Default invocation calls
24286         DoResolve. 
24287
24288         (Indexers): New class used to keep track of indexers in a given
24289         Type. 
24290
24291         (IStackStore): Renamed from LValue, as it did not really describe
24292         what this did.  Also ResolveLValue is gone from this interface and
24293         now is part of Expression.
24294
24295         (ElementAccess): Depending on the element access type
24296
24297         * typemanager.cs: Add `indexer_name_type' as a Core type
24298         (System.Runtime.CompilerServices.IndexerNameAttribute)
24299
24300         * statement.cs (Goto): Take a location.
24301
24302 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24303
24304         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24305         if two delegates are compatible.
24306
24307         (NewDelegate::DoResolve): Update to take care of the case when
24308         we instantiate a delegate from another delegate.
24309
24310         * typemanager.cs (FindMembers): Don't even try to look up members
24311         of Delegate types for now.
24312
24313 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24314
24315         * delegate.cs (NewDelegate): New class to take care of delegate
24316         instantiation.
24317
24318         * expression.cs (New): Split the delegate related code out into 
24319         the NewDelegate class.
24320
24321         * delegate.cs (DelegateInvocation): New class to handle delegate 
24322         invocation.
24323
24324         * expression.cs (Invocation): Split out delegate related code into
24325         the DelegateInvocation class.
24326
24327 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24328
24329         * expression.cs (New::DoResolve): Implement delegate creation fully
24330         and according to the spec.
24331
24332         (New::DoEmit): Update to handle delegates differently.
24333
24334         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24335         because of which we were printing out arguments in reverse order !
24336
24337         * delegate.cs (VerifyMethod): Implement to check if the given method
24338         matches the delegate.
24339
24340         (FullDelegateDesc): Implement.
24341
24342         (VerifyApplicability): Implement.
24343
24344         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24345         delegate invocations too.
24346
24347         (Invocation::Emit): Ditto.
24348
24349         * ../errors/cs1593.cs : Added.
24350
24351         * ../errors/cs1594.cs : Added.
24352
24353         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24354
24355 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24356
24357         * typemanager.cs (intptr_type): Core type for System.IntPtr
24358
24359         (InitCoreTypes): Update for the same.
24360
24361         (iasyncresult_type, asynccallback_type): Ditto.
24362
24363         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24364         correct.
24365
24366         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24367         too.
24368
24369         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24370         the builders for the 4 members of a delegate type :-)
24371
24372         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24373         type.
24374
24375         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24376
24377         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24378
24379 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24380
24381         * statement.cs (Break::Emit): Implement.   
24382         (Continue::Emit): Implement.
24383
24384         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24385         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24386         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24387         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24388         end loop
24389
24390         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24391         properties that track the label for the current loop (begin of the
24392         loop and end of the loop).
24393
24394 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24395
24396         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24397         use of emitting anything at all.
24398
24399         * class.cs, rootcontext.cs : Get rid of calls to the same.
24400
24401         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24402
24403         (Populate): Define the constructor correctly and set the implementation
24404         attributes.
24405
24406         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24407         have been defined.
24408
24409         (AddDelegateType): Implement.
24410
24411         (IsDelegateType): Implement helper method.
24412
24413         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24414
24415         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24416         and accordingly handle it.
24417
24418         * delegate.cs (Populate): Take TypeContainer argument.
24419         Implement bits to define the Invoke method. However, I still haven't figured out
24420         how to take care of the native int bit :-(
24421
24422         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24423         Qualify the name of the delegate, not its return type !
24424
24425         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24426         conversion.
24427
24428         (StandardConversionExists): Checking for array types turns out to be recursive.
24429
24430         (ConvertReferenceExplicit): Implement array conversion.
24431
24432         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24433
24434 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24435
24436         * cs-parser.jay (delegate_declaration): Store the fully qualified
24437         name as it is a type declaration.
24438
24439         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24440         readonly.
24441
24442         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24443         as TypeContainer::DefineType.
24444
24445         (Populate): Method in which all the definition of the various methods (Invoke)
24446         etc is done.
24447
24448         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24449         see.
24450
24451         (CloseDelegate): Finally creates the delegate.
24452
24453         * class.cs (TypeContainer::DefineType): Update to define delegates.
24454         (Populate, Emit and CloseType): Do the same thing here too.
24455
24456         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24457         delegates in all these operations.
24458
24459 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24460
24461         * expression.cs: LocalTemporary: a new expression used to
24462         reference a temporary that has been created.
24463
24464         * assign.cs: Handle PropertyAccess back here, so that we can
24465         provide the proper semantic access to properties.
24466
24467         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24468         a few more explicit conversions. 
24469
24470         * modifiers.cs: `NEW' modifier maps to HideBySig.
24471
24472         * expression.cs (PropertyExpr): Make this into an
24473         ExpressionStatement, and support the EmitStatement code path. 
24474
24475         Perform get/set error checking, clean up the interface.
24476
24477         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24478         them into toplevel access objects.
24479
24480 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24481
24482         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24483         SRE.
24484
24485         * typemanager.cs: Keep track here of our PropertyBuilders again to
24486         work around lameness in SRE.
24487
24488 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24489
24490         * expression.cs (LValue::LValueResolve): New method in the
24491         interface, used to perform a second resolution pass for LValues. 
24492
24493         (This::DoResolve): Catch the use of this in static methods.
24494
24495         (This::LValueResolve): Implement.
24496
24497         (This::Store): Remove warning, assigning to `this' in structures
24498         is 
24499
24500         (Invocation::Emit): Deal with invocation of
24501         methods on value types.  We need to pass the address to structure
24502         methods rather than the object itself.  (The equivalent code to
24503         emit "this" for structures leaves the entire structure on the
24504         stack instead of a pointer to it). 
24505
24506         (ParameterReference::DoResolve): Compute the real index for the
24507         argument based on whether the method takes or not a `this' pointer
24508         (ie, the method is static).
24509
24510         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24511         value types returned from functions when we need to invoke a
24512         method on the sturcture.
24513
24514
24515 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24516
24517         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24518         defining the type in the Modulebuilder or Typebuilder. This is to take
24519         care of nested types which need to be defined on the TypeBuilder using
24520         DefineNestedMethod.
24521
24522         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24523         methods in RootContext, only ported to be part of TypeContainer.
24524
24525         (TypeContainer::GetInterfaceOrClass): Ditto.
24526
24527         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24528
24529         * interface.cs (Interface::DefineInterface): New method. Does exactly
24530         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24531         too.
24532
24533         (Interface::GetInterfaces): Move from RootContext here and port.
24534
24535         (Interface::GetInterfaceByName): Same here.
24536
24537         * rootcontext.cs (ResolveTree): Re-write.
24538
24539         (PopulateTypes): Re-write.
24540
24541         * class.cs (TypeContainer::Populate): Populate nested types too.
24542         (TypeContainer::Emit): Emit nested members too.
24543
24544         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24545         instead just use the name argument passed in as it is already fully
24546         qualified.
24547
24548         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24549         to TypeContainer mapping to see if a type is user-defined.
24550
24551         * class.cs (TypeContainer::CloseType): Implement. 
24552
24553         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24554         the default constructor.
24555
24556         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24557         twice.
24558
24559         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24560
24561         * interface.cs (CloseType): Create the type here.
24562
24563         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24564         the hierarchy.
24565
24566         Remove all the methods which are now in TypeContainer.
24567
24568 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24569
24570         * delegate.cs (Define): Re-write bits to define the delegate
24571         correctly.
24572
24573 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24574
24575         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24576
24577         * expression.cs (ImplicitReferenceConversion): handle null as well
24578         as a source to convert to any reference type.
24579
24580         * statement.cs (Return): Perform any implicit conversions to
24581         expected return type.  
24582
24583         Validate use of return statement.  
24584
24585         * codegen.cs (EmitContext): Pass the expected return type here.
24586
24587         * class.cs (Method, Constructor, Property): Pass expected return
24588         type to EmitContext.
24589
24590 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24591
24592         * expression.cs: Make DoResolve take an EmitContext instead of a
24593         TypeContainer.
24594
24595         Replaced `l' and `location' for `loc', for consistency.
24596
24597         (Error, Warning): Remove unneeded Tc argument.
24598
24599         * assign.cs, literal.cs, constant.cs: Update to new calling
24600         convention. 
24601
24602         * codegen.cs: EmitContext now contains a flag indicating whether
24603         code is being generated in a static method or not.
24604
24605         * cs-parser.jay: DecomposeQI, new function that replaces the old
24606         QualifiedIdentifier.  Now we always decompose the assembled
24607         strings from qualified_identifier productions into a group of
24608         memberaccesses.
24609
24610 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24611
24612         * rootcontext.cs: Deal with field-less struct types correctly now
24613         by passing the size option to Define Type.
24614
24615         * class.cs: Removed hack that created one static field. 
24616
24617 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24618
24619         * statement.cs: Moved most of the code generation here. 
24620
24621 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24622
24623         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24624         seem very right.
24625
24626         (ElementAccess): Remove useless bits for now - keep checks as the spec
24627         says.
24628
24629 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24630
24631         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24632         and start performing checks according to the spec.
24633
24634 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24635
24636         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24637         rank_specifiers instead.
24638
24639         (rank_specifiers): Change the order in which the rank specifiers are stored
24640
24641         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24642
24643         * expression.cs (ElementAccess): Implement the LValue interface too.
24644
24645 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24646
24647         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24648         except that user defined conversions are not included.
24649
24650         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24651         perform the conversion of the return type, if necessary.
24652
24653         (New::DoResolve): Check whether we are creating an array or an object
24654         and accordingly do the needful.
24655
24656         (New::Emit): Same here.
24657
24658         (New::DoResolve): Implement guts of array creation.
24659
24660         (New::FormLookupType): Helper function.
24661
24662 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24663
24664         * codegen.cs: Removed most of the code generation here, and move the
24665         corresponding code generation bits to the statement classes. 
24666
24667         Added support for try/catch/finalize and throw.
24668
24669         * cs-parser.jay: Added support for try/catch/finalize.
24670
24671         * class.cs: Catch static methods having the flags override,
24672         virtual or abstract.
24673
24674         * expression.cs (UserCast): This user cast was not really doing
24675         what it was supposed to do.  Which is to be born in fully resolved
24676         state.  Parts of the resolution were being performed at Emit time! 
24677
24678         Fixed this code.
24679
24680 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24681
24682         * expression.cs: Implicity convert the result from UserCast.
24683
24684 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24685
24686         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24687         prevented it from working correctly. 
24688
24689         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24690         merely ConvertImplicit.
24691
24692 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24693
24694         * typemanager.cs: Make the LookupTypeContainer function static,
24695         and not per-instance.  
24696
24697         * class.cs: Make static FindMembers (the one that takes a Type
24698         argument). 
24699
24700         * codegen.cs: Add EmitForeach here.
24701
24702         * cs-parser.jay: Make foreach a toplevel object instead of the
24703         inline expansion, as we need to perform semantic analysis on it. 
24704
24705 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24706
24707         * expression.cs (Expression::ImplicitUserConversion): Rename to
24708         UserDefinedConversion.
24709
24710         (Expression::UserDefinedConversion): Take an extra argument specifying 
24711         whether we look for explicit user conversions too.
24712
24713         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24714
24715         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24716
24717         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24718         with the appropriate arguments.
24719
24720         * cs-parser.jay (cast_expression): Record location too.
24721
24722         * expression.cs (Cast): Record location info.
24723
24724         (Expression::ConvertExplicit): Take location argument.
24725
24726         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24727         to determine if we are doing explicit conversions.
24728
24729         (UserCast::Emit): Update accordingly.
24730
24731         (Expression::ConvertExplicit): Report an error if everything fails.
24732
24733         * ../errors/cs0030.cs : Add.
24734
24735 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24736
24737         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24738         virtual and newslot bits. 
24739
24740         * class.cs (TypeContainer::RegisterRequiredImplementations):
24741         Record methods we need.
24742
24743         (TypeContainer::MakeKey): Helper function to make keys for
24744         MethodBases, since the Methodbase key is useless.
24745
24746         (TypeContainer::Populate): Call RegisterRequiredImplementations
24747         before defining the methods.   
24748
24749         Create a mapping for method_builders_to_methods ahead of time
24750         instead of inside a tight loop.
24751
24752         (::RequireMethods):  Accept an object as the data to set into the
24753         hashtable so we can report interface vs abstract method mismatch.
24754
24755 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24756
24757         * report.cs: Make all of it static.
24758
24759         * rootcontext.cs: Drop object_type and value_type computations, as
24760         we have those in the TypeManager anyways.
24761
24762         Drop report instance variable too, now it is a global.
24763
24764         * driver.cs: Use try/catch on command line handling.
24765
24766         Add --probe option to debug the error reporting system with a test
24767         suite. 
24768
24769         * report.cs: Add support for exiting program when a probe
24770         condition is reached.
24771
24772 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24773
24774         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24775         we do a forcible conversion regardless of type, to check if 
24776         ForceConversion returns a null.
24777
24778         (Binary::error19): Use location to report error.
24779
24780         (Unary::error23): Use location here too.
24781
24782         * ../errors/cs0019.cs : Check in.
24783
24784         * ../errors/cs0023.cs : Check in.
24785
24786         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24787         case of a non-null MethodInfo object with a length of 0 !
24788
24789         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24790         an applicable member - according to the spec :-)
24791         Also fix logic to find members in base types.
24792
24793         (Unary::ResolveOperator): Same here.
24794
24795         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24796         as I was getting thoroughly confused between this and error19 :-)
24797
24798         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24799         (::FindMostEncompassedType): Implement.
24800         (::FindMostEncompassingType): Implement.
24801         (::StandardConversionExists): Implement.
24802
24803         (UserImplicitCast): Re-vamp. We now need info about most specific
24804         source and target types so that we can do the necessary conversions.
24805
24806         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24807         mathematical union with no duplicates.
24808
24809 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24810
24811         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24812         in order from base classes to child classes, so that we can in
24813         child classes look up in our parent for method names and
24814         attributes (required for handling abstract, virtual, new, override
24815         constructs: we need to instrospect our base class, and if we dont
24816         populate the classes in order, the introspection might be
24817         incorrect.  For example, a method could query its parent before
24818         the parent has any methods and would determine that the parent has
24819         no abstract methods (while it could have had them)).
24820
24821         (RootContext::CreateType): Record the order in which we define the
24822         classes.
24823
24824 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24825
24826         * class.cs (TypeContainer::Populate): Also method definitions can
24827         fail now, keep track of this.
24828
24829         (TypeContainer::FindMembers): Implement support for
24830         DeclaredOnly/noDeclaredOnly flag.
24831
24832         (Constructor::Emit) Return the ConstructorBuilder.
24833
24834         (Method::Emit) Return the MethodBuilder. 
24835         Check for abstract or virtual methods to be public.
24836
24837         * rootcontext.cs (RootContext::CreateType): Register all the
24838         abstract methods required for the class to be complete and the
24839         interface methods that must be implemented. 
24840
24841         * cs-parser.jay: Report error 501 (method requires body if it is
24842         not marked abstract or extern).
24843
24844         * expression.cs (TypeOf::Emit): Implement.
24845
24846         * typemanager.cs: runtime_handle_type, new global type.
24847
24848         * class.cs (Property::Emit): Generate code for properties.
24849
24850 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24851
24852         * expression.cs (Unary::ResolveOperator): Find operators on base type
24853         too - we now conform exactly to the spec.
24854
24855         (Binary::ResolveOperator): Same here.
24856
24857         * class.cs (Operator::Define): Fix minor quirk in the tests.
24858
24859         * ../errors/cs0215.cs : Added.
24860
24861         * ../errors/cs0556.cs : Added.
24862
24863         * ../errors/cs0555.cs : Added.
24864
24865 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24866
24867         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24868         single integer which is really efficient
24869
24870 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24871
24872         *  expression.cs (Expression::ImplicitUserConversion): Use location
24873         even in the case when we are examining True operators.
24874  
24875         * class.cs (Operator::Define): Perform extensive checks to conform
24876         with the rules for operator overloading in the spec.
24877
24878         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24879         some of the other conversions mentioned in the spec.
24880
24881         * typemanager.cs (array_type): New static member for the System.Array built-in
24882         type.
24883
24884         (cloneable_interface): For System.ICloneable interface.
24885
24886         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24887         we start resolving the tree and populating types.
24888
24889         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24890  
24891 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24892
24893         * expression.cs (Expression::ExprClassFromMemberInfo,
24894         Expression::Literalize): Create literal expressions from
24895         FieldInfos which are literals.
24896
24897         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24898         type casts, because they were wrong.  The test suite in tests
24899         caught these ones.
24900
24901         (ImplicitNumericConversion): ushort to ulong requires a widening
24902         cast. 
24903
24904         Int32 constant to long requires widening cast as well.
24905
24906         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24907         for integers because the type on the stack is not i4.
24908
24909 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24910
24911         * expression.cs (report118): require location argument. 
24912
24913         * parameter.cs: Do not dereference potential null value.
24914
24915         * class.cs: Catch methods that lack the `new' keyword when
24916         overriding a name.  Report warnings when `new' is used without
24917         anything being there to override.
24918
24919         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24920
24921         * class.cs: Only add constructor to hashtable if it is non-null
24922         (as now constructors can fail on define).
24923
24924         (TypeManager, Class, Struct): Take location arguments.
24925
24926         Catch field instance initialization in structs as errors.
24927
24928         accepting_filter: a new filter for FindMembers that is static so
24929         that we dont create an instance per invocation.
24930
24931         (Constructor::Define): Catch errors where a struct constructor is
24932         parameterless 
24933
24934         * cs-parser.jay: Pass location information for various new
24935         constructs. 
24936
24937         * delegate.cs (Delegate): take a location argument.
24938
24939         * driver.cs: Do not call EmitCode if there were problesm in the
24940         Definition of the types, as many Builders wont be there. 
24941
24942         * decl.cs (Decl::Decl): Require a location argument.
24943
24944         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24945         into integers, and find the most appropiate integer for it.
24946
24947         * literal.cs: Implement ULongLiteral.
24948
24949         * rootcontext.cs: Provide better information about the location of
24950         failure when CreateType fails.
24951
24952 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24953
24954         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24955         as well.
24956
24957         * expression.cs (Binary::CheckShiftArguments): Add missing type
24958         computation.
24959         (Binary::ResolveOperator): Add type to the logical and and logical
24960         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24961         before.
24962
24963         (Binary::DoNumericPromotions): In the case where either argument
24964         is ulong (and most signed types combined with ulong cause an
24965         error) perform implicit integer constant conversions as well.
24966
24967 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24968
24969         * expression.cs (UserImplicitCast): Method should always be
24970         non-null. 
24971         (Invocation::BetterConversion): Simplified test for IntLiteral.
24972
24973         (Expression::ImplicitNumericConversion): Split this routine out.
24974         Put the code that performs implicit constant integer conversions
24975         here. 
24976
24977         (Expression::Resolve): Become a wrapper around DoResolve so we can
24978         check eclass and type being set after resolve.
24979
24980         (Invocation::Badness): Remove this dead function
24981
24982         (Binary::ResolveOperator): Do not compute the expensive argumnets
24983         unless we have a union for it.
24984
24985         (Probe::Emit): Is needs to do an isinst and then
24986         compare against null.
24987
24988         (::CanConvert): Added Location argument.  If the Location argument
24989         is null (Location.Null), then we do not report errors.  This is
24990         used by the `probe' mechanism of the Explicit conversion.  We do
24991         not want to generate an error for something that the user
24992         explicitly requested to be casted.  But the pipeline for an
24993         explicit cast first tests for potential implicit casts.
24994
24995         So for now, if the Location is null, it means `Probe only' to
24996         avoid adding another argument.   Might have to revise this
24997         strategy later.
24998
24999         (ClassCast): New class used to type cast objects into arbitrary
25000         classes (used in Explicit Reference Conversions).
25001
25002         Implement `as' as well.
25003
25004         Reverted all the patches from Ravi below: they were broken:
25005
25006                 * The use of `level' as a mechanism to stop recursive
25007                   invocations is wrong.  That was there just to catch the
25008                   bug with a strack trace but not as a way of addressing
25009                   the problem.
25010
25011                   To fix the problem we have to *understand* what is going
25012                   on and the interactions and come up with a plan, not
25013                   just get things going.
25014
25015                 * The use of the type conversion cache that I proposed
25016                   last night had an open topic: How does this work across
25017                   protection domains.  A user defined conversion might not
25018                   be public in the location where we are applying the
25019                   conversion, a different conversion might be selected
25020                   (ie, private A->B (better) but public B->A (worse),
25021                   inside A, A->B applies, but outside it, B->A will
25022                   apply).
25023
25024                 * On top of that (ie, even if the above is solved),
25025                   conversions in a cache need to be abstract.  Ie, `To
25026                   convert from an Int to a Short use an OpcodeCast', not
25027                   `To convert from an Int to a Short use the OpcodeCast on
25028                   the variable 5' (which is what this patch was doing).
25029
25030 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25031
25032         * expression.cs (Invocation::ConversionExists): Re-write to use
25033         the conversion cache
25034
25035         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25036         cache all conversions done, not just user-defined ones.
25037
25038         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25039         to determine if a conversion exists instead of acutually trying to 
25040         perform the conversion. It's faster too.
25041
25042         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25043         and only then attempt the implicit conversion.
25044
25045 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25046
25047         * expression.cs (ConvertImplicit): Use a cache for conversions
25048         already found. Check level of recursion and bail out if necessary.
25049
25050 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25051
25052         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25053         Export standard methods that we expect for string operations.
25054
25055         * statement.cs (Block::UsageWarning): Track usage of variables and
25056         report the errors for not used variables.
25057
25058         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25059         operator. 
25060
25061 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25062
25063         * codegen.cs: remove unnneded code 
25064
25065         * expression.cs: Removed BuiltinTypeAccess class
25066
25067         Fix the order in which implicit conversions are
25068         done.  
25069
25070         The previous fixed dropped support for boxed conversions (adding a
25071         test to the test suite now)
25072
25073         (UserImplicitCast::CanConvert): Remove test for source being null,
25074         that code is broken.  We should not feed a null to begin with, if
25075         we do, then we should track the bug where the problem originates
25076         and not try to cover it up here.
25077
25078         Return a resolved expression of type UserImplicitCast on success
25079         rather than true/false.  Ravi: this is what I was talking about,
25080         the pattern is to use a static method as a "constructor" for
25081         objects. 
25082
25083         Also, do not create arguments until the very last minute,
25084         otherwise we always create the arguments even for lookups that
25085         will never be performed. 
25086
25087         (UserImplicitCast::Resolve): Eliminate, objects of type
25088         UserImplicitCast are born in a fully resolved state. 
25089
25090         * typemanager.cs (InitCoreTypes): Init also value_type
25091         (System.ValueType). 
25092
25093         * expression.cs (Cast::Resolve): First resolve the child expression.
25094
25095         (LValue): Add new method AddressOf to be used by
25096         the `&' operator.  
25097
25098         Change the argument of Store to take an EmitContext instead of an
25099         ILGenerator, because things like FieldExpr need to be able to call
25100         their children expression to generate the instance code. 
25101
25102         (Expression::Error, Expression::Warning): Sugar functions for
25103         reporting errors.
25104
25105         (Expression::MemberLookup): Accept a TypeContainer instead of a
25106         Report as the first argument.
25107
25108         (Expression::ResolvePrimary): Killed.  I still want to improve
25109         this as currently the code is just not right.
25110
25111         (Expression::ResolveMemberAccess): Simplify, but it is still
25112         wrong. 
25113
25114         (Unary::Resolve): Catch errors in AddressOf operators.
25115
25116         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25117         index to a byte for the short-version, or the compiler will choose
25118         the wrong Emit call, which generates the wrong data.
25119
25120         (ParameterReference::Emit, ::Store): same.
25121
25122         (FieldExpr::AddressOf): Implement.
25123
25124         * typemanager.cs: TypeManager: made public variable instead of
25125         property.
25126
25127         * driver.cs: document --fatal.
25128
25129         * report.cs (ErrorMessage, WarningMessage): new names for the old
25130         Error and Warning classes.
25131
25132         * cs-parser.jay (member_access): Turn built-in access to types
25133         into a normal simplename
25134
25135 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25136
25137         * expression.cs (Invocation::BetterConversion): Fix to cope
25138         with q being null, since this was introducing a bug.
25139
25140         * expression.cs (ConvertImplicit): Do built-in conversions first.
25141
25142 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25143
25144         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25145
25146 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25147
25148         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25149         I had introduced long ago (what's new ?).
25150
25151         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25152         the work of all the checking. 
25153         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25154         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25155
25156         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25157         that is the right way. 
25158
25159         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25160         overloading resolution. Use everywhere instead of cutting and pasting code.
25161
25162         (Binary::ResolveOperator): Use MakeUnionSet.
25163
25164         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25165         we have to convert to bool types. Not complete yet.
25166
25167 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25168
25169         * typemanager.cs (TypeManager::CSharpName): support ushort.
25170
25171         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25172         to provide an expression that performsn an implicit constant int
25173         conversion (section 6.1.6).
25174         (Expression::ConvertImplicitRequired): Reworked to include
25175         implicit constant expression conversions.
25176
25177         (Expression::ConvertNumericExplicit): Finished.
25178
25179         (Invocation::Emit): If InstanceExpression is null, then it means
25180         that we perform a call on this.
25181
25182 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25183
25184         * expression.cs (Unary::Emit): Remove some dead code.
25185         (Probe): Implement Resolve and Emit for `is'.
25186         (Expression::ConvertImplicitRequired): Attempt to do constant
25187         expression conversions here.  Maybe should be moved to
25188         ConvertImplicit, but I am not sure.
25189         (Expression::ImplicitLongConstantConversionPossible,
25190         Expression::ImplicitIntConstantConversionPossible): New functions
25191         that tell whether is it possible to apply an implicit constant
25192         expression conversion.
25193
25194         (ConvertNumericExplicit): Started work on explicit numeric
25195         conversions.
25196
25197         * cs-parser.jay: Update operator constants.
25198
25199         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25200         (Parameters::GetSignature): Hook up VerifyArgs here.
25201         (Parameters::VerifyArgs): Verifies that no two arguments have the
25202         same name. 
25203
25204         * class.cs (Operator): Update the operator names to reflect the
25205         ones that the spec expects (as we are just stringizing the
25206         operator names).
25207
25208         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25209         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25210         previous usage did only work for our methods.
25211         (Expression::ConvertImplicit): Handle decimal implicit numeric
25212         conversions as well.
25213         (Expression::InternalTypeConstructor): Used to invoke constructors
25214         on internal types for default promotions.
25215
25216         (Unary::Emit): Implement special handling for the pre/post
25217         increment/decrement for overloaded operators, as they need to have
25218         the same semantics as the other operators.
25219
25220         (Binary::ResolveOperator): ditto.
25221         (Invocation::ConversionExists): ditto.
25222         (UserImplicitCast::Resolve): ditto.
25223
25224 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25225
25226         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25227         operator, return after emitting body. Regression tests pass again !
25228
25229         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25230         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25231         (Invocation::OverloadResolve): Ditto.
25232         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25233
25234         * everywhere : update calls to the above methods accordingly.
25235
25236 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25237
25238         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25239
25240         * expression.cs (ExpressionStatement): New base class used for
25241         expressions that can appear in statements, so that we can provide
25242         an alternate path to generate expression that do not leave a value
25243         on the stack.
25244
25245         (Expression::Emit, and all the derivatives): We no longer return
25246         whether a value is left on the stack or not.  Every expression
25247         after being emitted leaves a single value on the stack.
25248
25249         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25250         facilties of ExpressionStatement if possible.
25251
25252         * cs-parser.jay: Update statement_expression.
25253
25254 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25255
25256         * driver.cs: Change the wording of message
25257
25258 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25259
25260         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25261         the type of the expression to the return type of the method if
25262         we have an overloaded operator match ! The regression tests pass again !
25263         (Unary::ResolveOperator): Ditto.
25264
25265         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25266         to find "op_Implicit", not "implicit" ;-)
25267         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25268         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25269
25270         * everywhere : Correct calls to the above accordingly.
25271
25272         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25273         (ConvertImplicit): Do user-defined conversion if it exists.
25274
25275 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25276
25277         * assign.cs: track location.
25278         (Resolve): Use implicit conversions on assignment.
25279
25280         * literal.cs: Oops.  Not good, Emit of short access values should
25281         pass (Bytes) or the wrong argument will be selected.
25282
25283         * expression.cs (Unary::Emit): Emit code for -expr.
25284
25285         (Unary::ResolveOperator): Handle `Substract' for non-constants
25286         (substract from zero from the non-constants).
25287         Deal with Doubles as well. 
25288
25289         (Expression::ConvertImplicitRequired): New routine that reports an
25290         error if no implicit conversion exists. 
25291
25292         (Invocation::OverloadResolve): Store the converted implicit
25293         expressions if we make them
25294
25295 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25296
25297         * class.cs (ConstructorInitializer): Take a Location argument.
25298         (ConstructorBaseInitializer): Same here.
25299         (ConstructorThisInitializer): Same here.
25300
25301         * cs-parser.jay : Update all calls accordingly.
25302
25303         * expression.cs (Unary, Binary, New): Take location argument.
25304         Update accordingly everywhere.
25305
25306         * cs-parser.jay : Update all calls to the above to take a location
25307         argument.
25308
25309         * class.cs : Ditto.
25310
25311 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25312
25313         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25314         (Invocation::BetterConversion): Same here
25315         (Invocation::ConversionExists): Ditto.
25316
25317         (Invocation::ConversionExists): Implement.
25318
25319 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25320
25321         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25322         Also take an additional TypeContainer argument.
25323
25324         * All over : Pass in TypeContainer as argument to OverloadResolve.
25325
25326         * typemanager.cs (CSharpName): Update to check for the string type and return
25327         that too.
25328
25329         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25330         a given method.
25331
25332 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25333
25334         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25335         (Invocation::BetterFunction): Implement.
25336         (Invocation::BetterConversion): Implement.
25337         (Invocation::ConversionExists): Skeleton, no implementation yet.
25338
25339         Okay, things work fine !
25340
25341 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25342
25343         * typemanager.cs: declare and load enum_type, delegate_type and
25344         void_type. 
25345
25346         * expression.cs (Expression::Emit): Now emit returns a value that
25347         tells whether a value is left on the stack or not.  This strategy
25348         might be reveted tomorrow with a mechanism that would address
25349         multiple assignments.
25350         (Expression::report118): Utility routine to report mismatches on
25351         the ExprClass.
25352
25353         (Unary::Report23): Report impossible type/operator combination
25354         utility function.
25355
25356         (Unary::IsIncrementableNumber): Whether the type can be
25357         incremented or decremented with add.
25358         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25359         complemented. 
25360         (Unary::ResolveOperator): Implement ++, !, ~,
25361
25362         (Invocation::Emit): Deal with new Emit convetion.
25363
25364         * All Expression derivatives: Updated their Emit method to return
25365         whether they leave values on the stack or not.
25366
25367         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25368         stack for expressions that are statements. 
25369
25370 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25371
25372         * expression.cs (LValue): New interface.  Must be implemented by
25373         LValue objects.
25374         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25375         LValue interface.
25376
25377         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25378         interface for generating code, simplifies the code.
25379
25380 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25381
25382         * expression.cs (everywhere): Comment out return statements in ::Resolve
25383         methods to avoid the warnings.
25384
25385 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25386
25387         * driver.cs (parse): Report error 2001 if we can not open the
25388         source file.
25389
25390         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25391         not resolve it.
25392
25393         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25394         object. 
25395
25396         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25397         otherwise nested blocks end up with the same index.
25398
25399         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25400
25401         * expression.cs:  Instead of having FIXMEs in the Resolve
25402         functions, throw exceptions so it is obvious that we are facing a
25403         bug. 
25404
25405         * cs-parser.jay (invocation_expression): Pass Location information.
25406
25407         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25408         Use a basename for those routines because .NET does not like paths
25409         on them. 
25410
25411         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25412         already defined.
25413
25414 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25415
25416         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25417         are loading the correct data types (throws an exception if not).
25418         (TypeManager::InitCoreTypes): Use CoreLookupType
25419
25420         * expression.cs (Unary::ResolveOperator): return the child
25421         expression for expressions which are just +expr.
25422         (Unary::ResolveOperator): Return negative literals for -LITERAL
25423         expressions (otherwise they are Unary {Literal}).
25424         (Invocation::Badness): Take into account `Implicit constant
25425         expression conversions'.
25426
25427         * literal.cs (LongLiteral): Implement long literal class.
25428         (IntLiteral): export the `Value' of the intliteral. 
25429
25430 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25431
25432         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25433
25434         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25435         instead of 'Operator'
25436
25437         * expression.cs (Binary::ResolveOperator): Update accordingly.
25438         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25439         and 'Minus'
25440
25441         * cs-parser.jay (unary_expression): Update to use the new names.
25442
25443         * gen-treedump.cs (GetUnary): Same here.
25444
25445         * expression.cs (Unary::Resolve): Implement.
25446         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25447         operators are found instead of making noise ;-)
25448         (Unary::ResolveOperator): New method to do precisely the same thing which
25449         Binary::ResolveOperator does for Binary expressions.
25450         (Unary.method, .Arguments): Add.
25451         (Unary::OperName): Implement.   
25452         (Unary::ForceConversion): Copy and Paste !
25453
25454         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25455         a unary operator.
25456
25457         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25458         for the inbuilt operators. Only overloading works for now ;-)
25459
25460 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25461
25462         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25463         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25464
25465         * expression.cs (This::Emit): Implement. 
25466         (This::Resolve): Implement.
25467         (TypeOf:Resolve): Implement.
25468         (Expression::ResolveSimpleName): Add an implicit this to instance
25469         field references. 
25470         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25471         Bind instance variable to Field expressions.
25472         (FieldExpr::Instance): New field used to track the expression that
25473         represents the object instance.
25474         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25475         binding 
25476         (FieldExpr::Emit): Implement.
25477
25478         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25479         the last instruction contains a return opcode to avoid generating
25480         the last `ret' instruction (this generates correct code, and it is
25481         nice to pass the peverify output).
25482
25483         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25484         initializer for static and instance variables.
25485         (Constructor::Emit): Allow initializer to be null in the case of
25486         static constructors.  Only emit initializer for instance
25487         constructors. 
25488
25489         (TypeContainer::FindMembers): Return a null array if there are no
25490         matches.
25491
25492         Also fix the code for the MemberTypes.Method branch, as it was not
25493         scanning that for operators (or tried to access null variables before).
25494
25495         * assign.cs (Assign::Emit): Handle instance and static fields. 
25496
25497         * TODO: Updated.
25498
25499         * driver.cs: Stop compilation if there are parse errors.
25500
25501         * cs-parser.jay (constructor_declaration): Provide default base
25502         initializer for non-static constructors.
25503         (constructor_declarator): Do not provide a default base
25504         initializers if none was specified.
25505         Catch the fact that constructors should not have parameters.
25506
25507         * class.cs: Do not emit parent class initializers for static
25508         constructors, that should be flagged as an error.
25509
25510 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25511
25512         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25513         Move back code into TypeContainer::Populate.
25514
25515 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25516
25517         * class.cs (TypeContainer::AddConstructor): Fix the check to
25518         compare against Name, not Basename. 
25519         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25520
25521         * cs-parser.jay : Update accordingly.
25522
25523         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25524         for methods, don't forget to look into the operators too.
25525         (RegisterMethodBuilder): Helper method to take care of this for
25526         methods, constructors and operators.
25527         (Operator::Define): Completely revamp.
25528         (Operator.OperatorMethod, MethodName): New fields.
25529         (TypeContainer::Populate): Move the registering of builders into
25530         RegisterMethodBuilder.
25531         (Operator::Emit): Re-write.
25532
25533         * expression.cs (Binary::Emit): Comment out code path to emit method
25534         invocation stuff for the case when we have a user defined operator. I am
25535         just not able to get it right !
25536
25537 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25538
25539         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25540         argument. 
25541
25542         (Expression::MemberLookup): Provide a version that allows to
25543         specify the MemberTypes and BindingFlags. 
25544
25545         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25546         so it was not fetching variable information from outer blocks.
25547
25548         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25549         Beforefieldinit as it was buggy.
25550
25551         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25552         that Ravi put here.  
25553
25554         * class.cs (Constructor::Emit): Only emit if block is not null.
25555         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25556         deal with this by semantically definining it as if the user had
25557         done it.
25558
25559         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25560         constructors as we now "emit" them at a higher level.
25561
25562         (TypeContainer::DefineDefaultConstructor): Used to define the
25563         default constructors if none was provided.
25564
25565         (ConstructorInitializer): Add methods Resolve and Emit. 
25566
25567         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25568
25569 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25570
25571         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25572         the default constructor builder with our hashtable for methodbuilders
25573         to methodcores.
25574
25575         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25576         and argument_count is 0 in which case we have a match.
25577         (Binary::ResolveOperator): More null checking and miscellaneous coding
25578         style cleanup.
25579
25580 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25581
25582         * rootcontext.cs (IsNameSpace): Compare against null.
25583
25584         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25585
25586         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25587         and Unary::Operator.
25588
25589         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25590         accordingly.
25591
25592         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25593         we have overloaded operators.
25594         (Binary::ResolveOperator): Implement the part which does the operator overload
25595         resolution.
25596
25597         * class.cs (Operator::Emit): Implement.
25598         (TypeContainer::Emit): Emit the operators we have too.
25599
25600         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25601         the case when we have a user-defined operator.
25602
25603 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25604
25605         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25606
25607 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25608
25609         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25610         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25611         (Constructor::Emit): Implement.
25612         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25613         if we have no work to do. 
25614         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25615         Emit method.
25616
25617         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25618         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25619
25620         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25621         of parent.parent.
25622
25623 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25624
25625         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25626         in the source.
25627         (Tree::RecordNamespace): Method to do what the name says ;-)
25628         (Tree::Namespaces): Property to get at the namespaces hashtable.
25629
25630         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25631         keep track.
25632
25633         * rootcontext.cs (IsNamespace): Fixed it :-)
25634
25635 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25636
25637         * class.cs (TypeContainer::FindMembers): Add support for
25638         constructors. 
25639         (MethodCore): New class that encapsulates both the shared aspects
25640         of a Constructor and a Method.  
25641         (Method, Constructor): Factored pieces into MethodCore.
25642
25643         * driver.cs: Added --fatal which makes errors throw exceptions.
25644         Load System assembly as well as part of the standard library.
25645
25646         * report.cs: Allow throwing exceptions on errors for debugging.
25647
25648         * modifiers.cs: Do not use `parent', instead use the real type
25649         container to evaluate permission settings.
25650
25651         * class.cs: Put Ravi's patch back in.  He is right, and we will
25652         have to cope with the
25653
25654 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25655
25656         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25657         FamORAssem, not FamANDAssem.
25658
25659 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25660
25661         * driver.cs: Added --parse option that only parses its input files
25662         and terminates.
25663
25664         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25665         incorrect.  IsTopLevel is not used to tell whether an object is
25666         root_types or not (that can be achieved by testing this ==
25667         root_types).  But to see if this is a top-level *class* (not
25668         necessarly our "toplevel" container). 
25669
25670 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25671
25672         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25673         parent instead of a direct call to GetType.
25674
25675 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25676
25677         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25678         Modifiers.TypeAttr. This should just be a call to that method.
25679
25680         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25681         object so that we can determine if we are top-level or not.
25682
25683         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25684         TypeContainer too.
25685
25686         * enum.cs (Enum::Define): Ditto.
25687
25688         * modifiers.cs (FieldAttr): Re-write.
25689
25690         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25691         (TypeContainer::HaveStaticConstructor): New property to provide access
25692         to precisely that info.
25693
25694         * modifiers.cs (MethodAttr): Re-write.
25695         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25696
25697         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25698         of top-level types as claimed.
25699
25700 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25701
25702         * expression.cs (MemberLookup): Fruitless attempt to lookup
25703         constructors.  Maybe I need to emit default constructors?  That
25704         might be it (currently .NET emits this for me automatically).
25705         (Invocation::OverloadResolve): Cope with Arguments == null.
25706         (Invocation::EmitArguments): new function, shared by the new
25707         constructor and us.
25708         (Invocation::Emit): Handle static and instance methods.  Emit
25709         proper call instruction for virtual or non-virtual invocations.
25710         (New::Emit): Implement.
25711         (New::Resolve): Implement.
25712         (MemberAccess:Resolve): Implement.
25713         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25714         to track instances.
25715         (FieldExpr::Resolve): Set type.
25716
25717         * support.cs: Handle empty arguments.
25718                 
25719         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25720         SimpleLookup): Auxiliary routines to help parse a qualifier
25721         identifier.  
25722
25723         Update qualifier_identifier rule.
25724
25725         * codegen.cs: Removed debugging messages.
25726
25727         * class.cs: Make this a global thing, this acts just as a "key" to
25728         objects that we might have around.
25729
25730         (Populate): Only initialize method_builders_to_methods once.
25731
25732         * expression.cs (PropertyExpr): Initialize type from the
25733         PropertyType. 
25734
25735         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25736         Resolve pattern.  Attempt to implicitly convert value to boolean.
25737         Emit code.
25738
25739         * expression.cs: Set the type for the int32/int32 argument case.
25740         (Binary::ResolveOperator): Set the return type to boolean for
25741         comparission operators
25742
25743         * typemanager.cs: Remove debugging print code.
25744
25745         (Invocation::Resolve): resolve type.
25746
25747         * class.cs: Allocate a MemberInfo of the correct size, as the code
25748         elsewhere depends on the test to reflect the correct contents.
25749
25750         (Method::) Keep track of parameters, due to System.Reflection holes
25751
25752         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25753         mapping here.
25754
25755         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25756         of the exact size and return that.
25757
25758         (Class::LookupMethodByBuilder): New function that maps
25759         MethodBuilders to its methods.  Required to locate the information
25760         on methods because System.Reflection bit us again.
25761
25762         * support.cs: New file, contains an interface ParameterData and
25763         two implementations: ReflectionParameters and InternalParameters
25764         used to access Parameter information.  We will need to grow this
25765         as required.
25766
25767         * expression.cs (Invocation::GetParameterData): implement a cache
25768         and a wrapper around the ParameterData creation for methods. 
25769         (Invocation::OverloadResolve): Use new code.
25770
25771 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25772
25773         * class.cs (TypeContainer::EmitField): Remove and move into 
25774         (Field::Define): here and modify accordingly.
25775         (Field.FieldBuilder): New member.
25776         (TypeContainer::Populate): Update accordingly.
25777         (TypeContainer::FindMembers): Implement.
25778
25779 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25780
25781         * statement.cs: (VariableInfo::VariableType): New field to be
25782         initialized with the full type once it is resolved. 
25783
25784 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25785
25786         * parameter.cs (GetParameterInfo): Use a type cache to compute
25787         things only once, and to reuse this information
25788
25789         * expression.cs (LocalVariableReference::Emit): Implement.
25790         (OpcodeCast::Emit): fix.
25791
25792         (ParameterReference::Resolve): Implement.
25793         (ParameterReference::Emit): Implement.
25794
25795         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25796         that are expressions need to stay as Expressions.
25797
25798         * typemanager.cs (CSharpName): Returns the C# name of a type if
25799         possible. 
25800
25801         * expression.cs (Expression::ConvertImplicit): New function that
25802         implements implicit type conversions.
25803
25804         (Expression::ImplicitReferenceConversion): Implements implicit
25805         reference conversions.
25806
25807         (EmptyCast): New type for transparent casts.
25808
25809         (OpcodeCast): New type for casts of types that are performed with
25810         a sequence of bytecodes.
25811
25812         (BoxedCast): New type used for casting value types into reference
25813         types.  Emits a box opcode.
25814
25815         (Binary::DoNumericPromotions): Implements numeric promotions of
25816         and computation of the Binary::Type.
25817
25818         (Binary::EmitBranchable): Optimization.
25819
25820         (Binary::Emit): Implement code emission for expressions.
25821
25822         * typemanager.cs (TypeManager): Added two new core types: sbyte
25823         and byte.
25824
25825 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25826
25827         * class.cs (TypeContainer::FindMembers): Method which does exactly
25828         what Type.FindMembers does, only we don't have to use reflection. No
25829         implementation yet.
25830
25831         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25832         typecontainer objects as we need to get at them.
25833         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25834
25835         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25836         typecontainer object.
25837
25838         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25839         of just a Report object.
25840
25841 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25842
25843         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25844         "remove_"
25845         (TypeContainer::Populate): Now define the delegates of the type too.
25846         (TypeContainer.Delegates): Property to access the list of delegates defined
25847         in the type.
25848
25849         * delegates.cs (Delegate::Define): Implement partially.
25850
25851         * modifiers.cs (TypeAttr): Handle more flags.
25852
25853 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25854
25855         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25856         and not <=
25857         (Operator::Define): Re-write logic to get types by using the LookupType method
25858         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25859         (Indexer::Define): Ditto.
25860         (Event::Define): Ditto.
25861         (Property::Define): Ditto.
25862
25863 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25864
25865         * class.cs (TypeContainer::Populate): Now define operators too. 
25866         (TypeContainer.Operators): New property to access the list of operators
25867         in a type.
25868         (Operator.OperatorMethodBuilder): New member to hold the method builder
25869         for the operator we are defining.
25870         (Operator::Define): Implement.
25871
25872 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25873
25874         * class.cs (Event::Define): Make the prefixes of the accessor methods
25875         addOn_ and removeOn_ 
25876
25877         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25878         of the location being passed in too. Ideally, this should go later since all
25879         error reporting should be done through the Report object.
25880
25881         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25882         (Populate): Iterate thru the indexers we have and define them too.
25883         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25884         for the get and set accessors.
25885         (Indexer::Define): Implement.
25886
25887 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25888
25889         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25890         my previous implementation, did not work.
25891
25892         * typemanager.cs: Add a couple of missing types (the longs).
25893
25894         * literal.cs: Use TypeManager.bool_type instead of getting it.
25895
25896         * expression.cs (EventExpr): New kind of expressions.
25897         (Expressio::ExprClassFromMemberInfo): finish
25898
25899 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25900
25901         * assign.cs: Emit stores to static fields differently.
25902
25903 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25904
25905         * Merge in changes and adjust code to tackle conflicts. Backed out my
25906         code in Assign::Resolve ;-) 
25907
25908 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25909
25910         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25911         instead Report.Error and also pass in the location.
25912         (CSharpParser::Lexer): New readonly property to return the reference
25913         to the Tokenizer object.
25914         (declare_local_variables): Use Report.Error with location instead of plain 
25915         old error.
25916         (CheckDef): Ditto.
25917
25918         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25919         (Operator.CheckBinaryOperator): Ditto.
25920
25921         * cs-parser.jay (operator_declarator): Update accordingly.
25922
25923         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25924         (CheckBinaryOperator): Same here.
25925
25926         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25927         on the name without any prefixes of namespace names etc. This is because we
25928         already might have something already fully qualified like 
25929         'System.Console.WriteLine'
25930
25931         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25932
25933 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25934
25935         * cs-tokenizer.cs (location): Return a string which also contains
25936         the file name.
25937
25938         * expression.cs (ElementAccess): New class for expressions of the
25939         type 'element access.'
25940         (BaseAccess): New class for expressions of the type 'base access.'
25941         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25942         respectively.
25943
25944         * cs-parser.jay (element_access): Implement action.
25945         (base_access): Implement actions.
25946         (checked_expression, unchecked_expression): Implement.
25947
25948         * cs-parser.jay (local_variable_type): Correct and implement.
25949         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25950
25951         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25952
25953         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25954         name and the specifiers.
25955
25956         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25957
25958         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25959         making them all public ;-)
25960
25961         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25962         class anyways.
25963
25964 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25965
25966         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25967         PropertyExprs.
25968         (FieldExpr, PropertyExprs): New resolved expressions.
25969         (SimpleName::MemberStaticCheck): Perform static checks for access
25970         to non-static fields on static methods. Maybe this should be
25971         generalized for MemberAccesses. 
25972         (SimpleName::ResolveSimpleName): More work on simple name
25973         resolution. 
25974
25975         * cs-parser.jay (primary_expression/qualified_identifier): track
25976         the parameter index.
25977
25978         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25979         (EmitContext::EmitBoolExpression): Chain to expression generation
25980         instead of temporary hack.
25981         (::EmitStatementExpression): Put generic expression code generation.
25982
25983         * assign.cs (Assign::Emit): Implement variable assignments to
25984         local variables, parameters and fields.
25985
25986 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25987
25988         * statement.cs (Block::GetVariableInfo): New method, returns the
25989         VariableInfo for a variable name in a block.
25990         (Block::GetVariableType): Implement in terms of GetVariableInfo
25991
25992         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25993         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25994
25995 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25996
25997         * cs-parser.jay (operator_declaration): Continue on my quest : update
25998         to take attributes argument.
25999         (event_declaration): Ditto.
26000         (enum_declaration): Ditto.
26001         (indexer_declaration): Ditto.
26002
26003         * class.cs (Operator::Operator): Update constructor accordingly.
26004         (Event::Event): Ditto.
26005
26006         * delegate.cs (Delegate::Delegate): Same here.
26007
26008         * enum.cs (Enum::Enum): Same here.
26009
26010 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26011
26012         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26013
26014         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26015
26016         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26017         being passed around as an arraylist.
26018         (Attributes::AddAttribute): Method to add attribute sections.
26019
26020         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26021         (struct_declaration): Update accordingly.
26022         (constant_declaration): Update.
26023         (field_declaration): Update.
26024         (method_header): Update.
26025         (fixed_parameter): Update.
26026         (parameter_array): Ditto.
26027         (property_declaration): Ditto.
26028         (destructor_declaration): Ditto.
26029
26030         * class.cs (Struct::Struct): Update constructors accordingly.
26031         (Class::Class): Ditto.
26032         (Field::Field): Ditto.
26033         (Method::Method): Ditto.
26034         (Property::Property): Ditto.
26035         (TypeContainer::OptAttribute): update property's return type.
26036
26037         * interface.cs (Interface.opt_attributes): New member.
26038         (Interface::Interface): Update to take the extra Attributes argument.
26039
26040         * parameter.cs (Parameter::Parameter): Ditto.
26041
26042         * constant.cs (Constant::Constant): Ditto.
26043
26044         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26045         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26046         the attributes as a parameter.
26047         (InterfaceProperty): Update constructor call.
26048         (InterfaceEvent): Ditto.
26049         (InterfaceMethod): Ditto.
26050         (InterfaceIndexer): Ditto.
26051
26052         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26053         pass the attributes too.
26054         (interface_event_declaration): Ditto.
26055         (interface_property_declaration): Ditto.
26056         (interface_method_declaration): Ditto.
26057         (interface_declaration): Ditto.
26058
26059 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26060
26061         * class.cs (Method::Define): Track the "static Main" definition to
26062         create an entry point. 
26063
26064         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26065         EntryPoint if we find it. 
26066
26067         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26068         (EmitContext::ig): Make this variable public.
26069
26070         * driver.cs: Make the default output file be the first file name
26071         with the .exe extension.  
26072
26073         Detect empty compilations
26074
26075         Handle various kinds of output targets.  Handle --target and
26076         rename -t to --dumper.
26077
26078         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26079         methods inherited from Expression return now an Expression.  This
26080         will is used during the tree rewriting as we resolve them during
26081         semantic analysis.
26082
26083         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26084         the spec.  Missing entirely is the information about
26085         accessability of elements of it.
26086
26087         (Expression::ExprClassFromMemberInfo): New constructor for
26088         Expressions that creates a fully initialized Expression based on
26089         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26090         a Type.
26091
26092         (Invocation::Resolve): Begin implementing resolution of invocations.
26093
26094         * literal.cs (StringLiteral):  Implement Emit.
26095
26096 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26097
26098         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26099         member.
26100
26101 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26102
26103         * cs-parser.jay (attribute_arguments): Implement actions.
26104         (attribute): Fix bug in production. Implement action.
26105         (attribute_list): Implement.
26106         (attribute_target): Implement.
26107         (attribute_target_specifier, opt_target_specifier): Implement
26108         (CheckAttributeTarget): New method to check if the attribute target
26109         is valid.
26110         (attribute_section): Implement.
26111         (opt_attributes): Implement.
26112
26113         * attribute.cs : New file to handle attributes.
26114         (Attribute): Class to hold attribute info.
26115
26116         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26117         (attribute_section): Modify production to use 2 different rules to 
26118         achieve the same thing. 1 s/r conflict down !
26119         Clean out commented, useless, non-reducing dimension_separator rules.
26120
26121         * class.cs (TypeContainer.attributes): New member to hold list
26122         of attributes for a type.
26123         (Struct::Struct): Modify to take one more argument, the attribute list.
26124         (Class::Class): Ditto.
26125         (Field::Field): Ditto.
26126         (Method::Method): Ditto.
26127         (Property::Property): Ditto.
26128
26129         * cs-parser.jay (struct_declaration): Update constructor call to
26130         pass in the attributes too.
26131         (class_declaration): Ditto.
26132         (constant_declaration): Ditto.
26133         (field_declaration): Ditto.
26134         (method_header): Ditto.
26135         (fixed_parameter): Ditto.
26136         (parameter_array): Ditto.
26137         (property_declaration): Ditto.
26138
26139         * constant.cs (Constant::Constant): Update constructor similarly.
26140         Use System.Collections.
26141
26142         * parameter.cs (Parameter::Parameter): Update as above.
26143
26144 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26145
26146         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26147         (TypeContainer.delegates): New member to hold list of delegates.
26148
26149         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26150         this time as I seem to be on crack ;-)
26151
26152 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26153
26154         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26155         tell whether an identifier represents a namespace.
26156
26157         * expression.cs (NamespaceExpr): A namespace expression, used only
26158         temporarly during expression resolution.
26159         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26160         utility functions to resolve names on expressions.
26161
26162 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26163
26164         * codegen.cs: Add hook for StatementExpressions. 
26165
26166         * class.cs: Fix inverted test for static flag in methods.
26167
26168 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26169
26170         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26171         to make it coincide with MS' number.
26172         (Operator::CheckBinaryOperator): Ditto.
26173
26174         * ../errors/errors.txt : Remove error numbers added earlier.
26175
26176         * ../errors/cs1019.cs : Test case for error # 1019
26177
26178         * ../errros/cs1020.cs : Test case for error # 1020
26179
26180         * cs-parser.jay : Clean out commented cruft.
26181         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26182         used anywhere - non-reducing rule.
26183         (namespace_declarations): Non-reducing rule - comment out.
26184
26185         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26186         with TypeContainer::AddEnum.
26187
26188         * delegate.cs : New file for delegate handling classes.
26189         (Delegate): Class for declaring delegates.
26190
26191         * makefile : Update.
26192
26193         * cs-parser.jay (delegate_declaration): Implement.
26194
26195 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26196
26197         * class.cs (Event::Define): Implement.
26198         (Event.EventBuilder): New member.
26199
26200         * class.cs (TypeContainer::Populate): Update to define all enums and events
26201         we have.
26202         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26203         readonly fields for all these cases ?
26204
26205 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26206
26207         * class.cs (Property): Revamp to use the convention of making fields readonly.
26208         Accordingly modify code elsewhere.
26209
26210         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26211         the Define method of the Property class.
26212
26213         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26214         trivial bug.
26215         (TypeContainer::Populate): Update to define all the properties we have. Also
26216         define all enumerations.
26217
26218         * enum.cs (Define): Implement.
26219
26220 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26221
26222         * cs-parser.jay (overloadable_operator): The semantic value is an
26223         enum of the Operator class.
26224         (operator_declarator): Implement actions.
26225         (operator_declaration): Implement.
26226
26227         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26228         validity of definitions.
26229         (Operator::CheckBinaryOperator): Static method to check for binary operators
26230         (TypeContainer::AddOperator): New method to add an operator to a type.
26231
26232         * cs-parser.jay (indexer_declaration): Added line to actually call the
26233         AddIndexer method so it gets added ;-)
26234
26235         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26236         already taken care of by the MS compiler ?  
26237
26238 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26239
26240         * class.cs (Operator): New class for operator declarations.
26241         (Operator::OpType): Enum for the various operators.
26242
26243 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26244
26245         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26246         ostensibly handle this in semantic analysis.
26247
26248         * cs-parser.jay (general_catch_clause): Comment out
26249         (specific_catch_clauses, specific_catch_clause): Ditto.
26250         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26251         (catch_args, opt_catch_args): New productions.
26252         (catch_clause): Rewrite to use the new productions above
26253         (catch_clauses): Modify accordingly.
26254         (opt_catch_clauses): New production to use in try_statement
26255         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26256         and re-write the code in the actions to extract the specific and
26257         general catch clauses by being a little smart ;-)
26258
26259         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26260         Hooray, try and catch statements parse fine !
26261
26262 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26263
26264         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26265         string from the hashtable of variables.
26266
26267         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26268         I end up making that mistake ;-)
26269         (catch_clauses): Fixed gross error which made Key and Value of the 
26270         DictionaryEntry the same : $1 !!
26271
26272 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26273
26274         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26275
26276         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26277         when the add and remove accessors are specified. 
26278
26279 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26280
26281         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26282         information about indexer_declarator.
26283         (indexer_declarator): Implement actions.
26284         (parsing_indexer): New local boolean used to keep track of whether
26285         we are parsing indexers or properties. This is necessary because 
26286         implicit_parameters come into picture even for the get accessor in the 
26287         case of an indexer.
26288         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26289
26290         * class.cs (Indexer): New class for indexer declarations.
26291         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26292         (TypeContainer::indexers): New member to hold list of indexers for the
26293         type.
26294
26295 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26296
26297         * cs-parser.jay (add_accessor_declaration): Implement action.
26298         (remove_accessor_declaration): Implement action.
26299         (event_accessors_declaration): Implement
26300         (variable_declarators): swap statements for first rule - trivial.
26301
26302         * class.cs (Event): New class to hold information about event
26303         declarations.
26304         (TypeContainer::AddEvent): New method to add an event to a type
26305         (TypeContainer::events): New member to hold list of events.
26306
26307         * cs-parser.jay (event_declaration): Implement actions.
26308
26309 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26310
26311         * cs-parser.jay (dim_separators): Implement. Make it a string
26312         concatenating all the commas together, just as they appear.
26313         (opt_dim_separators): Modify accordingly
26314         (rank_specifiers): Update accordingly. Basically do the same
26315         thing - instead, collect the brackets here.
26316         (opt_rank_sepcifiers): Modify accordingly.
26317         (array_type): Modify to actually return the complete type string
26318         instead of ignoring the rank_specifiers.
26319         (expression_list): Implement to collect the expressions
26320         (variable_initializer): Implement. We make it a list of expressions
26321         essentially so that we can handle the array_initializer case neatly too.
26322         (variable_initializer_list): Implement.
26323         (array_initializer): Make it a list of variable_initializers
26324         (opt_array_initializer): Modify accordingly.
26325
26326         * expression.cs (New::NType): Add enumeration to help us
26327         keep track of whether we have an object/delegate creation
26328         or an array creation.
26329         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26330         members to hold data about array creation.
26331         (New:New): Modify to update NewType
26332         (New:New): New Overloaded contructor for the array creation
26333         case.
26334
26335         * cs-parser.jay (array_creation_expression): Implement to call
26336         the overloaded New constructor.
26337
26338 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26339
26340         * class.cs (TypeContainer::Constructors): Return member
26341         constructors instead of returning null.
26342
26343 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26344
26345         * typemanager.cs (InitCoreTypes): Initialize the various core
26346         types after we have populated the type manager with the user
26347         defined types (this distinction will be important later while
26348         compiling corlib.dll)
26349
26350         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26351         on Expression Classification.  Now all expressions have a method
26352         `Resolve' and a method `Emit'.
26353
26354         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26355         generation from working.     Also add some temporary debugging
26356         code. 
26357
26358 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26359
26360         * codegen.cs: Lots of code generation pieces.  This is only the
26361         beginning, will continue tomorrow with more touches of polish.  We
26362         handle the fundamentals of if, while, do, for, return.  Others are
26363         trickier and I need to start working on invocations soon.
26364
26365         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26366         s.InitStatement. 
26367
26368         * codegen.cs (EmitContext): New struct, used during code
26369         emission to keep a context.   Most of the code generation will be
26370         here. 
26371
26372         * cs-parser.jay: Add embedded blocks to the list of statements of
26373         this block.  So code generation proceeds in a top down fashion.
26374
26375 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26376
26377         * statement.cs: Add support for multiple child blocks.
26378
26379 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26380
26381         * codegen.cs (EmitCode): New function, will emit the code for a
26382         Block of code given a TypeContainer and its ILGenerator. 
26383
26384         * statement.cs (Block): Standard public readonly optimization.
26385         (Block::Block constructors): Link children. 
26386         (Block::Child): Child Linker.
26387         (Block::EmitVariables): Emits IL variable declarations.
26388
26389         * class.cs: Drop support for MethodGroups here, delay until
26390         Semantic Analysis.
26391         (Method::): Applied the same simplification that I did before, and
26392         move from Properties to public readonly fields.
26393         (Method::ParameterTypes): Returns the parameter types for the
26394         function, and implements a cache that will be useful later when I
26395         do error checking and the semantic analysis on the methods is
26396         performed.
26397         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26398         and made a method, optional argument tells whether this is a class
26399         or a structure to apply the `has-this' bit.
26400         (Method::GetCallingConvention): Implement, returns the calling
26401         convention. 
26402         (Method::Define): Defines the type, a second pass is performed
26403         later to populate the methods.
26404
26405         (Constructor::ParameterTypes): implement a cache similar to the
26406         one on Method::ParameterTypes, useful later when we do semantic
26407         analysis. 
26408
26409         (TypeContainer::EmitMethod):  New method.  Emits methods.
26410
26411         * expression.cs: Removed MethodGroup class from here.
26412
26413         * parameter.cs (Parameters::GetCallingConvention): new method.
26414
26415 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26416
26417         * class.cs (TypeContainer::Populate): Drop RootContext from the
26418         argument. 
26419
26420         (Constructor::CallingConvention): Returns the calling convention.
26421         (Constructor::ParameterTypes): Returns the constructor parameter
26422         types. 
26423
26424         (TypeContainer::AddConstructor): Keep track of default constructor
26425         and the default static constructor.
26426
26427         (Constructor::) Another class that starts using `public readonly'
26428         instead of properties. 
26429
26430         (Constructor::IsDefault): Whether this is a default constructor. 
26431
26432         (Field::) use readonly public fields instead of properties also.
26433
26434         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26435         track of static constructors;  If none is used, turn on
26436         BeforeFieldInit in the TypeAttributes. 
26437
26438         * cs-parser.jay (opt_argument_list): now the return can be null
26439         for the cases where there are no arguments. 
26440
26441         (constructor_declarator): If there is no implicit `base' or
26442         `this', then invoke the default parent constructor. 
26443
26444         * modifiers.cs (MethodAttr): New static function maps a set of
26445         modifiers flags into a MethodAttributes enum
26446         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26447         MethodAttr, TypeAttr to represent the various mappings where the
26448         modifiers are used.
26449         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26450
26451 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26452
26453         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26454         method arguments.
26455
26456         * interface.cs (PopulateIndexer): Implemented the code generator
26457         for interface indexers.
26458
26459 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26460
26461         * interface.cs (InterfaceMemberBase): Now we track the new status
26462         here.  
26463
26464         (PopulateProperty): Implement property population.  Woohoo!  Got
26465         Methods and Properties going today. 
26466
26467         Removed all the properties for interfaces, and replaced them with
26468         `public readonly' fields. 
26469
26470 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26471
26472         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26473         initialize their hashtables/arraylists only when they are needed
26474         instead of doing this always.
26475
26476         * parameter.cs: Handle refs and out parameters.
26477
26478         * cs-parser.jay: Use an ArrayList to construct the arguments
26479         instead of the ParameterCollection, and then cast that to a
26480         Parameter[] array.
26481
26482         * parameter.cs: Drop the use of ParameterCollection and use
26483         instead arrays of Parameters.
26484
26485         (GetParameterInfo): Use the Type, not the Name when resolving
26486         types. 
26487
26488 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26489
26490         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26491         and instead use public readonly fields.
26492
26493         * class.cs: Put back walking code for type containers.
26494
26495 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26496
26497         * class.cs (MakeConstant): Code to define constants.
26498
26499         * rootcontext.cs (LookupType): New function.  Used to locate types 
26500
26501
26502 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26503
26504         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26505         this System.Reflection code is.  Kudos to Microsoft
26506
26507         * typemanager.cs: Implement a type cache and avoid loading all
26508         types at boot time.  Wrap in LookupType the internals.  This made
26509         the compiler so much faster.  Wow.  I rule!
26510
26511         * driver.cs: Make sure we always load mscorlib first (for
26512         debugging purposes, nothing really important).
26513
26514         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26515         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26516
26517         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26518         on namespaces that have been imported using the `using' keyword.
26519
26520         * class.cs (TypeContainer::TypeAttr): Virtualize.
26521         (Class::TypeAttr): Return attributes suitable for this bad boy.
26522         (Struct::TypeAttr): ditto.
26523         Handle nested classes.
26524         (TypeContainer::) Remove all the type visiting code, it is now
26525         replaced with the rootcontext.cs code
26526
26527         * rootcontext.cs (GetClassBases): Added support for structs. 
26528
26529 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26530
26531         * interface.cs, statement.cs, class.cs, parameter.cs,
26532         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26533         Drop use of TypeRefs, and use strings instead.
26534
26535 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26536
26537         * rootcontext.cs: 
26538
26539         * class.cs (Struct::Struct): set the SEALED flags after
26540         checking the modifiers.
26541         (TypeContainer::TypeAttr): new property, returns the
26542         TypeAttributes for a class.  
26543
26544         * cs-parser.jay (type_list): Oops, list production was creating a
26545         new list of base types.
26546
26547         * rootcontext.cs (StdLib): New property.
26548         (GetInterfaceTypeByName): returns an interface by type name, and
26549         encapsulates error handling here.
26550         (GetInterfaces): simplified.
26551         (ResolveTree): Encapsulated all the tree resolution here.
26552         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26553         types. 
26554
26555         * driver.cs: Add support for --nostdlib, to avoid loading the
26556         default assemblies.
26557         (Main): Do not put tree resolution here. 
26558
26559         * rootcontext.cs: Beginning of the class resolution.
26560
26561 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26562
26563         * rootcontext.cs: Provide better error reporting. 
26564
26565         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26566
26567         * rootcontext.cs (CreateInterface): Handle the case where there
26568         are no parent interfaces.
26569
26570         (CloseTypes): Routine to flush types at the end.
26571         (CreateInterface): Track types.
26572         (GetInterfaces): Returns an array of Types from the list of
26573         defined interfaces.
26574
26575         * typemanager.c (AddUserType): Mechanism to track user types (puts
26576         the type on the global type hash, and allows us to close it at the
26577         end). 
26578
26579 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26580
26581         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26582         RecordInterface instead.
26583
26584         * cs-parser.jay: Updated to reflect changes above.
26585
26586         * decl.cs (Definition): Keep track of the TypeBuilder type that
26587         represents this type here.  Not sure we will use it in the long
26588         run, but wont hurt for now.
26589
26590         * driver.cs: Smaller changes to accomodate the new code.
26591
26592         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26593         when done. 
26594
26595         * rootcontext.cs (CreateInterface):  New method, used to create
26596         the System.TypeBuilder type for interfaces.
26597         (ResolveInterfaces): new entry point to resolve the interface
26598         hierarchy. 
26599         (CodeGen): Property, used to keep track of the code generator.
26600
26601 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26602
26603         * cs-parser.jay: Add a second production for delegate_declaration
26604         with `VOID'.
26605
26606         (enum_body): Put an opt_comma here instead of putting it on
26607         enum_body or enum_member_declarations so we can handle trailing
26608         commas on enumeration members.  Gets rid of a shift/reduce.
26609
26610         (type_list): Need a COMMA in the middle.
26611
26612         (indexer_declaration): Tell tokenizer to recognize get/set
26613
26614         * Remove old targets.
26615
26616         * Re-add the parser target.
26617
26618 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26619
26620         * cs-parser.jay: Add precendence rules for a number of operators
26621         ot reduce the number of shift/reduce conflicts in the grammar.
26622
26623 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26624
26625         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26626         and put it here.
26627
26628         Get rid of old crufty code.
26629
26630         * rootcontext.cs: Use this to keep track of the parsed
26631         representation and the defined types available to the program. 
26632
26633         * gen-treedump.cs: adjust for new convention.
26634
26635         * type.cs: Split out the type manager, and the assembly builder
26636         from here. 
26637
26638         * typemanager.cs: the type manager will live here now.
26639
26640         * cil-codegen.cs: And the code generator here. 
26641
26642 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26643
26644         * makefile: Fixed up for easy making.
26645
26646 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26647
26648         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26649         the 
26650
26651         (unary_expression): Expand pre_increment_expression and
26652         post_decrement_expression to reduce a shift/reduce.
26653
26654 2001-07-11  Simon Cozens
26655
26656         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26657
26658         Improve allow_keyword_as_indent name.
26659
26660 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26661
26662         * Adjustments for Beta2. 
26663
26664 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26665
26666         * decl.cs: Added `Define' abstract method.
26667         (InTransit): new property, used to catch recursive definitions. 
26668
26669         * interface.cs: Implement `Define'. 
26670
26671         * modifiers.cs: Map Modifiers.constants to
26672         System.Reflection.TypeAttribute flags.
26673
26674         * class.cs: Keep track of types and user-defined types.
26675         (BuilderInit): New method for creating an assembly
26676         (ResolveType): New function to launch the resolution process, only
26677         used by interfaces for now.
26678
26679         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26680         that are inserted into the name space. 
26681
26682 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26683
26684         * ARGH.  I have screwed up my tree so many times due to the use of
26685         rsync rather than using CVS.  Going to fix this at once. 
26686
26687         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26688         load types.
26689
26690 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26691
26692         * Experiment successful: Use System.Type rather that our own
26693         version of Type.  
26694
26695 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26696
26697         * cs-parser.jay: Removed nsAliases from here.
26698
26699         Use new namespaces, handle `using XXX;' 
26700
26701         * namespace.cs: Reimplemented namespace handling, use a recursive
26702         definition of the class.  Now we can keep track of using clauses
26703         and catch invalid using clauses.
26704
26705 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26706
26707         * gen-treedump.cs: Adapted for all the renaming.
26708
26709         * expression.cs (Expression): this class now has a Type property
26710         which returns an expression Type.
26711
26712         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26713         `Type', as this has a different meaning now in the base
26714
26715 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26716
26717         * interface.cs, class.cs: Removed from all the sources the
26718         references to signature computation, as we can not do method
26719         signature computation during the parsing time, as we are not
26720         trying to solve at that point distinguishing:
26721
26722         class X {
26723                 void a (Blah x) {}
26724                 void a (NS.Blah x) {}
26725         }
26726
26727         Which depending on the context might be valid or not, as we do not
26728         know if Blah is the same thing as NS.Blah at that point.
26729
26730         * Redid everything so the code uses TypeRefs now instead of
26731         Types.  TypeRefs are just temporary type placeholders, that need
26732         to be resolved.  They initially have a pointer to a string and the
26733         current scope in which they are used.  This is used later by the
26734         compiler to resolve the reference to an actual Type. 
26735
26736         * DeclSpace is no longer a CIR.Type, and neither are
26737         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26738         are all DeclSpaces, but no Types. 
26739
26740         * type.cs (TypeRefManager): This implements the TypeRef manager,
26741         which keeps track of all the types that need to be resolved after
26742         the parsing has finished. 
26743
26744 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26745
26746         * ARGH.  We are going to have to store `foreach' as a class rather
26747         than resolving it, as we need to verify error 1579 after name
26748         resolution.   *OR* we could keep a flag that says `This request to
26749         IEnumerator comes from a foreach statement' which we can then use
26750         to generate the error.
26751
26752 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26753
26754         * class.cs (TypeContainer.AddMethod): we now add methods to the
26755         MethodGroup instead of the method hashtable.  
26756
26757         * expression.cs: Add MethodGroup abstraction, which gets us one
26758         step closer to the specification in the way we handle method
26759         declarations.  
26760
26761         * cs-parser.jay (primary_expression): qualified_identifier now
26762         tried to match up an identifier to a local variable reference or
26763         to a parameter reference.
26764
26765         current_local_parameters is now a parser global variable that
26766         points to the current parameters for the block, used during name
26767         lookup.
26768
26769         (property_declaration): Now creates an implicit `value' argument to
26770         the set accessor.
26771
26772 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26773
26774         * parameter.cs: Do not use `param' arguments as part of the
26775         signature, per the spec.
26776
26777 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26778
26779         * decl.cs: Base class for classes, structs and interfaces.  This
26780         is the "Declaration Space" 
26781
26782         * cs-parser.jay: Use CheckDef for checking declaration errors
26783         instead of having one on each function.
26784
26785         * class.cs: Factor out some code for handling error handling in
26786         accordance to the "Declarations" section in the "Basic Concepts"
26787         chapter in the ECMA C# spec.
26788
26789         * interface.cs: Make all interface member classes derive from
26790         InterfaceMemberBase.
26791
26792 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26793
26794         * Many things: all interfaces are parsed and generated in
26795         gen-treedump.  Support for member variables, constructors,
26796         destructors, properties, constants is there.
26797
26798         Beginning of the IL backend, but very little done, just there for
26799         testing purposes. 
26800
26801 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26802
26803         * cs-parser.jay: Fix labeled statement.
26804
26805         * cs-tokenizer.cs (escape): Escape " and ' always.
26806         ref_line, ref_name: keep track of the line/filename as instructed
26807         by #line by the compiler.
26808         Parse #line.
26809
26810 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26811
26812         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26813         to match the values in System.CodeDOM.
26814
26815         Divid renamed to Divide.
26816
26817         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26818         statements. 
26819         (Statements.set): remove.
26820
26821         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26822         statements. 
26823
26824         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26825         falseStatements always have valid values. 
26826
26827         * cs-parser.jay: Use System.CodeDOM now.
26828