bff1d8a953716d4f543c1b9fa96d01ce70708367
[mono.git] / mcs / mcs / ChangeLog
1 2007-01-09  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #80446
4         * support.cs (ReflectionParameter): Don't use an invalid index on
5         the generic parameter data.
6
7 2007-01-08  Miguel de Icaza  <miguel@novell.com>
8
9         * driver.cs: Just add a tiny bit of infrastructure.
10
11 2007-01-02  Marek Safar  <marek.safar@gmail.com>
12
13         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
14         where field type is struct from current assembly.
15         
16         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
17         it is possible.
18
19 2007-01-02  Marek Safar  <marek.safar@gmail.com>
20
21         A fix for bug #80381
22         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
23         the core types.
24
25         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
26         messages.
27         (Namespace.LookupType): Always use core types from corlib when speficied.
28
29         * report.cs: A new warning.
30
31         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
32         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
33         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
34
35         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
36         (InitCoreTypes): Set expression type of object_type and value_type
37         immediately after lookup.
38
39 2007-01-01  Miguel de Icaza  <miguel@novell.com>
40
41         * cs-tokenizer.cs: Accept Pc class characters (Connector
42         Punctuation) as valid identifiers.  Fixes #78259
43
44         * expression.cs (Invocation.DoResolve): Moved the check for the
45         use of `this' for doing method calls to the Invocation resolution
46         step, after overload resolution has taken place instead of doing
47         the check at the low-level `This.DoResolve' level.
48
49         The `This.DoResolve' happens before overload resolution, so it has
50         no way of knowing if the method that will be called will be
51         instace or static, triggering an erroneous report for cs0188 (Bug
52         78113).
53
54         We now do the check for instance method invocations after we know
55         what method will be called.
56
57         (This.CheckThisUsage): Move the actual use of this structure
58         checking into its own method and expose it. 
59
60         * Everywhere that called Error_ValueCannotBeConverted: pass a new
61         EmitContext.
62
63         Exceptions: Null.ConvertImplicitly,
64         Constant.ImplicitConversionRequired as there are too many call
65         sites for passing the ec. 
66
67         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
68         EmitContext, if the value is null, then we do not try to provide
69         the extra information from the error (If a userdefined conversion
70         exists, as UserDefinedConversion requires a non null-EmitContext).
71
72         Fixes: #80347
73
74 2006-12-30  Raja R Harinath  <rharinath@novell.com>
75
76         * flowanalysis.cs (MyBitVector): Document some invariants.
77         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
78         introduced below, and add a couple of others, 
79
80 2006-12-30  Marek Safar  <marek.safar@gmail.com>
81
82         * attribute.cs (GetMethodObsoleteAttribute): Uses new
83         GetPropertyFromAccessor and GetEventFromAccessor.
84         
85         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
86         overrides non-obsolete one.
87         (Indexer.Define): Error message has been moved to the parser.
88
89         * cs-parser.jay: Better syntax errors handling.
90
91         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
92         when an invocation has no arguments.
93
94         * ecore.cs: Removed not used caching.
95
96         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
97         implementation.
98
99         * report.cs: Add a new warning.
100
101         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
102
103         * typemanager.cs (enumeration_type): Removed.
104         (CSharpSignature): Reuses IsSpecialMethod.
105         (IsEqual): Hack for MS BCL.
106         (GetPropertyFromAccessor): New method.
107         (GetEventFromAccessor): New method.
108         (IsSpecialMethod): Fixed to handle more cases.
109
110 2006-12-30  Marek Safar  <marek.safar@gmail.com>
111
112         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
113         Made white spaces array static.
114
115         * ecore.cs (RemoveGenericArity): Optimized.
116
117         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
118         10 times faster).
119         (MyBitVector.initialize_vector): Simplified.
120
121 2006-12-22  Miguel de Icaza  <miguel@novell.com>
122
123         * ecore.cs: Am not entirely happy with this hack, but it seems to
124         address the issue in 80257 (a small test case for
125         CreativeDocs.NET). 
126
127         I set the MethodGroupExpr.Type to an internal compiler type
128         (itself in this case) to force the resolution to take place.   Why
129         it does not take place with a null is beyond me.
130
131 2006-12-20  Marek Safar  <marek.safar@gmail.com>
132
133         A fix for bug #80288
134         * expression.cs (ResolveOperator): Consider user defined conversion for
135         logical and operator too.
136         (EmitBranchable): Optimization for logical and when full constant folding
137         could not be applied but one operand is constant.
138
139 2006-12-19  Marek Safar  <marek.safar@gmail.com>
140
141         * class.cs (GetClassBases): Write 5 times every day, will never use
142         FullName for error reporting.
143
144         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
145
146 2006-12-19  Martin Baulig  <martin@ximian.com>
147
148         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
149         the symbol file info here.
150
151 2006-12-18  Marek Safar  <marek.safar@gmail.com>
152
153         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
154         of `elseif' is taking then following sections are not taking.
155         Fixes an issue reported on mono mailing list.
156
157 2006-12-18  Marek Safar  <marek.safar@gmail.com>
158
159         A fix for bug #80300
160         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
161         a caller is not taking.
162
163 2006-12-18  Raja R Harinath  <rharinath@novell.com>
164
165         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
166         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
167         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
168         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
169         * class.cs: Update to changes.
170
171 2006-12-17  Marek Safar  <marek.safar@gmail.com>
172
173         A fix for bug #79934
174         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
175         partial container.
176
177         * class.cs (ResolveMembers): Register an iterator in current container and
178         not in shared one.
179
180 2006-12-16  Raja R Harinath  <rharinath@novell.com>
181
182         Fix test-543.cs
183         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
184         satisfy a params annotated parameter.
185
186 2006-12-16  Marek Safar  <marek.safar@gmail.com>
187
188         A fix for bug #77014
189         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
190         paramters correctly and not rely on hacks in Parameters class.
191         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
192         at any possition.
193         (Invocation.VerifyArgumentsCompat): Ditto.
194         (Invocation.EmitArguments): Changed to correctly emit params arguments at
195         any possition.
196
197         * parameter.cs (HasParams): Don't assume that params is the last one.
198
199         * support.cs (ReflectionParameters.ctor): Look for params attribute
200         correctly.
201         (ReflectionParameters.ParameterType): Removed hack when we returned last
202         parameter for out of range parameters.
203         (ParameterName, ParameterModifier): Ditto.
204
205 2006-12-14  Marek Safar  <marek.safar@gmail.com>
206
207         A fix for bug #79987
208         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
209         when assembly is not CLS compliant but type is. I have no idea why is this
210         allowed.
211
212         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
213
214 2006-12-13  Miguel de Icaza  <miguel@novell.com>
215
216         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
217         in struct constructors, they are basically no-ops.
218
219 2006-12-12  Marek Safar  <marek.safar@gmail.com>
220
221         * cs-tokenizer.cs (Position): Save preprocessor status too.
222
223 2006-12-12  Marek Safar  <marek.safar@gmail.com>
224
225         A fix for bug #77794
226         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
227
228 2006-12-12  Marek Safar  <marek.safar@gmail.com>
229
230         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
231         Fixes #69299.
232         (pp_expr): Report error for an invalid expression.
233         (handle_preprocessing_directive): Simplified; add more error checking.
234
235 2006-12-11  Marek Safar  <marek.safar@gmail.com>
236
237         A fix for bug #74939
238         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
239         directives handling.
240
241 2006-12-10  Marek Safar  <marek.safar@gmail.com>
242
243         A fix for bugs #80093, and #75984
244         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
245         logic, it seems to me as it worked before "by coincidence".
246         (xtoken): Simplified to use reworked handle_preprocessing_directive.
247         (cleanup): Enabled endif check.
248
249 2006-12-09  Marek Safar  <marek.safar@gmail.com>
250
251         A fix for bug #80162
252         * statement.cs (CollectionForeach.TryType): Generics and non-generics
253         enumerators are never ambiguous.
254
255 2006-12-08  Raja R Harinath  <rharinath@novell.com>
256
257         Fix #80060
258         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
259
260 2006-12-06  Marek Safar  <marek.safar@gmail.com>
261
262         A fix for bug #80144
263         * class.cs (EventProperty.Define): Explicit implementation means
264         that an even is used.
265
266 2006-12-06  Marek Safar  <marek.safar@gmail.com>
267
268         Fixes the operators implementation (part II)
269
270         * cfold.cs (DoConstantNumericPromotions): Renamed to
271         DoBinaryNumericPromotions and simplified.
272         (BinaryFold): Couple of conversion fixes; simplified.
273
274         * constant.cs, ecore.cs, literal.cs
275         (ToType): Renamed to ConvertImplicitly.
276         (Reduce): Renamed to ConvertExplicitly.
277
278         * class.cs, convert.cs: Updated.
279
280         * expression.cs: TryReduce doesn't throw an exception.
281
282 2006-12-01  Marek Safar  <marek.safar@gmail.com>
283
284         A fix for bug #80108
285         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
286         compatible.
287
288 2006-11-30  Marek Safar  <marek.safar@gmail.com>
289
290         Fixes unary operators implementation (part I)
291         Also fixes #80026
292
293         * cfold.cs (Error_CompileTimeOverflow): Made internal
294
295         * const.cs (IConstant): Changed to use reference to constant and
296         not constant itself.
297         Updated IConstant implementations.
298
299         * constant.cs (CreateConstant): New factory method.
300         Updated IConstant implementation.
301
302         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
303
304         * ecore.cs: Updated to use CreateConstantReference.
305
306         * enum.cs: Reflects IConstant changes.
307
308         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
309
310         * literal.cs (NullConstant): Change to be independently usable.
311
312 2006-11-29  Martin Baulig  <martin@ximian.com>
313
314         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
315         we need to emit the scope initializer before calling the base .ctor.
316
317         * anonymous.cs: Merged back from the new anonymous methods branch.
318         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
319
320         * expression.cs (ParameterReference.DoResolveBase): Create a
321         "normal" ScopeInfo when capturing parameters rather than using the
322         root scope; this makes things work with anonymous methods having
323         parameters.
324
325         * statement.cs
326         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
327
328 2006-11-22  Marek Safar  <marek.safar@gmail.com>
329
330         A fix for bug #79987
331         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
332         check to a base class.
333         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
334         only when assembly has missing attribute.
335         * report.cs: Update.
336
337 2006-11-21  Marek Safar  <marek.safar@gmail.com>
338
339         * cs-tokenizer.cs: Merged with gmcs version.
340
341 2006-11-20  Marek Safar  <marek.safar@gmail.com>
342
343         * cs-tokenizer.cs,
344         * cs-parser.jay: Better error message when partial keyword is misplaced.
345
346 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
347
348         A fix for bug #79810
349         report.cs: CS1058 only applies to 2.0 profile (gmcs).
350         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
351         a RuntimeWrappedException by default.
352
353 2006-11-18  Marek Safar  <marek.safar@gmail.com>
354
355         A fix for bug #79843
356         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
357         implementation.
358         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
359
360 2006-11-18  Marek Safar  <marek.safar@gmail.com>
361
362         * driver.cs, namespace.cs: Uses faster IndexOf version.
363
364 2006-11-17  Marek Safar  <marek.safar@gmail.com>
365
366         A fix for bug #79941
367         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
368         operators.
369         (Operator.Define): Implicit/Explicit operator of same type is duplicate
370         even if internal name is different.
371         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
372         (UserDefinedConversion): Simplified as the operators cannot be internal.
373         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
374         conversions.
375         (MethodLookup): Replaced EmitContext with parentType.
376         * expression.cs: Updated.
377
378 2006-11-09  Raja R Harinath  <rharinath@novell.com>
379
380         * driver.cs (BadAssembly): Handle all the ugliness of
381         DefineDynamicAssembly.
382
383 2006-11-08  Raja R Harinath  <rharinath@novell.com>
384
385         Address parts of #58244 -- most of what's left is in the runtime
386         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
387         CS1509 error checks, and handle them for all assembly loads, not
388         just the first invocation.
389         (LoadModule): Likewise.  Move handling of 'adder_method' ...
390         * codegen.cs (AssemblyClass.AddModule): ... here.
391
392 2006-11-02  Marek Safar  <marek.safar@gmail.com>
393
394         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
395         IEnumerable<T> is ambiguous.
396
397 2006-10-31  Marek Safar  <marek.safar@gmail.com>
398
399         A fix for bug #67689
400         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
401         GetEnumerator is ambiguous.
402
403         * report.cs: Add new warning.
404
405 2006-10-29  Marek Safar  <marek.safar@gmail.com>
406
407         A fix for bug #78602
408         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
409         to protected member can be nested type.
410
411 2006-10-28  Marek Safar  <marek.safar@gmail.com>
412
413         A fix for bug #78965
414         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
415         to protected member must derive from current type.
416
417 2006-10-27  Marek Safar  <marek.safar@gmail.com>
418
419         assign.cs: Reuses error method.
420
421         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
422         instead of type for constants.
423         (Expression.Error_ValueAssignment): Common error method.
424
425         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
426         for any assignment.
427
428 2006-10-27  Marek Safar  <marek.safar@gmail.com>
429
430         A fix for bug #79081
431         * expression.cs (MemberAccess.DoResolve): Check nested type
432         accessibility.
433
434 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
435
436         * doc.cs : nested delegates were not handled. Fixed bug #79754.
437
438 2006-10-26  Marek Safar  <marek.safar@gmail.com>
439
440         A fix for bug #76591
441         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
442
443 2006-10-26  Marek Safar  <marek.safar@gmail.com>
444
445         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
446         type forwarder of the same type multiple times.
447
448 2006-10-26  Raja R Harinath  <rharinath@novell.com>
449
450         Fix #78820
451         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
452         instance as an rvalue, even when we later resolve as an lvalue.
453
454 2006-10-25  Martin Baulig  <martin@ximian.com>
455
456         * anonymous.cs: Fix #79673.
457
458 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
459
460         A fix for bug #79666
461         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
462         ignored when is optimized (= default value) as its value is already set.
463
464 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
465
466         A fix for bug #79724
467         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
468         TypeContainer for type lookup.
469
470 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
471
472         A fix for bug #79231
473         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
474         * expression.cs (OverloadResolve): Always convert type name for
475         an error message.
476         (ResolveNamespaceOrType): Don't confuse a nested type with any 
477         other member.
478
479 2006-10-18  Martin Baulig <martin@ximian.com>
480
481         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
482
483 2006-10-17  Miguel de Icaza  <miguel@novell.com>
484
485         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
486         an int32, but requesting an int64 from the conversion
487
488 2006-10-12  Martin Baulig  <martin@ximian.com>
489
490         * anonymous.cs
491         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
492         
493 2006-10-12  Martin Baulig  <martin@ximian.com>
494
495         * statement.cs
496         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
497
498 2006-10-11  Miguel de Icaza  <miguel@novell.com>
499
500         * convert.cs: Remove broken code: I was doing the "Existance"
501         tests for Implicit conversions.
502
503 2006-10-10  Miguel de Icaza  <miguel@novell.com>
504
505         * convert.cs: Added one missing case in
506         ImplicitStandardConversionExists uint64 to intptr.
507
508         Fixes #59800
509         
510         * typemanager.cs (uintptr_type): another core known type.   
511
512         * ecore.cs (OperatorCast): routine used to do cast operations that
513         depend on op_Explicit.  We could change some of the Decimal
514         conversions to use this.
515
516         This one has a probe mechanism that checks both types for an op_
517         which it coudl be used to eliminate two classes: CastToDecimal
518         and CastFromDecimal.
519
520         * convert.cs: Implement the conversions documented in #59800
521         
522 2006-10-10  Martin Baulig  <martin@ximian.com>
523
524         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
525         before RootScope.ResolveMembers().
526
527         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
528         `CurrentType' if appropriate.
529
530 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
531
532         A fix for bug #78568
533         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
534         when contains binary operators.
535         * cs-parser.jay: Updated.
536
537 2006-10-09  Martin Baulig  <martin@ximian.com>
538
539         * delegate.cs
540         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
541         moved that into Define() and also do the other type parameter
542         checks there.  Fixes #79094.  Added gtest-292.cs.
543
544         * expression.cs
545         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
546         since that doesn't include type parameters; don't use `Ldelema'
547         for type parameters.  Fixes #78980.  Added gtest-293.cs.
548
549 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
550
551         A fix for #77796
552         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
553         conversion is allowed.
554
555 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
556
557         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
558         error reporting when no error occurs.
559
560 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
561
562         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
563         does not exist.
564
565 2006-10-06  Raja R Harinath  <rharinath@novell.com>
566
567         Fix #79584
568         * class.cs (DefineTypeBuilder): Check circular dependencies before
569         setting the parent of the TypeBuilder.
570         (CheckRecursiveDefinition): Don't use 'BaseType', since
571         it may not be valid until after DefineTypeBuilder.  Use
572         'base_type' instead.
573
574 2006-10-04  Martin Baulig  <martin@ximian.com>
575
576         Merged the Anonymous Methods patch.
577
578         * anonymous.cs, iterators.cs: The new anonymous methods code.
579
580         * statement.cs (Variable): New public abstract class.
581         (LocalInfo.Variable): New public property.
582         (LocalInfo.ResolveVariable): New public method.
583         (Block.Flags): Add `IsIterator'.
584         (Block.AddVariable): Improved the CS0136 check.
585         (Block.AnonymousChildren): New public property.
586         (Block.AddAnonymousChild): New public method.
587         (ToplevelBlock): Update to use the new anonymous method framework.
588         (ToplevelBlock.ctor): `container' is now a `Block' and not a
589         `ToplevelBlock'; this is required to correctly implement the
590         CS0136 check.
591         (Fixed, Using): Use `TemporaryVariable' instead of directly
592         creating the `LocalBuilder'.
593
594         * parameter.cs (Parameter.ResolveVariable): New public method.
595         (Parameters.ResolveVariable): Likewise.
596
597         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
598
599         * class.cs (TypeContainer): Replaced the `iterators' list and
600         corresponding methods with a list of `CompilerGeneratedClass'es.
601         (TypeContainer.ResolveMembers): New public method.
602         (Method): `IIteratorContainer' has been replaced by
603         `IAnonymousHost'.
604
605         * expression.cs (VariableReference): New public abstract base
606         class for `LocalVariableReference', `ParameterReference' and
607         `This'.
608
609         * codegen.cs (EmitContext): Removed `capture_context',
610         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
611         (EmitContext.EmitThis): Removed.
612
613         * cs-parser.jay: Replace `iterator_container' with
614         `anonymous_host'.       
615
616 2006-10-04  Martin Baulig  <martin@ximian.com>
617
618         * generic.cs (GenericMethod): Don't make this abstract.
619         (Constraints.Clone): Added dummy implementation.
620
621 2006-10-04  Raja R Harinath  <harinath@gmail.com>
622
623         Fix #79577
624         * namespace.cs (LookForAnyGenericType): Avoid nullref on
625         'declspaces'.  Avoid allocating arrays willy-nilly.
626
627         Fix #79553
628         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
629         cases out of the switch.
630
631 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
632
633         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
634         message when non-generic type is used with the type arguments.
635         * expression.cs: Updated.
636
637 2006-09-28  Raja R Harinath  <rharinath@novell.com>
638
639         Fix #79013
640         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
641         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
642         Change semantics slightly.  Don't insist on having only one
643         temporary EmptyExpression -- just throttle the creation of new ones.
644
645         Fix #79451
646         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
647         non-interfaces too.  If no methods are found, don't try to create
648         a MethodGroupExpr.
649
650 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
651
652         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
653         generic type.
654
655         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
656         us produce better error message.
657
658 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
659
660         * expression.cs (Binary.ResolveOperator): Warn about a side effect
661         of the `|' operator.
662
663         * report.cs: A new warning added.
664
665 2006-09-27  Martin Baulig  <martin@ximian.com>
666
667         * generic.cs (GenericMethod): Don't make this abstract.
668
669 2006-09-27  Martin Baulig  <martin@ximian.com>
670
671         * report.cs
672         (InternalErrorException): Added overloaded ctor taking a params array.
673
674 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
675
676         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
677         Fixed the cases when same error was reported twice.
678
679         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
680         now report symbol information.
681
682 2006-09-25  Martin Baulig  <martin@ximian.com>
683
684         * class.cs: Completely unified with the gmcs version.
685
686 2006-09-25  Martin Baulig  <martin@ximian.com>
687
688         * typemanager.cs (TypeManager.IsNullableType): New public function.
689         (TypeManager.IsNullableTypeOf): Likewise.
690         (TypeManager.IsNullableValueType): Likewise.
691
692         * class.cs (MethodCore): Added the `GenericMethod' argument from
693         gmcs and also unified all classes derived from `MethodCore' with gmcs.
694
695 2006-09-24  Raja R Harinath  <harinath@gmail.com>
696
697         * convert.cs: Unify with gmcs version.
698
699 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
700
701         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
702         verify them as well.
703
704         * report.cs: New warning.
705
706 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
707
708         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
709         for anonymous block with out argument.
710
711 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
712
713         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
714         not used private events only.
715
716 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
717
718         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
719
720         * const.cs (Const.Define): Check for constant type.
721         (Const.IsConstantTypeValid): Looks for valid constant types.
722
723         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
724
725         * ecore.cs (EmptyConstantCast): New common class for all constant based
726         EmptyCast(s).
727
728         * expression.cs (Is.DoResolve): Handle null constant especially.
729         (New.DoResolve): Check for new void().
730         (MemberAccess.DoResolve): Cope with all kind of nulls.
731
732         * literal.cs (NullConstant): Uses EmptyConstantCast.
733         (NullDefault): Based on EmptyConstantCast.
734         (NullLiteral): Uses EmptyConstantCast.
735
736         * statement.cs (Block.ResolveMeta): Check for constant type.
737
738 2006-09-22  Martin Baulig  <martin@ximian.com>
739
740         * delegate.cs, attribute.cs: Merged with the gmcs versions.
741
742 2006-09-22  Raja R Harinath  <rharinath@novell.com>
743
744         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
745         not the null type.
746
747         Fix part of #79451
748         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
749         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
750         code slightly.
751
752 2006-09-22  Martin Baulig  <martin@ximian.com>
753
754         * ecore.cs: Merged with the gmcs version.
755
756         * generic.cs (ConstructedType): New dummy class.
757         (TypeArguments): Don't make this abstract.
758
759         * typemanager.cs
760         (TypeManager.IsGenericTypeDefinition): New method.
761         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
762
763 2006-09-22  Raja R Harinath  <rharinath@novell.com>
764
765         * expression.cs (ComposedCast): Check for arrays of TypedReference
766         before creating the type, not after.
767
768 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
769
770         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
771         after ToType change.
772
773         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
774         when constant must be implicitly convertible.
775
776         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
777
778         * ecore.cs (NullCast): Derives from NullConstant.
779
780         * expression.cs (Is.DoResolve): Removed useless variables.
781         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
782         (New.Constantify): Add enum support.
783         (MemberAccess.DoResolve): Add warning when accessing null constant or
784         variable.
785
786         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
787         property.
788
789         * literal.cs (NullConstant): New abstract class with common
790         functionality for all null specializations.
791         (NullDefault): Represents default(X) when result can be
792         reduced to null.
793         (NullLiteral): Updated.
794
795         * report.cs: Add new warning.
796
797 2006-09-21  Martin Baulig  <martin@ximian.com>
798
799         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
800
801 2006-09-21  Martin Baulig  <martin@ximian.com>
802
803         * generic.cs (GenericConstraints): New dummy class.
804         (Constraints): Likewise.
805         (TypeParameter): Likewise.
806         (TypeParameterName): Likewise.
807         (GenericMethod): Likewise.
808
809         * typemanager.cs (TypeManager.GetGenericArguments): New method.
810
811         * decl.cs: Merged with the gmcs version.
812
813 2006-09-21  Raja R Harinath  <rharinath@novell.com>
814
815         * generic.cs (TypeParameter): Implement IMemberContainer.
816         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
817
818         * rootcontext.cs: Unify with gmcs version.
819
820         * report.cs: Unify with gmcs version.
821         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
822         from gmcs/generics.cs.
823         * generics.cs (TypeParameter): New dummy class.
824
825         * support.cs: Unify with gmcs version.
826
827 2006-09-20  Raja R Harinath  <rharinath@novell.com>
828
829         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
830         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
831
832         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
833         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
834         * mcs.exe.sources: Add generic.cs.
835
836         * codegen.cs: Unify with gmcs version.
837
838         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
839         (EmitContext): Add GenericDeclContainer implementation.
840         * decl.cs (MemberCore, DeclSpace): Likewise.
841         * namespace.cs: Remove #ifdef GMCS_SOURCE.
842
843         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
844         MCS TypeManager has a corresponding dummy method.
845
846 2006-09-19  Martin Baulig  <martin@ximian.com>
847
848         * expression.cs: Completely merged with the gmcs version.
849
850 2006-09-19  Martin Baulig  <martin@ximian.com>
851
852         * expression.cs (Invocation): Merged with the gmcs version.
853         (ArrayAccess.GetStoreOpcode): Likewise.
854
855 2006-09-19  Martin Baulig  <martin@ximian.com>
856
857         * typemanager.cs
858         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
859         (TypeManager.IsGenericMethodDefinition): Likewise.
860
861 2006-09-19  Martin Baulig  <martin@ximian.com>
862
863         * typemanager.cs
864         (TypeManager.IsEqual): Moved the gmcs implementation here.
865         (TypeManager.DropGenericTypeArguments): Likewise.
866         (TypeManager.DropGenericMethodArguments): Likewise.
867         (TypeManager.GetTypeArguments): Moved here from gmcs.
868         (TypeManager.HasGenericArguments): Likewise.
869
870 2006-09-19  Martin Baulig  <martin@ximian.com>
871
872         * expression.cs (Binary): Merged with the gmcs version.
873
874 2006-09-19  Martin Baulig  <martin@ximian.com>
875
876         * expression.cs (Probe, As, Is): Merged with the gmcs version.
877
878 2006-09-19  Martin Baulig  <martin@ximian.com>
879
880         * typemanager.cs: Merged with the gmcs version.
881
882 2006-09-16  Raja R Harinath  <rharinath@novell.com>
883
884         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
885         * driver.cs: Likewise.
886
887 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
888
889         A fix for #79401
890         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
891         only if parent type is class.
892         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
893         update.
894
895 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
896
897         * cs-parser.jay,
898         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
899         keywords are used.
900         * typemanager.cs(CSharpName): Converts NullType to null.
901
902 2006-09-15  Martin Baulig  <martin@ximian.com>
903
904         * typemanager.cs
905         (TypeManager.GetMethodName): Added mcs implementation.
906         (TypeManager.IsEqual): Likewise.
907
908         * ecore.cs
909         (SimpleName.RemoveGenericArity): Added dummy implementation.
910
911         * pending.cs: Merged with the gmcs version.     
912
913 2006-09-15  Martin Baulig  <martin@ximian.com>
914
915         * statement.cs: Merge with the gmcs version.
916
917 2006-09-15  Martin Baulig  <martin@ximian.com>
918
919         * statement.cs (Switch): Merge with the gmcs implementation
920         (without nullables), which is newer.
921
922 2006-09-15  Martin Baulig  <martin@ximian.com>
923
924         * statement.cs (Block.Variables): Make this public.
925         (ToplevelBlock.Parameters): Make this a property.
926         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
927
928 2006-09-15  Martin Baulig  <martin@ximian.com>
929
930         * namespace.cs: Merge with the gmcs version.
931
932 2006-09-15  Martin Baulig  <martin@ximian.com>
933
934         * decl.cs (MemberName): Minor code cleanups.
935
936 2006-09-15  Martin Baulig  <martin@ximian.com>
937
938         * parameter.cs: Merge with the gmcs version.
939
940 2006-09-15  Martin Baulig  <martin@ximian.com>
941
942         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
943         and an error in mcs.
944
945 2006-09-15  Martin Baulig  <martin@ximian.com>
946
947         * flowanalysis.cs: Merged from GMCS; added the generics code into
948         a `GMCS_SOURCE' conditional so we can share this file.
949
950 2006-09-08  Martin Baulig  <martin@ximian.com>
951
952         * typemanager.cs (TypeManager.interlocked_type): New public field.
953         (TypeManager.int_interlocked_compare-exchange): New public field.
954         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
955         enumerator types here and call InitGenericCoreTypes().
956         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
957         after calling InitEnumUnderlyingTypes().
958
959         * rootcontext.cs
960         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
961         `classes_second_stage'. 
962
963 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
964
965         * assign.cs, ecore.cs, expression.cs: Share error message text.
966         * class.cs (FieldMember.Define): Check for varible of static type.
967         * driver.cs (LoadAssembly): Uses error output for errors.
968         * statement.cs: Updated.
969
970 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
971
972         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
973         type instance.
974
975 2006-09-07  Martin Baulig  <martin@ximian.com>
976
977         * driver.cs
978         (MainDriver): Revert r62663 from Marek; see #70506 for details.
979
980 2006-08-29  Miguel de Icaza  <miguel@novell.com>
981
982         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
983         
984 2006-08-17  Miguel de Icaza  <miguel@novell.com>
985
986         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
987         #52019 and #79064, the use of the \uXXXX sequence in source code
988         to represent unicode characters.
989
990 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
991
992         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
993         support.
994         * class.cs, ecore.cs, statement.cs: Merged to one error message.
995
996 2006-08-13  Miguel de Icaza  <miguel@novell.com>
997
998         * assign.cs: Catch attempts to assign to a method groups in += and
999         report as 1656
1000
1001 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
1002
1003         A fix for #79056
1004         * cs-parser.jay: Don't destroy current array type by typeof of array's.
1005
1006 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
1007
1008         * class.cs (Method.Define): Issue a warning when generic method looks like
1009         an entry point.
1010         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1011         as well.
1012
1013 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
1014  
1015         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1016         looking for ctor.
1017         * decl.cs (MemberCache.FindMembers): When container is interface we need to
1018         search all base interfaces as a member can be ambiguous.
1019         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1020         Constructor member type filter. 
1021         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1022         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1023         reporting for returned memberinfos.
1024         * report.cs: Updated.
1025         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1026         version to work on all runtimes.
1027         (TypeManager.RealMemberLookup): Removed members filtering.
1028
1029 2006-08-08  Raja R Harinath  <rharinath@novell.com>
1030
1031         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1032         (PropertyExpr.EmitAssign): Likewise.
1033         * expression.cs (Indirection.EmitAssign): Likewise.
1034         (LocalVariableReference.EmitAssign): Likewise.
1035         (ParameterReference.EmitAssign): Likewise.
1036         (Invocation.EmitArguments): Likewise.
1037         (ArrayAccess.EmitAssign): Likewise.
1038         (IndexerAccess.EmitAssign): Likewise.
1039         (This.EmitAssign): Likewise.
1040         (ConditionalLogicalOperator.Emit): Likewise.
1041
1042         Fix #79026
1043         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
1044         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
1045         leave it in after returning it.
1046         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
1047
1048 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
1049
1050         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1051         message.
1052
1053 2006-08-03  Raja R Harinath  <rharinath@novell.com>
1054
1055         Fix cs0146-3.cs and cs0146-4.cs.
1056         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1057         enclosing types don't depend on the current type.
1058
1059 2006-08-02  Raja R Harinath  <rharinath@novell.com>
1060
1061         Fix #77963
1062         * class.cs (TypeContainer.DoDefineMembers): Use
1063         FindBaseMemberWithSameName on Parent, since we're interested in
1064         whether we hide inherited members or not.
1065         (FindBaseMemberWithSameName): Make slightly more robust.
1066
1067         Fix the non-generic testcase from #77396
1068         * decl.cs (DeclSpace.DeclContainer): Remove override.
1069
1070         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1071         declspaces for doppelgangers too.
1072         (UsingEntry): Implement IResolveContext.
1073         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
1074         'this' as the resolve context.
1075         (LocalAliasEntry): Likewise.
1076
1077         Implement parts of #77403
1078         * roottypes.cs (RootDeclSpace): New.  Used to represent the
1079         toplevel declaration space.  Each namespace declaration introduces
1080         a "partial" root declaretion space.
1081         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1082         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1083         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1084         from 'current_namespace.SlaveDeclSpace'.
1085         (namespace_declaration): Likewise.
1086         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1087         check.  It can't happen now.
1088         * decl.cs (DeclSpace.LookupType): Likewise.
1089         * driver.cs (MainDriver): Sanity check.
1090
1091 2006-08-01  Raja R Harinath  <rharinath@novell.com>
1092
1093         * decl.cs (DeclSpace.FindNestedType): Remove.
1094         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1095         LookupTypeContainer to get the container of the nested type.
1096         * class.cs (TypeContainer.FindNestedType): Make non-override.
1097
1098 2006-07-31  Raja R Harinath  <rharinath@novell.com>
1099
1100         * decl.cs (DeclSpace.PartialContainer): Move field from ...
1101         * class.cs (TypeContainer.PartialContainer): ... here.
1102         (TypeContainer.AddBasesForPart): New helper.
1103         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
1104         instead.
1105         * cs-parser.jay (current_class): Convert to DeclSpace.
1106         (struct_declaration, interface_declaration, class_declaration):
1107         Use AddBasesForPart instead of .Bases directly.
1108         * const.cs, iterators.cs: Update to changes.
1109
1110 2006-07-28  Raja R Harinath  <rharinath@novell.com>
1111
1112         * class.cs (TypeContainer.AddMemberType): Rename from
1113         AddToTypeContainer.
1114         (TypeContainer.AddMember): Rename from AddToMemberContainer.
1115         (AddTypeContainer): New.  Combine AddClassOrStruct and
1116         AddInterface.
1117         (AddPartial): Update.  Add 'is_partial' argument.
1118         * roottypes.cs: Update to changes.
1119         * cs-parser.jay (push_current_class): New helper for handling
1120         current_container and current_class.
1121         (struct_declaration, interface_declaration, class_declaration):
1122         Use it.
1123
1124 2006-07-26  Raja R Harinath  <rharinath@novell.com>
1125
1126         * roottypes.cs: Rename from tree.cs.
1127
1128         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1129         * tree.cs (Tree, ITreeDump): Remove types.
1130         * rootcontext.cs (tree, Tree): Remove fields.
1131         (root, ToplevelTypes): New.
1132         * *.cs: Update to rename.
1133
1134         * tree.cs (Tree.RecordDecl): Remove.
1135         (RootTypes.AddToTypeContainer): Record the toplevel type in its
1136         namespace here.
1137         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1138
1139 2006-07-23  Raja R Harinath  <harinath@gmail.com>
1140
1141         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1142         DoFlowAnalysis and OmitStructFlowAnalysis here.
1143         (ec.With): Rename from WithUnsafe and generalize.
1144         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
1145         (ec.WithFlowAnalyis): New.
1146         * ecore.cs, expression.cs, statement.cs: Update.
1147
1148 2006-07-22  Raja R Harinath  <harinath@gmail.com>
1149
1150         * statement.cs (Block.ResolveMeta): Simplify slightly.
1151
1152         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
1153         multiple boolean fields.  Convert InUnsafe, constant_check_state,
1154         check_state to flags.
1155         (CheckState, ConstantCheckState): Update.
1156         (InUnsafe): New read-only property.
1157         (FlagsHandle): Rename from CheckStateHandle and convert to handle
1158         arbitrary flags.
1159         (WithUnsafe): New helper similar to WithCheckState.
1160         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1161         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1162
1163 2006-07-21  Raja R Harinath  <rharinath@novell.com>
1164
1165         Make comparisons use the same IL irrespective of whether they're
1166         in a 'checked' or 'unchecked' context: one of the issues in #78899
1167         * codegen.cs (EmitContext.CheckState): Make read-only property.
1168         (EmitContext.ConstantCheckState): Likewise.
1169         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1170         helper that implement a save/restore stack for CheckState
1171         values.  This is the only way to change check-state.
1172         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1173         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1174         (CheckedExpr.EmitBranchable): New forwarding method.
1175         (UnCheckedExpr): Likewise.
1176         * statement.cs (Block.ResolveMeta): Use WithCheckState.
1177         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1178         (Checked.Resolve, checked.DoEmit): Likewise.
1179
1180 2006-07-20  Miguel de Icaza  <miguel@novell.com>
1181
1182         * anonymous.cs: Cache the resolved anonymous delegate, and return
1183         this so that the ResolveTopBlock is only triggered once, not
1184         twice.
1185
1186         Currently we trigger ResolvetopBlock twice due to a first pass of
1187         argument check compatibility, and a second pass that does the
1188         actual resolution.   
1189         
1190 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1191
1192         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1193         modifiers.
1194         * rootcontext.cs (Reset): Add helper_classes.
1195
1196 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1197
1198         A fix for #78860
1199         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1200         correctly.
1201
1202 2006-07-13  Miguel de Icaza  <miguel@novell.com>
1203
1204         * statement.cs (Lock): Handle expressions of type
1205         TypeManager.null_type specially.  Fixes #78770
1206
1207 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1208
1209         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1210         to an event.
1211
1212 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1213
1214         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1215         for accessors as well.
1216         * ecore.cs (EventExpr): Add AccessorTable.
1217
1218 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
1219
1220         A fix for #78738
1221         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1222         for CS0122 where appropriate.
1223         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1224         level attributes.
1225         (Filter): Assembly can be null in the case of top level attributes.
1226
1227 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
1228
1229         A fix for #78690
1230
1231         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1232         is done at global level.
1233
1234 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1235
1236         A fix for #77002, Implemented TypeForwarder support.
1237
1238         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1239         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1240         * typemanager.cs (): Add type_forwarder_attr_type.
1241
1242 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1243
1244         * report.cs: Add CS0469 warning.
1245
1246 2006-06-21  Martin Baulig  <martin@ximian.com>
1247
1248         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1249         the `try'-block, so we also report CS0016 etc. there.
1250
1251 2006-06-21  Martin Baulig  <martin@ximian.com>
1252
1253         * delegate.cs
1254         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1255
1256 2006-06-21  Martin Baulig  <martin@ximian.com>
1257
1258         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1259         also report CS1686 for parameters.
1260
1261 2006-06-21  Martin Baulig  <martin@ximian.com>
1262
1263         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1264         instead of an error if the value is not implicitly convertible to
1265         the switch types; fixes #77964.
1266
1267 2006-06-21  Raja R Harinath  <rharinath@novell.com>
1268
1269         Fix #78673
1270         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1271         FieldBuilder is null.
1272
1273         Fix #78662
1274         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1275         'left' and 'right' before error-checking.
1276
1277 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
1278
1279         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1280         Fixed bug #78601.
1281         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1282         (FieldExpr.DoResolve): likewise.
1283         (PropertyExpr.InstanceResolve): likewise.
1284         (EventExpr.InstanceResolve): likewise. 
1285
1286 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
1287
1288         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1289         attribute applicable tests for attribute argument.
1290
1291 2006-06-02  Raja R Harinath  <rharinath@novell.com>
1292
1293         Fix #78079
1294         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1295         (Binary.OverloadResolve_PredefinedIntegral): New.
1296         (Binary.OverloadResolve_PredefinedFloating): New.
1297         (Binary.OverloadResolve_PredefinedString): New.
1298         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1299         Follow the standard more closely, and treat numeric promotions in
1300         terms of overload resolution.
1301         (Binary.CheckShiftArguments): Simplify.
1302
1303 2006-06-01  Raja R Harinath  <rharinath@novell.com>
1304
1305         * flowanalysis.cs (MyBitVector): Simplify representation.
1306         (MyBitVector.Clone): Avoid allocating BitArray.
1307         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1308         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1309         (*): Update.  Change all references to MyBitVector.And and
1310         MyBitVector.Or to &= and |=.
1311
1312 2006-05-29  Raja R Harinath  <rharinath@novell.com>
1313
1314         Fix cs0231-[34].cs.
1315         * cs-parser.jay (formal_parameter_list): Extend the pattern below
1316         to param arguments too.
1317
1318 2006-05-26  Miguel de Icaza  <miguel@novell.com>
1319
1320         * cs-parser.jay: Catch another parsing form for arglist being
1321         followed by other arguments.  Fixes #78313.
1322
1323 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1324
1325         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1326         checking of out parameters to ...
1327         (FlowBranchingToplevel.Merge): ... here.
1328         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1329         set, propagate the origin upward, and only complain if there was
1330         no other error.
1331         (FlowBranchingException.AddContinueOrigin): Likewise.
1332         (FlowBranchingException.AddReturnOrigin): Likewise.
1333         (FlowBranchingException.AddGotoOrigin): Likewise.       
1334
1335 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1336
1337         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1338         unreachable, skip it.
1339         (FlowBranchingException.Merge): Always propagate jumps, even if
1340         the finally block renders subsequent code unreachable.
1341
1342 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1343
1344         Fix #77601
1345         * statement.cs (Goto.Resolve): Move responsibility for resolving
1346         'goto' to FlowBranching.AddGotoOrigin.
1347         (Goto.SetResolvedTarget): New.  Callback to set the
1348         LabeledStatement that's the target of the goto.
1349         (Goto.DoEmit): Use Leave instead of Br when crossing an
1350         unwind-protect boundary.
1351         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1352         LookupLabel and adjust to new semantics.
1353         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1354         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1355         Goto.SetResolvedTarget to update target.
1356         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1357         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1358         AddBreakOrigin & co.  Delay propagation until ...
1359         (FlowBranchingException.Merge): ... this.
1360
1361         * statement.cs (Block.Resolve): Always depend on flow-branching to
1362         determine unreachability.  Kill workaround that originally emitted
1363         only one statement after an "unreachable" label (see infloop in
1364         test-515.cs).
1365
1366         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1367         This is still "wrong", but anything better would probably need a
1368         multi-pass algorithm.
1369         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1370         usage vector.  Force current usage vector to be reachable, to
1371         optimistically signify backward jumps.
1372         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1373         detected.
1374         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1375         detected, return the original salted-away usage vector instead,
1376         updated with appropriate changes.  Print unreachable warning if
1377         necessary.
1378         * statement.cs (Block.Resolve): Don't print unreachable warning on
1379         a labeled statement.
1380
1381 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1382
1383         * driver.cs: Pass filename without path to AssemblyBuilder's 
1384         AddResourceFile. Fixes bug #78407.
1385
1386 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1387
1388         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1389         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1390         (FlowBranching.MergeChild): Overwrite
1391         reachability information from Labeled branchings too.
1392
1393 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1394
1395         * statement.cs (Goto.Resolve): Merge jump origins here ...
1396         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1397
1398         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1399         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1400         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1401         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1402         here, ...
1403         * statement.cs (Goto.Resolve): ... not here.
1404         (Goto.Emit): Remove CS1632 check.
1405
1406 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1407
1408         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1409         error message.
1410
1411 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1412
1413         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1414         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1415         (FlowBranchingException.Label): Likewise.
1416
1417         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1418         given value.
1419         (MyBitVector.Or): Use it to avoid losing information (Count).
1420         (FlowBranching.MergeOrigins): Likewise.
1421
1422         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1423         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1424         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1425         (UsageVector.ToString): Simplify.
1426         (UsageVector.MergeSiblings): Move here from ...
1427         (FlowBranching.Merge): ... here.
1428         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1429         not a MyBitVector.
1430
1431 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1432
1433         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1434         null bitvector is treated as all-true.
1435
1436         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1437         (MyBitVector): Rationalize invariants.  'vector != null' implies
1438         that we have our own copy of the bitvector.  Otherwise,
1439         'InheritsFrom == null' implies all inherited bits are true.
1440
1441 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1442
1443         * statement.cs (LocalInfo): Add IsConstant.
1444         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1445         local variable for constants.
1446
1447 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1448
1449         * flowanalysis.cs (MyBitVector.Empty): New.
1450         (MyBitVector): Don't allow InheritedFrom to be null.
1451         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1452         (UsageVector, FlowBranching): Update to changes.
1453
1454         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1455         recursion.  The 'Parent == null' condition isn't sufficient for
1456         anonymous methods.
1457         (FlowBranching.AddBreakOrigin): Likewise.
1458         (FlowBranching.AddContinueOrigin): Likewise.
1459         (FlowBranching.AddReturnOrigin): Likewise.
1460         (FlowBranching.StealFinallyClauses): Likewise.
1461         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1462         (FlowBranching.CheckOutParameters): Likewise.
1463         (FlowBranchingToplevel): Terminate all the above recursions here.
1464         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1465         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1466
1467         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1468         toplevel block.
1469         (FlowBranchingToplevel): New.  Empty for now.
1470         (FlowBranching.MergeTopBlock): Update.
1471         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1472         branching for the anonymous delegate.
1473         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1474
1475         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1476         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1477         information at the start of the merge.  Reorganize.
1478
1479 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1480
1481         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1482
1483 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1484
1485         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1486         to newly introduced ctor.
1487
1488         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1489         message to one place.
1490         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1491         global namespace.
1492
1493 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1494
1495         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1496
1497         * ecore.cs (Expression.ResolveAsConstant): Updated.
1498
1499         * statement.cs (ResolveMeta): Updated.
1500
1501 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1502
1503         * cs-parser.jay: __arglist cannot be used in initializer.
1504
1505 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1506
1507         A fix for #77879
1508         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1509         private types.
1510
1511 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1512
1513         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1514         (LabeledStatement): Add 'name' parameter.
1515         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1516         (Block.AddLabel): Update to changes.
1517         * cs-parser.jay (labeled_statement): Likewise.
1518
1519         * flowanalysis.cs (BranchingType.Labeled): New.
1520         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1521         (FlowBranchingLabeled): New.  Does nothing for now, but will
1522         eventually handle 'goto' flows.
1523         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1524         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1525         that's terminated ...
1526         (Block.Resolve): ... here.
1527
1528         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1529         (UsageVector.MergeFinallyOrigins): Likewise.
1530         (FlowBranching.InTryOrCatch): Likewise.
1531         (FlowBranching.AddFinallyVector): Likewise.
1532         (FlowBranchingException): Update to changes.
1533
1534         Fix #78290
1535         * statement.cs (Return.Resolve): Move error checking to ...
1536         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1537         (FlowBranchingException): Handle return origins like break and
1538         continue origins.
1539         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1540
1541 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1542
1543         A fix for #76122
1544         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1545         filter.
1546
1547 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1548
1549         A fix for #77543
1550         * class.cs (MethodData.Define): Do public accessor check only when method
1551         implements an interface.
1552
1553 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1554
1555         Remove special handling of 'break'
1556         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1557         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1558         (UsageVector.Break): Remove.
1559         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1560         reachability.
1561         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1562
1563         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1564         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1565
1566 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1567
1568         A fix for #75726
1569         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1570         be the interface member.
1571
1572 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1573
1574         A fix for #60069
1575         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1576         for emitting small (int) values.
1577
1578 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1579
1580         Fix #59427
1581         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1582         control-flow passes through the 'finally' after merging-in all the
1583         control-flows from 'try' and the 'catch' clauses.
1584
1585         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1586         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1587         always true at the only non-recursive entry point.
1588         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1589         FlowBranchingBreakable.
1590         (FlowBranchingLoop): Remove.
1591         * statement.cs (Return.DoResolve): Update to changes.
1592
1593         Fix #76471, #76665
1594         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1595         (FlowBranching.CreateBranching): Handle it: create a
1596         FlowBranchingContinuable.
1597         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1598         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1599         except that it handles the 'continue' command.
1600         (FlowBranching.UsageVector.MergeOrigins): Rename from
1601         MergeBreakOrigins.
1602         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1603         except that it overrides AddContinueOrigin.
1604         (FlowBranchingException): Override AddContinueOrigin, similar to
1605         AddBreakOrigin.
1606         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1607         Create a new branching around the embedded statement.
1608         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1609         control flow after the embedded statement.
1610         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1611
1612         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1613         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1614         FlowBranchingBreakable.
1615         (FlowBranchingSwitch): Remove.
1616
1617         Fix test-503.cs
1618         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1619         error reporting to ...
1620         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1621         Rename from 'AddBreakVector'.  Add new location argument.  Return
1622         a bool indicating whether the 'break' crosses an unwind-protect.
1623         (FlowBranchingException.AddBreakOrigin): Add.
1624         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1625         flowbranching after updating with the effects of the 'finally'
1626         clause.
1627         (FlowBranchingBreakable): New common base class for
1628         FlowBranchingLoop and FlowBranchingSwitch.
1629
1630         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1631         embedded statement.
1632         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1633
1634 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1635
1636         * statement.cs (Do.Resolve): If the loop is infinite, set the
1637         barrier.
1638         (While.Resolve, For.Resolve): Set a barrier after the embedded
1639         statement.  There's no direct control flow that goes from the end
1640         of the embedded statement to the end of the loop.
1641         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1642         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1643         above ensure that the reachability is correctly computed.
1644
1645         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1646         (UsageVector.MergeBreakOrigins): If the current path is
1647         unreachable, treat it as if all parameters/locals are initialized.
1648         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1649         infinite loops before merging-in break origins.
1650
1651         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1652         (Reachability.Reachable): Split part into ...
1653         (Reachability.Unreachable): ... this.  Simplify.
1654         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1655
1656         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1657         (Reachability.SetThrowsSometimes): Likewise.
1658         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1659         TriState.Always, use corresponding property.
1660         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1661         (Block.Resolve): Likewise.  Remove some redundant checks.
1662
1663 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1664
1665         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1666         (Reachability.Meet): Don't bother checking AlwaysThrows --
1667         barrier is always set.
1668         (FlowBranchingBlock.Merge): Likewise.
1669
1670 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1671
1672         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1673         checks for unreachable.
1674
1675 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1676
1677         A fix for #77980
1678         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1679
1680         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1681         whether field is really assigned.
1682
1683 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1684
1685         * flowanalysis.cs (Reachability): Make 4-argument constructor
1686         private.
1687         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1688         (Reachability.Always): Rename from the highly misleading
1689         'Reachability.Never'.
1690         (FlowBranching.Merge): Update to changes.  Mark an impossible
1691         situation with a 'throw'.
1692         (*): Update to changes.
1693
1694 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1695
1696         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1697         Remove 'Undefined'.
1698         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1699         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1700         (*): Update to changes.
1701         * statement.cs: Update to changes.
1702
1703 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1704
1705         A fix for #78049
1706         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1707
1708 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1709
1710         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1711         dummy UsageVector.
1712
1713         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1714         argument to two arguments: an usage-vector and a bool.  Move call
1715         to FlowBranching.Merge () ...
1716         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1717
1718         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1719         handling of loop and switch reachability to ...
1720         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1721
1722 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1723
1724         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1725         handling to FlowBranchingLoop.InLoop.
1726         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1727
1728 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1729
1730         A fix for #78115
1731         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1732         anonymous method is allowed from AnonymousContainer here.
1733
1734         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1735
1736 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1737
1738         Fix #78156
1739         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1740
1741 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1742
1743         A fix for #49011.
1744         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1745         (DoubleConstant.Reduce): Ditto.
1746
1747 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1748
1749         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1750         Remove 'lvalue_right_side' argument.  Move parts to ...
1751         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1752         (LocalVariable.DoResolveLValue): ... these.
1753
1754 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1755
1756         Fix cs1655.cs
1757         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1758         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1759         (LocalVariableReference.DoResolveBase): Use it to implement new
1760         CS1655 check.
1761         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1762         (Argument.Resolve): Simplify.  Move CS1510 check ...
1763         * ecore.cs (Expression.ResolveLValue): ... here.
1764         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1765         (PropertyExpr.DoResolveLValue): Likewise.
1766         (FieldExpr.Report_AssignToReadonly): Likewise.
1767         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1768         LValueMemberAccess or LValueMemberOutAccess on instance depending
1769         on it.
1770         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1771         DoResolve as appropriate.
1772
1773 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1774
1775         Fix #75800
1776         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1777         implicit conversions on 'out' and 'ref' arguments.
1778
1779         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1780         improve clarity.  Remove dead code.
1781
1782         Fix #66031
1783         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1784         (Catch.Resolve): Resolve VarBlock if it exists.
1785
1786 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1787
1788         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1789         twice, this was some residual code, the enumerator was emitted
1790         properly in the two branche of if later.
1791
1792 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1793
1794         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1795         cast is never an lvalue.
1796         (Cast.DoResolve, Cast.ResolveRest): Combine.
1797         (Argument.Emit): Simplify slightly.  Move 'Expr is
1798         IMemoryLocation' check ...
1799         (Argument.Resolve): ... here.
1800         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1801
1802         Simplifications.  Fix cs0191-2.cs
1803         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1804         CS1649 and CS1651 to ...
1805         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1806         the actual selection of the error code and message to a lookup
1807         table.  Add a dummy return value to simplify callsites.
1808         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1809         readonly fields of other instances of the same type.  Move CS0197
1810         warning from ...
1811         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1812         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1813         resolution of an out or ref argument.  The code simplification
1814         above uses this invariant.
1815
1816 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1817
1818         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1819         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1820         CheckMarshallByRefAccess.  Drop parameter.
1821         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1822         warning.
1823         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1824         InstanceExpression.
1825         * report.cs (AllWarnings): Add CS1690.
1826         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1827         for ref access too.
1828         (LocalVariableReference.DoResolveBase): Update.
1829
1830 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1831
1832         * class.cs (MethodOrOperator): Moved common parts from method class.
1833         detect obsolete attributes.
1834         (Method.Define): Simplified as it reuses code from base.
1835         (Constructor.ValidAttributeTargets): Fixed issue found during
1836         refactoring.
1837         (Destructor.ValidAttributeTargets): Fixed issue found during
1838         refactoring.
1839         (Operator): Finished refactoring set off by #78020. Operator class is now
1840         ordinary method class.
1841
1842         * anonymous.cs: Updated.
1843
1844         * decl.cs (DeclSpace): Add IsGeneric
1845
1846 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1847
1848         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1849
1850 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1851
1852         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1853         detect obsolete attributes.
1854         (Method.CreateEmitContext): Moved to MethodOrOperator.
1855
1856 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1857
1858         A fix for #78048.
1859         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1860         customized exception to make crash detection easier.
1861         (MethodOrOperator): Started to work on new base class for methods and
1862         operators.
1863         (Method): Derives from MethodOrOperator.
1864         (Constructor.Emit): Emits its own attributes.
1865         (AbstractPropertyEventMethod.Emit): Ditto.
1866         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1867         patch.
1868         (Operator.Emit): It's temporary more tricky than should be.
1869         
1870         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1871
1872         * report.cs (InternalErrorException): Add ctor with inner exception.
1873
1874 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1875
1876         A fix for #76744.
1877         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1878         only not visible.
1879
1880 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1881
1882         A fix for #77916.
1883         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1884         array.
1885
1886 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1887
1888         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1889         attribute is present and Guid not.
1890         (Interface.ApplyAttributeBuilder): Ditto.
1891
1892         * attribute.cs: Add error message.
1893
1894 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1895
1896         A fix for #78020.
1897
1898         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1899         sources (it's composite) so hold them in extra array as they are used in
1900         Emit phase only. It worked in the previous versions by mistake.
1901         (Attribute.Emit): Emit attribute for more owners when exist.
1902
1903         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1904         it has now different behaviour.
1905
1906 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1907
1908         * constant.cs (Constant.IsDefaultInitializer): New method.
1909
1910         * class.cs: Updated.
1911
1912         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1913         re-initialize default values. It saves KBs almost for every assembly.
1914         Thanks Zoltan for the idea.
1915         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1916         (ArrayCreation.DoResolve): Resolve only once.
1917         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1918         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1919
1920 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1921
1922         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1923         From #77961.
1924
1925 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1926
1927         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1928         in an embedded statement too.
1929
1930 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1931
1932         Fix #77958
1933         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1934
1935 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1936
1937         A fix for #77966.
1938
1939         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1940         was not specified.
1941
1942         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1943
1944 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1945
1946         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1947         phase.
1948
1949         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1950         LocalTemporary change.
1951
1952         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1953         TypeContainer.
1954         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1955         initializers optimization.
1956         (ClassOrStruct.TypeAttr): Moved from modifiers.
1957         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1958         (FieldBase.ResolveInitializer): Resolves initializer.
1959         (FieldBase.HasDefaultInitializer): New property.
1960
1961         * cs-parser.jay: Removed message.
1962
1963         * expression.cs (CompilerGeneratedThis): New specialization.
1964
1965         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1966
1967 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1968
1969         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1970
1971 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1972
1973         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1974         be now EnumConstants only.
1975
1976 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1977
1978         * attribute.cs, driver.cs: Reset more caches.
1979
1980 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1981
1982         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1983
1984 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1985
1986         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1987         for easier reuse. Updated all overrides.
1988         (IntegralConstant): New base class for all integral constants.
1989         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1990         of the constant range, report custom error.
1991         (UIntConstant.Reduce): Fixed uint conversion.
1992
1993         * ecore.cs, literal.cs: Reduce updates.
1994
1995 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1996
1997         A fix for #75813.
1998
1999         * class.cs (Constructor.Define): Removed extra if for default ctors.
2000         A patch from Atsushi Enomoto.
2001
2002 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2003
2004         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2005         GetAttributableValue.
2006
2007         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2008         when required.
2009
2010         * convert.cs (ImplicitConversionRequired): Error message moved to
2011         DoubleLiteral.
2012
2013         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2014         automatic implicit conversion of an output value.
2015         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2016
2017         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2018         conversion.
2019         (TypeOf.GetAttributableValue): Add extra handling for object type.
2020
2021         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2022         special error message.
2023
2024 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
2025
2026         * class.cs (Constructor.Emit): Don't crash when struct ctor is
2027         InternalCall.
2028         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2029         compatible with MS runtime.
2030
2031 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
2032
2033         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2034         attribute arguments here.
2035
2036         * class.cs (Indexer.Define): The check was moved to attribute class.
2037
2038 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
2039
2040         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2041         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2042         easier.
2043
2044 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2045
2046         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2047         mcs to keep code differences small.
2048         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2049         * typemanager.cs (parameter_default_value_attribute_type): New.
2050         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2051         CS1908 check.
2052
2053 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2054
2055         * expression.cs (StringConcat.Append): Reverted back to no warning state.
2056
2057 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2058
2059         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2060
2061         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2062         the blocks too.
2063
2064 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
2065
2066         * doc-bootstrap.cs : fix build.
2067
2068 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2069
2070         * expression.cs (StringConcat.Append): Issue a warning when empty string
2071         is going to append.
2072
2073 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2074
2075         * assign.cs (CompoundAssign.ResolveSource): Removed.
2076
2077         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2078         clean up.
2079
2080         * class.cs (TypeContainer.FindMethods): Removed.
2081         (TypeContainer.CheckMemberUsage): Made static.
2082
2083         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2084
2085         * constant.cs (CheckRange): Removed unused type argument.
2086         (CheckUnsigned): Removed unused type argument.
2087
2088         * cs-parser.jay: Updated after MemberAccess clean up.
2089         Uses Length for empty string test.
2090
2091         * cs-tokenizer.cs: Uses Length for empty string test.
2092         (IsCastToken): Made static.
2093         (is_hex): Made static.
2094         (real_type_suffix): Made static.
2095
2096         * decl.cs (SetupCache): Made static.
2097         (OnGenerateDocComment): Removed unused ds argument.
2098
2099         * delegate.cs (VerifyDelegate): Removed unused argument.
2100
2101         * doc.cs: Uses Length for empty string test.
2102
2103         * driver.cs: Uses Length for empty string test.
2104
2105         * enum.cs (IsValidEnumType): Made static
2106
2107         * expression.cs (EnumLiftUp): Removed unused argument.
2108         (ResolveMethodGroup): Ditto.
2109         (BetterConversion): Ditto.
2110         (GetVarargsTypes): Ditto.
2111         (UpdateIndices): Ditto.
2112         (ValidateInitializers): Ditto.
2113         (MemberAccess.ctor): Ditto.
2114         (GetIndexersForType): Ditto.
2115
2116         * flowanalysis.cs: (MergeFinally): Removed unused argument.
2117
2118         * iterators.cs: Updated after MemberAccess clean up.
2119
2120         * location.cs: Uses Length for empty string test.
2121
2122         * namespace.cs: Uses Length for empty string test.
2123
2124          * report.cs (CheckWarningCode): Made static.
2125
2126         * statement.cs (LabeledStatement): Removed unused argument.
2127
2128         * typemanager.cs (FilterNone): Removed.
2129
2130 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2131
2132         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2133         obsolete.
2134
2135         * class.cs: Updated.
2136
2137 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2138
2139         * cs-parser.jay.cs: __arglist is not allowed for delegates.
2140
2141 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2142
2143         A fix for #77822.
2144
2145         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2146         reporting, it's more tricky than I thought.
2147
2148 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2149
2150         A fix for #77816.
2151
2152         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
2153         host container.
2154         (AnonymousMethod.ImplicitStandardConversionExists): New method.
2155         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2156         Add more error reporting; Fixed issue with params.
2157
2158         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2159
2160         * cs-parser.jay: AnonymousMethod requires host container.
2161
2162         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2163
2164 2006-03-18  Raja R Harinath  <harinath@gmail.com>
2165
2166         * class.cs: Change 'TypeContainer ds' constructor argument to
2167         'DeclSpace parent'.  Some classes were missed below due to
2168         different naming convention.
2169
2170         * class.cs (MemberCore.Parent): Delete.  This makes the
2171         ParentContainer changes below enforceable by the compiler.
2172
2173         Treat pointers to enclosing declaration space as 'DeclSpace', not
2174         'TypeContainer'.
2175         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2176         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2177
2178         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2179         of TypeContainer.
2180         (Block.AddThisVariable): Likewise.
2181         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2182         (AbstractPropertyEventMethod.Emit): Likewise.
2183         (AbstractPropertyEventMethod.EmitMethod): Likewise.
2184         (GetMethod.Define, SetMethod.Define): Likewise.
2185         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2186         (DelegateMethod.EmitMethod): Likewise.
2187
2188         Fix regression test-partial-13.cs.
2189         Rationalize use of PartialContainer.  Ensure that the partial
2190         class semantics can be tied to type-correctness, i.e., any
2191         violation will cause a compile error.
2192         * class.cs, const.cs: Access all fields that belong to class
2193         TypeContainer via ParentContainer.  Arguments of EmitContexts and
2194         Resolve()-like functions still use 'Parent'.
2195
2196         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2197         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2198         (PropertyMethod.CheckModifiers): Remove unused argument.
2199         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2200         DeclSpace.
2201
2202 2006-03-17  Raja R Harinath  <harinath@gmail.com>
2203
2204         Make semantics of PartialContainer simpler.
2205         * decl.cs (DeclSpace.IsPartial): Remove.
2206         * class.cs (TypeContainer.IsPartial): Likewise.
2207         (TypeContainer..ctor): Set PartialContainer to point to self.
2208         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2209         (TypeContainer.FindNestedType): Likewise.
2210         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2211
2212 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2213
2214         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2215
2216 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2217
2218         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2219         classes.
2220
2221 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2222
2223         * class.cs (Operator.Define): An error for base conversion was not
2224         reported correctly.
2225
2226 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2227
2228         * iterator.cs : yield break is allowed in try statement which has
2229           catch clauses. Fixed bug #77767.
2230
2231 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
2232
2233         A fix for #77593, #77574.
2234
2235         * class.cs (MethodCore.CheckBase): Another if for operator.
2236
2237 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
2238
2239         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2240         were not resolved
2241
2242         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2243         (DelegateCreation.ImplicitStandardConversionExists): New method for just
2244         conversion test.
2245         
2246         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2247         not needed.
2248
2249         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2250         Updated after another emitcontext usage was clean up. It should help us to
2251         synchronize with gmcs easier.
2252
2253 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2254
2255         A fix for #77353.
2256
2257         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2258         (Event.Define): ditto
2259         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2260
2261         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2262         Removed redundant code and set NewSlot for Invoke method too.
2263
2264         * parameter.cs (Parameters.ctor): Add custom, type ctor.
2265         (Parameters.MergeGenerated): New method. Use this method when you merge
2266         compiler generated argument with user arguments.
2267
2268 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
2269
2270         * attribute.cs (ResolveAsTypeTerminal): Removed.
2271
2272         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2273         specialization for predefined types; 30% speed up.
2274         Finally placed obsolete check to right place.
2275         (Expression.ResolveType): Removed.
2276
2277         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2278         Updated after ResolveType was removed.
2279
2280         * expression.cs (Cast.ctor): Check void cast.
2281         (Binary.ResolveAsTypeTerminal): Is never type.
2282         (Conditional.ResolveAsTypeTerminal): Is never type.
2283
2284         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2285
2286 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2287
2288         Fix #77679.
2289         * expression.cs (ParameterReference.DoResolveBase): Change return
2290         type to bool.
2291         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2292         Update.
2293
2294         Fix #77628.
2295         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2296
2297         Fix #77642.
2298         * typemanager.cs (GetFullNameSignature): Don't nullref on
2299         protected accessors.
2300
2301 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
2302
2303         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2304         these two separated members to simplify the code.
2305         (Attribute.Resolve): Refactored to use new fields and methods.
2306         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2307         implemented obsolete attribute checking.
2308         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2309         implemented obsolete checking again. It look line never ending quest ;-)
2310         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2311
2312         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2313
2314         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2315
2316         *class.cs (Property.Define): Add RegisterProperty call.
2317
2318         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2319         argument groups (only 2).
2320
2321         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2322         encoding expression to arguments.
2323         (Expression.ExprClassToResolveFlags): Just turned to property.
2324
2325         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2326         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2327         optimized as well as implemented support for zero-length attributes.
2328
2329         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2330         Add caching of PropertyInfo's.
2331
2332 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2333
2334         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2335         error multiple times.
2336
2337 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2338
2339         New partial class implementation.
2340         A fix for #77027, #77029, #77403
2341
2342         * attribute.cs (Attributable): Made attributes protected.
2343
2344         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2345         the replacements of ClassPart and PartialContainer.
2346         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2347         (TypeContainer.AddInterface): Ditto.
2348         (TypeContainer.AddPartial): The main method for partial classes. It checks
2349         for errors and merges ModFlags and attributes. At the end class is added to
2350         partial_parts list.
2351         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2352         required here.
2353         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2354         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2355         from the rest of partial classes.
2356         (TypeContainer.GetClassBases): Simplified.
2357         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2358         DefineType.
2359         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2360         (TypeContainer.HasExplicitLayout): Uses Flags now.
2361         (PartialContainer): Removed.
2362         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2363         (StaticClass): Was merged with Class.
2364         (Class.GetClassBases): class and static class bases are verified here.
2365         (Class.TypeAttr): Added static attributes when class is static.
2366         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2367         (MemberBase): In some cases we need to call parent container for partial
2368         class. It should be eliminated but it's not easy now.
2369
2370         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2371
2372         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2373         partial classed to accumulate class comments.
2374         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2375
2376         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2377
2378         * driver.cs (MainDriver): Tree.GetDecl was removed.
2379
2380         * modifiers.cs (Modifiers): Add partial modifier.
2381
2382         * tree.cs (Tree.decl): Removed.
2383         (RootTypes): Started to use this class more often for root types
2384         specializations.
2385
2386 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2387
2388         A fix for #77615
2389
2390         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2391         external interface does not have an attribute.
2392
2393 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2394
2395         Another prerequisites for new partial classs implementation.
2396         
2397         * attribute.cs (Attribute.Equal): Implemented.
2398         (Attribute.Emit): Changed as attributes can be applied more than twice.
2399         (Attributes.Emit): Check for duplicate attributes here.
2400
2401         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2402         as a parameter, clean-up.
2403
2404 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2405
2406         A fix for #77485
2407
2408         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2409         contains obsolete attribute check which can in some cases look for base
2410         type of current class which is not initialized yet.
2411         (TypeContainer.BaseType): Replacement of ptype.
2412
2413         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2414
2415 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2416
2417         First of prerequisites for new partial classs implemention.
2418         
2419         * attribute.cs (Attributable): Extended by ResolveContext;
2420         Attributes finally have correct context for resolving in all cases.
2421         (AttachTo): Attribute owner is assigned here.
2422
2423         * codegen.cs (IResolveContext): Introduce new interface to hold
2424         all information needed in resolving phase.
2425         (EmitContext): Implements IResolveContext; more clean-up needed here.
2426         
2427         * decl.cs (MemberCore): Implemented IResolveContext.
2428
2429         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2430         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2431         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2432         Refactored to use new IResolveContext instead of EmitContext; cleanup
2433
2434 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2435
2436         * codegen.cs (EmitScopeInitFromBlock): check here the
2437         capture_context, there is no need to make two calls to the
2438         EmitContext. 
2439
2440         * anonymous.cs: Add some debugging messages that might help me
2441         track other instances of this problem in the future (the
2442         regression of test 467).
2443
2444         * cs-parser.jay: track the variable block, as we need to initalize
2445         any captured variables declared in this block for the "catch"
2446         portion of the "Try" statement.
2447
2448         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2449         scope initialization for captured variables. 
2450
2451         Also, move the emit for the variables after the block location has
2452         been marked.
2453
2454 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2455
2456         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2457
2458 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2459
2460         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2461         commit yesterday, the initialization for the roots is necessary.
2462         What is not necessary is the scope activation.
2463
2464 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2465
2466         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2467         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2468         CS0206 checks.
2469         (Argument.Resolve): Remove CS0206 checks.
2470
2471 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2472
2473         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2474         scopes for all the roots, the scopes will now be emitted when the
2475         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
2476
2477         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2478         code.  This reduces a lot of existing cruft.
2479         
2480         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2481         that the ScopeInfo is generated as we enter the scope, not at the
2482         time of use, which is what we used to do before.
2483
2484         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2485         every time a Block is about to be emitted if we have a
2486         CaptureContext. 
2487
2488 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2489
2490         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2491         (Reset): Update.
2492         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2493
2494         * typemanager.cs (cons_param_array_attribute): Make private.
2495         (Reset): Set it to null.
2496         (InitCoreHelpers): Don't initialize it.
2497         (ConsParamArrayAttribute): New.  Initialize it as needed.
2498         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2499
2500 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2501
2502         * expression.cs: There might be errors reported during the
2503         selection of applicable methods.  If there are errors, do not
2504         continue execution as it will lead the compiler to crash.
2505
2506 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2507
2508         * expression.cs: Member access is not allowed on anonymous
2509         methods.  Fixes #77402.
2510
2511 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2512
2513         Fix #77401
2514         * cs-parser.jay (VariableDeclaration): Don't set
2515         current_array_type to null.
2516         (field_declaration, event_declaration, declaration_statement):
2517         Set it to null here.
2518
2519 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2520
2521         * typemanager.cs (GenericParameterPosition): New.
2522         * doc.cs: Use it.
2523
2524 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2525
2526         * doc.cs : To process "include" elements, first we should create
2527           another list than XmlNodeList, because it could result in node
2528           removal, which could result in that the XmlNodeList gives up
2529           yielding next node.
2530
2531           (Also made code identical to gmcs again.)
2532
2533 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2534
2535         * ecore.cs: Introduce an error report that we were not catching
2536         before, if not silent, we must report the error.  Gonzalo ran into
2537         it.
2538
2539 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2540
2541         A fix for bug: #76957
2542         
2543         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2544         ComputeMethodHost before creating the method, this is a new
2545         requirement. 
2546
2547         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2548         that this method references (RegisterScope).  The actual scope
2549         where the method is hosted is computed with the ComputeMethodHost
2550         before we create the method.
2551
2552         Moved the Deepest routine here.
2553
2554         (AnonymousContainer.ComputeMethodHost): New routine used to
2555         compute the proper ScopeInfo that will host the anonymous method.
2556
2557         (ScopeInfo): Deal with multiple roots.  The problem was that we
2558         did not have a unique root where all ScopeInfos could be hanged
2559         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2560         of roots.  
2561
2562         Remove AdjustMethodScope which is now computed at the end.  Remove
2563         LinkScope which did a partial link, instead link all ScopeInfos
2564         before code generation from the new "LinkScopes" routine. 
2565
2566         Simplify all the Add* routines as they no longer need to maintain
2567         the tree, they just need to record that they are using variables
2568         from a ScopeInfo.
2569
2570         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2571         routines to produce the forest of ScopeInfo trees.
2572
2573         * class.cs (TypeContainer.AppendMethod): This is just like
2574         AddMethod, but ensures that an interface implementation method
2575         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2576         methods, but at the end.
2577
2578         We use this functionality to ensure that the generated MoveNext
2579         method in the iterator class is resolved/emitted before the
2580         enumerator methods created.   
2581
2582         This is required because the MoveNext method computes the right
2583         ScopeInfo for the method.  And the other methods will eventually
2584         need to resolve and fetch information computed from the anonymous
2585         method. 
2586
2587 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2588             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2589
2590         Fix rest of #76995.
2591         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2592         the 'aliases' hash.
2593         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2594         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2595
2596 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2597
2598         Fix #76656, cs0231-2.cs.
2599         * cs-parser.jay (formal_parameter_list): Make error case catch
2600         more issues.
2601         (parenthesized_expression_0): Add CS1026 check.
2602         (invocation_expression): Remove unused { $$ = lexer.Location }.
2603
2604 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2605
2606         Fix #76824.
2607         * cs-parser.jay (statement_expression): Don't list out the
2608         individual statement-expressions.  Convert syntax error into
2609         CS0201 check.
2610
2611 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2612
2613         Fix #76874.
2614         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2615         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2616         CheckIntermediateModification.
2617         (FieldExpr.DoResolve): Add new two-argument version that
2618         allows us to resolve the InstanceExpression as an lvalue.
2619         The one-argument variant is now just a wrapper.
2620         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2621         Resolve the lhs as an lvalue if the it has a value type.
2622         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2623         from Assign.DoResolve.
2624         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2625         resolved as an lvalue.
2626         (PropertyExpr.DoResolve): Update.
2627         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2628         has a value type.  Move CS1612 check here from
2629         CheckIntermediateModification.
2630         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2631         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2632         'right_side' of a ResolveLValue on an 'out' argument.
2633         (EmptyExpression.LValueMemberAccess): New.  Used as the
2634         'right_side' of a propagated ResolveLValue on a value type.
2635         (LocalVariableReference.DoResolveBase): Recognize
2636         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2637         Add CS1654 check.
2638         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2639         EmptyExpression.Null.
2640
2641 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2642
2643         * typemanager.cs : added IsGenericParameter(). In mcs it always
2644           return false.
2645         * doc.cs : for generic parameters, use GenericParameterPosition,
2646           not FullName.
2647
2648 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2649
2650         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2651
2652 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2653
2654         This fixes the problem where we used ldfld instead of ldflda to
2655         load the "THIS" pointer on captured parameters, when THIS is a
2656         value type.  See bug #77205.
2657         
2658         * iterators.cs (CapturedThisReference.Emit): Pass false to
2659         EmitThis (we do not need the address).
2660
2661         * codegen.cs (EmitThis): it needs to know whether we need the
2662         address of `this' or not.  This is used by value types.  
2663
2664         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2665         every other call passes false.
2666
2667 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2668
2669         Fix #77221.
2670         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2671         GetOverride.
2672         * expression.cs (Invocation.OverloadResolve): Update.
2673         (Invocation.DoResolve): Avoid double resolution of invocation.
2674
2675 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2676
2677         Fix #77180.
2678         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2679         unary negation of floating point types as 0-expr; negation cannot
2680         overflow in floating point types.
2681
2682         Fix #77204.
2683         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2684         on operands of 'void' type.
2685
2686         Fix #77200.
2687         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2688         and ExclusiveOr for boolean constants too.
2689
2690 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2691
2692         Fix #75636.
2693         * expression.cs (Invocation.OverloadResolve): Replace reflected
2694         override methods with their base virtual methods, rather than
2695         skipping over them.
2696         * typemanager.cs (TypeManager.GetOverride): New.
2697
2698 2006-01-05  Jb Evain  <jbevain@gmail.com>
2699
2700         * class.cs (Property.Define, Indexer.Define): do not tag the
2701         properties as SpecialName | RTSpecialName.
2702
2703 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2704
2705         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2706         doing a low-level comparission of parameter types.  It was lacking
2707         a check for __argslist. 
2708
2709 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2710
2711         * expression.cs (ParameterReference.DoResolveBase): Allow
2712         reference parameters if they are local to this block. 
2713
2714         This allows the ref and out parameters of a delegate to be used in
2715         an anonymous method, for example:
2716
2717         delegate void set (out int x);
2718
2719         set s = delegate (out int x){
2720                 x = 0;
2721         };
2722
2723         This is used by functionality introduced late in the C# language.
2724         
2725         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2726         method that take ref and out parameters. 
2727
2728         Fixes #77119 which was a late change in the spec.
2729
2730 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2731
2732         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2733         parent if its the same scope.  Fixes #77060.
2734
2735 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2736
2737         * driver.cs: Report the case of no source files and no -out:
2738         argument provided.
2739
2740 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2741
2742         Fix #77035.
2743         * expression.cs (ComposedCast.GetSignatureForError): Define.
2744
2745 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2746
2747         Fix #76995
2748
2749         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2750         ListDictionary, to contain the ExternAliasEntry entries (in
2751         addition to the NamespaceEntry.aliases hashtable). This field is
2752         shared between the original entry and its doppelganger (bodyless 
2753         copy of it).
2754         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2755         extern_aliases field.
2756         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2757         lookup in extern_aliases.
2758
2759 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2760
2761         Fix #77006.
2762         * class.cs (TypeContainer.Mark_HasEquals): New.
2763         (TypeContainer.Mark_HasGetHashCode): New.
2764         (ClassPart): Override them.
2765         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2766
2767         Fix #77008.
2768         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2769         'parent' argument to the base constructor.
2770
2771         Remove all mention of TypeContainer from decl.cs.
2772         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2773         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2774         (DeclSpace.DeclSpace): Likewise.
2775         (DeclSpace.DefineMembers): Remove unused argument.
2776         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2777         debugging check -- we don't care if the debug code throws an
2778         InvalidCastException instead of an InternalErrorException.
2779         * class.cs (TypeContainer.DefineMembers): Update to changes.
2780         (TypeContainer.DoDefineMembers): Likewise.
2781         (TypeContainer.GetMethods): Likewise.
2782         (PropertyMember.Define): Likewise.
2783         (MemberBase.Parent): New property that forwards to
2784         MemberCore.Parent, but ensures that we get a TypeContainer.
2785         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2786         (RootContext.PopulateTypes): Likewise.  Remove special case code
2787         for !RootContext.StdLib: DefineMembers is idempotent.
2788
2789 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2790
2791         * convert.cs (ExplicitConversionCore): Check the return value from
2792         ExplicitConversionCore which can return null on failure.  Fixes #76914
2793
2794 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2795
2796         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2797
2798 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2799
2800         * doc.cs : The search for referenced namespace was insufficient to
2801           get global one as it used to do. Fixed bug #76965.
2802
2803 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2804
2805         * doc.cs : check name in cref in the last phase that whether it is
2806           namespace or not.
2807
2808 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2809
2810         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2811           Mono.C5.
2812
2813 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2814
2815         * doc.cs : so it turned out that we cannot skip override check for 
2816           interface members. Fixed bug #76954.
2817
2818 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2819
2820         * cs-tokenizer.cs : fixed bug #75984:
2821           - #warning and #error should not be handled when the source line
2822             is disabled.
2823           - #line is not checked strictly when the source line is disabled.
2824           - #define and #undef is on the other hand checked strictly at any
2825             state.
2826
2827 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2828
2829         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2830           CS1027 report.
2831
2832 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2833
2834         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2835
2836         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2837         event initializers.
2838         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2839         (FieldBase.Initializer): Initializer is now optional.
2840         (EventField.Define): Only event field can have initializer.
2841
2842         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2843
2844         * const.cs (Const): Reuse initializer.
2845
2846         * cs-parser.jay: Updated after FieldBase changes.
2847         Added current_array_type to simplify array initializers.
2848
2849         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2850
2851         * expression.cs, iterators.cs: Updated.
2852
2853         * namespace.cs (NamespaceEntry): Made UsingFound private.
2854
2855 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2856
2857         * parameterCollection.cs: Obsolete, removed.
2858         * parser.cs: Obsolete, removed.
2859
2860 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2861
2862         Fix #76849.
2863         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2864
2865         * enum.cs (Enum.Define): Set obsolete context here.
2866
2867 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2868
2869         * doc.cs :
2870           - FindDocumentedMember() now expects 1) paramList as null
2871             when "we don't have to check the number of parameters" and
2872             2) Type.EmptyTypes when "there is no arguments".
2873           - Introduced FoundMember struct to hold the exact type which was
2874             used to find the documented member (the above change broke
2875             test-xml-044; it might be better just to use DeclaringType than
2876             what MS does, like this change does, but it depends on usage.)
2877
2878 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2879
2880         * doc.cs : documented member might be from DeclaringType for nested
2881           types. Fixed bug #76782.
2882
2883 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2884
2885         * anonymous.cs: Have the param code handle leaving copies on the
2886         stack etc. Allows anonymous params to take part in the assignment
2887         code (++, +=, etc). Fixes bug #76550
2888
2889         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2890         it down to the anon code.
2891
2892         * iterators.cs: Use dummy var here
2893
2894         * codegen.cs: Handle new vars
2895
2896 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2897
2898         Fix #76849.
2899         * class.cs (MethodData.Define): Set proper Obsolete context.
2900
2901         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2902         obsolete context.
2903         (FieldExpr.DoResolve): Ditto.
2904
2905 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2906
2907         Fix #76849.
2908         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2909         parent is not obsolete.
2910
2911 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2912
2913         * doc.cs : (FindDocumentedMember) find parameterless members first
2914           and get CS0419 in the early stage. Fixed first case of bug #76727.
2915
2916 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2917
2918         Fix #76859.
2919         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2920         no error was reported.
2921
2922         *expression.cs (Binary.DoResolve): left can be null.
2923
2924 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2925
2926         Fix #76783.
2927         * class.cs (MethodData.Emit): Parameters should be labeled first.
2928
2929 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2930
2931         Fix #76761.
2932         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2933
2934 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2935
2936         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2937
2938         * class.cs (MethodCore): Parameter clean up.
2939         (IMethodData): Added ParameterInfo.
2940         (MethodData): Parameter clean up.
2941         (Indexer.Define): Parameter clean up.
2942
2943         * anonymous.cs,
2944         * codegen.cs,
2945         * cs-parser.jay,
2946         * decl.cs,
2947         * doc.cs,
2948         * ecore.cs,
2949         * flowanalysis.cs,
2950         * iterators.cs,
2951         * pending.cs,
2952         * statement.cs,
2953         * typemanager.cs: Parameter clean up.
2954
2955         * delegate.cs (Define): Get rid of duplicated code.
2956
2957         * expression.cs (ParameterReference): Removed useless parameters
2958         and simplified.
2959         (Invocation): Ditto.
2960
2961         * parameter.cs (ParamsParameter): New class, params specialization.
2962         (ArglistParameter): Attemp to separate arglist.
2963         (Parameter): Refactored to be reusable and faster.
2964         (Parameter.Modifier): Made understandable.
2965         (Parameters): Changed to be used as a class for `this' assembly
2966         parameters. Refactored to use new specialized classes.
2967
2968         * support.cs (ParameterData): Added Types property.
2969         (InternalParameters): Deleted.
2970
2971 2005-08-20  Martin Baulig  <martin@ximian.com>
2972
2973         Merging this patch from GMCS to fix #75867.
2974
2975         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2976         scope if we don't already have it.
2977
2978 2005-11-17  Martin Baulig  <martin@ximian.com>
2979
2980         * anonymous.cs
2981         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2982         inherit the scope from our parent.  Fixes #76653.
2983
2984 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2985
2986         * doc.cs : the previous patch does not actually fix the bug.
2987           PropertyInfo override check is now implemented and really fixed it.
2988         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2989
2990 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2991
2992         * doc.cs : apply "override filter" also to properties.
2993           Fixed bug #76730.
2994
2995 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2996
2997         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2998           no need to check overrides. For classes, omit those results from 
2999           interfaces since they must exist in the class. Fixed bug #76726.
3000
3001 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3002
3003         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3004           with different parameters. Fixed the second problem in #76685.
3005
3006 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3007
3008         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3009           get expected 'protected' access in CheckValidFamilyAccess()).
3010           Fixed bug #76692.
3011
3012 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3013
3014         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3015           Fixed bug #76705.  CS1569 was incorrectly commented out.
3016
3017 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3018
3019         * doc.cs : use Invocation.IsOverride() to do real override check.
3020         * expression.cs : made Invocation.IsOverride() internal.
3021
3022 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3023
3024         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3025           TypeBuilder.FindMembers() and filter overriden base members out.
3026           Fixed bug #76990.
3027
3028 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3029
3030         * doc.cs : ref/out parameters are represented as '@' (instead of
3031           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3032
3033 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3034
3035         * doc.cs : when there was no '.' in cref to methods in doc comment,
3036           then parameters were missing in the output. Fixed bug #76691.
3037
3038 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3039
3040         * driver.cs : don't output docs when there is an error.
3041           Fixed bug #76693.
3042
3043 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3044
3045         * doc.cs :
3046           Now it should detect indexers. Fixed primary concern in bug #76685.
3047           Fixed CS0419 message to not show the identical member signature in
3048           the message.
3049
3050 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3051
3052         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3053           instead of Type.FindMembers() since it does not handle events.
3054           Fixed bug #71604.
3055
3056 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3057
3058         * codegen.cs: Fixed typo (speficied -> specified).
3059
3060 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3061
3062         Fix #76369.
3063         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3064
3065 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3066
3067         * attribute.cs: Changed error message.
3068
3069         * cs-tokenizer.cs: One more check.
3070
3071 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3072
3073         * statement.cs (Block.Resolve): Ignore empty statement.
3074
3075 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3076
3077         * report.cs: Made error/warning methods more strict to avoid
3078         their misuse.
3079
3080         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3081         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3082         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3083         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3084
3085 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3086
3087         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3088         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3089
3090         * class.cs (TypeContainer.IsComImport): New property.
3091         (Constructor.Define): Create proper ctor for ComImport types.
3092
3093         * expression.cs (New.CheckComImport): Fixed.
3094
3095 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3096
3097         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3098         that a parameter has been captured does not mean that we do not
3099         have to do the rest of the processing.  This fixes the second part
3100         of #76592.  If there was another anonymous method capturing
3101         values in the past, the Scope would never be set for the second
3102         method that captured the same parameter.
3103
3104         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3105         properly manipulate the stack.   Second part of fix for #76592.
3106
3107         * expression.cs (New): Add support for invoking "new" on
3108         interfaces that have been flagged with the ComImport attribute and
3109         the CoClass.  Fixes #76637 
3110
3111         * statement.cs (Try.DoEmit): When a variable is captured, do not
3112         try to emit the vi.LocalBuilder variable as it has been captured.
3113         Create a temporary variable and store the results on the
3114         FieldBuilder.  Fixes #76642
3115
3116 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3117
3118         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3119
3120         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3121
3122         * expression.cs (Binary.DoResolve): Added && optimalization.
3123     
3124         * typemanager.cs (AddUserType): Removed useless argument.
3125
3126 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3127
3128         * statement.cs (Block.variables): Uses ListDictionary.
3129
3130 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3131
3132         Fix #75969.
3133         * class.cs (PartialContainer.EmitType): Customized to emit
3134         security attributes.
3135         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3136         for partial classes.
3137
3138 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3139
3140         Fix #76599.
3141         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3142         access has to be fixed.
3143         
3144         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3145
3146 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3147
3148         Fix #76590.
3149         * ecore.cs (NullCast.Reduce): Implemented.
3150
3151         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3152         constant type.
3153         
3154         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3155         properly.
3156         (Foreach.Resolve): Catch null properly.
3157
3158 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3159  
3160         * cs-tokenizer.cs: Warning text fix.
3161
3162         * driver.cs: AllWarningNumbers exposed on public interface.
3163
3164         * report.cs (): Reviewed warning numbers.
3165         (IsValidWarning): Use binary search.
3166
3167 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3168  
3169         * driver.cs: Implemeted resource visibility.
3170         (Resources): New class for code sharing between /res: and
3171         /linkres:
3172  
3173 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3174
3175         Fix #76568.
3176         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3177         folding.
3178         
3179         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3180         contants only.
3181         
3182         * ecore.cs (NullCast): Child is contant only.
3183         
3184         * literal.cs (NullLiteral.Reduce): null can be converted to any
3185         reference type.
3186
3187 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3188
3189         * driver.cs: Use Encoding.Default as default code page instead
3190           of ISO-28591.
3191
3192 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3193
3194         Fix #76085.
3195         * expression.cs (Invocation.Error_InvalidArguments): Handle
3196         __arglist parameters.
3197         (Invocation.VerifyArgumentsCompat): Likewise.
3198         * support.cs (ReflectionParameters.GetSignatureForError): Print
3199         __arglist parameters.
3200         (InternalParamters.GetSignatureForError): Likewise.
3201         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3202
3203 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3204
3205         * attribute.cs (GetPropertyValue): Made public.
3206
3207         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3208         Resolve.
3209         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3210         attribute.
3211         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3212         is not defined.
3213         
3214         * driver.cs: Reflect method name change.
3215         
3216         * statement.cs (Try.Resolve): Warn when try has both general
3217         exception handlers.
3218         
3219         * typemanager.cs: runtime_compatibility_attr_type new predefined
3220         type.
3221
3222 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3223
3224         Fix #76419.
3225         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3226         treat it as an empty parameter list.
3227
3228 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3229
3230         Fix #76271.     
3231         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3232         ResolveAsTypeStep silent.
3233         * statement.cs (Block.AddConstant): Mark block as used.
3234         (Block.ResolveMeta): Avoid piling on error messages
3235         if a constant initializer resolution fails.
3236
3237 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3238
3239         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3240         Remove.
3241         (NamespaceEntry.VerifyAllUsing): New.
3242         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3243         behaviour.  Delegates actual resolution of alias to ...
3244         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3245         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3246         Update.
3247         * driver.cs (Driver.MainDriver): Update.
3248         
3249         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3250         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3251         property.
3252         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3253         Remove.
3254         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3255         RootNamespace.DefineNamespacesForAll.
3256
3257 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3258
3259         * typemanager.cs (assemblies, external_aliases, modules)
3260         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3261         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3262         overhead.  Move resposibility ...
3263         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3264         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3265
3266 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3267
3268         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3269         cached_namespaces.  Improve usage.
3270         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3271         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3272         Move from GlobalRootNamespace and simplify.
3273         (RootNamespace.Global): Make instance variable.
3274         (RootNamespace.RootNamespace): Add "alias name" parameter.
3275         (GlobalRootNamespace): Simplify drastically.
3276         (Namespace.Lookup): Don't use GetNamespace.
3277         * typemanager.cs (GetRootNamespace): Rename from
3278         ComputeNamespaceForAlias.
3279         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3280
3281 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3282
3283         * anonymous.cs (AnonymousContainer): Don't crash when container
3284         doesn't exist.
3285
3286 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3287
3288         * expression.cs (Binary.DoResolve): Warn when comparing same
3289         values.
3290
3291 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3292
3293         Fix #76486.
3294         * expression.cs (Binary.DoResolve): It looks like there are no
3295         convetsion rules in enum context.
3296
3297 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3298
3299         Add support for extern alias qualifiers.
3300         * typemanager.cs: Move some LookupTypeReflection code
3301         to namespace.cs, to have cleaner code. Added some methods
3302         to help us keep track of the extern aliased references.
3303         * driver.cs: Add suport for extern alias assemblies on command
3304         line and check for their warnings/errors. Also keep track of the
3305         extern aliased assemblies.
3306         * namespace.cs: Move the global functionality of Namespace
3307         to GlobalRootNamespace/RootNamespace. Now the global namespace
3308         is GlobalRootNamespace.Globa. Also the code moved from 
3309         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3310         Finally added LocalAliasEntry (AliasEntry before) and
3311         ExternAliasEntry, to handle alias statements.
3312         * cs-parser.jay: Add support in the grammar for extern alias
3313         statement.
3314         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3315         Update callings to Namespace (now in GlobalRootNamespace).
3316
3317 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3318
3319         Fix #76371.
3320         * class.cs (TypeContainer.DefineType): Move updating of
3321         topological sort earlier in the code.
3322         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3323
3324 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3325
3326         Fix #76273.
3327         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3328         
3329         * constant.cs (Constant.TryReduce): Moved from Cast class.
3330         (Reduce): Made little bit more OO and fixed missing conversions.
3331         
3332         * ecore.cs (Reduce): Implemented.
3333         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3334         
3335         * literal.cs (Reduce): Implemented.
3336         
3337         * class.cs: Reverted Miguel's wrong commit.
3338
3339 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3340
3341         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3342
3343 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3344
3345         * cs-parser.jay, expression.cs : CS0214 was missing error location
3346           for constants. Fixed bug #76404.
3347
3348 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3349
3350         Fix #76370.
3351         * convert.cs (ExplicitConversionCore): Fixed object->enum
3352         conversion.
3353
3354 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3355
3356         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3357         InstanceExpression.
3358         (PropertyExpr.EmitCall): Likewise.
3359         * expression.cs (Invocation.EmitArguments): Handle case where
3360         arguments == null.
3361         (Invocation.EmitCall): Avoid allocating temporary variable if
3362         there are no arguments.
3363
3364 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3365
3366         Fix #76323.
3367         * convert.cs (ImplicitConversionStandard): Move conversion of
3368         void* to arbitrary pointer types ...
3369         (ExplicitConversionStandard): .. here.
3370         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3371         error to always print typenames.
3372
3373 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3374
3375         * convert.cs (GetConversionOperator): Rename from
3376         GetConversionOperators.  Move operator selection code from ...
3377         (UserDefinedConversion): ... here.
3378
3379 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3380
3381         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3382         conversion.
3383
3384 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3385
3386         * assign.cs (Assign.DoResolve): Error method changed.
3387
3388         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3389         
3390         * const.cs (ResolveValue): Reset in_transit immediately.
3391         
3392         * constant.cs: Error method changed.
3393         
3394         * convert.cs: Removed useless location parameter.
3395         (ExplicitNumericConversion): Don't do double enum check.
3396         (ExplicitConversionCore): Renamed from ExplicitConversion.
3397         (ExplicitUnsafe): Extracted from ExplicitConversion.
3398         (ExplicitConversion): Uses for error reporting.
3399         
3400         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3401         error messages.
3402         (ResolveBoolean): Uses common error method.
3403         (CastToDecimal): Get rid of ec.
3404         (CastFromDecimal): Optimized.
3405         (ConvCast): Get rid of ec.
3406         
3407         * enum.cs (ResolveValue): Reset in_transit immediately.
3408         (Emit): Return after first error.
3409         
3410         * expression.cs: Convert changes.
3411         
3412         * literal.cs: Error method changed.
3413         
3414         * statement.cs: Error method changed.
3415
3416 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3417
3418         * support.cs (SeekableStreamReader.Position): Don't error out when
3419         the requested position is just beyond the end of the current
3420         buffered data.
3421
3422 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3423
3424         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3425         try to keep in sync with the byte count of the underlying Stream.
3426         However, this limits us to a window size of 2048 characters: i.e.,
3427         the maximum lookahead of our lexer/parser can be 2048 characters.
3428
3429 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3430
3431         Fix #76255.
3432         * driver.cs: Fix compilation files with full root path.
3433
3434 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3435
3436         * report.cs (SymbolRelatedToPreviousError): Format the output so
3437         it does not use an open parenthesis that is never closed. 
3438
3439         * driver.cs: Follow coding guidelines
3440
3441 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3442
3443         Fix #72930.
3444         * const.cs (Const.ResolveValue): Check for assigning non-null
3445         value to reference type.
3446
3447 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3448
3449         * anonymous.cs: Implemented ExprClassName.
3450         
3451         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3452         delegate.
3453         
3454         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3455         check.
3456         
3457         * class.cs (StaticClass.DefineContainerMembers): Report protected
3458         members as error.
3459         
3460         * codegen.cs: if(ed) PRODUCTION.
3461         
3462         * convert.cs (Error_CannotImplicitConversion): Better error
3463         distinction.
3464         
3465         * cs-parser.jay: More error checks.
3466         
3467         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3468         
3469         * driver.cs (CSCParseOption): Enabled wrong option check.
3470         
3471         * ecore.cs (Expression.ExprClassName): Turned to property.
3472         (MemberExpr.CheckIntermediateModification): For checking boxed
3473         value types     modification.
3474         
3475         * statement.cs (Fixed.Resolve): Expression type must be
3476         convertible to fixed type.
3477         (CollectionForeach.GetEnumeratorFilter,TryType):
3478         Small refactoring for easier error checking.
3479
3480 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3481
3482         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3483         attributes.
3484         
3485         * class.cs (GeneratedBaseInitializer): New class for customization
3486         compiler generated initializers.
3487         (MemberBase.DoDefine): Check Obsolete attribute here.
3488         (FieldMember.DoDefine): Ditto.
3489         
3490         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3491         constants.
3492         
3493         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3494         (MemberCore.GetObsoleteAttribute): Removed argument.
3495         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3496         (MemberCore.CheckObsoleteType): New helper.
3497         
3498         * delegate.cs,
3499         * enum.cs,
3500         * statement.cs: Updates after MemberCore changes.
3501         
3502         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3503         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3504         
3505         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3506         obsolete attribute for compiler construct.
3507         (As.DoResolve): Cache result.
3508         
3509         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3510
3511 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3512
3513         Fix #76133.
3514         * expression.cs (This.VerifyFixed): In a value type T, the type of
3515         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3516         value type R, 'this' is treated as a value parameter.
3517
3518 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3519
3520         * statement.cs (Lock): Use the TemporaryVariable class instead of
3521         manually using local variables as those do not work when variables
3522         are captured.
3523
3524         * ecore.cs: Moved the TemporaryVariable class from being a nested
3525         class inside Foreach to be a public class that can be employed in
3526         other places. 
3527
3528 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3529
3530         * cs-parser.jay: interface_accessors replaced by
3531         accessor_declarations.
3532
3533         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3534         location.
3535         
3536         * statement.cs (GotoCase.Resolve): Convert null constant to
3537         null case.
3538         (SwitchLabel.ResolveAndReduce): Ditto.
3539         (SwitchLabel.NullStringCase): Custom null stamp.
3540         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3541         
3542         typemanager.cs (CSharpSignature): Don't skip first argument
3543         for full names.
3544
3545 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3546
3547         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3548
3549         * location.cs (InEmacs): in this mode, do not report column
3550         location as it confuses Emacs.
3551
3552 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3553
3554         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3555         expression.cs, iterators.cs, literal.cs: Store constants and
3556         literals location.
3557         
3558         * class.cs (MemberBase.ShortName): Pass location.
3559         
3560         * cs-parser.jay: Some location fixes.
3561         
3562         * ecore.cs (Expression.Location): Made virtual.
3563
3564 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3565
3566         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3567         if the underlying types are the same, otherwise we need to produce
3568         code that will do the proper cast.
3569
3570         This was exposed by Marek's constant rewrite which produced
3571         invalid code for the call site:
3572
3573         enum X : long { a }
3574         void Method (X v) {}
3575
3576         Method ((X) 5)
3577
3578         This fixes test-49.cs
3579
3580 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3581
3582         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3583           Type/Object should be allowed as well. Fixed bug #75968.
3584
3585 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3586
3587         * expression.cs : (Binary.DoResolve): when one is enum constant and
3588           another is constant 0, then return enum one *as enum type*.
3589           Fixed bug 74846.
3590
3591 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3592
3593         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3594         internal.
3595
3596         Fix #75941.
3597         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3598         flow-branching for LocalVariableReferences in case we were invoked
3599         from a MemberAccess.
3600         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3601         Carved out of ...
3602         (LocalVariableReference.DoResolveBase): ... this.
3603         (MemberAccess.Resolve): Do the check that was disabled during
3604         SimpleNameResolve.
3605
3606 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3607
3608         * class.cs :
3609           (PartialContainer.Create): check abstract/sealed/static strictly
3610           but abstract/sealed can exist only at one side. Fixed bug #75883.
3611
3612 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3613
3614         Fix #75945.
3615         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3616         specified, don't default to UnmanagedType.I4.
3617
3618 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3619
3620         * expression.cs : conditional operator should check possibly
3621           incorrect assign expression. Fixed bug #75946.
3622
3623 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3624
3625         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3626           Reverting the change. gmcs is much complex than mcs on this matter.
3627
3628 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3629
3630         * cs-tokenizer.cs : To read another token ahead of the actual 
3631           consumption, use new SavedToken and cache token instead of moving
3632           back the stream with SeekableStreamReader (it seemed problematic).
3633         * cs-parser.jay,
3634           driver.cs : Thus use StreamReader directly.
3635         * support.cs : Thus removed SeekableStreamReader.
3636
3637 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3638
3639         Fix #75934.
3640         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3641         (ScopeInfo.EmitScopeType): Use it to construct field names from
3642         names of captured locals.
3643
3644         Fix #75929.
3645         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3646         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3647         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3648         (ExplicitConversion): Remove enum cases already handled by
3649         implicit conversion.  Move implicit conversion check to the beginning.
3650         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3651         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3652         Don't treat System.Enum as a struct.
3653
3654 2005-08-30  Jb Evain  <jbevain@gmail.com>
3655
3656         * attribute.cs: handles as expression in parameters.
3657
3658 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3659
3660         Fix #75802.
3661         * class.cs (TypeContainer.VerifyClsName): Don't use a
3662         PartialContainer when verifying CLS compliance.
3663         (AbstractPropertyEventMethod): Set Parent here, ...
3664         (PropertyMethod): ... not here.
3665
3666 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3667
3668         * attribute.cs : escaped attribute name should not be allowed to be
3669           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3670
3671 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3672
3673         Fix #75927.
3674         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3675         when converting a long constant to unsigned long.
3676         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3677         detect where IsApplicable and VerifyArgumentsCompat disagree.
3678
3679 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3680         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3681
3682         Fix #75848.
3683         * class.cs (TypeContainer.CanElideInitializer): New helper.
3684         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3685         can safely emitting the initializer of a field.
3686
3687 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3688
3689         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3690           allowed inside a switch (without loop). Fixed bug #75433.
3691
3692 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3693
3694         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3695         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3696
3697 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3698
3699         * driver.cs : kinda reverting the default encoding changes (not exact 
3700           revert since I noticed that "codepage:reset" might not work fine).
3701
3702 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3703
3704         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3705           Location. Now getter and setter store location correctly.
3706           (errors/cs0111-12.cs now reports the expected location.)
3707
3708 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3709
3710         * driver.cs : Use default encoding on the environment.
3711           Removed (now that) extra parameter for SeekableStreamReader.
3712         * support.cs : (SeekableStreamReader) third .ctor() argument for
3713           StreamReader is not required (always true). preamble size could
3714           be acquired in simpler and safe way.
3715
3716 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3717
3718         * cs-parser.jay: report CS0642 at warning level 3
3719           and report CS0642 for an if else statement also
3720           fixes bug #74745. Patch by John Luke (and a bit
3721           modified by me).
3722           Removed extra CS0642 warning check for "while",
3723           "for" and "fixed".
3724         * statement.cs: In Block.Resolve(), CS0642 check
3725           is reimplemented to check a sequence of an empty
3726           statement and a block.
3727
3728           Both fix bug #66777.
3729
3730 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3731
3732         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3733         detection until I fix it.
3734         
3735         * cs-tokenizer.cs: Changed error message.
3736         
3737         * cs-parser.jay: Fixed 2 error locations.
3738         
3739         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3740         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3741         properties.
3742         
3743         * enum.cs (GetSignatureForError): Fixed.
3744         
3745         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3746         method detection.
3747         
3748         * class.cs,
3749         * typemanager.cs (RegisterProperty): Removed.
3750         
3751         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3752
3753 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3754
3755         Fix #75874.
3756         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3757         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3758
3759 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3760
3761         * expression.cs : tiny fix is required for not warning positive ulong.
3762           See test-441.cs.
3763
3764 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3765
3766         * expression.cs : add CS0652 check for constant and integral
3767           expression. Fixed bug #53974.
3768
3769 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3770
3771         * expression.cs : in DoNumericPromotions(), check if there is implicit
3772           conversion overload for string (to check CS0034). Fixed bug #52492.
3773
3774 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3775
3776         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3777
3778 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3779
3780         * ecore.cs : report location when it is *not* Null.
3781
3782 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3783
3784         * codegen.cs,
3785           ecore.cs,
3786           flowanalysis.cs,
3787           expression.cs:
3788           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3789           correctly. Fixed bug #75721.
3790
3791 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3792
3793         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3794         loop that performs 'min (pos, char_count)'.
3795
3796         Fix #75862.
3797         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3798         converted value in Operator.OnesComplement.
3799
3800 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3801
3802         * anonymous.cs: If the anon method is pulled into a helper class,
3803         it needs to be `internal' not `private'. Fixes runtime behavior on
3804         msft. bug #75704
3805
3806 2005-08-20  Martin Baulig  <martin@ximian.com>
3807
3808         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3809         scope if we don't already have it.
3810
3811         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3812         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3813         fixes #75867.
3814
3815 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3816
3817         Fix #75803
3818         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3819         is a partial class.
3820
3821 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3822
3823         The big constants rewrite
3824         Fix #75746, #75685 and more
3825         As a side effect saved 1MB for MWF ;-)
3826         
3827         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3828         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3829         enum based for corlib compilation.
3830         
3831         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3832         subtractions.
3833         
3834         * class.cs (FixedField.Define): Use ResolveAsConstant.
3835         
3836         * const.cs (IConstant): Interface constants and enums.
3837         (Const.ResolveValue): New method for constant resolvning.
3838         (ExternalConstant): Constants from imported assemblies.
3839         
3840         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3841         conversion; like enums.
3842         (Constant.ToType): Converts this constant to different type.
3843         (Constant.Increment): Adds 1.
3844         
3845         * convert.cs (ImplicitConversionRequired): Simplified.
3846         
3847         * cs-parser.jay: Create EnumMember directly.
3848         
3849         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3850         
3851         * doc.cs (GenerateEnumDocComment): Removed.
3852         
3853         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3854         (ConvertIntLiteral): Removed.
3855         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3856         
3857         * enum.cs (EnumMember): Implement IConstant.
3858         (Enum.IsValidEnumConstant): Removed.
3859         (Enum.GetNextDefaultValue): Removed.
3860         (Enum.FindMembers): Updated.
3861         (Enum.GenerateDocComment): Iterate enum members.
3862         
3863         * expression.cs (Cast.TryReduce): Handle enums correctly.
3864         (New.Constantify): Made public.
3865         (MemberAccess.DoResolve): Removed contant specific if(s).
3866         
3867         * literal.cs (NullLiteral): Implement new abstract methods.
3868         
3869         * statement.cs (GotoCase.Resolve): Use new constant methods.
3870         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3871         
3872         * typemanager.cs (LookupEnum): Removed.
3873         (IsEnumType): Fixed to work with corlib.
3874         (RegisterConstant): Removed.
3875         (LookupConstant): Removed.
3876         (GetConstant): Changed to work with IConstant.
3877
3878 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3879
3880         * location.cs : Fixed overflown (>255) column number.
3881
3882 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3883
3884         First cut of the qualified-alias-member feature.
3885         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3886         token.
3887         * cs-parser.jay (DOUBLE_COLON): New token.
3888         (namespace_or_type_name): Add rule for recognizing
3889         qualified-alias-members.
3890         (primary_expression): Likewise.
3891         (element_access): Allow QualifiedAliasMember as a possible
3892         type-bearing expression.
3893         (local_variable_type, local_variable_pointer_type): Likewise.
3894         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3895         aliases in the current and enclosing namespace declarations.
3896         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3897         * decl.cs (MemberName.is_double_colon): New.
3898         (MemberName.MemberName): Add new constructor for alias-member.
3899         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3900         * expression.cs (QualifiedAliasMember): New expression type.
3901
3902 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3903
3904         * location.cs : it borked when no argument was specified.
3905
3906 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3907
3908         * location.cs : tiny ToString() format fix.
3909
3910 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3911
3912         * statement.cs : oops, it was missing.
3913
3914 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3915
3916         A set of fixes for precise line/column location.
3917
3918         * location.cs :
3919           "token" field now holds a file/line "delta", a line number offset 
3920           from the segment, and a column number. See also:
3921           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3922           December/009508.html
3923           Removed static IsNull. Use instance IsNull property instead.
3924         * cs-tokenizer.cs :
3925           For some tokens it stores Location. For Identifier it stores
3926           LocatedToken which is a pair of string name and location.
3927           Column numbers are adjusted only at getChar().
3928         * report.cs :
3929           Use Location.ToString() for reporting (it now contains column).
3930         * cs-parser.jay :
3931           Largely modified to use LocatedToken instead of
3932           string (IDENTIFIER), and to acquire Location from some tokens.
3933         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3934           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3935           codegen.cs :
3936           Now MemberName holds Location. DeclSpace.ctor() receives Location
3937           as a parameter. Removed extra parameters to all derived classes.
3938           Replaced Location.IsNull() with instance property.
3939         * assign.cs, expression.cs :
3940           Added .ctor() overload that omits Location.
3941         * attribute.cs :
3942           Added "nameEscaped" flag that indicates the identifier was escaped
3943           in the source file. This fixes bug #57047.
3944
3945 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3946
3947         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3948         New method, looking for lo-case imported cls type.
3949
3950         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3951         here.
3952
3953         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3954
3955         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3956
3957         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3958         all_imported_types.
3959         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3960
3961         Optimized to save 3.5 MB for SWF compilation.
3962
3963 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3964
3965         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3966         (PartialContainer.Create): Moved logic AddToContainer.
3967         (PartialContainer.MarkForDuplicationCheck): Shares name.
3968         
3969         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3970         place.
3971         
3972         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3973         initialization.
3974         (Namespace.GetSignatureForError): New method.
3975         
3976         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3977         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3978
3979 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3980
3981         Fix #75669.
3982         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3983         member lookup rather than qualifier_type, since qualifier_type can
3984         be null.
3985
3986 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3987
3988         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3989         enum member.
3990
3991 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3992
3993         * statement.cs: Copy the local exception into the exception
3994         captured local.  Fixes 75674
3995
3996 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3997
3998         Fix #75658.
3999         * expression.cs (Invocation.OverloadResolve): Don't report error
4000         CS1501 if error CS1502 has been reported.
4001         (New.DoResolve): Delegate CS1501 reporting to
4002         Invocation.OverloadResolve.
4003
4004         Fix #75656.
4005         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4006         invariant-meaning-in-block property in an enclosing block if
4007         necessary.
4008
4009 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4010
4011         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4012         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4013         (Switch.CheckSwitch): Just save 50kb for SWF.
4014
4015 2005-07-27  Martin Baulig  <martin@ximian.com>
4016
4017         * anonymous.cs (CaptureContext.AddField): Added
4018         `AnonymousContainer am' argument; compute its toplevel scope if
4019         it's not already computed.  Fixes #75649.
4020
4021 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4022
4023         Fix #75628.
4024         * class.cs (Constructor.Emit): Reset block to null if the block
4025         resolve fails.
4026
4027 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4028
4029         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4030
4031 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4032
4033         * class.cs (MethodData.Define): Check whether accessor implementing
4034         interface is public.
4035
4036         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4037
4038 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4039
4040         Fix #57245
4041         * namespace.cs (LookupType): Moved same type check to...
4042         
4043         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4044         with the same name.
4045
4046 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4047
4048         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4049         already found a typebuilder.
4050         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4051         MemberNames, not strings.
4052
4053         * const.cs (Error_ExpressionMustBeConst): 
4054         Rename from Error_EpressionMustBeConst.
4055         * const.cs, class.cs, statement.cd: Update.
4056
4057 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4058
4059         Fix #65573
4060
4061         * const.cs (Const.LookupConstantValue): Report missing contant expression
4062         everytime.
4063         (Error_EpressionMustBeConstant): Only one error method.
4064
4065         * class.cs, statement.c: Updated.
4066
4067 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4068
4069         * statement.cs (Block.Flags): Add back HasVarargs.
4070         (Block.flags): Make protected.
4071         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4072
4073         * typemanager.cs (types, typecontainers, user_types): Remove.
4074         (UserTypes, TypeContainers): Likewise.
4075         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4076         (CleanUp, Reset): Update.
4077         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4078         (GetNestedType): Use Type.GetNestedType.
4079         (CoreLookupType): Take two arguments, the namespace and the
4080         basename of the type.  Update to use the Namespace.Lookup
4081         mechanism.
4082         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4083         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4084         string concatenation and substring matches.
4085         * class.cs, enum.cs, delegate.cs: Update to changes.
4086
4087 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4088
4089         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4090         Expression and made virtual.
4091
4092         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4093         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4094
4095         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4096
4097         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4098         error message.
4099
4100         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4101         change.
4102
4103 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4104
4105         Fix #57707
4106         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4107         AssemblyCultureAttribute is not used on executable.
4108
4109         * rootcontext.cs,
4110         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4111
4112 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4113
4114         Fix #60638.
4115         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4116         New.  Reports CS0252/CS0253.
4117         Mostly taken from preliminary patch by Duncak Mak.
4118         (Binary.DoResolveOperator): Store results of operator lookup.
4119         Use them to detect if we need to warn about unintended reference
4120         comparisons.
4121
4122 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4123
4124         Fix #72969.
4125         * namespace.cs (Namespace.Lookup): Add back location parameter.
4126         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4127         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4128
4129         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4130         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4131         (Namespace.LookupType): ... this.
4132         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4133         of namespaces.
4134         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4135         purported to handle pointers.
4136         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4137         CoreLookupType.
4138
4139 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4140
4141         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4142         type as namespace.
4143
4144 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4145
4146         * namespace.cs (Namespace.Lookup): Drop location parameter.
4147         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4148         (NamespaceEntry.Lookup): ... this.
4149         (NamespaceEntry.Error_AmbiguousTypeReference):
4150         Move here from DeclSpace.
4151         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4152         names ...
4153         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4154         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4155         Move to NamespaceEntry.
4156         * delegate.cs, expression.cs: Update to changes.
4157
4158 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4159
4160         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4161         CheckAttributeType and refactored.
4162         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4163         ResolveAsTypeTerminal error handling.
4164         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4165         handling.
4166         (GetSignatureForError): Print errors in same way.
4167
4168         * class.cs,
4169         * codegen.cs: Reflect attribute GetSignatureForError change.
4170
4171         * ecore.cs,
4172         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4173
4174         * namespace.cs (UsingEntry): Refactored to make fields private.
4175
4176         * assign.cs,
4177         statement.cs: Error_UnexpectedKind has extra parameter.
4178
4179 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4180
4181         * ecore.cs (IAlias): Remove.
4182         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4183         that implement the interface.
4184         * namespace.cs (Namespace): Likewise.
4185         (Namespace.declspaces): Renamed from 'defined_names'.
4186         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4187         DeclSpace instead of an IAlias.
4188         * tree.cs (Tree.AddDecl): Update.
4189
4190 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4191
4192         * statement.cs (Block.Flags); Remove HasVarargs.
4193         (Block.HasVarargs): Move to ToplevelBlock.
4194         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4195         (Block.Variables): Make protected.  Initialize variable hashtable
4196         if necessary.
4197         (Block.AddVariable): Update.
4198         (Block.Resolve): Update to changes.
4199         (ToplevelBlock.HasVarargs): New boolean.
4200         (ToplevelBlock.ThisVariable): Move here from Block.
4201         (ToplevelBlock.AddThisVariable): Likewise.
4202         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4203         * expression.cs (This.ResolveBase): Update to changes.
4204         (ArglistAccess.DoResolve): Likewise.
4205
4206 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4207
4208         Fix #75321
4209         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4210
4211         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4212         not used and not used & assigned.
4213         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4214
4215 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4216
4217         Fix #75053
4218         * expression.cs (Is.DoResolve): null is never provided type.
4219
4220 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4221
4222         Fix #52496
4223         * cs-parser.jay: Less strict event error rule to catch more errors.
4224
4225 2005-07-08  Martin Baulig  <martin@ximian.com>
4226
4227         Fix test-iter-10.cs - distinguish whether we `yield' in a property
4228         gettter (allowed) or setter (not allowed).
4229
4230         * class.cs (Accessor): Implement IIteratorContainer.
4231         (Accessor.Yields): New public field.
4232         (PropertyBase.PropertyMethod.Define): Handle iterators on a
4233         per-accessor basis.
4234
4235         * cs-parser.jay
4236         (get_accessor_declaration, set_accessor_declaration): Set the
4237         `yields' flag on the accessor, not the property.
4238         (property_declaration): Do the iterators check on a per-accessor
4239         basis and not for the whole property.
4240
4241 2005-07-08  Martin Baulig  <martin@ximian.com>
4242
4243         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4244         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4245
4246 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4247
4248         Fix #74975
4249         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4250         (ExtractSecurityPermissionSet): Cope with self referencing security
4251         attributes properly.
4252
4253         * driver.cs (SetOutputFile): Made public property OutputFile.
4254
4255 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4256
4257         Fix #75486.
4258         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4259         has_nonstatic_fields.  Make into a FieldBase pointer.
4260         (TypeContainer.AddField): Add CS0282 check.
4261         (TypeContainer.EmitType): Update.
4262
4263 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4264
4265         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4266         compare if they start with __.
4267
4268 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4269
4270         * statement.cs (Switch.SwitchGoverningType): Only look at
4271         UserCasts that don't need implicit standard conversions to one of
4272         the allowed switch types (Fixes test-322.cs).
4273         (LocalInfo.Resolve): Re-enable sanity-test.
4274
4275 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4276
4277         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4278         
4279         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4280         
4281         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4282
4283 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4284
4285         Fix #75472.
4286         * ecore.cs (SimpleName.GetSignatureForError): Add.
4287         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4288         (MemberAccess.GetSignatureForError): Add.
4289
4290 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4291  
4292         The big error and warning messages review.
4293         
4294         * anonymous.cs,
4295         * assign.cs,
4296         * attribute.cs,
4297         * class.cs,
4298         * codegen.cs,
4299         * convert.cs,
4300         * cs-parser.jay,
4301         * cs-tokenizer.cs,
4302         * decl.cs,
4303         * delegate.cs,
4304         * doc.cs,
4305         * driver.cs,
4306         * ecore.cs,
4307         * enum.cs,
4308         * expression.cs,
4309         * flowanalysis.cs,
4310         * iterators.cs,
4311         * literal.cs,
4312         * location.cs,
4313         * modifiers.cs,
4314         * namespace.cs,
4315         * parameter.cs,
4316         * pending.cs,
4317         * report.cs,
4318         * rootcontext.cs,
4319         * statement.cs,
4320         * support.cs,
4321         * tree.cs,
4322         * typemanager.cs: Updated.
4323         
4324         * class.cs: (MethodCore.SetYields): Moved here to share.
4325         (PropertyMethod.Define): Moved iterator setup here.
4326         
4327         * iterators.cs: Add orig_method to have full access to parent
4328         container.
4329
4330 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4331
4332         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4333         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4334         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4335         variable of struct type.
4336         * expression.cs (Unary.ResolveOperator): Update to change.
4337         (Indirection.VerifyFixed): Likewise.
4338         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4339         (ParameterReference.VerifyFixed): Value parameters are fixed.
4340         (This.VerifyFixed): Treat 'this' as a value parameter.
4341         * statement.cs (LocalInfo.IsFixed): Remove.
4342
4343 2005-07-01  Martin Baulig  <martin@ximian.com>
4344
4345         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4346         `ec.EmitThis ()' to get the correct scope.
4347
4348 2005-07-01  Martin Baulig  <martin@ximian.com>
4349
4350         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4351         instance is a ParameterReference; fixes #75299.
4352
4353 2005-07-01  Martin Baulig  <martin@ximian.com>
4354
4355         Reverted Marek's latest patch (r46725):
4356         - it contains structural changes which are neither mentioned in
4357           the ChangeLog nor explained anywhere; for example the additional
4358           argument of EmitContext's and Iterator's .ctor's and the
4359           TypeContainer.DefineMembers() change.
4360         - structural changes like this should go in in seperate patches
4361           and not be hidden in a huge patch which just seems to affect
4362           warnings and errors.
4363           a big and hard to understand patch.
4364         - it breaks iterators and causes regressions, for instance in
4365           test-iter-03.cs.      
4366
4367 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4368
4369         Fix #75412.
4370         * expression.cs (Indexers.map): Remove.
4371         (Indexers.Append): Filter out inaccessible setters and getters.
4372         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4373
4374         Fix #75283.
4375         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4376         Refactored from ...
4377         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4378         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4379         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4380         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4381
4382 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4383
4384         Fix #75322
4385         * class.cs (FieldBase.GetInitializerExpression): One more field
4386         for backup.
4387
4388 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4389
4390         * pending.cs: Do not define a proxy if the base method is virtual,
4391         it will be picked up by the runtime (bug 75270).
4392
4393 2005-06-08  Martin Baulig  <martin@ximian.com>
4394
4395         The big Iterators rewrite :-)
4396
4397         * iterators.cs: Rewrite this to use the anonymous methods framework.
4398
4399         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4400         before the TypeContainers; see 2test-21.cs.
4401
4402         * class.cs
4403         (TypeContainer.DefineType): Don't create a new EmitContext if we
4404         already have one (this only happens if we're an Iterator).
4405         (TypeContainer.Define): Also call Define() on all our iterators.
4406         (Method.CreateEmitContext): Added support for iterators.
4407
4408         * anonymous.cs
4409         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4410         (AnonymousContainer.CreateMethodHost): Moved here from
4411         AnonymousMethod and made abstract.
4412         (AnonymousContainer.CreateScopeType): New abstract method.
4413         (AnonymousContainer.IsIterator): New public property.
4414         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4415         get the ScopeTypeBuilder rather than manually defining it here. 
4416         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4417         iterators here.
4418
4419         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4420         before RootContext.DefineTypes().
4421
4422         * codegen.cs (EmitContext.RemapToProxy): Removed.
4423         (EmitContext.CurrentAnonymousMethod): Changed type from
4424         AnonymousMethod -> AnonymousContainer.
4425         (EmitContext.ResolveTopBlock): Protect from being called twice.
4426         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4427         (EmitContext.EmitThis): Removed the iterators hacks; use the
4428         anonymous methods framework for that.
4429
4430         * statement.cs
4431         (ToplevelBlock.Container): Make this a property, not a field.
4432         (ToplevelBlock.ReParent): New public method; move the
4433         ToplevelBlock into a new container.
4434         (Foreach.TemporaryVariable): Simplify.
4435
4436 2005-06-05  Martin Baulig  <martin@ximian.com>
4437
4438         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4439         (Block.AddTemporaryVariable): New public method; creates a new
4440         `LocalInfo' for a temporary variable.
4441         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4442         variables here.
4443         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4444         non-iterator variables.
4445
4446 2005-06-05  Martin Baulig  <martin@ximian.com>
4447
4448         * statement.cs (Foreach.TemporaryVariable): Create the
4449         LocalBuilder in the Emit phase and not in Resolve since in some
4450         situations, we don't have an ILGenerator during Resolve; see
4451         2test-19.cs for an example.
4452
4453 2005-06-04  Martin Baulig  <martin@ximian.com>
4454
4455         **** Merged r45395 from GCS ****
4456
4457         The big Foreach rewrite - Part II.
4458
4459         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4460         with `PropertyInfo ienumerator_getcurrent'.
4461
4462         * codegen.cs (VariableStorage): Removed.
4463
4464         * statement.cs
4465         (Foreach): Derive from Statement, not ExceptionStatement.
4466         (Foreach.CollectionForeach): New nested class.  Moved all the code
4467         dealing with collection foreach here.
4468         (Foreach.ForeachHelperMethods): Removed.
4469         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4470
4471 2005-05-23  Martin Baulig  <martin@ximian.com>
4472
4473         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4474         don't need to.  Fix #75014.
4475
4476 2005-05-20  Martin Baulig  <martin@ximian.com>
4477
4478         Merged r44808 from GMCS.
4479
4480         * class.cs (TypeContainer.CircularDepException): Removed.
4481         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4482         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4483         (CS0146) and interface (CS0529) dependencies here.
4484
4485 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4486
4487         * expression.cs (Invocation.EmitCall): Fix initialization
4488         'this_call' to reflect current behaviour.  Fix indentation.
4489
4490         * convert.cs (FindMostEncompassedType): Add two trivial special
4491         cases (number_of_types == 0 || number_of_types == 1).
4492         (FindMostEncompasingType): Likewise.
4493
4494 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4495
4496         Some cleanups preparing for the fix of #75283.
4497         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4498         error testing.
4499         (EventExpr.InstanceResolve): Likewise.
4500         (EventExpr.DoResolve): Remove redundant checks.
4501
4502 2005-06-10  Duncan Mak  <duncan@novell.com>
4503
4504         * cs-tokenizer.cs (process_directives): New flag for controlling
4505         the processing of preprocessor directives.
4506         (x_token): After seeing a '#', return Token.NONE instead of going
4507         to handle_preprocessing_directive() when not processing
4508         directives. This avoids unnecessary processing during the token peek in
4509         is_punct().
4510
4511         This fixes #74939.
4512
4513         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4514         the existing error reporting methods instead of Report.Error.
4515
4516         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4517         after Raja's rewrite.
4518
4519 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4520
4521         * class.cs: Small fix.
4522
4523 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4524
4525         Fix #75160.
4526         * class.cs (GetPartialBases): Fix return value check of
4527         part.GetClassBases.
4528
4529 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4530
4531         Ensure that partial classes are registered in their enclosing
4532         namespace.  Initial part of fix of #75160.
4533         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4534         Register declspace with namespace here, not in
4535         DeclSpace.RecordDecl.
4536         * cs-parser.jay: Pass namespace to RecordDecl.
4537         * class.cs (PartialContainer.Create): Likewise.
4538         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4539         called.
4540         * decl.cs (Declspace.RecordDecl): Remove.
4541         * namespace.cs (NamespaceEntry.DefineName): Remove.
4542
4543 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4544
4545         * rootcontext.cs: Reset TargetExt as well.
4546
4547 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4548
4549         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4550         -langversion:ISO-1.
4551
4552 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4553
4554         Fix #75080, cs0119.cs.
4555         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4556         of ...
4557         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4558         allowing ExprClass.Type and ExprClass.Namespace for
4559         ResolveFlags.VariableOrValue.
4560         (Expression.Resolve) [1-argument variant]: Change default resolve
4561         flags based on language version.
4562         (Expression.Error_UnexpectedKind): Use a simple string array
4563         rather than an ArrayList.
4564         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4565         not ExprClass.Type.
4566         (TypeOfVoid.DoResolve): Likewise.
4567         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4568         flags argument -- it always has the same value.
4569
4570 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4571
4572         Fix #75081.
4573         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4574         Use it in the error message.
4575         * assign.cs, expression.cs, statement.cs: Update.
4576
4577 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4578
4579         Fix #75088.
4580         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4581         the "almostMatchedMember" case too.
4582         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4583         that failed the accessibility checks to 'almost_match'.
4584
4585 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4586
4587         * attribute.cs: Use internal MethodBuilder methods to set
4588         ExactSpelling and SetLastError on PInvoke methods, instead
4589         of passing them via charset.  Fixes #75060.
4590
4591 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4592
4593         * parameter.cs (Parameter): Remove TODO comment.
4594         (Parameter.DefineParameter): Remove Location parameter.
4595         (Parameters.LabelParameters): Likewise.
4596         * class.cs (Constructor.Emit): Update to change.
4597         (MethodData.Emit): Likewise.
4598         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4599         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4600
4601 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4602
4603         * parameter.cs,
4604           Removed Parameters.Location and added Parameter.Location instead.
4605           Removed Location parameter from Emit() and GetSignature().
4606         * anonymous.cs,
4607           class.cs,
4608           cs-parser.jay,
4609           delegate.cs,
4610           iterators.cs,
4611           statement.cs :
4612           Modified all related calls.
4613
4614 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4615
4616         Improve user-defined conversion handling.
4617         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4618         applicable operators.
4619         (AddConversionOperators): New.  Helper for GetConversionOperators.
4620         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4621         there is only one most encompassed/encompassing type.
4622         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4623         "applicable operator" handling.
4624         (UserConversion): Move cache here from GetConversionOperators.
4625         Directly cache the chosen operator, rather than the whole
4626         MethodGroup.
4627         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4628         case.  Allow conversion of decimal to sbyte and byte too.
4629         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4630         New static methods.  Used to avoid allocating EmptyExpressions in
4631         convert.cs.
4632
4633 2005-05-24  Duncan Mak  <duncan@novell.com>
4634
4635         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4636         another class, used in Convert.ExplicitNumericConversion.
4637         (CastToDecimal): New class, similar to above, but casts to
4638         System.Decimal, used in Convert.ImplicitNumericConversion and also
4639         in explicit convesion from double/float to decimal.
4640
4641         * convert.cs (ImplicitNumericConversion): Handle implicit
4642         conversions to System.Decimal.
4643         (ExplicitNumericConversion): handle explicit conversions to
4644         System.Decimal.
4645
4646         This fixes #68711.
4647         
4648 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4649
4650         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4651         know the type at this stage, just break through.   Fixes #75008 
4652
4653 2005-05-19  Martin Baulig  <martin@ximian.com>
4654
4655         * delegate.cs
4656         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4657         to disable error reporting.
4658
4659         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4660         here since we don't want to report an error; see the new test-336.cs.
4661
4662 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4663
4664         * statement.cs (ToplevelBlock.GetParameterReference)
4665         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4666         Move here from class Block.
4667         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4668         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4669
4670 2005-05-18  Martin Baulig  <martin@ximian.com>
4671
4672         Fix #74978.
4673
4674         * flowanalysis.cs
4675         (FlowBranching.Reachability): Add non-static public And() and Or()
4676         methods.
4677         (FlowBranchingSwitch): New class; do the `break_origins' thing
4678         like in FlowBranchingLoop.
4679         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4680         reachability, not just locals and parameters.
4681         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4682         switch; MergeBreakOrigins() now takes care of that.
4683
4684 2005-05-18  Martin Baulig  <martin@ximian.com>
4685
4686         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4687         a loop and may leave it, reset the barrier; fixes #74974.
4688
4689 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4690         
4691         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4692         is back.
4693         
4694         * cs-parser.jay: Catch more lexical errors.
4695         
4696         * report.cs: Add one more Error method.
4697         
4698         * rootcontext.cs,
4699         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4700
4701 2005-05-17  Martin Baulig  <martin@ximian.com>
4702
4703         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4704         #70970. 
4705
4706 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4707
4708         Fix test-382.cs.  Emit values of decimal constants.
4709         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4710         Carved out of ...
4711         (TypeContainer.AddField): ... this.
4712         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4713         with initializers to include 'Const's.
4714         (ClassPart.RegisterFieldForInitialization): Forward to
4715         PartialContainer.
4716         * const.cs (Const.Const): Pass initializer to base class.
4717         (Const.Define): In case of decimal constants, register them for
4718         initialization in a static constructor.
4719
4720 2005-05-14  Martin Baulig  <martin@ximian.com>
4721
4722         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4723         do not call ResolveUnreachable() on unreachable statements in
4724         here, see the comment in the source code.
4725
4726 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4727
4728         Fix #74934.
4729         * expression.cs (BinaryResolveOperator): If one of the operands of
4730         an equality comparison is 'null' and the other is a pointer type,
4731         convert the null to a NullPointer.
4732         * convert.cs (ImplicitReferenceConversion): If the expression is a
4733         NullLiteral and the target type is a pointer type, return a
4734         NullPointer instead.
4735         (ImplicitConversionStandard): Likewise.
4736
4737 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4738         
4739         * cs-parser.jay: Set readonly context based on special constructs.
4740         
4741         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4742         readonly variable error handling.
4743         
4744         * rootcontext.cs (EmitCode): Don't verify members when error
4745         occurred.
4746         
4747         * statement.cs (LocalInfo): Add reaodnly context information.
4748         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4749
4750 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4751
4752         * statement.cs (Block.Resolve): Revert change below.  Modify fix
4753         for #74041 to initialize 'resolved' to false only for explicit
4754         blocks.  Fixes #74873.
4755
4756 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4757
4758         Fix #74920.
4759         * typemanager.cs (unmanaged_enclosing_types): New.
4760         (IsUnmanagedType): Avoid infloops by using
4761         'unmanaged_enclosing_types' to talk with recursive invocations.
4762
4763 2005-05-13  Martin Baulig  <martin@ximian.com>
4764
4765         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4766         instance variable, not a local.  Fix #74873.
4767         (Block.ResolveUnreachable): Set it to true here.
4768
4769 2005-05-11  Duncan Mak  <duncan@novell.com>
4770
4771         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4772         continuing to process for 'arg'.
4773         (handle_preprocessing_directive): Check the argument of the #endif
4774         directive and report error CS1025 if there are any trailing
4775         characters.
4776
4777         According to the C# spec, having even whitespace after the #endif
4778         directive is illegal; however, because we call arg.TrimEnd ()
4779         beforehand, we have the same behavior as csc, allowing whitespace
4780         after the directive.
4781
4782         Fixes #74892.
4783
4784 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4785
4786         Fix #74863.
4787         
4788         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4789         (Constructor.GetObsoleteAttribute): Implemented correctly.
4790
4791 2005-05-10  Martin Baulig  <martin@ximian.com>
4792
4793         * support.cs (ReflectionParameters.ParameterModifier): Use
4794         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4795         and `ParameterAttributes.In'.  Fixes #74884.
4796
4797 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4798
4799         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4800         
4801         * expression.cs (Argument.GetParameterModifier): Turned to property.
4802         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4803         
4804         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4805         its C# equivalent.
4806         
4807 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4808
4809         Fix #74852.
4810         * decl.cs (MemberCache.AddMethods): Register override methods,
4811         rather than non-override methods.
4812         * typemanager.cs (RegisterOverride): New.
4813         (IsOverride): Update.
4814
4815 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4816
4817         Fix #73105.
4818         
4819         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4820         recursive declaration.
4821         
4822         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4823         
4824 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4825
4826         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4827         
4828         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4829
4830 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4831
4832         Fix #74797.
4833         * decl.cs (DeclSpace.FamilyAccessible): 
4834         Use TypeManager.IsNestedFamilyAccessible.
4835
4836         Fix reopened #64812.
4837         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4838         internal'.
4839
4840 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4841             Abin Thomas  <projectmonokochi@rediffmail.com>
4842             Anoob V E  <projectmonokochi@rediffmail.com>
4843             Harilal P R  <projectmonokochi@rediffmail.com>
4844
4845         Fix #64812.
4846         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4847         allow access to all static members.
4848
4849 2005-05-04  Martin Baulig  <martin@ximian.com>
4850
4851         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4852
4853 2005-05-04  Martin Baulig  <martin@ximian.com>
4854
4855         Fix #74655.
4856
4857         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4858         section at the end; make things work if `default' is not the last
4859         section.        
4860
4861 2005-05-04  Martin Baulig  <martin@ximian.com>
4862
4863         Fix #70400.
4864
4865         * statement.cs (Switch): Replaced the `got_default' field with a
4866         `default_section' one.
4867         (Switch.CheckSwitch): Set `default_section' here.
4868         (Switch.Resolve): If we're a constant switch and the constant is
4869         not found, use the default section.
4870
4871 2005-05-03  Martin Baulig  <martin@ximian.com>
4872
4873         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4874
4875         * statement.cs (Foreach.ArrayForeach): New nested class.
4876         (Foreach.TemporaryVariable): New nested class.
4877         (Foreach.EmitArrayForeach): Removed; this is now in the new
4878         ArrayForeach class.
4879
4880 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4881
4882         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4883         more conservative.
4884         (VerifyPendingMethods): Revert change below.
4885
4886         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4887         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4888         that used to trigger warning -28.  Remove warning -28.
4889         * expression.cs (Invocation.OverloadResolve): Use
4890         TypeManager.IsOverride to distinguish override methods.
4891
4892         Fix #74773.
4893         * pending.cs (VerifyPendingMethods): If a base type implements the
4894         requested interface, don't bother checking individual methods of
4895         the base type.  As a side-effect, this prevents the creation of
4896         unnecessary proxies.
4897
4898 2005-05-02  Martin Baulig  <martin@ximian.com>
4899
4900         Fix #70182.
4901
4902         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4903         Also `And' the locals if the old vector is null.
4904         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4905         null; in this case we basically reset all the variables.        
4906
4907 2005-05-02  Martin Baulig  <martin@ximian.com>
4908
4909         Fix #74529.
4910
4911         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4912         Added `FlowBranching branching' argument; always `and' the
4913         variables instead of `or'ing them unless we're an infinite loop.
4914
4915         * statement.cs (While.Resolve): Create a new sibling unless we're
4916         infinite.       
4917
4918 2005-05-02  Martin Baulig  <martin@ximian.com>
4919
4920         Fix #70140.
4921
4922         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4923         arguments; use it instead of creating a new TopLevelBlock.
4924         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4925         our ConstructorInitializer.
4926
4927         * statement.cs
4928         (TopLevelBlock.TopLevelBranching): New public property.
4929         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4930         and create our `TopLevelBranching'.
4931
4932         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4933         anonymous method host, use `block.TopLevelBranching' rather than
4934         creating a new branching.
4935
4936 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4937
4938         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4939         a ScopeInfo, if any of the current children is a child of the new
4940         entry, move those children there.
4941
4942 2005-04-30  Martin Baulig  <martin@ximian.com>
4943
4944         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4945         at the beginning of a SwitchSection.  Fix #73335.
4946
4947 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4948
4949         Fix #74378
4950         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4951         
4952         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4953         (FieldExpr.DoResolve): Obsolete members are ignored for field
4954         initializers.
4955         
4956 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4957
4958         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4959         of arrays detection.
4960
4961         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4962         verification.
4963         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4964
4965         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4966         arrays report.
4967
4968 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4969
4970         * cs-parser.jay: Use the prefered version of -unsafe in error
4971         message.
4972
4973 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4974
4975         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4976         circumstances.
4977
4978 2005-04-20  John Luke  <john.luke@gmail.com>
4979
4980         * driver.cs: fix typo in error message, --outout to --output
4981
4982 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4983
4984         * codegen.cs (InRefOutArgumentResolving): New field.
4985         
4986         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4987         fields outside contructor.
4988         
4989         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4990         
4991 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4992
4993         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4994         parameter code was not completed ever, so it was not as up-to-date
4995         as local variables.  Must finish it.
4996
4997         The bug fix was to compare the Toplevel of the block, not the
4998         current block.  Thanks for Ben for pointing this out. 
4999
5000 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5001
5002         * decl.cs (AddMethods): Use the declaring type of the problem
5003         method to determine if we want to squash a warning.
5004
5005 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5006
5007         * attribute.cs: Removed debug output.
5008
5009         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5010         
5011         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5012         Report.Stderr.
5013         
5014 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5015
5016         Fix #74481.
5017         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5018         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5019         all null comparisons against reference types.
5020
5021 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5022
5023         Fix# 74565
5024         * class.cs (TypeContainer.CircularDepException) New nested
5025         exception class.
5026         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5027         (TypeContainer.DefineType): Removed error, reset InTransit before
5028         exit.
5029         (Class.DefineType): Throw exception when is in Transit.
5030         Catch exception and report error.
5031         (Struct.DefineType): Throw exception when is in Transit.
5032         Catch exception and report error.
5033         (Interface.DefineType): Throw exception when is in Transit.
5034         Catch exception and report error.
5035
5036         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5037         handle nested exception handlers.
5038
5039         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5040         a catch.
5041
5042         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5043         InFinally and InCatch storage.
5044
5045         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5046         (Catch.Resolve): Set and Restore ec.InCatch.
5047         (Try.Resolve): Set and Restore ec.InFinally.
5048         (Try.HasCatch): True when try has catch.
5049
5050 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5051
5052         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5053           for the same event member, so exclude such cases from warning 419.
5054           Fixed bug #74633.
5055
5056 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5057
5058         * expression.cs (Binary.ResolveOperator): Apply patch from John
5059         Luke to fix bug 59864: operators &, | and ^ on enumerations
5060         require that the same enum type on both sides.
5061
5062         * driver.cs: Add warnings to old flag usage, this is to assist
5063         people who produce Makefiles and hope that the Makefiles will be
5064         used on Windows.
5065
5066         * class.cs (TypeContainer.EmitType): Moved the definition of the
5067         special $PRIVATE$ field from the resolve phase to the Emit phase.
5068         During resolve we do not know if we are a struct with
5069         HasExplicitLayout, we know this only after the attributes for the
5070         type are emitted.
5071
5072         Set the FieldOffset to zero on the dummy field that we create for
5073         the class.   Fixes 74590.
5074
5075 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5076
5077         Fix #73834.
5078         * ecore.cs (PropertyExpr.resolved): New.
5079         (DoResolve): Use it to handle a case of double resolution here.
5080         Handle a case of identical-name-and-type-name.
5081         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5082         resolution by storing the results of expression resolution back
5083         into the "probes" array.
5084
5085 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5086
5087         Fix cs0208-7.cs and cs0208-8.cs.
5088         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5089         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5090         error reporting to point out the reason a struct is not unmanaged.
5091
5092 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5093
5094         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5095           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5096
5097 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5098
5099         Fix #74528.
5100         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5101         IdenticalNameAndTypeName here.
5102         (EventExpr.InstanceResolve): Likewise.
5103
5104 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5105
5106         C# 2.0 DefaultCharSetAttribute implementation
5107         
5108         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5109         which allows us to set GlobalNamespace for every resolve.
5110         (Attribute.ResolveArguments): Cut from Resolve.
5111         (Attribute.GetCharSetValue): Returns CharSet named argument.
5112         (Attribute.DefinePInvokeMethod): Gets default charset from
5113         module settings.
5114         (GlobalAttribute.ResolveAsTypeStep): Override.
5115         (GlobalAttribute.ResolveArguments): Override.
5116         
5117         * class.cs (TypeAttr): Is protected.
5118         
5119         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5120         (ModuleClass.DefaultCharSetType): New memeber.
5121         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5122         
5123         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5124         charset from module.
5125         
5126         * delegate.cs (TypeAttr): Override.
5127         (Delegate.DefineType): Use this TypeAttr.
5128         
5129         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5130         at very early stage (before types are defined) to resolve model
5131         module attributes. It will probably not work with corlib but it
5132         should be ok.
5133         
5134         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5135         charset from module.
5136         
5137         * typemanager.cs (default_charset_type): New type.
5138
5139 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5140
5141         * decl.cs (MemberCache.AddMethods): Don't warn if
5142         System.Object.Finalize has buggy MethodAttributes.
5143
5144         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5145         removed below.
5146
5147 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5148
5149         * doc.cs : detect ambiguous reference to overloaded members.
5150           Fixed bug #71603. MS 1.1 csc does not detect it.
5151
5152 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5153
5154         * doc.cs : delegates must not be referenced with parameters.
5155           Fixed bug #71605.
5156
5157 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5158
5159         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5160
5161 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5162
5163         * driver.cs (MainDriver): Stop processing if the CLS stage found
5164         errors. 
5165
5166         (CompilerCallableEntryPoint.InvokeCompiler): Always
5167         reset after execution;   Take a TextWriter argument for the
5168         output.
5169
5170         * report.cs: Use the error stream instead of hardcoding stderr. 
5171
5172 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5173
5174         * class.cs: Reduce code paths to test, too small of an
5175         optimization to make it worth the extra testing.  Always perform
5176         it. 
5177
5178 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5179
5180         Fix #74510.
5181         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5182         operators that had errors reported on them.
5183
5184 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5185
5186         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5187         argument types.
5188         (Attribute.Resolve): Add named argument type checking.
5189         
5190         * class.cs (FixedField.Define): Use IsPrimitiveType
5191         
5192         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5193         
5194         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5195         unsafe parameter types.
5196         
5197         * statement.cs (Using.ResolveExpression): Add better error description.
5198         
5199         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5200         
5201 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5202
5203         Fix #74484.
5204         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5205         AttributeUsageAttribute in the emitcontext of the attribute class,
5206         not in the emitcontext of the attributable entity it was attached to.
5207         * cs-parser.jay: Use 'current_class', not 'current_container',
5208         when creating a GlobalAttribute.
5209
5210 2005-04-08  Alp Toker  <alp@atoker.com>
5211
5212         * pending.cs: The fix to #58413 failed to compile methods implementing
5213         interfaces with/without params modifiers and vice versa, even though
5214         params modifiers aren't part of the signature. Make the modifier check
5215         less strict as in csc.
5216
5217 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5218             Anoob V E  <projectmonokochi@rediffmail.com>
5219             Harilal P R  <projectmonokochi@rediffmail.com>
5220
5221         Fix #58413.
5222         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5223         modifiers of pending methods.
5224         (PendingImplementation.PendingImplementation): Initialize it.
5225         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5226         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5227         with ParameterData.  Add check for modifiers.
5228         * class.cs (MethodData.Define): Update to changes.
5229
5230 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5231
5232         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5233
5234 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5235
5236         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5237         property.
5238         
5239         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5240         
5241         * rootcontext.cs,
5242         * typemanager.cs: Registered RequiredAttributeAttribute.
5243         
5244 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5245
5246         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5247         Warning CS0169 is back at level 3.
5248         (IMethodData.SetMemberIsUsed): New method.
5249         
5250         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5251         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5252         
5253         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5254
5255         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5256         contants.
5257         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5258         is used.
5259         
5260         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5261         is used.
5262         
5263         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5264         to avoid the problems with nested types.
5265
5266 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5267             Anoob V.E  <projectmonokochi@rediffmail.com>
5268             Harilal P.R  <projectmonokochi@rediffmail.com>
5269             Raja R Harinath  <rharinath@novell.com>
5270
5271         Fix #73820.
5272         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5273         attribute.
5274         * typemanager (GetConstructor): Make public.
5275
5276 2005-04-05  John Luke  <john.luke@gmail.com>
5277             Raja R Harinath  <rharinath@novell.com>
5278
5279         Fix #62232.
5280         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5281         struct too.  Return false quicker in a few cases.
5282         (VerifyUnManaged): Use it.
5283
5284 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5285
5286         Fix #74041.
5287         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5288         not 'unreachable_seen'.
5289
5290 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5291
5292         * attribute.cs (Attribute.GetValue): Removed unused.
5293         
5294         * codegen.cs (CodeGen.TrimExt): Removed unused.
5295         
5296         * cs-parser.jay (output): Removed unused.
5297         
5298         * cs-tokenizer.cs (hex_digits): Removed unused.
5299         
5300         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5301         
5302         * expression.cs (Indirection.LoadExprValue): Removed unused.
5303         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5304         
5305         * iterators.cs (Iterator.param_types): Removed unused.
5306         
5307         * statement.cs (Goto.block): Removed unused.
5308         (ToplevelBlock.did): Removed unused.
5309         (Switch.ResolveConstantSwitch): Removed unused.
5310
5311 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5312
5313         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5314         resetting thingy.
5315
5316 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5317
5318         Fix #74232 and cs0208-3.cs.
5319         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5320         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5321         unmanaged type.  Don't use FieldBuilders when 't' is a
5322         TypeBuilder.  Use ModFlags and MemberType fields.
5323         * class.cs (MemberBase.member_type): Rename from MemberType.
5324         (MemberBase.MemberType): New property.  Determines member_type on
5325         demand.
5326         (MemberBase.DoDefine): Don't initialize MemberType here.
5327         (FieldMember.Define): Likewise.
5328
5329 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5330
5331         Fix #74241
5332         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5333         Attributes are emitted there.
5334         
5335 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5336
5337         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5338         keyword in 'partial enum' too.
5339         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5340         is not allowed).
5341         Report from Kamil Skalski <nazgul@omega.pl>.
5342
5343         Fix #74309.
5344         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5345         have partial containers too.
5346
5347         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5348         in block' checks to Block.CheckInvariantMeaningInBlock.
5349         * statement.cs (Block.GetKnownVariableInfo): Make private.
5350         (Block.IsVariableUsedInChildBlock): Remove.
5351         (Block.IsVariableUsedInBlock): Likewise.
5352         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5353         conflicting declaration.
5354         (Block.AddVariable): Make error messages less long-winded and more
5355         specific.  Show location of conflicting declaration.
5356         * parameter.cs (Parameters.Location): New readonly property.
5357
5358 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5359
5360         Clean up semantics of invoking ResolveMemberAccess.
5361         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5362         can have an instance, ensure that we pass in a non-TypeExpression
5363         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5364         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5365         argument.  Update to changes and simplify.
5366         (FieldExpr.Emitinstance): Remove CS0120 check.
5367         (PropertyExpr.EmitInstance): Likewise.
5368         * expression.cs (Argument.Resolve): Likewise.
5369         (Invocation.DoResolve): Update to changes in semantics of
5370         InstanceExpression.
5371
5372 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5373
5374         Fix #74241
5375         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5376         customization.
5377         
5378         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5379
5380 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5381
5382         Fix difference in behaviour with commandline invocation.
5383         * driver.cs (Driver.Reset): New.
5384         (CompilerCallableEntryPoint): Call it.
5385
5386         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5387         variable" warnings if the boolean expression failed to resolve.
5388
5389 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5390
5391         * attribute.cs: Fix the union of several permissions when some of them
5392         are unrestricted (so the result isn't an unrestricted permission set).
5393         Fix #74036.
5394
5395 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5396
5397         * ecore.cs (MemberExpr): New class.  Convert from interface
5398         IMemberExpr.
5399         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5400         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5401         error checks.
5402         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5403         (MethodGroupExpr.IsExplicitImpl): Remove.
5404         (Expression.GetFieldFromEvent): Remove.
5405         (SimpleName.MemberStaticCheck): Remove.
5406         (SimpleName.DoSimpleNameResolve): Update to changes.
5407         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5408         (MemberAccess.IdenticalNameAndTypeName): Remove.
5409         (MemberAccess.error176): Move to MemberExpr.
5410         (MemberAccess.DoResolve): Update to changes.
5411         (BaseAccess.DoResolve): Likewise.
5412
5413 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5414
5415         C# 2.0 Conditional attribute class implementation
5416         
5417         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5418         Analyzes class whether it has attribute which has ConditionalAttribute
5419         and its condition is not defined.
5420         
5421         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5422         (Class.IsExcluded): New method. Search for at least one defined
5423         condition in ConditionalAttribute of attribute class.
5424
5425 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5426
5427         * ecore.cs (PropertyExpr): Derive from Expression, not
5428         ExpressionStatement.
5429         (PropertyExpr.EmitStatement): Remove.
5430
5431 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5432
5433         Fix #74060.
5434         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5435         internal field "value__" of an enum be private.  The examples for
5436         "value__" that I found on MSDN all used FieldAttributes.Private.
5437
5438         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5439         Don't mention IL method attribute names.
5440
5441         Fix #47991.  Remove a TODO.
5442         * statement.cs (Block.Toplevel): Make into a field.
5443         (Block.Parameters): Move into ToplevelBlock.
5444         (Block.known_variables): Rename from child_variable_names.
5445         (Block.Block): Remove variants that take Parameters.  Initialize
5446         'Toplevel' with the immediately surrounding toplevel block.
5447         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5448         LocalInfo parameter.
5449         (Block.GetKnownVariableInfo): New.
5450         (Block.IsVariableNameUsedInChildBlock): Update.
5451         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5452         the block, even though it may not be in scope.
5453         (Block.AddVariable): Remove Parameters parameter.  Use
5454         Toplevel.Parameters instead.
5455         (Block.AddConstant): Remove Parameters parameter.
5456         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5457         (Block.IsParamaterReference): Likewise.
5458         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5459         (ToplevelBlock.Parameters): New.  Moved from Block.
5460         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5461         initialize Parameters to a non-null value.
5462         * cs-parser.jay: Update to changes.
5463         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5464         simple names that mean different things in the same block.  Use
5465         Block.IsVariableNameUsedInBlock.
5466
5467 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5468
5469         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5470         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5471         GetTypeHandle.  It is possible for a reflected type to derive from
5472         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5473         System.Array during mscorlib compilation).
5474         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5475         contain a method_hash, don't create one either.  Don't create a
5476         deep copy of the base cache's method_hash.
5477         (MemberCache.SetupCache): Rename back from DeepCopy.
5478         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5479         already initialized.  If we see an override function, add its
5480         underlying base virtual function to the member_hash too.
5481
5482         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5483
5484 2005-03-26  Raja R Harinath  <harinath@acm.org>
5485
5486         Fix #73038.
5487         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5488         fails to resolve, ensure that the LHS is still resolved as an
5489         lvalue.
5490
5491 2005-03-25  Raja R Harinath  <harinath@acm.org>
5492
5493         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5494         ec.ContainerType.
5495         (Enum.current_ec): Remove.
5496         (Enum.LookupEnumValue): Remove EmitContext argument.
5497         Just uses the one created during DefineType.
5498         (Enum.FindMembers): Update.
5499         * expression.cs (MemberAccess.DoResolve): Update.
5500
5501 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5502
5503         * assign.cs (Assign.DoResolve): Check for CS1717 when
5504         source and target are same (uses Equals).
5505
5506         * expression.cs (LocalVariableReference, ParameterReference,
5507         This): Implemented Equals, GetHashCode.
5508
5509         * statement.cs (Block.GetParameterReference): Removed useless
5510         local variable.
5511
5512 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5513
5514         Fix cs0128.cs
5515         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5516         blocks before deciding whether the error is cs0136 or cs0128.
5517
5518         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5519         (using_alias_directive, using_namespace_directive): Pass
5520         MemberName, not an expression to Namespace.UsingAlias and
5521         Namespace.Using.
5522         (MakeName): Use the MemberName of the namespace.
5523         * namespace.cs (Namespace.MemberName): New.
5524         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5525         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5526         Likewise.
5527         * decl.cs (MemberName.Name): Make readonly.
5528         (MemberName.FromDotted): New "constructor".
5529         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5530         (MemberCore.Name): Compute from MemberName on demand.
5531         (MemberCore.SetMemberName): Provide a way to change the
5532         MemberName.
5533         (MemberCore.AddToContainer): Don't take a fullname parameter.
5534         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5535         fully qualified name of the container to the member name.
5536         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5537         only if the type is a member of the root container.
5538         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5539         MemberName.Left rather than searching for an embedded ".".
5540         (PartialContainer.CreatePart): Update to changes in RootContext.
5541         (MemberBase.ShortName): Turn into a property.  Use
5542         MemberCore.SetMemberName.
5543         (MemberBase.ExplicitInterfaceName): Remove.
5544         (MemberBase.UpdateMemberName): Remove.
5545         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5546         (PropertyBase.SetMemberName): New override.
5547         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5548         (Tree.GetDecl): New.
5549         (Tree.AllDecls): Rename from Decls.
5550         * attribute.cs, enum.cs, report.cs: Update to changes.
5551         * driver.cs (MainDriver): Use MemberName.FromDotted on
5552         RootContext.MainClass.
5553
5554 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5555
5556         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5557         checks.
5558
5559         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5560
5561 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5562
5563         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5564         property accessor modifiers.
5565
5566         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5567         fixed buffer attribute (CS1716).
5568         (PropertyMethod.HasCustomAccessModifier): When property accessor
5569         has custom modifier.
5570
5571         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5572         modifiers.
5573         (PropertyExpr.DoResolveLValue): Add CS0272.
5574
5575 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5576
5577         * convert.cs: When converting to a pointer, use the proper Conv.U
5578         or Conv.I depending on the source data type.
5579
5580         * cs-tokenizer.cs: Make the size for large decimal constants,
5581         fixes #72957.
5582
5583 2005-03-17  Martin Baulig  <martin@ximian.com>
5584
5585         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5586         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5587
5588 2005-03-17  Martin Baulig  <martin@ximian.com>
5589
5590         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5591         to bool so we can return an error condition.
5592         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5593         returned an error.
5594
5595 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5596
5597         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5598         attributes.
5599
5600 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5601
5602         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5603         Refactor to avoid traversing the list of assemblies, and to avoid
5604         string concatenation.
5605         * typemanager.cs (guid_attr_type): Remove.
5606         (negative_hits, pointers, references): Remove hashes.
5607         (type_hash): New.
5608         (GetConstructedType): New.  Uses type_hash to handle constructed
5609         types (arrays, references, pointers).
5610         (GetReferenceType, GetPointerType): Use it.
5611         (GetNestedType): New.  Uses type_hash to handle nested types of
5612         reflected types.
5613         (LookupType, LookupTypeDirect): Remove.
5614         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5615         'types' hash and LookupTypeReflection directly.
5616         (params_string, params_object): Use GetConstructedType.
5617         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5618         top-level types.
5619         (Namespace.Lookup): Use cached_types.
5620         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5621         provided by old TypeManager.LookupType.
5622         * rootcontext.cs (MakeFQN): Remove.
5623         * decl.cs (DeclSpace.MakeFQN): Likewise.
5624         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5625         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5626         TypeManager.GetConstructedType.
5627         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5628
5629 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5630
5631         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5632         indexers.
5633
5634         * cs-parser.jay: Reports CS1527 for any namespace element.
5635
5636         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5637         Added CS0407.
5638
5639         * expression.cs (ParameterReference.IsAssigned): Changed error to
5640         CS0269.
5641         (Error_WrongNumArguments): Moved CS0245 detection here.
5642
5643         * statement.cs (Return.Resolve): Add CS1622 report.
5644
5645 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5646
5647         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5648
5649 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5650
5651         * attribute.cs expression.cs: Get rid of some allocations.
5652
5653 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5654
5655         * doc.cs : just eliminate the latest change.
5656
5657 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5658
5659         * doc.cs : commented out the latest change. It breaks xml-030.cs
5660
5661 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5662
5663         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5664           fail. So invoke CreateType() in FindDocumentedType().
5665
5666 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5667
5668         * cs-tokenizer.cs : added IsKeyword().
5669         * doc.cs : Detect keyword incorrectly used as identifier.
5670           Allow identifiers prefixed by @.
5671
5672 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5673
5674         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5675         It caused exception in namespace resolving (again!).
5676         
5677         * class.cs (Class.ctor): Removed exit.
5678         (PropertyMethod.ctor): ditto.
5679         
5680         * codegen.cs (Codegen.Reset): Reset static data.
5681         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5682         
5683         * cs-tokenizer.cs (Cleanup): Removed.
5684         
5685         * driver.cs (GetSystemDir): Rewrote to one line command.
5686         It caused problem with unloaded dynamic modules.
5687         (UnixParseOption): Removed Exit.
5688         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5689         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5690         Now can be mcs used as library.
5691         
5692         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5693         empty location.
5694         
5695         * location.cs (Reset): Reset static data.
5696         
5697         * namespace.cs (Reset): Reset static data.
5698         
5699         * report.cs (Report.Reset): Reset static data.
5700         
5701         * rootcontext.cs (RootContext.Reset): Reset static data.
5702         
5703         * tree.cs (RootTypes.ctor): Use Location.Null
5704         
5705         * typemanager.cs (TypeManager.Reset): Reset static data.
5706         (CoreLookupType): Removed Exit.
5707         (TypeHandle.Reset): Reset static data.
5708         
5709 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5710
5711         Fix #73516.
5712         * typemanager.cs (ComputeNamespaces): Import namespaces from
5713         referenced modules too.
5714
5715 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5716
5717         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5718         than '.'.
5719
5720 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5721
5722         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5723         enclosing DeclSpace.  This ensures that a name-lookup populates
5724         more caches and there are fewer 'TypeExpression's.  Carve out
5725         nested type lookup into ...
5726         (LookupNestedTypeInHierarchy): ... this.
5727
5728 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5729
5730         Clean up a few partial-class semantics.  
5731         Fixes test-357.cs and cs1618-2.cs.
5732         * cs-parser.jay (struct_declaration): Use 'current_class' as
5733         parent of newly-created struct.  Remove call to Register ().
5734         Use 'pop_current_class' to complete handing the current struct.
5735         (interface_declaration): Likewise.
5736         (class_declaration): Likewise.
5737         (enum_declaration): Use 'current_class' as parent of newly created
5738         enum.
5739         (delegate_declaration): Likewise.
5740         (pop_current_class): New function.  This is used to handle closing
5741         up the 'current_class' and 'current_container', and pointing them
5742         to the enclosing class/container.
5743         (CSharpParser): Initialize 'current_class' too.
5744         * decl.cs (MemberCore): Add check for invariant: a partial
5745         container is not a parsed entity, and thus does not enclose any
5746         parsed members.
5747         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5748         (DeclSpace.BaseTypeExpr): Use it.
5749         (DeclSpace.LookupType): Add check for invariant.
5750         * class.cs (TypeContainer): Add check for invariant: a nested
5751         class should have the same NamespaceEntry as its enclosing class.
5752         (TypeContainer.EmitFieldInitializers): Make virtual.
5753         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5754         MemberCore.
5755         (TypeContainer.Register): Remove.
5756         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5757         null.  Use TypeResolveEmitContext for resolving base types and
5758         interfaces.  Move initialization of Parts.TypeBuilder here from
5759         ...
5760         (TypeContainer.DefineNestedTypes): ... here.
5761         (PartialContainer): Take a Namespace not a NamespaceEntry.
5762         (PartialContainer.Create): Don't use Register.  Call the
5763         appropriate Add... function directly.
5764         (ClassPart): Take both the PartialContainer and the enclosing
5765         class as constructor arguments.
5766         (ClassPart.EmitFieldInitializers): Override.
5767         (ClassPart.PartFindNestedTypes): Remove.
5768         (FieldBase.GetInitializerExpression): Resolve the initializer
5769         expression in the emit context of the enclosing class.
5770         * tree.cs (RootTypes): Remove Register ().
5771         
5772 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5773
5774         * cs-parser.jay: Removed CS0134.
5775         
5776         * driver.cs: Removed CS1901.
5777         
5778         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5779         for predefined types.
5780
5781 2005-03-07  Duncan Mak  <duncan@novell.com>
5782
5783         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5784         well. Fixes bug #73454.
5785
5786 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5787
5788         * cs-tokenizer.cs (xtoken): Add CS1035.
5789         
5790         * class.cs (MethodData.Define): Add CS0683.
5791         (FieldMember.ctor): Add CS0681.
5792
5793 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5794
5795         * ecore.cs (SimpleName.DoResolve): Rename from
5796         SimpleName.DoResolveAllowStatic.
5797         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5798         Pass 'intermediate' flag to MemberStaticCheck.
5799         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5800         of "intermediate" lookups via MemberAccess.
5801         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5802         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5803
5804 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5805
5806         Fix #73394.
5807         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5808         slipped in because of variable names that are identical to a
5809         builtin type's BCL equivalent ('string String;', 'int Int32;').
5810         (PropertyExpr.EmitInstance): Likewise.
5811
5812 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5813
5814         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5815         
5816         * report.cs (warning_ignore_table): Made public.
5817
5818 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5819
5820         Fix #73282.
5821         * class.cs (MethodData.Emit): Pass 'container' to
5822         container.GetObsoleteAttribute instead of 'container.Parent'.
5823
5824 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5825
5826         * cs-parser.jay: Add 1534 error test.
5827
5828         * iterators.cs (Yield.CheckContext): Add error 1629.
5829         (Iterator.ctor): Save unsafe modifier.
5830         (MoveNextMethod.DoEmit): Restore unsafe context.
5831
5832         * namespace.cs (UsingAlias): Better error message.
5833
5834 2005-03-03  Dan Winship  <danw@novell.com>
5835
5836         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5837         the warning message [#73219]
5838
5839 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5840
5841         Fix compile with MCS 1.0.0.0.
5842         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5843         w_restore to not depend on string constant folding.
5844
5845 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5846
5847         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5848         CS0246 check to users who passed 'silent = false'.
5849         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5850         check.
5851         (SimpleName.SimpleNameResolve): Update.
5852         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5853         (MemberAccess.IdenticalNameAndTypeName): Update.
5854         * doc.cs (FindDocumentedTypeNonArray): Update.
5855
5856 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5857
5858         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5859         * parameters.cs (ComputeAndDefineParameters): Remove.
5860         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5861         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5862         Use GetParameterInfo.
5863
5864 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5865
5866         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5867
5868 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5869
5870         Unify DeclSpace.LookupType and DeclSpace.FindType.
5871         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5872         is in charge of defining nested types on demand.
5873         (DeclSpace.LookupType): Use it when the current_type is a
5874         TypeBuilder.  Use LookupTypeDirect for reflected types.
5875         (DeclSpace.FindType): Remove.
5876         (DeclSpace.LookupInterfaceOrClass): Likewise.
5877         (DeclSpace.DefineTypeAndParents): Likewise.
5878         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5879         DeclSpace.LookupType.
5880         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5881         * typemanager.cs (LookupType): Simplify.
5882         (AddUserType): Remove type from negative_hits.
5883         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5884         * class.cs (TypeContainer.FindMembers): Move handling of nested
5885         types ...
5886         (TypeContainer.FindMembers_NestedTypes): ... here.
5887         (TypeContainer.FindNestedType): Implement override.
5888         (ClassPart.FindNestedType): Delegate to PartialContainer.
5889         (ClassPart.PartFindNestedType): Looks up the nested types of the
5890         part alone.
5891
5892 2005-03-02  Martin Baulig  <martin@ximian.com>
5893
5894         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5895         static constructor in static classes.
5896
5897 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5898
5899         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5900         sizeParamIndex is not specified.
5901
5902 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5903
5904         Fix #73117
5905         * report.cs (WarningMessage.IsEnabled): Missing null check.
5906
5907 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5908
5909         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5910         in the fields and not in the properties.
5911
5912 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5913
5914         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5915         fields as well.
5916
5917 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5918
5919         * attribute.cs: Small refactoring (improved robustness).
5920         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5921         (ValidateGuid): Removed.
5922         (Resolve): Removed referenced to above mentioned.
5923         (GetAttributeUsage): Made private and changed to work without
5924         class assistance.
5925         (GetIndexerAttributeValue): Don't crash.
5926         (GetConditionalAttributeValue): Ditto.
5927         (GetClsCompliantAttributeValue): Ditto.
5928         (ExtractSecurityPermissionSet): All attributes exceptions are
5929         error 648.
5930         (GetPropertyValue): New helper.
5931         (GetMethodImplOptions): New method.
5932         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5933         some missing properties.
5934         
5935         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5936         (Method.ApplyAttributeBuilder): Updated.
5937         
5938         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5939         exception.
5940
5941 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5942
5943         Fix #73052.
5944         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5945         non-simple types (array, pointer, reference).
5946
5947 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5948
5949         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5950
5951         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5952         for operators.
5953         (Method.CheckBase): Catch wrong destructor here.
5954         (MethodData.Define): Add errors 550, 668.
5955
5956         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5957
5958         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5959
5960         * pending.cs (VerifyPendingMethods): Add error 551.
5961
5962         * typemanager.cs (CSharpName): Next error report helper.
5963
5964 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5965
5966         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5967         attributes. Removed useless attribute double check.
5968         It saves almost 2MBs for corlib.
5969
5970 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5971
5972         Fix #72924.
5973         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5974         called twice in case of error.
5975
5976 2005-02-23  Chris Toshok  <toshok@ximian.com>
5977
5978         Fix compiler portions of #72827.
5979         * statement.cs (Block.Emit): call Begin/EndScope on the
5980         EmitContext instead of the ILGenerator.
5981
5982         * codegen.cs (EmitContext.BeginScope): new method, call
5983         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5984         we have one.)
5985         (EmitContext.BeginScope): same, but EndScope and CloseScope
5986
5987         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5988         offset and call the superclass's OpenScope(int) with it.
5989         (SymbolWriter.CloseScope): get the current il
5990         offset and call superclass's CloseScope(int) with it.
5991
5992 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5993
5994         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5995         CS1677 for out and ref as well.
5996
5997         * class.cs (Method.Define): Add error CS1599 detection.
5998         
5999         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6000         
6001         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6002         
6003         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6004         
6005         * support.cs.cs (ModifierDesc): New helper method.
6006
6007 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6008             Abin Thomas  <projectmonokochi@rediffmail.com>
6009             Anoob V E  <projectmonokochi@rediffmail.com>
6010             Harilal P R  <projectmonokochi@rediffmail.com>
6011
6012         Fix #57851, #72718.
6013         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6014         MemberLookup (used for error reporting) actually returns a result.
6015         Fix error report number (122, not 112).
6016
6017 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6018             Anoob V E  <projectmonokochi@rediffmail.com>
6019             Harilal P R  <projectmonokochi@rediffmail.com>
6020
6021         Fix #71134.
6022         * pending.cs (PendingImplementation.GetAbstractMethods):
6023         Find NonPublic members too.
6024
6025 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6026
6027         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6028         Fixed error 217.
6029         
6030         * class.cs (MethodCore.CheckMethodAgainstBase):
6031         Add error 239 report.
6032
6033 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6034
6035         Fix #68955.
6036         * expression.cs (Invocation.IsApplicable): Make public.
6037         (Invocation.IsParamsMethodApplicable): Likewise.
6038         * delegate.cs (Delegate.VerifyApplicability): Don't use
6039         Invocation.VerifyArgumentCompat for parameter applicability
6040         testing.  Use Invocation.IsApplicable and
6041         Invocation.IsParamsMethodApplicable.
6042
6043 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6044
6045         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6046         
6047         * class.cs (Operator.Define): Add error 217 report.
6048         
6049 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6050
6051         * namespace.cs (UsingEntry.Resolve): Undo change below.
6052
6053 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6054
6055         Fix #72756.
6056         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6057         disable the error message when the extended MemberLookup also
6058         fails.
6059         (Expression.MemberLookupFinal): Update.
6060         (SimpleName.DoSimpleNameResolve): Update.
6061         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6062         Don't use MemberLookupFinal.
6063         (New.DoResolve): Update.
6064         (BaseAccess.CommonResolve): Update.
6065
6066 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6067
6068         Fix #72732.
6069         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6070         occured previously, don't resolve again.
6071
6072 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6073
6074         Fix #69949
6075         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6076         argument. Call ResolveAttributeUsage for unresolved.
6077         when types doesn't match ctor arguments.
6078         
6079         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6080         for nested attribute classes.
6081         (Class.attribute_usage): Removed.
6082         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6083         for attribute class.
6084         
6085         * ecore.cs (IsAttribute): Removed.
6086         
6087         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6088         
6089         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6090         now normal types.
6091         (attribute_types): Removed.
6092         (EmitCode): Global attributes are emited as the latest.
6093
6094 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6095
6096         * class.cs (EmitFieldInitializers): Don't emit field initializer
6097         for default values when optimilization is on.
6098         
6099         * constant.cs (Constant.IsDefaultValue): New property.
6100         
6101         * driver.cs: Add /optimize handling.
6102         
6103         * constant.cs,
6104         * ecore.cs,
6105         * literal.cs: Implement new IsDefaultValue property.
6106         
6107         * rootcontext.cs (Optimize): New field, holds /optimize option.
6108
6109 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6110
6111         Fix crasher in re-opened #72347.
6112         * namespace.cs (Namespace.Lookup): Return null if
6113         DeclSpace.DefineType returns null.
6114
6115         Fix #72678.
6116         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6117
6118 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6119
6120         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6121         now returns null if it cannot resolve to an lvalue.
6122         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6123         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6124         returned null.  Remove check for SimpleName.
6125         (EventExpr.DoResolveLValue): New.
6126         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6127         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6128         error from ...
6129         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6130         avoid CS0131 error.
6131         (Unary.ResolveOperator): Move CS0211 check ...
6132         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6133         CS0131 error.
6134         (Unary.DoResolveLValue): Simplify.
6135         (AddressOf.DoResolveLValue): New.
6136         (ArrayAccess.DoResolveLValue): New.
6137
6138 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6139
6140         * attribute.cs (Attribute.Resolve): Add arguments casting for
6141         when types doesn't match ctor arguments.
6142
6143 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6144
6145         Fix parts of #63202.
6146         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6147         lookup of operator in base type.  Ensure that all checks happen
6148         when the operator resolves to an "op_..." method.
6149
6150 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6151
6152         Fix #71992.
6153         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6154         'ignore_cs0104' parameter.  Pass it to ...
6155         (NamespaceEntry.Lookup): ... this.
6156         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6157         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6158         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6159         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6160         Update.  Request that cs0104 errors be ignored.
6161         (ComposedCast.ResolveAsTypeStep): Update.
6162
6163 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6164
6165         Fix #59209.
6166         * expression.cs (Invocation.BetterFunction): Remove support for
6167         comparing virtual functions and their overrides.
6168         (Invocation.IsOverride): New.
6169         (Invocation.OverloadResolve): Don't consider 'override' functions
6170         during candidate selection.  Store them in a lookaside list.
6171         If the selected method is a 'virtual' function, use the list to
6172         find any overrides that are closer to the LHS type.
6173
6174 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6175
6176         * expression.cs (New.DoResolve): Add complex core type reduction.
6177         (New.Constantify): Converts complex core type syntax like 'new int ()'
6178         to simple constant.
6179         
6180 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6181
6182         * decl.cs (EntryType.EntryType): New constructor to create an
6183         updated copy of a cache entry.
6184         (MemberCache.AddMethods): Use it.
6185         (MemberCache.ClearDeclaredOnly): Remove.
6186         (MemberCache.MemberCache): Update.
6187
6188 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6189
6190         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6191         variable.  This one is represents the actual low-level declaration
6192         of the method, as opposed to the semantic level `IsStatic'.   
6193
6194         An anonymous method which is hosted into a static method might be
6195         actually an instance method.  IsStatic would reflect the
6196         container, while MethodIsStatic represents the actual code
6197         generated.
6198
6199         * expression.cs (ParameterReference): Use the new MethodIsStatic
6200         instead of IsStatic.
6201
6202         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6203         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6204         set on the current EmitContext. 
6205
6206         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6207         resolve our casted expression as an LValue.  This triggers the
6208         proper LValue processing that is later required by Assign.
6209
6210         This fixes 72347.
6211
6212         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6213
6214 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6215
6216         C# 2.0 Fixed buffer implementation
6217
6218         * anonymous.cs: Update after RegisterHelperClass renaming.
6219
6220         * attribute.cs (AttributeTester.fixed_buffer_cache):
6221         Cache of external fixed buffers.
6222         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6223         implementation if field is fixed buffer else null.
6224
6225         * class.cs
6226         (TypeContainer.AddField): Accept FieldMember instead of Field.
6227         (FieldBase.IsFieldClsCompliant): Extracted code from
6228         VerifyClsCompliance descendant customization.
6229         (FixedField): New class handles fixed buffer fields.
6230         (FixedFieldExternal): Keeps information about imported fixed
6231         buffer.
6232         (IFixedField): Make access to internal or external fixed buffer
6233         same.
6234
6235         * cs-parser.jay: Add fixed buffer parsing.
6236
6237         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6238         buffer.
6239
6240         * expression.cs (Indirection): Extended implementation to accept
6241         fixed buffer field.
6242         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6243         (ElementAccess.MakePointerAccess): Get type as parameter.
6244         (DoResolve): Add fixed buffer field expression conversion.
6245         (DoResolveLValue): Ditto.
6246         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6247         (ArrayPtr): Derives from FixedBufferPtr.
6248         (ArrayPtr.Emit): Add extra emit for array elements.
6249
6250         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6251
6252         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6253         for compiler generated types.
6254         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6255
6256         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6257         and consume less memory.
6258         (Fixed.Resolve): Add fixed buffer case.
6259
6260         * typemanager.cs (compiler_generated_attr_ctor,
6261         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6262         (HasElementType): Add our own implementation to work on every
6263         runtime.
6264
6265 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6266
6267         * anonymous.cs (CaptureContext): Track whether `this' has been
6268         referenced.   
6269
6270         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6271         only captured `this' if it was implicitly done (instance
6272         methods/variables were used). 
6273
6274         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6275         `this' must be captured.
6276
6277 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6278  
6279         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6280         is null it means that there has been no need to capture anything,
6281         so we just create a sibling.
6282
6283         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6284
6285         Just a partial fix.  The other half is fairly elusive.
6286         
6287 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6288
6289         Fix #52586, cs0121-4.cs.
6290         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6291         and return a hashtable.
6292         (MemberCache.ClearDeclaredOnly): New.
6293         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6294         the method_hash of a base type too.
6295         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6296         type methods.  Overwrite entries with the same MethodHandle so
6297         that the ReflectedType is correct.  The process leaves in base
6298         virtual functions and their overrides as distinct entries.
6299         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6300         matters since it was boxed in a ArrayList before.
6301         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6302         modifier.
6303         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6304         case of a virtual function and its override (choose the overload
6305         as better).
6306         (Invocation.OverloadResolve): Avoid 'override' members during
6307         'applicable_type' calculation.
6308
6309 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6310
6311         Combine two near-redundant caches.
6312         * typemanager.cs (method_params): Rename from method_internal_params.
6313         (TypeManager.GetParameterData): New.  Replace
6314         Invocation.GetParameterData.
6315         (TypeManager.LookupParametersByBuilder): Remove.
6316         * expression.cs (Invocation.method_parameter_cache): Remove.
6317         (Invocation.GetParameterData): Remove.
6318         Update to changes.
6319         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6320         Update to changes.
6321
6322 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6323
6324         Fix #72015.
6325         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6326         TypeManager.multicast_delegate_type is null, resolve it by looking
6327         up "System.MulticastDelegate".
6328         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6329
6330 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6331             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6332             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6333
6334         Fix cs0164.cs.
6335         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6336         (LabeledStatement.AddReference): New.  Set 'referenced'.
6337         (Goto.Resolve): Use it.
6338
6339 2005-02-05  John Luke  <john.luke@gmail.com>
6340
6341         * driver.cs: remove duplicate -doc line in Usage ()
6342
6343 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6344
6345         * location.cs (Location.AddFile): Fix CS2002 error report.
6346
6347 2005-02-02  Martin Baulig  <martin@ximian.com>
6348
6349         * delegate.cs (Delegate.DefineType): Report an internal error if
6350         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6351         details.        
6352
6353 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6354
6355         Fix a crasher in a variant of #31984.
6356         * const.cs (Constant.CheckBase): New override that defers the
6357         new-or-override check in case the base type hasn't been populated
6358         yet.
6359         (Constant.Define): Ensure the new-or-override check is performed.
6360
6361 2005-02-01  Duncan Mak  <duncan@ximian.com>
6362
6363         * const.cs (LookupConstantValue): Check that `ce' is not null
6364         before calling GetValue ().
6365
6366 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6367
6368         Fix test-334.cs (#69519).
6369         * cs-parser.jay (using_alias_directive): Pass in an expression to
6370         NamespaceEntry.UsingAlias.
6371         (using_namespace_directive): Pass in an expression to
6372         NamespaceEntry.Using.
6373         (namespace_name): Don't flatten to a string.
6374         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6375         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6376         ResolveAsTypeStep.
6377         (NamespaceEntry.UsingEntry): Likewise.
6378         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6379         changes.
6380         (NamespaceEntry.LookupForUsing): Remove.
6381         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6382         names.
6383         (NamespaceEntry.Lookup): Remove support for dotted names.
6384
6385 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6386
6387         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6388         split into two.
6389         (NamespaceEntry.ImplicitParent): Compute on demand.
6390         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6391         parallels the current.
6392         (NamespaceEntry.LookupForUsing): Use it.
6393         (NamespaceEntry.Lookup): If the current namespace-entry is
6394         implicit, don't search aliases and using tables.
6395
6396 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6397
6398         Fix #31984.
6399         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6400         BaseCache here.
6401         (TypeContainer.BaseCache): Compute on demand.
6402         (TypeContainer.FindMembers): Define constants and types if they're
6403         not already created.
6404         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6405         check.
6406         * const.cs (Constant.Define): Make idempotent.
6407
6408 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6409
6410         * pending.cs: Produce better code (no nops produced by using Ldarg
6411         + value).
6412         
6413         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6414         i - 1' it should be arg + 1.
6415
6416         Fixes bug #71819.
6417
6418 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6419
6420         * attribute.cs (Attribute.CheckAttributeType): Make private
6421         non-virtual.
6422         (Attribute.ResolveType): Make virtual.
6423         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6424         handling of RootContext.Tree.Types.
6425
6426 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6427
6428         Update attribute-handling to use the SimpleName/MemberAccess
6429         mechanisms.
6430         * cs-parser.jay (attribute): Pass in an expression to the
6431         constructors of Attribute and GlobalAttribute.
6432         * attribute.cs (Attribute): Take an expression for the name.
6433         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6434         passed in attribute name expression.
6435         (Attribute.CheckAttributeType): Use it.
6436         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6437         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6438         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6439         argument to prevent error messages if the lookup fails.
6440
6441 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6442
6443         * expression.cs (Indirection): Implemented IVariable interface
6444         to support indirection in AddressOf operator.
6445         (PointerArithmetic.Emit): Add optimalization for case where
6446         result can be precomputed.
6447
6448 2005-01-26  Martin Baulig  <martin@ximian.com>
6449
6450         * class.cs (TypeContainer.AttributeTargets): Return the correct
6451         AttributeTargets depending on our `Kind' instead of throwing an
6452         exception; fixes #71632.
6453
6454 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6455
6456         Fix #71257
6457         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6458         constant members.
6459
6460 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6461
6462         Fix #71602.
6463         * expression.cs (MemberAccess.DoResolve): Don't complain with
6464         cs0572 when the LHS of a member access has identical name and type
6465         name.
6466
6467 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6468
6469         Fix #71651, #71675
6470         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6471         CreatePermission.
6472         Create custom PermissionSet only for PermissionSetAttribute.
6473
6474 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6475
6476         Fix #71649
6477         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6478         delegates in static class.
6479
6480 2005-01-24  Martin Baulig  <martin@ximian.com>
6481
6482         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6483         merging an implicit block, just use its reachability.
6484
6485         * statement.cs (Block.Resolve): Make the unreachable code check
6486         work wrt. implicit blocks; see test-337 from #63842.
6487
6488 2005-01-21  Alp Toker  <alp@atoker.com>
6489  
6490         * cs-parser.jay: destructor_declaration's container is PartialContainer
6491         not Class when partial types are used, so use Kind prop instead of
6492         'is'.
6493         
6494 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6495
6496         * cs-parser.jay: Improve error reporting when an interface
6497         declares new types.
6498
6499 2005-01-20  Dick Porter  <dick@ximian.com>
6500
6501         * support.cs: SeekableStreamReader fix from Sandor Dobos
6502         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6503         chars are read.  Fixes bug 70369.
6504
6505 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6506
6507         * cs-parser.jay (catch_clause): Simplify current_block handling
6508         somewhat.
6509
6510 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6511
6512         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6513         code with ImplicitStandardConversion to handle the implicit
6514         conversion of method groups into valid delegate invocations. 
6515
6516         The problem is that in parameter handling we were using this code
6517         path.  Fixes bug #64698
6518
6519 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6520
6521         * cs-parser.jay: Fix several infelicities.
6522         - Avoid assigning to the parser value stack.  Code like 
6523           '$3 = null' is unclean.  Synthesize a value for the code block
6524           instead. 
6525         - Avoid using oob_stack for storing location information.  Use ...
6526         (_mark_): ... this.  New (empty) rule.  Saves the current location
6527         in $$.
6528         (foreach_statement): Avoid using oob_stack for current_block
6529         handling.  Use technique used in for_statement and
6530         using_statement.  Synthesize a value for the code block to store
6531         additional intermediate information.
6532
6533 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6534
6535         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6536         of a different type is only allowed to private fields of a
6537         containing type, not on fields of a base class.
6538
6539         See test-174.cs and error cs0122-9.cs
6540
6541 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6542
6543         Fix test-335.cs (bug #58126).
6544         * cs-parser.jay (argument): Split out non-expression parts of the
6545         rule into 'non_simple_argument'.
6546         (invocation_expression): Support parenthesized invocations with
6547         multiple arguments, and with single non-simple arguments.
6548
6549 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6550
6551         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6552         places.
6553
6554 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6555
6556         Fix cs0038-1.cs, cs1640-6.cs.
6557         * ecore.cs (Expression.Resolve): Remove special-case for
6558         SimpleName in error-handling.
6559         (Expression.almostMatchedMembers): Relax access permission to
6560         protected.
6561         (Expression.MemberLookupFailed): Handle duplicates in
6562         almostMatchedMembers list.
6563         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6564         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6565         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6566         overload if the passed in MemberInfo is a MethodBase.
6567
6568 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6569
6570         Fix #70749
6571         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6572         for non-CAS & merge permission sets properly.
6573
6574 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6575
6576         Improve standard-compliance of simple name and member access 
6577         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6578         * ecore.cs (FullNamedExpression): New abstract base class 
6579         for Namespaces and TypeExpressions.
6580         (ResolveFlags.SimpleName): Remove.
6581         (SimpleName): Remove support for dotted names.
6582         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6583         DeclSpace.FindType and DeclSpace.LookupType.
6584         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6585         (Expression.ExprClassName): Make member function.
6586         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6587         a namespace.  Remove creation of dotted "SimpleName"s.
6588         (MemberAccess.DoResolve): Likewise.
6589         * decl.cs (DeclSpace.Cache): Make private.
6590         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6591         (DeclSpace.FindType): Update.
6592         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6593         FullNamedExpression.
6594         * namespace.cs (Namespace): Derive from FullNamedExpression
6595         so that it can be part of expression resolution.
6596         (Namespace.Lookup): Return an FullNamedExpression.
6597         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6598         namespace.
6599         * rootcontext.cs (NamespaceLookup): Remove.
6600         (LookupType): Move to DeclSpace.
6601         * attribute.cs (CheckAttributeType): Update.
6602         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6603         (FindDocumentedTypeNonArray): Likewise.
6604
6605 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6606
6607         Fix cs0509.cs, cs1632.cs.
6608         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6609         is the same as IsInterface.
6610         (TypeContainer.GetClassBases): Likewise.
6611         * statement.cs (LabeledStatement.ig): New field.
6612         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6613         label.
6614         (LabeledStatement.DoEmit): Check that the label was created with
6615         the same ILGenerator.
6616
6617 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6618
6619         Fix #71058
6620         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6621         accessors to its properties.
6622
6623         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6624         from accessors to property.
6625         
6626 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6627
6628         Fix #70722
6629         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6630         only for overrides.
6631         
6632 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6633
6634         * attribute.cs: Check for null and empty strings.  
6635
6636         I have lost another battle to Paolo.
6637
6638 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6639
6640         Fix #70942
6641         * class.cs (PropertyMethod): Set Parent field in ctors.
6642         (SetMethod.InternalParameters): Add unsafe switch hack.
6643         Override MarkForDuplicationCheck where it is appropriate.
6644
6645         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6646         It says whether container allows members with the same name.
6647         Base default is no.
6648         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6649         Removed is_method parameter.
6650
6651 2005-01-06  Duncan Mak  <duncan@ximian.com>
6652
6653         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6654         because the previous change led to incorrect reporting of CS1032
6655         ("Cannot define/undefine preprocessor symbols after first token in
6656         file"). Instead of using `tokens_seen' as the only flag that
6657         triggers CS1040, introduce `comments_seen'. This new flag is used
6658         to signify having seen comments on the current line, so it is
6659         unset after a newline.
6660
6661 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6662
6663         * doc.cs : When searching for a type, find nested type too.
6664           This fixes bug #71040.
6665
6666 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6667
6668         * doc.cs :
6669           - Warn missing member comment on those classes which also does not
6670             have doc comments. Fixed bug #71041.
6671           - Don't warn missing doc comment on default constructor.
6672             Fixed bug #71042.
6673
6674 2005-01-06  Duncan Mak  <duncan@ximian.com>
6675
6676         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6677         comments, set `tokens_seen' to true. This allows us to detect
6678         misplaced preprocessor directives (i.e. not at the beginning of
6679         the a line, nor after whitespaces). In that case, report error
6680         CS1040. This fixes bug #56460.
6681
6682         * cs-parser.jay (interface_member_declaration): Add checks for
6683         IsExplicitImpl, and report CS0541 error if an interface member is
6684         defined as an explicit interface declaration.
6685
6686 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6687
6688         Fix #70817
6689         * class.cs (PropertyMethod): Set Parent field in ctors.
6690         (SetMethod.InternalParameters): Add unsafe switch hack.
6691         
6692         * decl.cs (MemberCore.Parent): Cannot be readonly.
6693
6694 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6695
6696         * decl.cs (DeclSpace.ResolveType): Remove.
6697         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6698         Merge in code from ...
6699         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6700         * class.cs, enum.cs: Update to changes.
6701
6702 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6703
6704         * anonymous.cs: Ensure that we init the scope of our parent if it
6705         has not been initialized yet.
6706
6707 2004-12-30  Duncan Mak  <duncan@ximian.com>
6708
6709         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6710         if field.FieldBuilder is null. Fixes #70758.
6711
6712         * convert.cs: Fixed some typos and updated some of the comments.
6713         (ImplicitStandardConversionExists):
6714         (TryImplicitIntConversion): If `target_type' is an interface and
6715         the type of `ic' implements this interface, return true or a new
6716         BoxedCast instead of null. This fixes #70468.
6717
6718 2004-12-29  Duncan Mak  <duncan@ximian.com>
6719
6720         * expression.cs (Argument.Emit): Check that Expr is
6721         IMemoryLocation before casting to it, and report CS1510 otherwise.
6722
6723         This fixes #70402.
6724
6725 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6726
6727         * statement.cs (Block.ThisVariable): remove the recursion here, to
6728         make the --profile more sane.
6729
6730 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6731
6732         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6733         assembly, by JB Evain.
6734
6735 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6736
6737         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6738           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6739         "parent" refers to enclosing type/class.  "base" refers to superclass.
6740
6741 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6742
6743         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6744         Ensure that we only have GlobalAttributes.
6745         * attribute.cs (Attribute.Emit): Make non-virtual.
6746         (GlobalAttribute.Emit): Remove.
6747         (Attribute.Resolve): Make virtual.
6748         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6749         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6750         the argument. Don't create one.
6751         (Attribute.GetObsoleteAttribute): Likewise.
6752         (Attribute.GetClsCompliantAttributeValue): Likewise.
6753         * class.cs, decl.cs: Update to changes.
6754
6755 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6756
6757         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6758         
6759         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6760         
6761         * statement.cs (Foreach.Resolve): Add error 186 report.
6762
6763 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6764
6765         * expression.cs (Conditional.DoResolve): Add warning 429.
6766         
6767         * statement.cs (If.Resolve): Add warning 665.
6768
6769 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6770
6771         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6772         except when in the parser, and in GlobalAttribute.
6773         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6774         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6775         RootContext.Tree.Types.NamespaceEntry once work is done.
6776         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6777         and resets RootContext.Tree.Types.NamespaceEntry.
6778
6779 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6780
6781         * cs-parser.jay: Don't create a block for every variable.
6782
6783 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6784
6785         * location.cs: Provide extra information.
6786
6787         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6788         variables from the captured environment, it is the ldarg_0.
6789
6790 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6791
6792         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6793         find a conclusion.
6794         
6795         * class.cs: Changed warning level for 169 to avoid developer
6796         displeasure from warning flooding. It will be changed back when they
6797         fix most of current BCL warnings.
6798         
6799         * RootContext.cs: Pushed default WarningLevel to 3.
6800         
6801         * statement.cs: Removed unused variable.
6802
6803 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6804
6805         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6806         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6807         Add error 502 report.
6808         (StaticClass.DefineType): Add error 441 report.
6809         (Class.AllowedModifiersProp): New virtual property as temporary
6810         extension to AllowedModifiers.
6811         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6812         to share implementation with StaticClass and don't call virtual
6813         methods from ctor.
6814         
6815         * driver.cs (MainDriver): Add error 1558 test.
6816
6817         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6818         report. Moved error 36 test here.
6819
6820         * statement.cs (Throw.Resolve): Add error 724 report.
6821
6822         * typemanager.cs: Add out_attribute_type core type.
6823         
6824 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6825
6826         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6827         3018 report.
6828         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6829
6830         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6831         3017 report.
6832         
6833         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6834
6835         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6836         Add error 3023 report.
6837         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6838
6839         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6840         implementation.
6841
6842 2004-12-12  John Luke  <john.luke@gmail.com>
6843
6844         * driver.cs (AddArgs): take -- into account when
6845         adding arguments, fixes bug 65710 
6846
6847 2004-12-12  Martin Baulig  <martin@ximian.com>
6848
6849         * expression.cs (Unary.TryReduceNegative): Added support for
6850         SByteConstant and ByteConstant.
6851         (Unary.Reduce): Check error values from TryReduceNegative().
6852
6853 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6854
6855         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6856         and report exception as error 182.
6857
6858 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6859
6860         * driver.cs (Main): Fix message when there are warnings.
6861
6862 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6863
6864         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6865
6866 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6867
6868         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6869         Reduced number of warnings.
6870         
6871         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6872
6873 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6874
6875         * driver.cs: Removed message.
6876
6877         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6878
6879 2004-12-08    <vargaz@freemail.hu>
6880
6881         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6882
6883 2004-12-08  Martin Baulig  <martin@ximian.com>
6884
6885         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6886         instead of a CS3002 for properties and indexer.
6887
6888 2004-12-08  Martin Baulig  <martin@ximian.com>
6889
6890         * decl.cs (MemberName.ToString): Make this work again.
6891
6892 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6893
6894         * attribute.cs (Resolve): Add error 591 detection.
6895
6896         * class.cs (FieldMember.Define): Add error 1547 detection.
6897         (Indexer.Define): Add error 620 detection.
6898         (Operator.Define): Add error 590 detection.
6899
6900         * ecore.cs: Missing argument for error 79.
6901
6902         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6903         detection.
6904
6905 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6906
6907         Fix #70106
6908         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6909         only.
6910
6911 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6912
6913         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6914           Some operator comments were suppressed.
6915         * doc.cs : Implicit/explicit operator name in doc comments are like
6916           "op_Explicit(type)~returnType", so added suffix handling.
6917
6918 2004-12-07  Martin Baulig  <martin@ximian.com>
6919
6920         * decl.cs
6921         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6922         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6923         (DeclSpace.ec): New protected field; store the EmitContext here.
6924         (DeclSpace.EmitContext): New public property; moved here from
6925         `TypeContainer'.
6926         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6927         EmitContext.
6928
6929         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6930         (Enum.Emit): Don't create a new EmitContext.
6931
6932         * delegate.cs (Delegate.DefineType): Always create the
6933         EmitContext.
6934
6935         * iterators.cs (Iterators.DefineIterator): Create a new
6936         EmitContext and store it in `ec'.
6937
6938 2004-08-24  Martin Baulig  <martin@ximian.com>
6939
6940         * typemanager.cs
6941         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6942         this for accessibility checks.
6943         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6944         IsNestedFamilyAccessible.
6945         (TypeManager.IsSubclassOf): New method, do what the name actually
6946         says.   
6947
6948 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6949
6950         Fix crash on cs0657-17.cs.
6951         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6952         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6953         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6954         the case where the NamespaceEntry gets overwritten.
6955
6956 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6957
6958         Fixed #69195, #56821
6959         * ecore.cs (ResolveBoolean): Tiny refactoring.
6960
6961         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6962         of right expression resolving when left is false constant and
6963         operator is LogicalAnd OR true constant and operator is LogicalOr.
6964
6965         * statement.cs (ResolveUnreachable): Always reports warning.
6966
6967 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6968
6969         * class.cs: Distinguish between 1721 and 1722 (just a little help
6970         for the programmer).
6971
6972 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6973
6974         * delegate.cs: Only allow this on new versions of the language. 
6975
6976 2004-12-02  Duncan Mak  <duncan@ximian.com>
6977
6978         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6979         Expression class.
6980         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6981         here as a static method. Take an additional bool out parameter
6982         `must_do_cs1540_check' for signaling to InstanceResolve.
6983         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6984         member field from PropertyExpr class and made it an argument of
6985         the method instead.
6986         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6987         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6988         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6989         and `remove_accessor' as well as InstanceResolve: report CS0122
6990         where applicable.
6991
6992         Fixes #70129.
6993
6994 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6995
6996         Fix test-327.cs, test-328.cs, and put in early infrastructure
6997         for eventually fixing #52697.
6998         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6999         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7000         from other methods.
7001         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7002         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7003         (VerifyUsing, error246): Update.
7004         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7005         'NamespaceEntry.LookupNamespaceOrType'.
7006
7007 2004-12-03  Martin Baulig  <martin@ximian.com>
7008
7009         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7010         method as our child, call AnonymousMethod.Compatible() on it.
7011
7012 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7013
7014         Disable XML documentation support in 'basic' profile.
7015         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7016         Redirect XmlElement to System.Object.
7017         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7018         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7019         * mcs.exe.sources: Add doc-bootstrap.cs.
7020         * doc-bootstrap.cs: New file.  Contains empty stub implementation
7021         of doc.cs.
7022
7023 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7024
7025         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7026           comments are allowed.
7027
7028 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7029
7030         * delegate.cs: Add checks for subtypes in paramaters and return values
7031         in VerifyMethod () to add support for Covariance/Contravariance
7032         in delegates.
7033         
7034 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7035
7036         * report.cs: Remove extra closing parenthesis.
7037
7038         * convert.cs (Error_CannotImplicitConversion): If the name of the
7039         types are the same, provide some extra information.
7040
7041         * class.cs (FieldBase): Use an unused bit field from the field to
7042         encode the `has_offset' property from the FieldMember.  This saves
7043         a couple of Ks on bootstrap compilation.
7044
7045         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7046         method as our child, return the AnonymousMethod resolved
7047         expression.
7048
7049         * expression.cs (New.DoResolve): Allow return values from
7050         NewDelegate to also include AnonymousMethods.
7051
7052         Fixes #70150.
7053
7054 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7055
7056         Fix bug #70102
7057         * attribute.cs (Resolve): Improved implementation of params
7058         attribute arguments.
7059
7060         * support.cs (ParameterData): Add HasParams to be faster.
7061
7062 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7063
7064         all things are for /doc support:
7065
7066         * doc.cs: new file that supports XML documentation generation.
7067         * mcs.exe.sources: added doc.cs.
7068         * driver.cs:
7069           Handle /doc command line option.
7070           Report error 2006 instead of 5 for missing file name for /doc.
7071           Generate XML documentation when required, after type resolution.
7072         * cs-tokenizer.cs:
7073           Added support for picking up documentation (/// and /** ... */),
7074           including a new XmlCommentState enumeration.
7075         * cs-parser.jay:
7076           Added lines to fill Documentation element for field, constant,
7077           property, indexer, method, constructor, destructor, operator, event
7078           and class, struct, interface, delegate, enum.
7079           Added lines to warn incorrect comment.
7080         * rootcontext.cs :
7081           Added Documentation field (passed only when /doc was specified).
7082         * decl.cs:
7083           Added DocComment, DocCommentHeader, GenerateDocComment() and
7084           OnGenerateDocComment() and some supporting private members for
7085           /doc feature to MemberCore.
7086         * class.cs:
7087           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7088         * delegate.cs:
7089           Added overriden DocCommentHeader.
7090         * enum.cs:
7091           Added overriden DocCommentHeader and GenerateDocComment().
7092
7093 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7094
7095         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7096         unwrapping the enumeration values, chain to
7097         DoConstantNumericPromotions again, so we can promote things to the
7098         fundamental types (takes care of enums that are bytes, sbytes).
7099
7100         Fixes bug #62054.
7101
7102 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7103
7104         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7105         Fix long-standing bug in type-lookup.  Use FindType instead of
7106         LookupType when ec.ResolvingTypeTree.
7107         (Attribute.ResolveType, Attribute.Resolve)
7108         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7109         Update to changes.
7110         (Attributes.Search): Remove internal version.  Update.
7111         (Attributes.SearchMulti): Update.
7112         (Attributes.GetClsCompliantAttribute): Remove.
7113         (Attributes.GetIndexerNameAttribute): Remove.
7114         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7115         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7116         * class.cs (Indexer.Define): Likewise.
7117
7118 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7119
7120         Fix bug #68790
7121         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7122         MarshallByReference members access.
7123
7124         * expression.cs: Use CheckMarshallByRefAccess;
7125         Better error CS0197 message.
7126
7127         * report.cs: Print whole related error message.
7128
7129 2004-11-30  Raja R Harinath  <rharinath@novell.com>
7130
7131         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7132         the current directory to help debugging.
7133
7134 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7135
7136         * class (GetClassBases): Better error 60 report.
7137         (EventProperty): Disabled warning 67 detection.
7138
7139 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7140
7141         Fix bug #60324
7142         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7143
7144         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7145         precise values.
7146
7147 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7148
7149         Fix bug #49488
7150         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7151
7152         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7153
7154 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7155
7156         * attribute.cs (Attribute.Resolve): Refine error reporting and
7157         report a cs0117 if the identifier does not exist, to distinguish
7158         from 0617 which is a miss-use of the actual identifier.
7159
7160         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7161         between cs0070 and cs0079.
7162
7163         * class.cs (MemberBase.DoDefine): When reporting a wrong
7164         accessibility level, we use MethodCore to compare instead of
7165         Method (this was a regression in some refactoring effort).
7166
7167         So now we correctly report cs0056 again.
7168
7169         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7170         testing the target_type (which was known to be object_type) and
7171         not the source type (which is anonymous_method).
7172
7173         Fixed reporting of error cs1660.
7174
7175         * expression.cs (UserCast.Source): Expose the underlying cast.
7176
7177         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7178         allowed types to find a match to int32 first (most common).
7179
7180         In addition, it ignores any ImplicitUserConversions that did an
7181         internal implicit conversion (as the switch statement allows only
7182         one integral conversion to exist).
7183
7184         * class.cs (PartialContainer.Create): rename `name' to
7185         `member_name' for clarity.  Then replace the string calls with a
7186         call to MemberName.GetPartialName, as now using
7187         MemberName.ToString is an error (this is due to the side effects
7188         it had, that were fixed in the past).
7189
7190         This will restore the error reporting on a number of partial class
7191         errors that were missusing this (and getting an exception as a
7192         results, which is now just a plain textual warning, because
7193         yyparse debug output would crash otherwise).
7194
7195 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7196
7197         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7198
7199 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7200
7201         * rootcontext.cs (LookupType): Make sure to cache lookups that
7202         don't give us a negative result. This saves about 5% of corlib
7203         compilation time.
7204
7205 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7206
7207         * report.cs (AbstractMessage.Print): messages are sent to stderr
7208
7209         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7210         non-interface in the list of interfaces (at this point, either
7211         parent was properly set, or a base class is being listed in the
7212         interfaces section).
7213
7214         This flags error 1722, and resolves the crash from bug 69259.
7215
7216 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7217
7218         * statement.cs (Using.EmitExpressionFinally): make this work right
7219         for valuetypes. Fixes 69926.
7220
7221 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7222
7223         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7224         converted to an enum" here, before we try to change the underlying
7225         type.  This code exists, but it is a different code path than the
7226         one used while encoding constants.
7227
7228         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7229         old bug: when converting from the null literal to a pointer,
7230         return an EmptyCast, not the NullLiteral.
7231
7232         This fixes #69921, the recent null_type changes probably made this
7233         bug more prominent.
7234
7235         (ImplicitReferenceConversionExists): In addition, resynchronized
7236         the code here, so it matches the same code in
7237         ImplicitReferenceConversionExists for the `from any class-type S
7238         to any interface-type T'.
7239         
7240
7241 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7242
7243         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7244
7245 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7246
7247         * cs-parser.jay: Use verbosity accordingly. 
7248
7249 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7250
7251         * expression.cs (Unary.ResolveOperator): Do not report warning;
7252         AddressOf reads from variable.
7253         
7254         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7255
7256 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7257
7258         Fix bug #69462
7259
7260         * attribute.cs (Attributable): Removed CheckTargets.
7261         (Attributes.Emit): Explicit attribute targets are tested here.
7262
7263         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7264         not enabled for interfaces.
7265
7266         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7267         (GetAssemblyName): Ouch next bug there.
7268
7269 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7270
7271         * expression.cs: Error 275 added.
7272         
7273 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7274
7275         Fix bug #69177 (Implemented decimal constant support)
7276
7277         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7278         (BinaryFold): Add DecimalConstant.
7279
7280         * const.cs (Define): Decimal constant 
7281         (is not constant.
7282         (ChangeType): Add decimal type handling.
7283         (LookupConstantValue): Don't set value for decimal type but
7284         emit DecimalConstantAttribute. Needed for constant optimization.
7285
7286         * constant.cs (ToDecimal): New method.
7287         (ConvertToDecimal): New method.
7288         (IntConstant): Implemented ConvertToDecimal.
7289         (DecimalConstant.Emit): Emit optimized version for decimals in
7290         int range.
7291
7292         * expression.cs (ResolveOperator): Changed order of constant
7293         reduction to work correctly with native types which have
7294         overloaded operators.
7295         (ResolveMemberAccess): Extract constant value from attribute
7296         for decimal type.
7297
7298         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7299
7300         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7301         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7302         (ChangeType): Decimal is special.
7303         (TypeToCoreType): Add decimal type.
7304
7305 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7306
7307         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7308         decimal types.
7309
7310 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7311
7312         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7313         test cs1667-5.cs.
7314
7315 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7316
7317         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7318
7319         * pending.cs (PendingImplementation): Grab only interfaces.
7320
7321 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7322
7323         * statement.cs (ForeachHelperMethods): Add location member and
7324         error 202 detection.
7325
7326 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7327
7328         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
7329         automatically handled by executable.make.
7330         (PROGRAM): Make profile-specific.
7331
7332 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7333
7334         * expression.cs (DoResolveBase): Fixed wrong warning for out
7335         variables.
7336
7337 2004-11-18  Martin Baulig  <martin@ximian.com>
7338
7339         Merged latest changes into gmcs.  Please keep this comment in
7340         here, it makes it easier for me to see what changed in MCS since
7341         the last time I merged.
7342
7343 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7344
7345         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7346         (TypeHandle.GetMemberCache): New.
7347         (TypeHandle.TypeHandle): Update.
7348         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7349         (TypeManager.LookupParentInterfacesCache):
7350         Rename from LookupInterfaceCache.  Optimize slightly.
7351         (TypeManager.MemberLookup_FindMembers): Update.
7352         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7353         multi-type variant.
7354         (AddCacheContents): Rename from AddHashtable.
7355         * class.cs (TypeContainer.parent_container): Remove.
7356         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7357         (TypeContainer.DoDefineMembers): Don't initialize it.
7358         Update to name changes.
7359         
7360 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7361
7362         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7363         that factors the code to check access modifiers on override.  
7364
7365         (PropertyBase): Use the code here.
7366
7367         Patch from Lluis S'anchez, fixes bug #69361.
7368
7369 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7370
7371         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7372         routine that is used to report the use of a captured variable
7373         whose address has been taken.
7374
7375         There are two checks: one when variables are being captured and
7376         the other check is when the address of a variable is taken. 
7377         
7378         (because an anonymous methods might be resolved before *or* after
7379         the address has been taken) and 
7380
7381         * expression.cs (Conditional.DoResolve): Remove the special
7382         casing that Martin added to trueExpr and falseExpr being both
7383         NullLiteral.  We get the right behavior now just by introducing
7384         the null_type into the compiler. 
7385
7386         * convert.cs (ExplicitConversion): Change the code to use
7387         null_type instead of testing `expr is NullLiteral'.
7388         (ImplicitConversionStandard): use null_type too.
7389         (ImplicitReferenceConversionExists): use null_type too.
7390         (ImplicitReferenceConversion): use null_type too.
7391
7392         * literal.cs: The type of `NullLiteral' is now null_type instead
7393         of object_type. 
7394         (Resolve): Set the type here.
7395
7396         * typemanager.cs: Introduce null_type.
7397
7398 2004-11-17  Martin Baulig  <martin@ximian.com>
7399
7400         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7401         direction, like FindMembers() does.  Fixes #69546, testcase is in
7402         test-315.cs.    
7403
7404 2004-11-16  Martin Baulig  <martin@ximian.com>
7405
7406         This is based on a patch from Marek Safar, see bug #69082.
7407         Fixes bugs #63705 and #67130.
7408
7409         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7410         method; create a MemberCache for an interface type and cache the
7411         result.
7412
7413         * decl.cs (IMemberContainer.ParentContainer): Removed.
7414         (IMemberContainer.ParentCache): New property.
7415         (MemberCache.SetupCacheForInterface): Removed.
7416         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7417         to create a cache for an interface's "parent".
7418
7419         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7420         interfaces too.
7421
7422 2004-11-16  Martin Baulig  <martin@ximian.com>
7423
7424         Merged back from gmcs; these changes already went into gmcs a
7425         couple of weeks ago.
7426
7427         * typemanager.cs
7428         (TypeManager.AddUserType): Removed the `ifaces' argument.
7429         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7430         `TypeExpr []'.
7431         (TypeManager.AddUserInterface): Removed.
7432         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7433         `TypeExpr []'.
7434         (TypeManager.GetInterfaces): Likewise.
7435         (TypeManager.GetExplicitInterfaces): Likewise.
7436
7437         * ecore.cs (TypeExpr.GetInterfaces): Removed.
7438
7439         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7440         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7441
7442 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7443
7444         * statement.cs: Avoid adding bools to a hashtable.
7445
7446 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7447
7448         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7449         calling an unsafe method from a safe location.
7450
7451 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7452
7453         Fix #69167
7454         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7455
7456 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7457
7458         * namespace.cs (VerifyUsing): use GetPartialName instead of
7459         ToString. 
7460
7461 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7462
7463         * statement.cs (Return.Resolve): Fix regression in typo: if
7464         `in_exc', we have to request a NeedReturnLabel, this was a typo
7465         introduced in the anonymous method check-in.  Fixes #69131.
7466
7467         * Indexers were using the ShortName when defining themselves,
7468         causing a regression in the compiler bootstrap when applying the
7469         patch from 2004-11-02 (first part), now they use their full name
7470         and the bug is gone.
7471
7472 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7473
7474         * driver.cs: Strip the path from the names of embedded resources. Fixes
7475         #68519.
7476
7477 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7478
7479         Fix error message regression: cs0104-2.cs.
7480         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7481         (AliasEntry.Resolve): Update.
7482         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7483         'silent' flag.
7484         (RootContext.LookupType): Update.
7485
7486 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7487
7488         * cs-parser.jay: Add support for handling accessor modifiers
7489         * class: Add support port accessor modifiers and error checking,
7490         define PropertyMethod.Define as virtual (not abstract anymore)
7491         * ecore.cs: Add checking for proeprties access with access modifiers
7492         * iterators.cs: Modify Accessor constructor call based in the modified
7493         constructor
7494 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7495
7496         * expression.cs (StringConcat): Handle being called twice,
7497         as when we have a concat in a field init with more than two
7498         ctors in the class
7499
7500 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7501
7502         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7503         special case explicit implementations, we should always produce
7504         the .property or .event declaration.
7505         
7506         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7507         since it will not return correct data if people use this
7508         unresolved in the presence of using statements (see test-313).
7509
7510         * class.cs (MethodData.Define): If we are an explicit interface
7511         implementation, set the method name to the full name of the
7512         interface plus the name of the method.  
7513
7514         Notice that using the method.MethodName.GetFullName() does not
7515         work, as it will only contain the name as declared on the source
7516         file (it can be a shorthand in the presence of using statements)
7517         and not the fully qualifed type name, for example:
7518
7519         using System;
7520
7521         class D : ICloneable {
7522                 object ICloneable.Clone ()  {
7523                 }
7524         }
7525
7526         Would produce a method called `ICloneable.Clone' instead of
7527         `System.ICloneable.Clone'.
7528
7529         * namespace.cs (Alias.Resolve): Use GetPartialName.
7530         
7531 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7532
7533         * cs-parser.jay: Add error 1055 report.
7534
7535 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7536
7537         * assign.cs (Assign.DoResolve): Only do the transform of
7538         assignment into a New if the types are compatible, if not, fall
7539         through and let the implicit code deal with the errors and with
7540         the necessary conversions. 
7541
7542 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7543
7544         * cs-parser.jay: Add error 1031 report.
7545
7546         * cs-tokenizer.cs: Add location for error 1038.
7547
7548 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7549
7550         * cs-parser.jay: Add error 1016 report.
7551
7552 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7553
7554         * cs-parser.jay: Add errors 1575,1611 report.
7555
7556 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7557
7558         * cs-parser.jay: Add error 1001 report.
7559
7560 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7561
7562         Fix #68850
7563         * attribute.cs (GetMarshal): Add method argument for
7564         caller identification.
7565
7566         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7567         agument for GetMarshal and RuntimeMissingSupport.
7568
7569 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7570
7571         * attribute.cs (ExtractSecurityPermissionSet): Removed
7572         TypeManager.code_access_permission_type.
7573
7574         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7575
7576 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7577
7578         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7579         for obsolete use of a variable here.   Fixes regression on errors
7580         cs0619-25 and cs0619-26.
7581
7582 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7583
7584         Fix #62358, implemented security attribute encoding.
7585
7586         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7587         Tests permitted SecurityAction for assembly or other types.
7588         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7589         data from SecurityPermissionAttribute to PermisionSet class.
7590
7591         * class.cs (ApplyAttributeBuilder): Added special handling
7592         for System.Security.Permissions.SecurityAttribute based types.
7593
7594         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7595         special handling for System.Security.Permissions.SecurityAttribute
7596         based types.
7597
7598         * enum.cs (ApplyAttributeBuilder): Added special handling
7599         for System.Security.Permissions.SecurityAttribute based types.
7600
7601         * parameter.cs (ApplyAttributeBuilder): Added special handling
7602         for System.Security.Permissions.SecurityAttribute based types.
7603
7604         * rootcontext.cs: Next 2 core types.
7605
7606         * typemanager.cs (TypeManager.security_permission_attr_type):
7607         Built in type for the SecurityPermission Attribute.
7608         (code_access_permission_type): Build in type.
7609
7610 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7611
7612         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7613         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7614         all of this information into
7615         EmitContext.EmitCapturedVariableInstance.
7616         
7617         * codegen.cs (EmitCapturedVariableInstance): move here the
7618         funcionality of emitting an ldarg.0 in the presence of a
7619         remapping.   This centralizes the instance emit code.
7620
7621         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7622         then emit a load of this: it means that we have reached the
7623         topmost ScopeInfo: the one that contains the pointer to the
7624         instance of the class hosting the anonymous method.
7625
7626         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7627         captures to the topmost CaptureContext.
7628
7629 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7630
7631         * expression.cs (LocalVariableReference): Move the knowledge about
7632         the iterators into codegen's EmitCapturedVariableInstance.
7633
7634 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7635
7636         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7637         all code paths return a value from an anonymous method (it is the
7638         same as the 161 error, but for anonymous methods).
7639
7640 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7641
7642         The introduction of anonymous methods in the compiler changed
7643         various ways of doing things in the compiler.  The most
7644         significant one is the hard split between the resolution phase
7645         and the emission phases of the compiler.
7646
7647         For instance, routines that referenced local variables no
7648         longer can safely create temporary variables during the
7649         resolution phase: they must do so from the emission phase,
7650         since the variable might have been "captured", hence access to
7651         it can not be done with the local-variable operations from the runtime.
7652         
7653         * statement.cs 
7654
7655         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7656         is a toplevel block.
7657
7658         (ToplevelBlock): A new kind of Block, these are the blocks that
7659         are created by the parser for all toplevel method bodies.  These
7660         include methods, accessors and anonymous methods.
7661
7662         These contain some extra information not found in regular blocks:
7663         A pointer to an optional CaptureContext (for tracking captured
7664         local variables and parameters).  A pointer to the parent
7665         ToplevelBlock.
7666         
7667         (Return.Resolve): Catch missmatches when returning a value from an
7668         anonymous method (error 1662).
7669         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7670         phase.
7671
7672         (Break.Resolve): ditto.
7673
7674         (SwitchLabel): instead of defining the labels during the
7675         resolution phase, we now turned the public ILLabel and ILLabelCode
7676         labels into methods called GetILLabelCode() and GetILLabel() that
7677         only define the label during the Emit phase.
7678
7679         (GotoCase): Track the SwitchLabel instead of the computed label
7680         (its contained therein).  Emit the code by using
7681         SwitchLabel.GetILLabelCode ().
7682
7683         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7684         whether the Local has been captured or not.
7685
7686         (LocalInfo.IsCaptured): New property, used to tell whether the
7687         local has been captured.
7688         
7689         * anonymous.cs: Vastly updated to contain the anonymous method
7690         support.
7691
7692         The main classes here are: CaptureContext which tracks any
7693         captured information for a toplevel block and ScopeInfo used to
7694         track the activation frames for various local variables.   
7695
7696         Each toplevel block has an optional capture context associated
7697         with it.  When a method contains an anonymous method both the
7698         toplevel method and the anonymous method will create a capture
7699         context.   When variables or parameters are captured, they are
7700         recorded on the CaptureContext that owns them, for example:
7701
7702         void Demo () {
7703              int a;
7704              MyDelegate d = delegate {
7705                  a = 1;
7706              }
7707         }
7708
7709         Here `a' will be recorded as captured on the toplevel
7710         CapturedContext, the inner captured context will not have anything
7711         (it will only have data if local variables or parameters from it
7712         are captured in a nested anonymous method.
7713
7714         The ScopeInfo is used to track the activation frames for local
7715         variables, for example:
7716
7717         for (int i = 0; i < 10; i++)
7718                 for (int j = 0; j < 10; j++){
7719                    MyDelegate d = delegate {
7720                         call (i, j);
7721                    }
7722                 }
7723
7724         At runtime this captures a single captured variable `i', but it
7725         captures 10 different versions of the variable `j'.  The variable
7726         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7727         recorded on a child.  
7728
7729         The toplevel ScopeInfo will also track information like the `this'
7730         pointer if instance variables were referenced (this is necessary
7731         as the anonymous method lives inside a nested class in the host
7732         type of the method). 
7733
7734         (AnonymousMethod): Expanded to track the Toplevel, implement
7735         `AnonymousMethod.Compatible' to tell whether an anonymous method
7736         can be converted to a target delegate type. 
7737
7738         The routine now also produces the anonymous method content
7739
7740         (AnonymousDelegate): A helper class that derives from
7741         DelegateCreation, this is used to generate the code necessary to
7742         produce the delegate for the anonymous method that was created. 
7743
7744         * assign.cs: API adjustments for new changes in
7745         Convert.ImplicitStandardConversionExists.
7746
7747         * class.cs: Adjustments to cope with the fact that now toplevel
7748         blocks are of type `ToplevelBlock'. 
7749
7750         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7751         insteda of standard blocks.
7752
7753         Flag errors if params arguments are passed to anonymous methods.
7754
7755         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7756         `CurrentAnonymousMethod' which points to the current Anonymous
7757         Method.  The variable points to the AnonymousMethod class that
7758         holds the code being compiled.  It is set in the new EmitContext
7759         created for the anonymous method.
7760
7761         (EmitContext.Phase): Introduce a variable and an enumeration to
7762         assist in enforcing some rules about when and where we are allowed
7763         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7764         only one that enfonces this right now).
7765
7766         (EmitContext.HaveCaptureInfo): new helper method that returns
7767         whether we have a CapturedContext initialized.
7768
7769         (EmitContext.CaptureVariable): New method used to register that a
7770         LocalInfo must be flagged for capturing. 
7771
7772         (EmitContext.CapturedParameter): New method used to register that a
7773         parameters must be flagged for capturing. 
7774         
7775         (EmitContext.CapturedField): New method used to register that a
7776         field must be flagged for capturing. 
7777
7778         (EmitContext.HaveCapturedVariables,
7779         EmitContext.HaveCapturedFields): Return whether there are captured
7780         variables or fields. 
7781
7782         (EmitContext.EmitMethodHostInstance): This is used to emit the
7783         instance for the anonymous method.  The instance might be null
7784         (static methods), this (for anonymous methods that capture nothing
7785         and happen to live side-by-side with the current method body) or a
7786         more complicated expression if the method has a CaptureContext.
7787
7788         (EmitContext.EmitTopBlock): Routine that drives the emission of
7789         code: it will first resolve the top block, then emit any metadata
7790         and then emit the code.  The split is done so that we can extract
7791         any anonymous methods and flag any captured variables/parameters.
7792         
7793         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7794         during this phase, the ILGenerator should not be used as labels
7795         and local variables declared here might not be accessible to any
7796         code that is part of an anonymous method.  
7797
7798         Exceptions to this include the temporary variables that are
7799         created by some statements internally for holding temporary
7800         variables. 
7801         
7802         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7803         metadata for a cb
7804
7805         (EmitContext.TemporaryReturn): This method is typically called
7806         from the Emit phase, and its the only place where we allow the
7807         ReturnLabel to be defined other than the EmitMeta.  The reason is
7808         that otherwise we would have to duplicate a lot of logic in the
7809         Resolve phases of various methods that today is on the Emit
7810         phase. 
7811
7812         (EmitContext.NeedReturnLabel): This no longer creates the label,
7813         as the ILGenerator is not valid during the resolve phase.
7814
7815         (EmitContext.EmitThis): Extended the knowledge in this class to
7816         work in anonymous methods in addition to iterators. 
7817
7818         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7819         code is necessary on the stack to access the instance to a local
7820         variable (the variable will be accessed as a field).
7821
7822         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7823         EmitContext.EmitAddressOfParameter): Routines to support
7824         parameters (not completed at this point). 
7825         
7826         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7827         will also remove the parameters.
7828
7829         * convert.cs (Convert): Define a `ConstantEC' which points to a
7830         null.  This is just to prefity some code that uses
7831         ImplicitStandardConversion code and do not have an EmitContext
7832         handy.
7833
7834         The idea is to flag explicitly that at that point in time, it is
7835         known that the conversion will not trigger the delegate checking
7836         code in implicit conversions (which requires a valid
7837         EmitContext). 
7838
7839         Everywhere: pass new EmitContext parameter since
7840         ImplicitStandardConversionExists now requires it to check for
7841         anonymous method conversions. 
7842
7843         (Convert.ImplicitStandardConversionExists): If the type of an
7844         expression is the anonymous_method_type, and the type is a
7845         delegate, we invoke the AnonymousMethod.Compatible method to check
7846         whether an implicit conversion is possible. 
7847
7848         (Convert.ImplicitConversionStandard): Only do implicit method
7849         group conversions if the language level is not ISO_1.
7850
7851         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7852         MethodInfo for the Invoke method.  used by Delegate and
7853         AnonymousDelegate.
7854
7855         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7856         method conversions if the target type is a delegate.
7857
7858         Removed extra debugging nops.
7859
7860         (LocalVariableReference): Turn the `local_info' into a public
7861         field. 
7862
7863         Add `prepared' field, the same hack used for FieldExprs to cope
7864         with composed assignments, as Local variables do not necessarily
7865         operate purely on the stack as they used to: they can be captured
7866         fields. 
7867
7868         Add `temp' for a temporary result, like fields.
7869
7870         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7871
7872         It now copes with Local variables that are captured and emits the
7873         proper instance variable to load it from a field in the captured
7874         case. 
7875
7876         (ParameterReference.DoResolveBase): During the resolve phase,
7877         capture parameters if we are in an anonymous method.
7878
7879         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7880         anonymous method, use the EmitContext helper routines to emit the
7881         parameter reference.
7882
7883         * iterators.cs: Set RemapToProxy to true/false during the
7884         EmitDispose class.
7885
7886         * parameters.cs (GetParameterByName): New helper method. 
7887
7888         * typemanager.cs (anonymous_method_type) a new type that
7889         represents an anonyous method.  This is always an internal type,
7890         used as a fencepost to test against the anonymous-methodness of an
7891         expression. 
7892         
7893 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7894
7895         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7896         561 report.
7897         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7898
7899 2004-10-18  Martin Baulig  <martin@ximian.com>
7900
7901         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7902         `Type' directly, but call ResolveType() on it.
7903         (Catch.Resolve): Likewise.
7904         (Foreach.Resolve): Likewise.
7905
7906 2004-10-18  Martin Baulig  <martin@ximian.com>
7907
7908         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7909         `Type' directly, but call ResolveType() on it.
7910         (Probe.DoResolve): Likewise.
7911         (ArrayCreation.LookupType): Likewise.
7912         (TypeOf.DoResolve): Likewise.
7913         (SizeOf.DoResolve): Likewise.
7914
7915 2004-10-18  Martin Baulig  <martin@ximian.com>
7916
7917         * expression.cs (Invocation.BetterFunction): Put back
7918         TypeManager.TypeToCoreType().
7919
7920 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7921
7922         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7923         the ResolveType.
7924
7925 2004-10-18  Martin Baulig  <martin@ximian.com>
7926
7927         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7928         `Type' directly, but call ResolveType() on it.
7929
7930 2004-10-18  Martin Baulig  <martin@ximian.com>
7931
7932         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7933         `Type' directly, but call ResolveType() on it.
7934         (MemberBase.DoDefine): Likewise.
7935
7936         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7937         `Type' directly, but call ResolveType() on it.
7938         (ComposedCast.DoResolveAsTypeStep): Likewise.
7939
7940         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7941         `Type' directly, but call ResolveType() on it.
7942
7943 2004-10-17  John Luke  <john.luke@gmail.com>
7944
7945         * class.cs (Operator.GetSignatureForError): use CSharpName
7946
7947         * parameter.cs (Parameter.GetSignatureForError): Returns
7948         correct name even if was not defined.
7949
7950 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7951
7952         Fix #65816.
7953         * class.cs (TypeContainer.EmitContext): New property.
7954         (DefineNestedTypes): Create an emitcontext for each part.
7955         (MethodCore.DoDefineParameters): Use container's emitcontext.
7956         Pass type array to InternalParameters.
7957         (MemberBase.DoDefine): Use container's emitcontext.
7958         (FieldMember.Define): Likewise.
7959         (Event.Define): Likewise.
7960         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7961         Pass type array to InternalParameters.
7962         (SetIndexerMethod.GetParameterInfo): Likewise.
7963         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7964         * delegate.cs (Define): Pass emitcontext to
7965         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7966         array to InternalParameters.
7967         * expression.cs (ParameterReference.DoResolveBase): Pass
7968         emitcontext to GetParameterInfo.
7969         (ComposedCast.DoResolveAsTypeStep): Remove check on
7970         ec.ResolvingTypeTree.
7971         * parameter.cs (Parameter.Resolve): Change argument to
7972         EmitContext.  Use ResolveAsTypeTerminal.
7973         (Parameter.GetSignature): Change argument to EmitContext.
7974         (Parameters.ComputeSignature): Likewise.
7975         (Parameters.ComputeParameterTypes): Likewise.
7976         (Parameters.GetParameterInfo): Likewise.
7977         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7978         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7979         * support.cs (InternalParameters..ctor): Remove variant that takes
7980         a DeclSpace.
7981         * typemanager.cs (system_intptr_expr): New.
7982         (InitExpressionTypes): Initialize it.
7983
7984 2004-10-12  Chris Toshok  <toshok@ximian.com>
7985
7986         * cs-parser.jay: fix location for try_statement and catch_clause.
7987
7988 2004-10-11  Martin Baulig  <martin@ximian.com>
7989
7990         * report.cs: Don't make --fatal abort on warnings, we have
7991         -warnaserror for that.
7992
7993 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7994
7995         More DeclSpace.ResolveType avoidance.
7996         * decl.cs (MemberCore.InUnsafe): New property.
7997         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7998         with newly created EmitContext.
7999         (FieldMember.Define): Likewise.
8000         * delegate.cs (Delegate.Define): Likewise.
8001         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8002         only if normal name-lookup fails.
8003         (TypeExpr.DoResolve): Enable error-checking.
8004         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8005         (SizeOf.DoResolve): Likewise.
8006         (ComposedCast.DoResolveAsTypeStep): Likewise.
8007         (StackAlloc.DoResolve): Likewise.
8008         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8009         (Block.Unsafe): New property.
8010         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8011         (Unsafe): Set 'unsafe' flag of contained block.
8012         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8013         (Fixed.Resolve): Likewise.
8014         (Catch.Resolve): Likewise.
8015         (Using.ResolveLocalVariableDecls): Likewise.
8016         (Foreach.Resolve): Likewise.
8017
8018 2004-10-05  John Luke <john.luke@gmail.com>
8019
8020         * cs-parser.jay: add location to error CS0175
8021
8022 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8023
8024         * ecore.cs (Expression.Constantity): Add support for turning null
8025         into a constant.
8026
8027         * const.cs (Const.Define): Allow constants to be reference types
8028         as long as the value is Null.
8029
8030 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8031
8032         * namespace.cs (NamespaceEntry.Using): No matter which warning
8033         level is set, check if this namespace name has already been added.
8034
8035 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8036
8037         * expression.cs: reftype [!=]= null should always use br[true,false].
8038         # 67410
8039
8040 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8041
8042         Fix #67108
8043         * attribute.cs: Enum conversion moved to 
8044         GetAttributeArgumentExpression to be applied to the all
8045         expressions.
8046
8047 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8048
8049         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8050         * class.c (TypeContainer.DefineType): Flag error if
8051         base types aren't accessible due to access permissions.
8052         * decl.cs (DeclSpace.ResolveType): Move logic to
8053         Expression.ResolveAsTypeTerminal.
8054         (DeclSpace.ResolveTypeExpr): Thin layer over
8055         Expression.ResolveAsTypeTerminal.
8056         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8057         Refactor code into NestedAccess.  Use it.
8058         (DeclSpace.NestedAccess): New.
8059         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8060         argument to silence errors.  Check access permissions.
8061         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8062         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8063         (Cast.DoResolve): Likewise.
8064         (New.DoResolve): Likewise.
8065         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8066         (TypeOf.DoResolve): Likewise.
8067
8068         * expression.cs (Invocation.BetterConversion): Return the Type of
8069         the better conversion.  Implement section 14.4.2.3 more faithfully.
8070         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8071         section 14.4.2.2 explicit.
8072         (Invocation.OverloadResolve): Update.
8073         (Invocation): Remove is_base field.
8074         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8075         (Invocation.Emit): Likewise.
8076
8077 2004-09-27  Raja R Harinath  <rharinath@novell.com>
8078
8079         * README: Update to changes.
8080
8081 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8082
8083         * cs-parser.jay: Reverted 642 warning fix.
8084
8085 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8086
8087         Fix bug #66615
8088         * decl.cs (FindMemberWithSameName): Indexer can have more than
8089         1 argument.
8090
8091 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8092
8093         * expression.cs (LocalVariableReference.DoResolveLValue):
8094         Do not report warning 219 for out values.
8095         (EmptyExpression.Null): New member to avoid extra allocations.
8096
8097 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8098
8099         * cs-parser.jay: Fix wrong warning 642 report.
8100
8101         * cs-tokenizer.cs (CheckNextToken): New helper;
8102         Inspect next character if is same as expected.
8103
8104 2004-09-23  Martin Baulig  <martin@ximian.com>
8105
8106         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8107         (Convert.ImplicitReferenceConversionExists): Likewise.
8108
8109 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8110
8111         * class.cs (Operator.Define): Add error 448 and 559 report.
8112
8113 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8114
8115         * class.cs (MemberBase.IsTypePermitted): New protected
8116         method for checking error CS0610.
8117
8118 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8119
8120         * class.cs (TypeContainer.HasExplicitLayout): New property
8121         Returns whether container has StructLayout attribute set Explicit.
8122         (FieldMember): New abstract class for consts and fields.
8123         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8124         (Field): Reuse FieldMember.
8125
8126         * const.cs (Const): Reuse FieldMember.
8127
8128         * rootcontext.cs: EmitConstants call moved to class.
8129
8130 2004-09-22  Martin Baulig  <martin@ximian.com>
8131
8132         Thanks to Peter Sestoft for this bug report.
8133
8134         * expression.cs (Conditional): If both the `trueExpr' and the
8135         `falseExpr' is a NullLiteral, return a NullLiteral.
8136
8137 2004-09-22  Martin Baulig  <martin@ximian.com>
8138
8139         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8140         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8141         for the "get_Current" call.
8142
8143 2004-09-22  Martin Baulig  <martin@ximian.com>
8144
8145         Marek and me just fixed one of our oldest bugs: #28562 :-)
8146
8147         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8148
8149         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8150         we're an EnumConstant, just return that.
8151         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8152         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8153         to get the value which'll actually be written into the attribute.
8154         However, we have to use GetValue() to access the attribute's value
8155         in the compiler.        
8156
8157 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8158
8159         * constant.cs (Constant.IsNegative): New abstract property
8160         IsNegative.
8161
8162         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8163         (StackAlloc.DoResolve): Reused IsNegative.
8164
8165 2004-09-21  Martin Baulig  <martin@ximian.com>
8166
8167         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8168         if we're used in an iterator, we may be called from different
8169         methods.
8170
8171         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8172         we actually have an exception block.
8173
8174 2004-09-20  John Luke <jluke@cfl.rr.com>
8175
8176         * class.cs, cs-parser.jay: Improve the error report for 1520:
8177         report the actual line where the error happens, not where the
8178         class was declared.
8179
8180         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8181         Pass location information that was available elsewhere.
8182
8183 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
8184
8185         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8186         runtime to delay sign assemblies.
8187
8188 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8189
8190         * cs-parser.jay: Do not report the stack trace, this is barely
8191         used nowadays.
8192
8193 2004-08-22  John Luke  <john.luke@gmail.com>
8194  
8195         * driver.cs : check that a resource id is not already used
8196         before adding it, report CS1508 if it is, bug #63637
8197
8198 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8199
8200         * ecore.cs: Removed dead code.
8201
8202 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
8203
8204         * class.cs: Do not report warning CS0067 on the interfaces.
8205
8206 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8207
8208         * cs-parser.jay: Add error 504 report.
8209
8210 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8211
8212         * rootcontext.cs: WarningLevel is 4 by default now.
8213
8214         * statement.cs (Fixed.Resolve): Do not null
8215         VariableInfo.
8216
8217 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8218
8219         Fixed bug #55780
8220         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8221         deep search when property is not virtual.
8222         (PropertyExpr.ResolveAccessors): Make one call for both
8223         accessors.
8224
8225 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8226
8227         Fixed bug #65766
8228         * statement.cs: Error 152 report constains also location.
8229
8230 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8231
8232         Fixed bug #65766
8233         * const.cs: Explicitly set constant as static.
8234
8235 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8236
8237         Fixed bug #64226
8238         * cs-parser.jay: Add error 1017 report.
8239
8240 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8241
8242         Fixed bug #59980, #64224
8243         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8244
8245         * typemanager.cs (IsSpecialMethod): Simplified
8246
8247 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8248
8249         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8250         condition with better params.
8251
8252 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8253
8254         Fixed bug #65238
8255         * attribute.cs (Resolve): Property has to have both
8256         accessors.
8257
8258 2004-09-14  Martin Baulig  <martin@ximian.com>
8259
8260         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8261
8262 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8263
8264         Fixed bug #61902
8265         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8266         called and is obsolete then this member suppress message
8267         when call is inside next [Obsolete] method or type.
8268
8269         * expression.cs: Use TestObsoleteMethodUsage member.
8270
8271 2004-09-14  Martin Baulig  <martin@ximian.com>
8272
8273         * cs-parser.jay: Sync a bit with the GMCS version.
8274
8275 2004-09-14  Martin Baulig  <martin@ximian.com>
8276
8277         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8278         (CSharpParser.yacc_verbose_flag): New public field.
8279
8280         * genericparser.cs: Removed.
8281
8282 2004-09-14  Raja R Harinath  <rharinath@novell.com>
8283
8284         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8285
8286 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8287
8288         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8289
8290 2004-09-10  Martin Baulig  <martin@ximian.com>
8291
8292         Backported my MemberName changes from GMCS into MCS.
8293
8294         - we are now using a special `MemberName' class instead of using
8295         strings; in GMCS, the `MemberName' also contains the type
8296         arguments.
8297
8298         - changed the grammar rules a bit:
8299           * the old `member_name' is now a `namespace_or_type_name':
8300             The rule is that we use `namespace_or_type_name' everywhere
8301             where we expect either a "member name" (GetEnumerator) or a
8302             "member name" with an explicit interface name
8303             (IEnumerable.GetEnumerator).
8304             In GMCS, the explicit interface name may include type arguments
8305             (IEnumerable<T>.GetEnumerator).
8306           * we use `member_name' instead of just `IDENTIFIER' for
8307             "member names":
8308             The rule is that we use `member_name' wherever a member may
8309             have type parameters in GMCS.       
8310
8311         * decl.cs (MemberName): New public class.
8312         (MemberCore.MemberName): New public readonly field.
8313         (MemberCore.ctor): Take a `MemberName' argument, not a string.
8314         (DeclSpace): Likewise.
8315
8316         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8317         * enum.cs (Enum.ctor): Likewise.
8318
8319         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8320         MemberName.     
8321         (AliasEntry.ctor): Take a MemberName, not an Expression.
8322         (AliasEntry.UsingAlias): Likewise.
8323
8324         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8325         (IMethodData.MemberName): Changed type from string to MemberName.
8326         (MemberBase.ExplicitInterfaceName): Likewise.
8327         (AbstractPropertyEventMethod.SetupName): Make this private.
8328         (AbstractPropertyEventMethod.ctor): Added `string prefix'
8329         argument; compute the member name here.
8330         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8331         on the `member.MemberName' and the `prefix'.
8332
8333         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8334         not `type_name'.
8335         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8336         thus, we get a `MemberName' instead of a `string'.  These
8337         declarations may have type parameters in GMCS.
8338         (interface_method_declaration, delegate_declaration): Likewise.
8339         (class_declaration, interface_declaration): Likewise.
8340         (method_header): Use `namespace_or_type_name' instead of
8341         `member_name'.  We may be an explicit interface implementation.
8342         (property_declaration, event_declaration): Likewise.
8343         (member_name): This is now just an `IDENTIFIER', not a
8344         `namespace_or_type_name'.
8345         (type_name, interface_type): Removed.
8346         (namespace_or_type_name): Return a MemberName, not an Expression.
8347         (primary_expression): Use `member_name' instead of `IDENTIFIER';
8348         call GetTypeExpression() on the MemberName to get an expression.
8349         (IndexerDeclaration.interface_type): Changed type from string to
8350         MemberName.
8351         (MakeName): Operate on MemberName's instead of string's.
8352
8353 2004-09-13  Raja R Harinath  <rharinath@novell.com>
8354
8355         Fix bug #55770.
8356         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8357         (NamespaceEntry.Lookup): Add new argument to flag if we want the
8358         lookup to avoid symbols introduced by 'using'.
8359         * rootcontext.cs (NamespaceLookup): Update.
8360
8361 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8362
8363         * class.cs (TypeContainer.DoDefineMembers): Do not call
8364         DefineDefaultConstructor for static classes.
8365
8366 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8367
8368         * attribute.cs (Attribute.Resolve): Add error 653 report.
8369
8370         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8371         report.
8372         (Method.ApplyAttributeBuilder): Add error 685 report.
8373         (Operator.Define): Add error 564 report.
8374
8375         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8376
8377         * expression.cs (Invocation.DoResolve): Add error
8378         245 and 250 report.
8379
8380         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8381         error 674 report.
8382
8383 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8384
8385         * class.cs (ConstructorInitializer.Resolve):
8386         Wrong error number (515->516).
8387
8388 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8389
8390         * class.cs (Indexer.Define): Add error 631 report.
8391
8392 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8393
8394         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8395
8396 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8397
8398         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8399
8400 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8401
8402         * cs-parser.jay: Added error CS0241 report.
8403
8404 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8405
8406         * cs-parser.jay (fixed_statement): Introduce a scope for the
8407         declaration in the 'fixed' statement.
8408
8409 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8410
8411         * cs-parser.jay: Added CS0230 error report.
8412
8413 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8414
8415         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8416
8417 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8418
8419         * expression.cs (Argument.Resolve): Added error CS0192 and
8420         CS0199 report.
8421
8422 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8423
8424         C# 2.0 #pragma warning feature
8425
8426         * cs-tokenizer.cs (PreProcessPragma): New method; 
8427         Handles #pragma directive.
8428
8429         * report.cs (WarningRegions): New class; Support
8430         class for #pragma warning directive. It tests whether
8431         warning is enabled for a given line.
8432
8433 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8434
8435         * const.cs: Add more descriptive error report, tahnks to
8436         Sebastien. 
8437
8438 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8439
8440         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8441
8442 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8443
8444         * expression.cs: Apply patch from Ben: Remove dead code from
8445         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8446         as that code just threw an exception anwyays.
8447
8448         * const.cs: Remove the call to the turnintoconstant, for details
8449         see bug: #63144
8450         
8451         * literal.cs: The type of the null-literal is the null type;  So
8452         we use a placeholder type (literal.cs:System.Null, defined here)
8453         for it.
8454
8455         * expression.cs (Conditional.DoResolve): Remove some old code that
8456         is no longer needed, conversions have been fixed.
8457
8458         (ArrayCreationExpression.DoResolve): Return false if we fail to
8459         resolve the inner expression.
8460
8461 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8462
8463         Fix test-290.cs.
8464         * cs-parser.jay (delegate_declaration): Record a delegate
8465         declaration as a type declaration.
8466         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8467
8468 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8469
8470         * parameter.cs: Do not crash if the type can not be resolved. 
8471
8472         * expression.cs: Report errors with unsafe pointers, fixes #64896
8473
8474 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8475
8476         * expression.cs: Pointer arith always needs to do a conv.i
8477         if the operand is a long. fix 65320
8478
8479 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8480
8481         Fixed cs0619-37.cs, cs0619-38.cs
8482
8483         * enum.cs (GetObsoleteAttribute): Removed.
8484
8485         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8486         on Enum member is double staged. The first is tested member
8487         and then enum.
8488
8489 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8490
8491         Fixed #56986, #63631, #65231
8492
8493         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8494         adds member to name container.
8495         (TypeContainer.AddToTypeContainer): New method, adds type to
8496         name container.
8497         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8498         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8499         AddOperator): Simplified by reusing AddToMemberContainer.
8500         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8501         instead of field.
8502         (Method.CheckForDuplications): Fixed implementation to test all
8503         possibilities.
8504         (MemberBase): Detection whether member is explicit interface
8505         implementation is now in constructor.
8506         (MemberBase.UpdateMemberName): Handles IndexerName.
8507         (Accessor): Changed to keep also location information.
8508         (AbstractPropertyEventMethod): Is derived from MemberCore.
8509         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8510         will be emited or not.
8511         (PropertyBase.AreAccessorsDuplicateImplementation):
8512         Tests whether accessors are not in collision with some method.
8513         (Operator): Is derived from MethodCore to simplify common
8514         operations.
8515
8516         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8517         must be performed.
8518         (DeclSpace.AddToContainer): Adds the member to defined_names
8519         table. It tests for duplications and enclosing name conflicts.
8520
8521         * enum.cs (EnumMember): Clean up to reuse the base structures
8522
8523 2004-09-03  Martin Baulig  <martin@ximian.com>
8524
8525         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8526         into TypeContainer, to make partial classes work again.
8527
8528 2004-09-03  Martin Baulig  <martin@ximian.com>
8529
8530         * rootcontext.cs (RootContext.V2): Removed.
8531
8532 2004-03-23  Martin Baulig  <martin@ximian.com>
8533
8534         * expression.cs (Invocation.OverloadResolve): Added `bool
8535         may_fail' argument and use it instead of the Location.IsNull() hack.
8536
8537 2004-09-03  Martin Baulig  <martin@ximian.com>
8538
8539         Merged latest changes into gmcs.  Please keep this comment in
8540         here, it makes it easier for me to see what changed in MCS since
8541         the last time I merged.
8542
8543 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8544
8545         Fix #61128.
8546         * expression.cs (BetterConversion): Don't allow either conversion 
8547         to be null.  Remove redundant implicit conversion test when 'q ==
8548         null' -- when this function is invoked, we already know that the
8549         implicit conversion exists.
8550         (BetterFunction): Assume that 'best' is non-null.  Remove
8551         redundant reimplementation of IsApplicable when 'best' is null.
8552         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8553         number of arguments.
8554         (IsAncestralType): Extract from OverloadResolve.
8555         (OverloadResolve): Make robust to the MethodGroupExpr being
8556         unsorted.  Implement all the logic of Section 14.5.5.1, and
8557         support overloading of methods from multiple applicable types.
8558         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8559
8560         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8561         (RealError, Warning): Append type of report to related symbol.
8562
8563 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8564
8565         * enum.cs: Fixed CLS-Compliance checks for enum members.
8566         Error tests cs3008-8.cs, cs3014-8.cs
8567
8568 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8569
8570         Fixed bug #62342, #63102
8571         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8572         like ImplementMethod.
8573
8574 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8575
8576         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8577         Fixed bug #65170.
8578
8579 2004-09-02  Martin Baulig  <martin@ximian.com>
8580
8581         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8582         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8583         on the MethodBase.
8584
8585 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8586
8587         C# 2.0 Static classes implemented
8588
8589         * class.cs (TypeContainer): instance_constructors,
8590         initialized_fields, initialized_static_fields,
8591         default_constructor, base_inteface_types are protected to be
8592         accessible from StaticClass.
8593         (TypeContainer.DefineDefaultConstructor): New virtual method
8594         for custom default constructor generating
8595         (StaticClass): New class to handle "Static classes" feature.
8596
8597         * cs-parser.jay: Handle static keyword on class like instance
8598         of StaticClass.
8599
8600         * driver.cs: Added "/langversion" command line switch with two
8601         options (iso-1, default).
8602
8603 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8604
8605         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8606
8607 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8608
8609         * delegate.cs: Style.
8610
8611 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8612
8613         * delegate.cs: Add seperate instance expr field for miguel.
8614
8615 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8616
8617         * PointerArithmetic (Resolve): make sure we are not doing
8618         pointer arith on void*. Also, make sure we are resolved
8619         by not setting eclass until resolve.
8620
8621         All callers: Make sure that PointerArithmetic gets resolved.
8622
8623 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8624
8625         * ArrayCreation (LookupType): If the type does not resolve 
8626         to an array, give an error.
8627
8628 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8629
8630         * statement.cs (Try.Resolve): Fixed bug #64222
8631
8632 2004-08-27  Martin Baulig  <martin@ximian.com>
8633
8634         * class.cs
8635         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8636         crash here.     
8637
8638 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8639
8640         * ecore.cs (Constantify): Get underlying type via
8641         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8642         Windows in special cases.
8643
8644 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8645
8646         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8647         for obtaining also private methods.
8648         (GetRemoveMethod): Used GetRemoveMethod (true)
8649         for obtaining also private methods.
8650
8651 2004-08-24  Martin Baulig  <martin@ximian.com>
8652
8653         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8654         MethodAttributes.HideBySig for operators.
8655
8656 2004-08-23  Martin Baulig  <martin@ximian.com>
8657
8658         Back to the old error reporting system :-)
8659
8660         * report.cs (Message): Removed.
8661         (Report.MessageData, ErrorData, WarningData): Removed.
8662         (Report.Error, Warning): Back to the old system.
8663
8664 2004-08-23  Martin Baulig  <martin@ximian.com>
8665
8666         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8667
8668         * class.cs (TypeContainer.ParentContainer): New public virtual
8669         method; replaces the explicit interface implementation.
8670         (ClassPart.ParentContainer): Override.
8671
8672 2004-08-23  Martin Baulig  <martin@ximian.com>
8673
8674         * statement.cs (Switch): Added support for constant switches; see
8675         #59428 or test-285.cs.
8676
8677 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8678
8679         Fixed bug #62740.
8680         * statement.cs (GetEnumeratorFilter): Removed useless
8681         logic because C# specs is strict. GetEnumerator must be
8682         public.
8683
8684 2004-08-22  Martin Baulig  <martin@ximian.com>
8685
8686         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8687         a switch and may break, reset the barrier.  Fixes #59867.
8688
8689 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8690
8691         CLS-Compliance speed up (~5% for corlib)
8692
8693         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8694         New method. Tests container for CLS-Compliant names
8695
8696         * class.cs (TypeContainer.VerifyClsName): New method.
8697         Checks whether container name is CLS Compliant.
8698         (Constructor): Implements IMethodData.
8699
8700         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8701         low-case table for CLS Compliance test.
8702         (MemberCache.VerifyClsParameterConflict): New method.
8703         Checks method parameters for CS3006 error.
8704
8705         * enum.cs (EnumMember): Is derived from MemberCore.
8706         (Enum.VerifyClsName): Optimized for better performance.
8707
8708 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8709
8710         * report.cs: Renamed Error_T to Error and changed all
8711         references.
8712
8713 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8714
8715         * class.cs (TypeContainer.IndexerArrayList): New inner class
8716         container for indexers.
8717         (TypeContainer.DefaultIndexerName): New constant for default
8718         indexer name. Replaced all "Item" with this constant.
8719         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8720
8721         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8722         DefaultMemberAttribute constructor.
8723
8724 2004-08-05  Martin Baulig  <martin@ximian.com>
8725
8726         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8727         Fix bug #59429.
8728
8729 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8730
8731         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8732         multi platforms problem.
8733
8734         * compiler.csproj: Included shared files.
8735
8736 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8737
8738         Fix bug 60333, 55971 in the more general way
8739         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8740         Added arg_type argument for constant conversion.
8741         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8742
8743 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8744
8745         Fix bug #59760
8746         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8747         OperatorArrayList, MethodCoreArrayList for typecontainer
8748         containers. Changed class member types to these new types.
8749         (MethodArrayList.DefineMembers): Added test for CS0659.
8750
8751 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8752
8753         * cfold.cs: Synchronize the folding with the code in expression.cs
8754         Binary.DoNumericPromotions for uint operands.
8755
8756         * attribute.cs: Revert patch from Raja, it introduced a regression
8757         while building Blam-1.2.1 (hard to isolate a test case).
8758
8759 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8760
8761         Fix for #55382
8762         * class.cs:
8763         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8764         name collision.
8765         (MethodCore.parent_method): New member. The method we're overriding
8766         if this is an override method.
8767         (MethodCore.CheckBase): Moved from Method class and made common.
8768         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8769         private.
8770         (MethodCore.CheckForDuplications): New abstract method. For custom
8771         member duplication search in a container
8772         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8773         method and its return type.
8774         (Event.conflict_symbol): New member. Symbol with same name in the
8775         parent class.
8776
8777         * decl.cs:
8778         (MemberCache.FindMemberWithSameName): New method. The method
8779         is looking for conflict with inherited symbols.
8780
8781 2004-08-04  Martin Baulig  <martin@ximian.com>
8782
8783         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8784
8785         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8786
8787 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8788
8789         * report.cs (Message): New enum for better error, warning reference in
8790         the code.
8791         (MessageData): New inner abstract class. It generally handles printing of
8792         error and warning messages.
8793         Removed unused Error, Warning, Message methods.
8794
8795 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8796
8797         Fix for cs0592-8.cs test
8798         * attribute.cs
8799         (Attributable.ValidAttributeTargets): Made public.
8800         (Attribute.ExplicitTarget): New member for explicit target value.
8801         (Attribute.CheckTargets): Now we translate explicit attribute
8802         target to Target here.
8803
8804 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8805
8806         * ecore.cs (MethodGroupExpr): new IsBase property.
8807
8808         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8809
8810         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8811         rather than an instance expr.
8812
8813         (DelegateCreation.Emit): Use the method group rather than
8814         the instance expression. Also, if you have base.Foo as the
8815         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8816
8817         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8818
8819         (NewDelegate.DoResolve): Only check for the existance of Invoke
8820         if the method is going to be needed. Use MethodGroupExpr.
8821
8822         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8823
8824         * expression.cs: For pointer arith., make sure to use
8825         the size of the type, not the size of the pointer to
8826         the type.
8827
8828 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8829
8830         Fix for #60722
8831         * class.cs (Class): Added error CS0502 test.
8832
8833 2004-08-03  John Luke  <jluke@cfl.rr.com>
8834             Raja R Harinath  <rharinath@novell.com>
8835
8836         Fix for #60997.
8837         * attribute.cs (Attribute.complained_before): New flag.
8838         (Attribute.ResolveType, Attribute.Resolve),
8839         (Attribute.DefinePInvokeMethod): Set it.
8840         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8841         
8842 2004-08-03  Martin Baulig  <martin@ximian.com>
8843
8844         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8845         use a user-defined operator; we still need to do numeric
8846         promotions in case one argument is a builtin type and the other
8847         one has an implicit conversion to that type.  Fixes #62322.
8848
8849 2004-08-02  Martin Baulig  <martin@ximian.com>
8850
8851         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8852         (LocalInfo.IsThis): New public property.
8853         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8854
8855 2004-08-01  Martin Baulig  <martin@ximian.com>
8856
8857         * class.cs (TypeContainer.GetClassBases): Don't set the default
8858         here since we may get called from GetPartialBases().
8859         (TypeContainer.DefineType): If GetClassBases() didn't return a
8860         parent, use the default one.
8861
8862 2004-07-30  Duncan Mak  <duncan@ximian.com>
8863
8864         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8865
8866 2004-07-30  Martin Baulig  <martin@ximian.com>
8867
8868         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8869
8870         * class.cs (SourceMethod): New public class, derive from the
8871         symbol writer's ISourceMethod.
8872         (Method): Use the new symbol writer API.
8873
8874         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8875         as argument and use the new symbol writer.
8876
8877         * location.cs
8878         (SourceFile): Implement the symbol writer's ISourceFile.
8879         (Location.SymbolDocument): Removed.
8880         (Location.SourceFile): New public property.
8881
8882         * symbolwriter.cs: Use the new symbol writer API.
8883
8884 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8885
8886         * Makefile (install-local): Remove.  Functionality moved to
8887         executable.make.
8888
8889 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8890
8891         * Makefile: Install mcs.exe.config file together with mcs.exe.
8892         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8893         correct runtime version.
8894         
8895 2004-07-25  Martin Baulig  <martin@ximian.com>
8896
8897         * class.cs
8898         (TypeContainer.RegisterOrder): Removed, this was unused.
8899         (TypeContainer, interface_order): Removed.
8900         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8901         TypeContainer as argument since we can also be called with a
8902         `PartialContainer' for a partial class/struct/interface.
8903         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8904         of checking whether we're an `Interface' - we could be a
8905         `PartialContainer'.
8906         (PartialContainer.Register): Override; call
8907         AddClass()/AddStruct()/AddInterface() on our parent.
8908
8909         * cs-parser.jay (interface_member_declaration): Add things to the
8910         `current_container', not the `current_class'.
8911
8912         * rootcontext.cs (RegisterOrder): The overloaded version which
8913         takes an `Interface' was unused, removed.
8914
8915         * typemanager.cs (TypeManager.LookupInterface): Return a
8916         `TypeContainer', not an `Interface'.
8917         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8918         contain a `PartialContainer' for an interface, so check it's
8919         `Kind' to figure out what it is.
8920
8921 2004-07-25  Martin Baulig  <martin@ximian.com>
8922
8923         * class.cs (Class.DefaultTypeAttributes): New public constant.
8924         (Struct.DefaultTypeAttributes): Likewise.
8925         (Interface.DefaultTypeAttributes): Likewise.
8926         (PartialContainer.TypeAttr): Override this and add the
8927         DefaultTypeAttributes.
8928
8929 2004-07-25  Martin Baulig  <martin@ximian.com>
8930
8931         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8932         we can just use the `Parent' field instead.
8933
8934 2004-07-25  Martin Baulig  <martin@ximian.com>
8935
8936         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8937
8938 2004-07-25  Martin Baulig  <martin@ximian.com>
8939
8940         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8941         our parts before defining any methods.
8942         (TypeContainer.VerifyImplements): Make this virtual.
8943         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8944         on our PartialContainer.
8945
8946 2004-07-25  Martin Baulig  <martin@ximian.com>
8947
8948         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8949
8950         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8951         argument, we can just use the `Parent' field instead.
8952
8953         * class.cs
8954         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8955         (MemberBase.DoDefine): Likewise.
8956
8957 2004-07-24  Martin Baulig  <martin@ximian.com>
8958
8959         * decl.cs (MemberCore.Parent): New public field.
8960         (DeclSpace.Parent): Moved to MemberCore.
8961
8962         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8963         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8964         parent's .ctor.
8965         (FieldBase, Field, Operator): Likewise.
8966         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8967         (EventField, Event): Likewise.
8968
8969 2004-07-23  Martin Baulig  <martin@ximian.com>
8970
8971         * class.cs (PartialContainer): New public class.
8972         (ClassPart): New public class.
8973         (TypeContainer): Added support for partial classes.
8974         (TypeContainer.GetClassBases): Splitted some of the functionality
8975         out into GetNormalBases() and GetPartialBases().
8976
8977         * cs-tokenizer.cs (Token.PARTIAL): New token.
8978         (Tokenizer.consume_identifier): Added some hacks to recognize
8979         `partial', but only if it's immediately followed by `class',
8980         `struct' or `interface'.
8981
8982         * cs-parser.jay: Added support for partial clases.
8983
8984 2004-07-23  Martin Baulig  <martin@ximian.com>
8985
8986         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8987         a `DeclSpace' and also made it readonly.
8988         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8989         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8990         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8991
8992         * cs-parser.jay: Pass the `current_class', not the
8993         `current_container' (at the moment, this is still the same thing)
8994         to a new Method, Property, Event, Indexer or Constructor.
8995
8996 2004-07-23  Martin Baulig  <martin@ximian.com>
8997
8998         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8999         and removed the `current_interface' one.
9000         (struct_declaration, class_declaration, interface_declaration):
9001         Set `current_class' to the newly created class/struct/interface;
9002         set their `Bases' and call Register() before parsing their body.
9003
9004 2004-07-23  Martin Baulig  <martin@ximian.com>
9005
9006         * class.cs (Kind): New public enum.
9007         (TypeContainer): Made this class abstract.
9008         (TypeContainer.Kind): New public readonly field.
9009         (TypeContainer.CheckDef): New public method; moved here from
9010         cs-parser.jay.
9011         (TypeContainer.Register): New public abstract method.
9012         (TypeContainer.GetPendingImplementations): New public abstract
9013         method.
9014         (TypeContainer.GetClassBases): Removed the `is_class' and
9015         `is_iface' parameters.
9016         (TypeContainer.DefineNestedTypes): Formerly known as
9017         DoDefineType().
9018         (ClassOrStruct): Made this class abstract.
9019
9020         * tree.cs (RootTypes): New public type. 
9021
9022 2004-07-20  Martin Baulig  <martin@ximian.com>
9023
9024         * tree.cs (Tree.RecordNamespace): Removed.
9025         (Tree.Namespaces): Removed.
9026
9027         * rootcontext.cs (RootContext.IsNamespace): Removed.
9028
9029         * cs-parser.jay (namespace_declaration): Just create a new
9030         NamespaceEntry here.
9031
9032 2004-07-20  Martin Baulig  <martin@ximian.com>
9033
9034         * statement.cs (ExceptionStatement): New abstract class.  This is
9035         now used as a base class for everyone who's using `finally'.
9036         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9037         our local variables before using them.
9038
9039         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9040         virtual method.  This is used by Yield.Resolve() to "steal" an
9041         outer block's `finally' clauses.
9042         (FlowBranchingException): The .ctor now takes an ExceptionStatement
9043         argument.
9044
9045         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9046         version which takes an ExceptionStatement.  This version must be
9047         used to create exception branchings.
9048
9049         * iterator.cs
9050         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9051         (Iterator.EmitMoveNext): Added exception support; protect the
9052         block with a `fault' clause, properly handle 'finally' clauses.
9053         (Iterator.EmitDispose): Run all the `finally' clauses here.
9054
9055 2004-07-20  Martin Baulig  <martin@ximian.com>
9056
9057         * iterator.cs: This is the first of a set of changes in the
9058         iterator code.  Match the spec more closely: if we're an
9059         IEnumerable, then GetEnumerator() must be called.  The first time
9060         GetEnumerator() is called, it returns the current instance; all
9061         subsequent invocations (if any) must create a copy.
9062
9063 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
9064
9065         * expression.cs: Resolve the constant expression before returning
9066         it. 
9067
9068 2004-07-19  Martin Baulig  <martin@ximian.com>
9069
9070         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9071         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9072         the return type of the new EmitContext.
9073
9074 2004-07-18  Martin Baulig  <martin@ximian.com>
9075
9076         * class.cs (Property.Define): Fix iterators.
9077
9078         * iterators.cs (Iterator.Define): Moved the
9079         `container.AddInterator (this)' call here from the .ctor; only do
9080         it if we resolved successfully.
9081
9082 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
9083
9084         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9085         `true' for preprocessing directives that we parse.  The return
9086         value indicates whether we should return to regular tokenizing or
9087         not, not whether it was parsed successfully.
9088
9089         In the past if we were in: #if false ... #line #endif, we would
9090         resume parsing after `#line'.  See bug 61604.
9091
9092         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9093         building: IsEnumType should return true only for enums, not for
9094         enums or System.Enum itself.  This fixes #61593.
9095
9096         Likely what happened is that corlib was wrong: mcs depended on
9097         this bug in some places.  The bug got fixed, we had to add the
9098         hack, which caused bug 61593.
9099
9100         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9101         that was a workaround for the older conditions.
9102
9103 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
9104
9105         * assign.cs: IAssignMethod has a new interface, as documented
9106         inline. All assignment code now uses this new api.
9107
9108         * ecore.cs, expression.cs: All classes which implement
9109         IAssignMethod now use the new interface.
9110
9111         * expression.cs (Invocation): add a hack to EmitCall so that
9112         IndexerAccess can be the target of a compound assignment without
9113         evaluating its arguments twice.
9114
9115         * statement.cs: Handle changes in Invocation api.
9116
9117 2004-07-16  Martin Baulig  <martin@ximian.com>
9118
9119         * iterators.cs: Rewrote this.  We're now using one single Proxy
9120         class for both the IEnumerable and the IEnumerator interface and
9121         `Iterator' derives from Class so we can use the high-level API.
9122
9123         * class.cs (TypeContainer.AddIterator): New method.
9124         (TypeContainer.DoDefineType): New protected virtual method, which
9125         is called from DefineType().
9126         (TypeContainer.DoDefineMembers): Call DefineType() and
9127         DefineMembers() on all our iterators.
9128         (TypeContainer.Emit): Call Emit() on all our iterators.
9129         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9130
9131         * codegen.cs (EmitContext.CurrentIterator): New public field.
9132
9133 2004-07-15  Martin Baulig  <martin@ximian.com>
9134
9135         * typemanager.cs
9136         (TypeManager.not_supported_exception_type): New type.   
9137
9138 2004-07-14  Martin Baulig  <martin@ximian.com>
9139
9140         * iterators.cs: Use real error numbers.
9141
9142 2004-07-14  Martin Baulig  <martin@ximian.com>
9143
9144         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9145         requires this to be a System.Collection.IEnumerable and not a
9146         class implementing that interface.
9147         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9148
9149 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9150
9151         * class.cs: Fixed previous fix, it broke some error tests.
9152
9153 2004-07-12  Martin Baulig  <martin@ximian.com>
9154
9155         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9156         Fixes #61293.
9157
9158 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9159
9160         * assign.cs (LocalTemporary): Add new argument: is_address,If
9161         `is_address' is true, then the value that we store is the address
9162         to the real value, and not the value itself.
9163         
9164         * ecore.cs (PropertyExpr): use the new local temporary
9165         stuff to allow us to handle X.Y += z (where X is a struct)
9166
9167 2004-07-08  Martin Baulig  <martin@ximian.com>
9168
9169         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9170         not always return, just like we're doing in Using.Resolve().
9171
9172 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9173
9174         * cs-parser.jay (fixed_statement): flag this as Pinned.
9175
9176 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9177
9178         * typemanager.cs (TypeManager): Removed MakePinned method, this
9179         mechanism is replaced with the .NET 2.x compatible mechanism of
9180         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9181
9182         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9183         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9184         `IsFixed' property which has a different meaning.
9185
9186 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9187
9188         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9189         visible from inside a nested class, not just the names of the
9190         immediately enclosing class.
9191         Fix for bug #60730.
9192
9193 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9194
9195         * expression.cs (BetterConversion): Remove buggy special-case
9196         handling of "implicit constant expression conversions".  At this
9197         point, we already know that the conversion is possible -- we're
9198         only checking to see which is better.
9199
9200 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9201
9202         * cs-parser.jay: Added error CS0210 test.
9203
9204 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9205
9206         * cs-parser.jay: Added error CS0134 test.
9207
9208 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9209
9210         Fix bug #52507
9211         * cs-parser.jay: Added error CS0145 test.
9212
9213 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9214
9215         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9216
9217 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9218         
9219         * expression.cs (StackAlloc.Resolve): The argument may not
9220         be a constant; deal with this case.
9221         
9222 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9223
9224         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9225         GetIndexerAttributeValue.
9226         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9227
9228         * class.cs (Indexer.Define): Added error tests for CS0415,
9229         CS0609.
9230
9231 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9232
9233         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9234         property code.
9235
9236 2004-06-23  Martin Baulig  <martin@ximian.com>
9237
9238         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9239         neither return nor throw, reset the barrier as well.  Fixes #60457.
9240
9241 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9242
9243         * class.cs : EventAttributes is now set to None by default.
9244           This fixes bug #60459.
9245
9246 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9247
9248         Fix bug #60219
9249         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9250         Don't throw exception but return null (it's sufficient now).
9251
9252 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9253
9254         * typemanager.cs (GetArgumentTypes): Faster implementation.
9255
9256 2004-06-18  Martin Baulig  <martin@ximian.com>
9257
9258         * attribute.cs (Attribute.Resolve): Check whether we're an
9259         EmptyCast which a Constant child.  Fixes #60333.
9260
9261 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9262
9263         * statement.cs (EmitCollectionForeach): Account for the fact that
9264         not all valuetypes are in areas which we can take the address of.
9265         For these variables, we store to a temporary variable. Also, make
9266         sure that we dont emit a `callvirt' on a valuetype method.
9267
9268 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9269
9270         * expression.cs (StackAlloc.DoReSolve): Added test for
9271         negative parameter (CS0247).
9272
9273 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9274
9275         Fix bug #59792
9276         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9277
9278 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9279
9280         Fix bug #59781
9281         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9282         ulong.
9283
9284 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9285
9286         Fix bug #58254 & cs1555.cs, cs1556.cs
9287         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9288
9289 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9290
9291         * cs-parser.jay: Added error CS1669 test for indexers.
9292
9293 2004-06-11  Martin Baulig  <martin@ximian.com>
9294
9295         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9296         call this twice: for params and varargs methods.
9297
9298 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9299
9300         * class.cs:
9301         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9302
9303 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9304
9305         * attribute.cs (Attribute.GetValidTargets): Made public.
9306
9307         * class.cs: 
9308         (AbstractPropertyEventMethod): New class for better code sharing.
9309         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9310         CS1667 report.
9311         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9312
9313 2004-06-11  Raja R Harinath  <rharinath@novell.com>
9314
9315         Fix bug #59477.
9316         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9317         that the call to Resolve is part of a MemberAccess.
9318         (Expression.Resolve): Use it for SimpleName resolution.
9319         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9320         Add 'intermediate' boolean argument.
9321         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
9322         error message when the SimpleName can be resolved ambiguously
9323         between an expression and a type.
9324         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9325         public.
9326         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9327         call on the left-side.
9328
9329 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9330
9331         * class.cs:
9332         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9333
9334 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9335
9336         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9337
9338 2004-06-11  Martin Baulig  <martin@ximian.com>
9339
9340         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9341         varargs methods if applicable.
9342
9343 2004-06-11  Martin Baulig  <martin@ximian.com>
9344
9345         * expression.cs (Invocation.EmitCall): Don't use
9346         `method.CallingConvention == CallingConventions.VarArgs' since the
9347         method could also have `CallingConventions.HasThis'.
9348
9349 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9350
9351         * class.cs (Event.GetSignatureForError): Implemented.
9352         Fixed crash in error test cs3010.cs
9353
9354 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
9355
9356         * cs-tokenizer.cs: Change the way we track __arglist to be
9357         consistent with the other keywords.
9358
9359 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
9360
9361         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9362         tomorrow.
9363
9364 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
9365
9366         * codegen.cs: Check that all referenced assemblies have a strongname
9367         before strongnaming the compiled assembly. If not report error CS1577.
9368         Fix bug #56563. Patch by Jackson Harper.
9369         * typemanager.cs: Added a method to return all referenced assemblies.
9370         Fix bug #56563. Patch by Jackson Harper.
9371
9372 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9373
9374         * class.cs:
9375         (Method.ApplyAttributeBuilder): Moved and added conditional
9376         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9377
9378         * delegate.cs:
9379         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9380
9381 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9382
9383         Fixed #59640
9384         * class.cs: (EventField.attribute_targets): Changed default target.
9385
9386 2004-06-08  Martin Baulig  <martin@ximian.com>
9387
9388         * expression.cs (Invocation.EmitCall): Enable varargs methods.
9389
9390 2004-06-08  Martin Baulig  <martin@ximian.com>
9391
9392         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9393
9394 2004-06-07  Martin Baulig  <martin@ximian.com>
9395
9396         Added support for varargs methods.
9397
9398         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9399         keyword.
9400
9401         * cs-parser.jay: Added support for `__arglist'.
9402
9403         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9404
9405         * expression.cs (Argument.AType): Added `ArgList'.
9406         (Invocation): Added support for varargs methods.
9407         (ArglistAccess): New public class.
9408         (Arglist): New public class.
9409
9410         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9411
9412         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
9413         a method's top-level block if the method has varargs.
9414
9415         * support.cs (ReflectionParameters, InternalParameters): Added
9416         support for varargs methods.    
9417
9418 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
9419
9420         * class.cs: Provide location in indexer error report.
9421
9422         * driver.cs: Use standard names.
9423
9424         * namespace.cs: Catch the use of using after a namespace has been
9425         declared also on using aliases.
9426
9427 2004-06-03  Raja R Harinath  <rharinath@novell.com>
9428
9429         Bug #50820.
9430         * typemanager.cs (closure_private_ok, closure_invocation_type)
9431         (closure_qualifier_type, closure_invocation_assembly)
9432         (FilterWithClosure): Move to ...
9433         (Closure): New internal nested class.
9434         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9435         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9436         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9437         (MemberLookup, MemberLookupFailed): Use it.
9438         * expression.cs (New.DoResolve): Treat the lookup for the
9439         constructor as being qualified by the 'new'ed type.
9440         (Indexers.GetIndexersForTypeOrInterface): Update.
9441
9442 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
9443
9444         * attribute.cs
9445         (GetConditionalAttributeValue): New method. Returns
9446         condition of ConditionalAttribute.
9447         (SearchMulti): New method.  Returns all attributes of type 't'.
9448         Use it when attribute is AllowMultiple = true.
9449         (IsConditionalMethodExcluded): New method.
9450
9451         * class.cs
9452         (Method.IsExcluded): Implemented. Returns true if method has conditional
9453         attribute and the conditions is not defined (method is excluded).
9454         (IMethodData): Extended interface for ConditionalAttribute support.
9455         (PropertyMethod.IsExcluded): Implemented.
9456
9457         * decl.cs
9458         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9459
9460         * expression.cs
9461         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9462         on the method.
9463
9464 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9465
9466         * expression.cs (ArrayCreationExpression): Make this just an
9467         `expression'. It can't be a statement, so the code here was
9468         dead.
9469
9470 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9471
9472         Fixed #59072
9473         * typemanager.cs (GetFullNameSignature): New method for
9474         MethodBase types.
9475
9476 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9477
9478         Fixed #56452
9479         * class.cs (MemberBase.GetSignatureForError): New virtual method.
9480         Use this method when MethodBuilder is null.
9481         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9482         Added test for error CS0626 (MONO reports error for this situation).
9483         (IMethodData.GetSignatureForError): Extended interface.
9484
9485 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9486
9487         * attribute.cs
9488         (AttributeTester.GetObsoleteAttribute): Returns instance of
9489         ObsoleteAttribute when type is obsolete.
9490
9491         * class.cs
9492         (TypeContainer.VerifyObsoleteAttribute): Override.
9493         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9494         (MethodCode.VerifyObsoleteAttribute): Override.
9495         (MemberBase.VerifyObsoleteAttribute): Override.
9496
9497         * decl.cs
9498         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9499         and report proper error.
9500
9501         *delegate.cs
9502         Delegate.VerifyObsoleteAttribute): Override.
9503
9504         * ecore.cs
9505         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9506         and report proper error.
9507         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9508
9509         * enum.cs
9510         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9511         and enum member.
9512
9513         * expression.cs
9514         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9515         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9516         Added test for ObsoleteAttribute.
9517
9518         * statement.cs
9519         (Catch): Derived from Statement.
9520
9521 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9522  
9523         Fixed bug #59071 & cs0160.cs
9524  
9525         * statement.cs (Try.Resolve): Check here whether order of catch
9526         clauses matches their dependencies.
9527
9528 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
9529
9530         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
9531         caused a regression: #59343.  Referencing nested classes from an
9532         assembly stopped working.
9533
9534 2004-05-31  Martin Baulig  <martin@ximian.com>
9535
9536         MCS is now frozen for beta 2.
9537
9538 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9539
9540         * convert.cs: add a trivial cache for overload operator resolution.
9541
9542 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9543
9544         * decl.cs: If possible, use lookuptypedirect here. We can only do
9545         this if there is no `.' after the namespace. Avoids using
9546         LookupType, which does lots of slow processing.
9547         (FindNestedType) New method, does what it says :-).
9548         * namespace.cs: use LookupTypeDirect.
9549         * rootcontext.cs: use membercache, if possible.
9550         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9551
9552 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9553
9554         * expression.cs:
9555         According to the spec, 
9556
9557         In a member access of the form E.I, if E is a single identifier,
9558         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9559         field, property, localvariable, or parameter with the same type as
9560         the meaning of E as a type-name (§3.8), then both possible
9561         meanings of E are permitted.
9562
9563         We did not check that E as a simple-name had the same type as E as
9564         a type name.
9565
9566         This trivial check gives us 5-7% on bootstrap time.
9567
9568 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9569
9570         * expression.cs (Invocation.OverloadResolve): Avoid the
9571         use of hashtables and boxing here by allocating on demand.
9572
9573 2004-05-30  Martin Baulig  <martin@ximian.com>
9574
9575         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9576         we're doing a silent lookup.  Don't try to lookup nested types in
9577         TypeManager.object_type (thanks to Ben Maurer).
9578
9579 2004-05-30  Martin Baulig  <martin@ximian.com>
9580
9581         Committing a patch from Ben Maurer.
9582
9583         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9584
9585 2004-05-29  Martin Baulig  <martin@ximian.com>
9586
9587         * class.cs (IMethodData.ShouldIgnore): New method.
9588
9589         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9590         `Location' argument, we don't need it anywhere.  Use
9591         `IMethodData.ShouldIgnore ()' instead of
9592         `MethodData.GetMethodFlags ()'.
9593         (TypeManager.AddMethod): Removed.
9594         (TypeManager.AddMethod2): Renamed to AddMethod.
9595
9596 2004-05-29  Martin Baulig  <martin@ximian.com>
9597
9598         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9599
9600         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9601         converting from a class type S to an interface type and we already
9602         have an object on the stack, don't box it again.  Fixes #52578.
9603
9604 2004-05-29  Martin Baulig  <martin@ximian.com>
9605
9606         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9607         Added support for `params' parameters.  Fixes #59267.
9608
9609 2004-05-29  Martin Baulig  <martin@ximian.com>
9610
9611         * literal.cs (NullPointer): Provide a private .ctor which sets
9612         `type' to TypeManager.object_type.  Fixes #59048.
9613
9614 2004-05-29  Martin Baulig  <martin@ximian.com>
9615
9616         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9617         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9618
9619         * ecore.cs (EventExpr.instance_expr): Make the field private.
9620
9621 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9622
9623         Fixed bug #50080 & cs0214-2.cs
9624         * expression.cs (Cast.DoResolve): Check unsafe context here.
9625         
9626         * statement.cs (Resolve.DoResolve): Likewise.
9627
9628 2004-05-26  Martin Baulig  <martin@ximian.com>
9629
9630         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9631
9632         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9633         (RootContext.LookupType): Pass down the `silent' flag.
9634
9635 2004-05-25  Martin Baulig  <martin@ximian.com>
9636
9637         * expression.cs
9638         (MethodGroupExpr.IdenticalTypeName): New public property.
9639         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9640         expression actually refers to a type.
9641
9642 2004-05-25  Martin Baulig  <martin@ximian.com>
9643
9644         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9645         for #56176 and made it actually work.
9646
9647 2004-05-25  Martin Baulig  <martin@ximian.com>
9648
9649         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9650         (FieldExpr, PropertyExpr): Override and implement
9651         CacheTemporaries.  Fixes #52279.
9652
9653 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9654
9655         * location.cs: In the new compiler listing a file twice is a
9656         warning, not an error.
9657
9658 2004-05-24  Martin Baulig  <martin@ximian.com>
9659
9660         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9661         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9662
9663 2004-05-24  Martin Baulig  <martin@ximian.com>
9664
9665         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9666         walking the `using' list.  Fixes #53921.
9667
9668 2004-05-24  Martin Baulig  <martin@ximian.com>
9669
9670         * const.cs (Const.LookupConstantValue): Added support for
9671         EmptyCast's; fixes #55251.
9672
9673 2004-05-24  Martin Baulig  <martin@ximian.com>
9674
9675         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9676         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9677         which does the CS0135 check.  The reason is that we first need to
9678         check whether the variable actually exists.
9679
9680 2004-05-24  Martin Baulig  <martin@ximian.com>
9681
9682         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9683         than RootContext.LookupType() to find the explicit interface
9684         type.  Fixes #58584.
9685
9686 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9687
9688         * Makefile: Simplify.  Use executable.make.
9689         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9690
9691 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9692
9693         * decl.cs:
9694         * enum.cs:
9695         Use the invariant culture when doing String.Compare for CLS case
9696         sensitivity.
9697         
9698 2004-05-23  Martin Baulig  <martin@ximian.com>
9699
9700         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9701         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9702
9703         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9704         
9705 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9706
9707         * class.cs (MemberBase.Define): Reuse MemberType member for 
9708         resolved type. Other methods can use it too.
9709
9710 2004-05-23  Martin Baulig  <martin@ximian.com>
9711
9712         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9713         the variable also exists in the current block (otherwise, we need
9714         to report a CS0103).  Fixes #58670.
9715
9716 2004-05-23  Martin Baulig  <martin@ximian.com>
9717
9718         * flowanalysis.cs (Reachability.Reachable): Compute this
9719         on-the-fly rather than storing it as a field.
9720
9721 2004-05-23  Martin Baulig  <martin@ximian.com>
9722
9723         * flowanalysis.cs (Reachability.And): Manually compute the
9724         resulting `barrier' from the reachability.      
9725        
9726 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9727
9728         Fix bug #57835
9729         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9730         instance of ObsoleteAttribute when symbol is obsolete.
9731
9732         * class.cs
9733         (IMethodData): Extended interface for ObsoleteAttribute support.
9734
9735 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9736
9737         * attribute.cs: Fix bug #55970
9738
9739 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9740
9741         Fix bug #52705
9742         * attribute.cs
9743         (GetObsoleteAttribute): New method. Creates the instance of
9744         ObsoleteAttribute.
9745         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9746         ObsoleteAttribute when member is obsolete.
9747         (AttributeTester.Report_ObsoleteMessage): Common method for
9748         Obsolete error/warning reporting.
9749
9750         * class.cs
9751         (TypeContainer.base_classs_type): New member for storing parent type.
9752
9753         * decl.cs
9754         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9755         for this MemberCore.
9756
9757 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9758
9759         * attribute.cs, const.cs: Fix bug #58590
9760
9761 2004-05-21  Martin Baulig  <martin@ximian.com>
9762
9763         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9764         out parameters if the end of the method is unreachable.  Fixes
9765         #58098. 
9766
9767 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9768
9769         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9770         Hari was right, why extra method.
9771
9772 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9773
9774         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9775
9776 2004-05-20  Martin Baulig  <martin@ximian.com>
9777
9778         Merged this back from gmcs to keep the differences to a minumum.
9779
9780         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9781         instead of a Declspace.
9782         (Attribute.ResolveType): Likewise.
9783         (Attributes.Search): Likewise.
9784         (Attributes.Contains): Likewise.
9785         (Attributes.GetClsCompliantAttribute): Likewise.
9786
9787         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9788         argument.
9789         (MethodData.ApplyAttributes): Take an EmitContext instead of a
9790         DeclSpace.
9791
9792 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9793
9794         Fix bug #58688 (MCS does not report error when the same attribute
9795         is assigned twice)
9796
9797         * attribute.cs (Attribute.Emit): Distinction between null and default.
9798
9799 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9800
9801         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9802         of a top-level attribute without an attribute target.
9803         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9804         Make non-static.
9805         (Attribute.Conditional_GetConditionName), 
9806         (Attribute.Obsolete_GetObsoleteMessage): Update.
9807         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9808         part of ScanForIndexerName.
9809         (Attribute.CanIgnoreInvalidAttribute): New function.
9810         (Attribute.ScanForIndexerName): Move to ...
9811         (Attributes.ScanForIndexerName): ... here.
9812         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9813         (Attributes.Search): New internal variant that can choose not to
9814         complain if types aren't resolved.  The original signature now
9815         complains.
9816         (Attributes.GetClsCompliantAttribute): Use internal variant, with
9817         complaints suppressed.
9818         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9819         only if it not useful.
9820         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9821         top-level for attributes that are shared between the assembly
9822         and a top-level class.
9823         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9824         * class.cs: Update to reflect changes.
9825         (DefineIndexers): Fuse loops.
9826         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9827         a couple more variants of attribute names.
9828
9829 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9830
9831         Fix bug #52585 (Implemented explicit attribute declaration)
9832
9833         * attribute.cs:
9834         (Attributable.ValidAttributeTargets): New abstract method. It gets
9835         list of valid attribute targets for explicit target declaration.
9836         (Attribute.Target): It holds target itself.
9837         (AttributeSection): Removed.
9838         (Attribute.CheckTargets): New method. It checks whether attribute
9839         target is valid for the current element.
9840
9841         * class.cs:
9842         (EventProperty): New class. For events that are declared like
9843         property (with add and remove accessors).
9844         (EventField): New class. For events that are declared like field.
9845         class.cs
9846
9847         * cs-parser.jay: Implemented explicit attribute target declaration.
9848
9849         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9850         Override ValidAttributeTargets.
9851
9852         * parameter.cs:
9853         (ReturnParameter): Class for applying custom attributes on 
9854         the return type.
9855         (ParameterAtribute): New class. Class for applying custom
9856         attributes on the parameter type.
9857
9858 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9859
9860         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9861         definitions. 
9862
9863         (Method): Allow UNSAFE here.
9864
9865         * modifiers.cs: Support unsafe reporting.
9866
9867 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9868
9869         * decl.cs: Fix bug #58478.
9870
9871 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9872
9873         * statement.cs: When checking for unreachable code on an EmptyStatement,
9874         set the location. Fixes bug #58488.
9875
9876 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9877
9878         * driver.cs: Add -pkg handling.
9879
9880         From Gonzalo: UseShelLExecute=false
9881
9882 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9883
9884         * attribute.cs:
9885         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9886         for attribute.
9887         (Attribute.IsClsCompliaceRequired): Moved to base for better
9888         accesibility.
9889         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9890         when attribute is AttributeUsageAttribute.
9891         (Attribute.GetValidTargets): Simplified.
9892         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9893         attribute for this type.
9894         (Attribute.ApplyAttributes): Method renamed to Emit and make
9895         non-static.
9896         (GlobalAttributeSection): New class for special handling of global
9897         attributes (assembly, module).
9898         (AttributeSection.Emit): New method.
9899
9900         * class.cs: Implemented Attributable abstract methods.
9901         (MethodCore.LabelParameters): Moved to Parameter class.
9902         (Accessor): Is back simple class.
9903         (PropertyMethod): Implemented Attributable abstract class.
9904         (DelegateMethod): Implemented Attributable abstract class.
9905         (Event): New constructor for disctintion between normal Event
9906         and Event with accessors.
9907
9908         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9909
9910         * codegen.cs, const.cs, decl.cs, delegate.cs:
9911         (CommonAssemblyModulClass): Implemented Attributable abstract class
9912         and simplified.
9913
9914         * enum.cs: Implement IAttributeSupport interface.
9915         (EnumMember): New class for emum members. Implemented Attributable
9916         abstract class
9917
9918         * parameter.cs:
9919         (ParameterBase): Is abstract.
9920         (ReturnParameter): New class for easier [return:] attribute handling.
9921
9922         * typemanager.cs: Removed builder_to_attr.
9923
9924 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9925
9926         Fix bug #57151.
9927         * attribute.cs (Attribute.GetPositionalValue): New function.
9928         * class.cs (TypeContainer.VerifyMembers): New function.
9929         (TypeContainer.Emit): Use it.
9930         (ClassOrStruct): New base class for Class and Struct.
9931         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9932         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9933         class.
9934         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9935         then each non-static field should have a FieldOffset attribute.
9936         Otherwise, none of the fields should have a FieldOffset attribute.
9937         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9938         and FieldOffset attributes.
9939         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9940         (TypeManager.field_offset_attribute_type): New core types.
9941         (TypeManager.InitCoreTypes): Initialize them.
9942
9943 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9944
9945         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9946         Return correct type.
9947         From bug #58270.
9948
9949 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9950
9951         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9952         be implicitly converted to ulong.
9953         
9954         * expression.cs: The logic for allowing operator &, | and ^ worked
9955         was wrong, it worked before because we did not report an error in
9956         an else branch.  Fixes 57895.
9957
9958         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9959         allow volatile fields to be reference types.
9960
9961 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9962
9963         * driver.cs: Add support for /debug-
9964
9965 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9966
9967         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9968         Add a 'complain' parameter to silence errors.
9969         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9970         silently overlooked type-resolutions.
9971         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9972         to reflect changes.
9973         (Attributes.Search): New function.
9974         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9975         (Attributes.GetAttributeFullName): Remove hack.
9976         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9977         Update to reflect changes.
9978         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9979         Use Attributes.Search instead of nested loops.
9980
9981 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9982
9983         * decl.cs:
9984         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9985         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9986         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9987
9988         * report.cs: (Report.Warning): Renamed to Warning_T because of
9989         parameter collision.
9990
9991 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9992
9993         * expression.cs (MemberAccess.ResolveMemberAccess):
9994         Exit with non-zero status after Report.Error.
9995         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9996         Likewise.
9997         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9998
9999 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10000
10001         * support.cs: Don't hang when the file is empty.
10002
10003 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10004
10005         * support.cs: In SeekableStreamReader, compute the preamble size of the
10006           underlying stream. Position changes should take into account that initial
10007           count of bytes.
10008
10009 2004-05-03  Todd Berman  <tberman@sevenl.net>
10010
10011         * driver.cs: remove unused GetSysVersion function.
10012
10013 2004-05-03  Todd Berman  <tberman@sevenl.net>
10014
10015         * driver.cs: Remove the hack from saturday, as well as the hack
10016         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10017         link_paths to get that bit proper.
10018
10019 2004-05-01  Todd Berman  <tberman@sevenl.net>
10020
10021         * driver.cs: Try a LoadFrom before a Load, this checks the current
10022         path. This is currently a bug in mono that is be fixed, however, this
10023         provides a workaround for now. This will be removed when the bug
10024         is fixed.
10025
10026 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10027
10028         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10029         incomplete key pairs (#57941).
10030
10031 2004-05-01  Todd Berman  <tberman@sevenl.net>
10032
10033         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10034         from the GAC
10035
10036 2004-04-30  Jackson Harper  <jackson@ximian.com>
10037
10038         * codegen.cs: Open keys readonly.
10039         
10040 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10041
10042         * typemanager.cs: don't report cyclic struct layout when a struct
10043         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10044         which has 2 Pango.Rectangle fields.
10045
10046 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10047
10048         * expression.cs: Handle IntPtr comparisons with IL code
10049         rather than a method call.
10050
10051 2004-04-29  Martin Baulig  <martin@ximian.com>
10052
10053         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10054         the list of PropertyInfo's in class hierarchy and find the
10055         accessor.  Fixes #56013.
10056
10057 2004-04-29  Martin Baulig  <martin@ximian.com>
10058
10059         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10060
10061 2004-04-29  Martin Baulig  <martin@ximian.com>
10062
10063         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10064
10065         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10066
10067 2004-04-29  Martin Baulig  <martin@ximian.com>
10068
10069         * class.cs (ConstructorInitializer.Resolve): Check whether the
10070         parent .ctor is accessible.  Fixes #52146.
10071
10072 2004-04-29  Martin Baulig  <martin@ximian.com>
10073
10074         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10075
10076         * statement.cs (Using.EmitLocalVariableDecls): Use
10077         TypeManager.idisposable_type, not typeof (IDisposable).
10078         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10079
10080 2004-04-29  Martin Baulig  <martin@ximian.com>
10081
10082         * class.cs (Event.Define): Don't emit the field and don't set
10083         RTSpecialName and SpecialName for events on interfaces.  Fixes
10084         #57703. 
10085
10086 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10087
10088         Refactor Attribute.ApplyAttributes.
10089         * attribute.cs (Attributable): New base class for objects that can
10090         have Attributes applied on them.
10091         (Attribute): Make AttributeUsage fields public.
10092         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10093         (Attribute.IsInternalCall): New property.
10094         (Attribute.UsageAttr): Convert to a public read-only property.
10095         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10096         (Attribute.ResolveType, Attribute.Resolve)
10097         (Attribute.ScanForIndexerName): Update to reflect changes.
10098         (Attribute.CheckAttributeTarget): Re-format.
10099         (Attribute.ApplyAttributes): Refactor, to various
10100         Attributable.ApplyAttributeBuilder methods.
10101         * decl.cs (MemberCore): Make Attributable.
10102         * class.cs (Accessor): Make Attributable.
10103         (MethodData.ApplyAttributes): Use proper attribute types, not
10104         attribute names.
10105         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10106         (TypeContainer.ApplyAttributeBuilder)
10107         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10108         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10109         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10110         (Operator.ApplyAttributeBuilder): New factored-out methods.
10111         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10112         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10113         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10114         * parameter.cs (ParameterBase): New Attributable base class
10115         that can also represent Return types.
10116         (Parameter): Update to the changes.
10117
10118 2004-04-29  Jackson Harper  <jackson@ximian.com>
10119
10120         * driver.cs: Prefer the corlib system version when looking for
10121         assemblies in the GAC. This is still a hack, but its a better hack
10122         now.
10123         
10124 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10125
10126         * decl.cs, enum.cs: Improved error 3005 reporting.
10127   
10128         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10129         (related_symbols): New private member for list of symbols
10130         related to reported error/warning.
10131         
10132         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10133
10134 2004-04-29  Martin Baulig  <martin@ximian.com>
10135
10136         * ecore.cs (Expression.Constantify): If we're an enum and
10137         TypeManager.TypeToCoreType() doesn't give us another type, use
10138         t.UnderlyingSystemType.  Fixes #56178.  
10139
10140 2004-04-29  Martin Baulig  <martin@ximian.com>
10141
10142         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10143         interfaces and for each interface, only add members directly
10144         declared in that interface.  Fixes #53255.
10145
10146 2004-04-28  Martin Baulig  <martin@ximian.com>
10147
10148         * expression.cs (ConditionalLogicalOperator): Use a temporary
10149         variable for `left' to avoid that we evaluate it more than once;
10150         bug #52588.
10151
10152 2004-04-28  Martin Baulig  <martin@ximian.com>
10153
10154         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10155         `void[]' (CS1547).
10156
10157 2004-04-28  Martin Baulig  <martin@ximian.com>
10158
10159         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10160         void (CS1547).
10161
10162         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10163         whether the type is not void (CS1547).
10164
10165 2004-04-28  Martin Baulig  <martin@ximian.com>
10166
10167         * expression.cs (Unary.DoResolveLValue): Override this and report
10168         CS0131 for anything but Operator.Indirection.
10169
10170 2004-04-28  Martin Baulig  <martin@ximian.com>
10171
10172         Committing a patch from Ben Maurer; see bug #50820.
10173
10174         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10175         check for classes.
10176
10177         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10178         classes.        
10179
10180 2004-04-28  Martin Baulig  <martin@ximian.com>
10181
10182         Committing a patch from Ben Maurer; see bug #50820.
10183
10184         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10185         check for classes.
10186
10187         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10188         classes.        
10189
10190 2004-04-28  Martin Baulig  <martin@ximian.com>
10191
10192         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10193         (Block.AddLabel): Call DoLookupLabel() to only search in the
10194         current block.
10195
10196 2004-04-28  Martin Baulig  <martin@ximian.com>
10197
10198         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10199         comparing StringConstants and NullLiterals in Equality and Inequality.
10200
10201 2004-04-28  Jackson Harper  <jackson@ximian.com>
10202
10203         * driver.cs: Attempt to load referenced assemblies from the
10204         GAC. This is the quick and dirty version of this method that
10205         doesnt take into account versions and just takes the first
10206         canidate found. Will be good enough for now as we will not have more
10207         then one version installed into the GAC until I update this method.
10208
10209 2004-04-28  Martin Baulig  <martin@ximian.com>
10210
10211         * typemanager.cs (TypeManager.CheckStructCycles): New public
10212         static method to check for cycles in the struct layout.
10213
10214         * rootcontext.cs (RootContext.PopulateTypes): Call
10215         TypeManager.CheckStructCycles() for each TypeContainer.
10216         [Note: We only need to visit each type once.]
10217
10218 2004-04-28  Martin Baulig  <martin@ximian.com>
10219
10220         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10221
10222         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10223         success and added `out object value'.  Use a `bool resolved' field
10224         to check whether we've already been called rather than
10225         `ConstantValue != null' since this breaks for NullLiterals.
10226
10227 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10228
10229         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10230         setting of this flag, since the 'set' method may be non-public.
10231
10232 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10233
10234         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10235         check on current_vector.Block.
10236
10237 2004-04-27  Martin Baulig  <martin@ximian.com>
10238
10239         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10240         a field initializer.  Fixes #56459.
10241
10242 2004-04-27  Martin Baulig  <martin@ximian.com>
10243
10244         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10245         we're not attempting to use an indexer.  Fixes #52154.
10246
10247 2004-04-27  Martin Baulig  <martin@ximian.com>
10248
10249         * statement.cs (Return): Don't create a return label if we don't
10250         need it; reverts my change from January 20th.  Thanks to Ben
10251         Maurer for this.
10252
10253 2004-04-27  Martin Baulig  <martin@ximian.com>
10254
10255         According to the spec, `goto' can only leave a nested scope, but
10256         never enter it.
10257
10258         * statement.cs (Block.LookupLabel): Only lookup in the current
10259         block, don't recurse into parent or child blocks.
10260         (Block.AddLabel): Check in parent and child blocks, report
10261         CS0140/CS0158 if we find a duplicate.
10262         (Block): Removed this indexer for label lookups.
10263         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10264         this already does the error reporting for us.
10265
10266         * flowanalysis.cs
10267         (FlowBranching.UsageVector.Block): New public variable; may be null.
10268         (FlowBranching.CreateSibling): Added `Block' argument.
10269         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10270         label for the target of a `goto' and check whether we're not
10271         leaving a `finally'.
10272
10273 2004-04-27  Martin Baulig  <martin@ximian.com>
10274
10275         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10276         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10277         just for returns).
10278
10279 2004-04-27  Martin Baulig  <martin@ximian.com>
10280
10281         * statement.cs (Block.AddLabel): Also check for implicit blocks
10282         and added a CS0158 check.
10283
10284 2004-04-27  Martin Baulig  <martin@ximian.com>
10285
10286         * flowanalysis.cs (FlowBranchingLoop): New class.
10287         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10288         UsageVector's instead of an ArrayList.
10289         (FlowBranching.Label): Likewise.
10290         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10291         (FlowBranching.AddBreakVector): New method.
10292
10293 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10294
10295         * attribute.cs: Small regression fix: only convert the type if we
10296         the type is different, fixes System.Drawing build.
10297
10298 2004-04-27  Martin Baulig  <martin@ximian.com>
10299
10300         * attribute.cs (Attribute.Resolve): If we have a constant value
10301         for a named field or property, implicity convert it to the correct
10302         type.
10303
10304 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10305
10306         * statement.cs (Block.Block): Implicit blocks share
10307         'child_variable_names' fields with parent blocks.
10308         (Block.AddChildVariableNames): Remove.
10309         (Block.AddVariable): Mark variable as "used by a child block" in
10310         every surrounding block.
10311         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10312         been used in a child block, complain about violation of "Invariant
10313         meaning in blocks" rule.
10314         * cs-parser.jay (declare_local_variables): Don't use
10315         AddChildVariableNames.
10316         (foreach_statement): Don't create an implicit block: 'foreach'
10317         introduces a scope.
10318
10319 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10320
10321         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10322         converting from 0L to ulong.  Fixes 57522.
10323
10324 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10325
10326         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10327         derived class hides via 'new' keyword field from base class (test-242.cs).
10328         TODO: Handle this in the more general way.
10329         
10330         * class.cs (CheckBase): Ditto.
10331
10332 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10333
10334         * decl.cs (caching_flags): New member for storing cached values
10335         as bit flags.
10336         (MemberCore.Flags): New enum where bit flags for caching_flags
10337         are defined.
10338         (MemberCore.cls_compliance): Moved to caching_flags.
10339         (DeclSpace.Created): Moved to caching_flags.
10340
10341         * class.cs: Use caching_flags instead of DeclSpace.Created
10342         
10343 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10344
10345         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10346         if we are only a derived class, not a nested class.
10347
10348         * typemanager.cs: Same as above, but do this at the MemberLookup
10349         level (used by field and methods, properties are handled in
10350         PropertyExpr).   Allow for the qualified access if we are a nested
10351         method. 
10352
10353 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10354
10355         * class.cs: Refactoring.
10356         (IMethodData): New inteface; Holds links to parent members
10357         to avoid member duplication (reduced memory allocation).
10358         (Method): Implemented IMethodData interface.
10359         (PropertyBase): New inner classes for get/set methods.
10360         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10361         (Event): New inner classes for add/remove methods.
10362         (Event.DelegateMethod): Implemented IMethodData interface.
10363
10364         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10365         EmitContext (related to class.cs refactoring).
10366
10367 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10368
10369         * delegate.cs (Delegate.VerifyApplicability): If the number of
10370         arguments are the same as the number of parameters, first try to
10371         verify applicability ignoring  any 'params' modifier on the last
10372         parameter.
10373         Fixes #56442.
10374
10375 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10376
10377         * class.cs (TypeContainer.AddIndexer): Use
10378         'ExplicitInterfaceName' to determine if interface name was
10379         explicitly specified.  'InterfaceType' is not initialized at this time.
10380         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10381         Indexers array is already in the required order.  Initialize
10382         'IndexerName' only if there are normal indexers.
10383         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10384         (TypeContainer.Emit): Emit DefaultMember attribute only if
10385         IndexerName is initialized.
10386         Fixes #56300.
10387
10388 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10389
10390         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10391         Fixes #57007
10392
10393 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10394
10395         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10396         attributes.
10397         Fix for #56456.
10398
10399         * attribute.cs (Attribute.Resolve): Check for duplicate named
10400         attributes.
10401         Fix for #56463.
10402
10403 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10404
10405         * iterators.cs (MarkYield): track whether we are in an exception,
10406         and generate code accordingly.  Use a temporary value to store the
10407         result for our state.
10408
10409         I had ignored a bit the interaction of try/catch with iterators
10410         since their behavior was not entirely obvious, but now it is
10411         possible to verify that our behavior is the same as MS .NET 2.0
10412
10413         Fixes 54814
10414
10415 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10416
10417         * iterators.cs: Avoid creating temporaries if there is no work to
10418         do. 
10419
10420         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10421         Enumerations, use TypeManager.EnumToUnderlying and call
10422         recursively. 
10423
10424         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10425         bug #57013
10426
10427         (This.Emit): Use EmitContext.EmitThis to emit our
10428         instance variable.
10429
10430         (This.EmitAssign): Ditto.
10431
10432         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10433         codepaths, we will move all the functionality into
10434         Mono.CSharp.This 
10435
10436         (FieldExpr.EmitAssign): Ditto.
10437
10438         This fixes several hidden bugs that I uncovered while doing a code
10439         review of this today.
10440
10441         * codegen.cs (EmitThis): reworked so the semantics are more clear
10442         and also support value types "this" instances.
10443
10444         * iterators.cs: Changed so that for iterators in value types, we
10445         do not pass the value type as a parameter.  
10446
10447         Initialization of the enumerator helpers is now done in the caller
10448         instead of passing the parameters to the constructors and having
10449         the constructor set the fields.
10450
10451         The fields have now `assembly' visibility instead of private.
10452
10453 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10454
10455         * expression.cs (Argument.Resolve): Check if fields passed as ref
10456         or out are contained in a MarshalByRefObject.
10457
10458         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10459         another compiler type.
10460
10461 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10462
10463         * class.cs (Indexer.Define): use the new name checking method.
10464         Also, return false on an error.
10465         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10466         (is_identifier_[start/part]_character): make static.
10467
10468 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10469
10470         * expression.cs (Binary.ResolveOperator): Do no append strings
10471         twice: since we can be invoked more than once (array evaluation)
10472         on the same concatenation, take care of this here.  Based on a fix
10473         from Ben (bug #56454)
10474
10475 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10476
10477         * codegen.cs: Fix another case where CS1548 must be reported (when 
10478         delay-sign isn't specified and no private is available #56564). Fix
10479         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10480         error when MCS is used on the MS runtime and we need to delay-sign 
10481         (which seems unsupported by AssemblyBuilder - see #56621).
10482
10483 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10484
10485         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10486         (TypeManager.ComputeNamespaces): Faster implementation for
10487         Microsoft runtime.
10488
10489         * compiler.csproj: Updated AssemblyName to mcs.
10490
10491 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10492
10493         * rootcontext.cs: Add new types to the boot resolution.
10494
10495         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10496         MulticastDelegate is not allowed.
10497
10498         * typemanager.cs: Add new types to lookup: System.TypedReference
10499         and ArgIterator.
10500
10501         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10502         check for TypedReference or ArgIterator, they are not allowed. 
10503
10504         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10505         makes us properly catch 1510 in some conditions (see bug 56016 for
10506         details). 
10507
10508 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10509
10510         * CryptoConvert.cs: update from corlib version
10511         with endian fixes.
10512
10513 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10514
10515         * class.cs (Indexer.Define): Check indexername declaration
10516
10517 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10518
10519         * attribute.cs (IsClsCompliant): Fixed problem with handling
10520         all three states (compliant, not-compliant, undetected).
10521
10522 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10523
10524         * attribute.cs (Attribute): Location is now public.
10525         (Resolve): Store resolved arguments (pos_values) in attribute class.
10526         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10527         (GetClsCompliantAttributeValue): New method that gets
10528         CLSCompliantAttribute value.
10529         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10530         if exists else null.
10531         (AttributeTester): New class for CLS-Compliant verification routines.
10532
10533         * class.cs (Emit): Add CLS-Compliant verification.
10534         (Method.GetSignatureForError): Implemented.
10535         (Constructor.GetSignatureForError): Implemented
10536         (Constructor.HasCompliantArgs): Returns if constructor has
10537         CLS-Compliant arguments.
10538         (Constructor.Emit): Override.
10539         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10540         is needed to test only parameters.
10541         (FieldBase.GetSignatureForError): Implemented.
10542         (TypeContainer): New member for storing base interfaces.
10543         (TypeContainer.FindMembers): Search in base interfaces too.
10544
10545         * codegen.cs (GetClsComplianceAttribute): New method that gets
10546         assembly or module CLSCompliantAttribute value.
10547         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10548         for assembly.
10549         (ModuleClass.Emit): Add error 3012 test.
10550
10551         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10552
10553         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10554         state for all decl types.
10555         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10556         if CLS-Compliant tests are required.
10557         (IsClsCompliaceRequired): New method. Analyze whether code
10558         must be CLS-Compliant.
10559         (IsExposedFromAssembly): New method. Returns true when MemberCore
10560         is exposed from assembly.
10561         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10562         value or gets cached value.
10563         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10564         is explicitly marked with CLSCompliantAttribute.
10565         (IsIdentifierClsCompliant): New abstract method. This method is
10566         used to testing error 3005.
10567         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10568         for identifier and parameters CLS-Compliant testing.
10569         (VerifyClsCompliance): New method. The main virtual method for
10570         CLS-Compliant verifications.
10571         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10572         null. I don't know why is null (too many public members !).
10573         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10574         and get value of first CLSCompliantAttribute that found.
10575
10576         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10577         (VerifyClsCompliance): Override and add extra tests.
10578
10579         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10580         clscheck- disable CLS-Compliant verification event if assembly is has
10581         CLSCompliantAttribute(true).
10582
10583         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10584         ApllyAttribute is now called in emit section as in the other cases.
10585         Possible future Emit integration.
10586         (IsIdentifierClsCompliant): New override.
10587         (VerifyClsCompliance): New override.
10588         (GetEnumeratorName): Returns full enum name.
10589
10590         * parameter.cs (GetSignatureForError): Implemented.
10591
10592         * report.cs (WarningData): New struct for Warning message information.
10593         (LocationOfPreviousError): New method.
10594         (Warning): New method. Reports warning based on the warning table.
10595         (Error_T): New method. Reports error based on the error table.
10596
10597         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10598         verifications are done here.
10599
10600         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10601
10602         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10603         CLSCompliantAttribute.
10604         (all_imported_types): New member holds all imported types from other
10605         assemblies.
10606         (LoadAllImportedTypes): New method fills static table with exported types
10607         from all referenced assemblies.
10608         (Modules): New property returns all assembly modules.
10609
10610 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10611
10612         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10613         throwing a parser error.
10614
10615         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10616         which removes the hardcoded get_/set_ prefixes for properties, as
10617         IL allows for the properties to be named something else.  
10618
10619         Bug #56013
10620
10621         * expression.cs: Do not override operand before we know if it is
10622         non-null.  Fix 56207
10623
10624 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10625
10626         * typemanager.cs: support for pinned variables.
10627
10628 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10629
10630         * decl.cs, typemanager.cs: Avoid using an arraylist
10631         as a buffer if there is only one result set.
10632
10633 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10634
10635         * expression.cs: Make sure you cant call a static method
10636         with an instance expression, bug #56174.
10637
10638 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10639
10640         * class.cs (IsDuplicateImplementation): Improve error reporting to
10641         flag 663 (method only differs in parameter modifier).
10642
10643         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10644         in preprocessor directives.
10645
10646         * location.cs (LookupFile): Allow for the empty path.
10647
10648         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10649         better approach for some of that patch, but its failing with the
10650         CharSet enumeration.  For now try/catch will do.
10651
10652         * typemanager.cs: Do not crash if a struct does not have fields.
10653         Fixes 56150.
10654
10655 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10656
10657         * expression.cs: cs0213, cant fix a fixed expression.
10658         fixes 50231.
10659
10660 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10661
10662         * cs-parser.jay: detect invalid embeded statements gracefully.
10663         bug #51113.
10664
10665 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10666
10667         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10668         As a regex:
10669         s/
10670         the invocation type may not be a subclass of the tye of the item/
10671         The type of the item must be a subclass of the invocation item.
10672         /g
10673
10674         Fixes bug #50820.
10675
10676 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10677
10678         * attribute.cs: Added methods to get a string and a bool from an
10679         attribute. Required to information from AssemblyKeyFileAttribute,
10680         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10681         * codegen.cs: Modified AssemblyName creation to include support for
10682         strongnames. Catch additional exceptions to report them as CS1548.
10683         * compiler.csproj: Updated include CryptoConvert.cs.
10684         * compiler.csproj.user: Removed file - user specific configuration.
10685         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10686         Mono.Security assembly. The original class is maintained and tested in
10687         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10688         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10689         like CSC 8.0 (C# v2) supports.
10690         * Makefile: Added CryptoConvert.cs to mcs sources.
10691         * rootcontext.cs: Added new options for strongnames.
10692
10693 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10694
10695         * driver.cs: For --expect-error, report error code `2'
10696         if the program compiled with no errors, error code `1' if
10697         it compiled with an error other than the one expected.
10698
10699 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10700
10701         * compiler.csproj: Updated for Visual Studio .NET 2003.
10702         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10703         * compiler.sln: Updated for Visual Studio .NET 2003.
10704
10705 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10706
10707         * expression.cs: Fix bug #47234. We basically need to apply the
10708         rule that we prefer the conversion of null to a reference type
10709         when faced with a conversion to 'object' (csc behaviour).
10710
10711 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10712
10713         * statement.cs: Shorter form for foreach, eliminates
10714         a local variable. r=Martin.
10715
10716 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10717
10718         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10719         checks if we can use brtrue/brfalse to test for 0.
10720         * expression.cs: use the above in the test for using brtrue/brfalse.
10721         cleanup code a bit.
10722
10723 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10724
10725         * expression.cs: Rewrite string concat stuff. Benefits:
10726
10727         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10728         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10729         rather than a concat chain.
10730
10731         * typemanager.cs: Add lookups for more concat overloads.
10732
10733 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10734
10735         * expression.cs: Emit shorter il code for array init.
10736
10737         newarr
10738         dup
10739         // set 1
10740
10741         // set 2
10742
10743         newarr
10744         stloc.x
10745
10746         ldloc.x
10747         // set 1
10748
10749         ldloc.x
10750         // set 2
10751
10752 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10753
10754         * statement.cs: Before, two switch blocks would be merged if the
10755         total size of the blocks (end_item - begin_item + 1) was less than
10756         two times the combined sizes of the blocks.
10757
10758         Now, it will only merge if after the merge at least half of the
10759         slots are filled.
10760
10761         fixes 55885.
10762
10763 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10764
10765         * class.cs : csc build fix for GetMethods(). See bug #52503.
10766
10767 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10768
10769         * expression.cs: Make sure fp comparisons work with NaN.
10770         This fixes bug #54303. Mig approved this patch a long
10771         time ago, but we were not able to test b/c the runtime
10772         had a related bug.
10773
10774 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10777
10778 2004-03-19  Martin Baulig  <martin@ximian.com>
10779
10780         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10781         error here and not in our caller.
10782
10783 2004-03-19  Martin Baulig  <martin@ximian.com>
10784
10785         * interface.cs: Completely killed this file.
10786         (Interface): We're now a TypeContainer and live in class.cs.
10787
10788         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10789         argument; we're now also called for interfaces.
10790         (TypeContainer.DefineMembers): Allow this method being called
10791         multiple times.
10792         (TypeContainer.GetMethods): New public method; formerly known as
10793         Interface.GetMethod().  This is used by PendingImplementation.
10794         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10795         it's now private and non-static.
10796         (Interface): Moved this here; it's now implemented similar to
10797         Class and Struct.
10798         (Method, Property, Event, Indexer): Added `bool is_interface'
10799         argument to their .ctor's.
10800         (MemberBase.IsInterface): New public field.
10801
10802         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10803         instances instead of InterfaceMethod, InterfaceProperty, etc.
10804         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10805         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10806
10807 2004-03-19  Martin Baulig  <martin@ximian.com>
10808
10809         * class.cs (MethodCore.IsDuplicateImplementation): New private
10810         method which does the CS0111 checking.
10811         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10812         Use IsDuplicateImplementation().
10813
10814 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10815
10816         * decl.cs (FindMemberToOverride): New method to find the correct
10817         method or property to override in the base class.
10818         * class.cs
10819             - Make Method/Property use the above method to find the
10820               version in the base class.
10821             - Remove the InheritableMemberSignatureCompare as it is now
10822               dead code.
10823
10824         This patch makes large code bases much faster to compile, as it is
10825         O(n) rather than O(n^2) to do this validation.
10826
10827         Also, it fixes bug 52458 which is that nested classes are not
10828         taken into account when finding the base class member.
10829
10830         Reviewed/Approved by Martin.
10831
10832 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10833
10834         * interface.cs: In all interface classes removed redundant
10835         member initialization.
10836
10837 2004-03-16  Martin Baulig  <martin@ximian.com>
10838
10839         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10840
10841 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10842
10843         * decl.cs (DefineTypeAndParents): New helper method to define a
10844         type's containers before the type itself is defined;  This is a
10845         bug exposed by the recent changes to Windows.Forms when an
10846         implemented interface was defined inside a class that had not been
10847         built yet.   
10848
10849         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10850
10851         (Check): Loop correctly to report errors modifiers
10852         (UNSAFE was not in the loop, since it was the same as TOP).
10853
10854         * interface.cs: Every interface member now takes a ModFlags,
10855         instead of a "is_new" bool, which we set on the base MemberCore. 
10856
10857         Every place where we called "UnsafeOk" in the interface, now we
10858         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10859         the unsafe settings from the member declaration instead of the
10860         container interface. 
10861
10862         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10863
10864         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10865         `set_indexer_name' to the pending bits (one per type).
10866
10867         We fixed a bug today that was picking the wrong method to
10868         override, since for properties the existing InterfaceMethod code
10869         basically ignored the method name.  Now we make sure that the
10870         method name is one of the valid indexer names.
10871
10872 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10873  
10874         * support.cs (SeekableStreamReader): Keep track of stream byte
10875         positions and don't mix them with character offsets to the buffer.
10876
10877         Patch from Gustavo Giráldez
10878
10879 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10880
10881         * interface.cs (InterfaceSetGetBase): Removed double member
10882         initialization, base class does it as well.
10883
10884 2004-03-13  Martin Baulig  <martin@ximian.com>
10885
10886         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10887         when compiling corlib.
10888
10889 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10890
10891         * convert.cs (ExplicitConversion): We were reporting an error on
10892         certain conversions (object_type source to a value type, when the
10893         expression was `null') before we had a chance to pass it through
10894         the user defined conversions.
10895
10896         * driver.cs: Replace / and \ in resource specifications to dots.
10897         Fixes 50752
10898
10899         * class.cs: Add check for duplicate operators.  Fixes 52477
10900
10901 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10902
10903         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10904         that are in the middle of the statements, not only at the end.
10905         Fixes #54987
10906
10907         * class.cs (TypeContainer.AddField): No longer set the
10908         `HaveStaticConstructor' flag, now we call it
10909         `UserDefineStaticConstructor' to diferentiate the slightly
10910         semantic difference.
10911
10912         The situation is that we were not adding BeforeFieldInit (from
10913         Modifiers.TypeAttr) to classes that could have it.
10914         BeforeFieldInit should be set to classes that have no static
10915         constructor. 
10916
10917         See:
10918
10919         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10920
10921         And most importantly Zoltan's comment:
10922
10923         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10924
10925         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10926          before its static fields are used', i.e. initialization does not need
10927          to be triggered by the first access to the type. Setting this flag
10928          helps the JIT to compile better code, since it can run the static
10929          constructor at JIT time, and does not need to generate code to call it
10930          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10931          this flag for lots of classes like String. 
10932          
10933          csc sets this flag if the type does not have an explicit static 
10934          constructor. The reasoning seems to be that if there are only static
10935          initalizers for a type, and no static constructor, then the programmer
10936          does not care when this initialization happens, so beforefieldinit
10937          can be used.
10938          
10939          This bug prevents the AOT compiler from being usable, since it 
10940          generates so many calls to mono_runtime_class_init that the AOT code
10941          is much slower than the JITted code. The JITted code is faster, 
10942          because it does not generate these calls if the vtable is type is
10943          already initialized, which is true in the majority of cases. But the
10944          AOT compiler can't do this."
10945
10946 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10947
10948         * class.cs (MethodData.Emit): Refactor the code so symbolic
10949         information is generated for destructors;  For some reasons we
10950         were taking a code path that did not generate symbolic information
10951         before. 
10952
10953 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10954
10955         * class.cs: Create a Constructor.CheckBase method that
10956         takes care of all validation type code. The method
10957         contains some code that was moved from Define.
10958
10959         It also includes new code that checks for duplicate ctors.
10960         This fixes bug #55148.
10961
10962 2004-03-09  Joshua Tauberer <tauberer@for.net>
10963
10964         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10965         a { ... }-style array creation invokes EmitStaticInitializers
10966         which is not good for reference-type arrays.  String, decimal
10967         and now null constants (NullCast) are not counted toward
10968         static initializers.
10969
10970 2004-03-05  Martin Baulig  <martin@ximian.com>
10971
10972         * location.cs (SourceFile.HasLineDirective): New public field;
10973         specifies whether the file contains or is referenced by a "#line"
10974         directive.
10975         (Location.DefineSymbolDocuments): Ignore source files which
10976         either contain or are referenced by a "#line" directive.        
10977
10978 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10979
10980         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10981         direct access to our parent, so check the method inline there.
10982
10983 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10984
10985         * expression.cs (Invocation.EmitCall): Miguel's last commit
10986         caused a regression. If you had:
10987
10988             T t = null;
10989             t.Foo ();
10990
10991         In Foo the implict this would be null.
10992
10993 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10994
10995         * expression.cs (Invocation.EmitCall): If the method is not
10996         virtual, do not emit a CallVirt to it, use Call.
10997
10998         * typemanager.cs (GetFullNameSignature): Improve the method to
10999         cope with ".ctor" and replace it with the type name.
11000
11001         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11002         as an argument the ConstructorBuilder where it is being defined,
11003         to catch the recursive constructor invocations.
11004
11005 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11006
11007         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11008         routines to check if a type is an enumerable/enumerator allow
11009         classes that implement the IEnumerable or IEnumerator interfaces.
11010
11011         * class.cs (Property, Operator): Implement IIteratorContainer, and
11012         implement SetYields.
11013
11014         (Property.Define): Do the block swapping for get_methods in the
11015         context of iterators.   We need to check if Properties also
11016         include indexers or not.
11017
11018         (Operator): Assign the Block before invoking the
11019         OperatorMethod.Define, so we can trigger the Iterator code
11020         replacement. 
11021
11022         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11023         Property and Operator classes are not created when we parse the
11024         declarator but until we have the block completed, so we use a
11025         singleton SimpleIteratorContainer.Simple to flag whether the
11026         SetYields has been invoked.
11027
11028         We propagate this setting then to the Property or the Operator to
11029         allow the `yield' to function.
11030
11031 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11032
11033         * codegen.cs: Implemented attribute support for modules.
11034         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11035         Assembly/Module functionality.
11036
11037         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11038         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11039         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11040
11041 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11042
11043         * interface.cs (FindMembers): The operation is performed on all base
11044         interfaces and not only on the first. It is required for future CLS Compliance patch.
11045
11046 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11047
11048         * statement.cs, codegen.cs:
11049         This patch deals with patterns such as:
11050
11051         public class List : IEnumerable {
11052
11053                 public MyEnumerator GetEnumerator () {
11054                         return new MyEnumerator(this);
11055                 }
11056
11057                 IEnumerator IEnumerable.GetEnumerator () {
11058                         ...
11059                 }
11060                 
11061                 public struct MyEnumerator : IEnumerator {
11062                         ...
11063                 }
11064         }
11065
11066         Before, there were a few things we did wrong:
11067         1) we would emit callvirt on a struct, which is illegal
11068         2) we emited ldarg when we needed to emit ldarga
11069         3) we would mistakenly call the interface methods on an enumerator
11070         type that derived from IEnumerator and was in another assembly. For example:
11071
11072         public class MyEnumerator : IEnumerator
11073
11074         Would have the interface methods called, even if there were public impls of the
11075         method. In a struct, this lead to invalid IL code.
11076
11077 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11078
11079         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11080           renamed to Emit.
11081
11082         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11083
11084 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11085
11086         * cs-parser.jay: Fix small regression: we were not testing V2
11087         compiler features correctly.
11088
11089         * interface.cs: If the emit context is null, then create one
11090
11091 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11092
11093         * decl.cs (GetSignatureForError): New virtual method to get full name
11094           for error messages.
11095
11096         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11097           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11098
11099         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11100           Duplicated members and code in these classes has been removed.
11101           Better encapsulation in these classes.
11102
11103 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11104
11105         * assign.cs (Assign.DoResolve): When dealing with compound
11106         assignments, there is a new rule in ECMA C# 2.4 (might have been
11107         there before, but it is documented here) that states that in:
11108
11109         a op= b;
11110
11111         If b is of type int, and the `op' is a shift-operator, then the
11112         above is evaluated as:
11113
11114         a = (int) a op b 
11115
11116         * expression.cs (Binary.ResolveOperator): Instead of testing for
11117         int/uint/long/ulong, try to implicitly convert to any of those
11118         types and use that in pointer arithmetic.
11119
11120         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11121         method to print information for from the type, not from the
11122         null-method we were given.
11123
11124 2004-02-01  Duncan Mak  <duncan@ximian.com>
11125
11126         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11127         parsing for cmd, fixes bug #53694.
11128
11129 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11130
11131         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11132         in the member name duplication tests. Property and operator name duplication
11133         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11134
11135 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11136
11137         * interface.cs (PopulateMethod): Fixed crash when interface method
11138         returns not existing type (error test cs0246-3.cs).
11139
11140 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11141
11142         * cs-parser.jay (interface_accessors): Re-write actions to also
11143         store attributes attached to get and set methods. Fix spelling
11144         while at it.
11145
11146         (inteface_property_declaration): Modify accordingly.
11147
11148         (InterfaceAccessorInfo): New helper class to store information to pass
11149         around between rules that use interface_accessors.
11150
11151         * interface.cs (Emit): Apply attributes on the get and set
11152         accessors of properties and indexers too.
11153
11154         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11155         right MethodBuilder when applying attributes to the get and set accessors.
11156
11157 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11158
11159         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11160
11161 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11162
11163         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11164
11165 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11166
11167         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11168         changes that treat `yield' specially when present before `break'
11169         or `return' tokens.
11170
11171         * cs-tokenizer.cs: yield is no longer a keyword.
11172
11173 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11174
11175         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11176         setting for default constructors.
11177         For default constructors are almost every time set wrong Modifier. The
11178         generated IL code has been alright. But inside mcs this values was
11179         wrong and this was reason why several of my CLS Compliance tests
11180         failed.
11181
11182 2004-01-22  Martin Baulig  <martin@ximian.com>
11183
11184         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11185         not a QualifiedIdentifier.  This is what `type_name_expression'
11186         was previously doing.
11187         (type_name_expression): Removed; the code is now in
11188         `namespace_or_type_name'.
11189         (qualified_identifier): Removed, use `namespace_or_type_name'
11190         instead.
11191         (QualifiedIdentifier): Removed this class.      
11192
11193 2004-01-22  Martin Baulig  <martin@ximian.com>
11194
11195         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11196         not a string as alias name.
11197
11198 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11199
11200         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11201         #52730 bug, and instead compute correctly the need to use a
11202         temporary variable when requesting an address based on the
11203         static/instace modified of the field and the constructor.
11204  
11205 2004-01-21  Martin Baulig  <martin@ximian.com>
11206
11207         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11208         class and namespace before looking up aliases.  Fixes #52517.
11209
11210 2004-01-21  Martin Baulig  <martin@ximian.com>
11211
11212         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11213         assinged in a 'try'; fixes exception4.cs.
11214
11215 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11216         * class.cs : Implemented parameter-less constructor for TypeContainer
11217
11218         * decl.cs: Attributes are now stored here. New property OptAttributes
11219
11220         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11221
11222         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11223
11224 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11225
11226         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11227           (CSharpSignature): New method for indexer and property signature.
11228
11229 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11230
11231         * pending.cs (IsVirtualFilter): Faster implementation.
11232
11233 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11234
11235         * typemanager.cs: Avoid inclusion of same assembly more than once.
11236
11237 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11238
11239         * cs-parser.jay: Fixed problem where the last assembly attribute
11240           has been applied also to following declaration (class, struct, etc.)
11241           
11242 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11243
11244         * class.cs: Added error CS0538, CS0539 reporting.
11245         Fixed crash on Microsoft runtime when field type is void.
11246
11247         * cs-parser.jay: Added error CS0537 reporting.
11248
11249         * pending.cs: Added error CS0535 reporting.
11250         Improved error report for errors CS0536, CS0534.
11251
11252 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11253
11254         Merge a few bits from the Anonymous Method MCS tree.
11255
11256         * statement.cs (ToplevelBlock): New class for toplevel methods,
11257         will hold anonymous methods, lifted variables.
11258
11259         * cs-parser.jay: Create toplevel blocks for delegates and for
11260         regular blocks of code. 
11261
11262 2004-01-20  Martin Baulig  <martin@ximian.com>
11263
11264         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11265         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11266         and `NeedExplicitReturn'; added `IsLastStatement'.
11267         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11268         have a `ReturnLabel' or we're not unreachable.
11269
11270         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11271         child's reachability; don't just override ours with it.  Fixes
11272         #58058 (lluis's example).
11273         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11274         InFinally(), InLoop(), InSwitch() and
11275         BreakCrossesTryCatchBoundary() methods.
11276
11277         * statement.cs (Return): Do all error checking in Resolve().
11278         Unless we are the last statement in a top-level block, always
11279         create a return label and jump to it.
11280         (Break, Continue): Do all error checking in Resolve(); also make
11281         sure we aren't leaving a `finally'.
11282         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11283         statement in a top-level block.
11284         (Block.Flags): Added `IsDestructor'.
11285         (Block.IsDestructor): New public property.
11286
11287 2004-01-20  Martin Baulig  <martin@ximian.com>
11288
11289         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11290
11291 2004-01-20  Martin Baulig  <martin@ximian.com>
11292
11293         * statement.cs (Statement.ResolveUnreachable): New public method.
11294         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11295         (Block.Resolve): Resolve unreachable statements.
11296
11297 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11298
11299         * expression.cs: We need to fix the case where we do
11300         not have a temp variable here.
11301
11302         * assign.cs: Only expression compound assignments need
11303         temporary variables.
11304
11305 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11306
11307         * flowanalysis.cs: Reduce memory allocation in a few ways:
11308           - A block with no variables should not allocate a bit
11309             vector for itself.
11310           - A method with no out parameters does not need any tracking
11311             for assignment of the parameters, so we need not allocate
11312             any data for it.
11313           - The arrays:
11314                 public readonly Type[] VariableTypes;
11315                 public readonly string[] VariableNames;
11316             Are redundant. The data is already stored in the variable
11317             map, so we need not allocate another array for it.
11318           - We need to add alot of checks for if (params | locals) == null
11319             due to the first two changes.
11320
11321 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11322
11323         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11324         implement IMemoryLocation, we store a copy on a local variable and
11325         take the address of it.  Patch from Benjamin Jemlich
11326
11327         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11328         to use a special "type_name_expression" rule which reduces the
11329         number of "QualifiedIdentifier" classes created, and instead
11330         directly creates MemberAccess expressions.
11331
11332 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11333
11334         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11335         that fixes #52853.  Null literal assignment to ValueType
11336
11337         * class.cs (MethodData.Emit): Instead of checking the name of the
11338         method to determine if its a destructor, create a new derived
11339         class from Method called Destructor, and test for that.  
11340
11341         * cs-parser.jay: Create a Destructor object instead of a Method.  
11342
11343         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11344
11345         Fixes: 52933
11346
11347 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11348
11349         * expression.cs (Binary.ResolveOperator): Perform an implicit
11350         conversion from MethodGroups to their delegate types on the
11351         Addition operation.
11352
11353         * delegate.cs: Introduce a new class DelegateCreation that is the
11354         base class for `NewDelegate' and `ImplicitDelegateCreation',
11355         factor some code in here.
11356
11357         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11358         conversion from MethodGroups to compatible delegate types. 
11359
11360         * ecore.cs (Expression.Resolve): Do not flag error 654
11361         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11362         we allow conversions from MethodGroups to delegate types now.
11363
11364         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11365         assignments in v2 either.
11366
11367 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11368
11369         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11370         static read-only fields in ctors.
11371
11372         Applied patch from Benjamin Jemlich 
11373
11374         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11375
11376 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11377
11378         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11379         here to return true, as they can be used like this:
11380
11381                 (XXX) int.MEMBER ()
11382
11383         Fixed 49836 and all the other dups
11384
11385 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11386
11387         * driver.cs: Implement /win32res and /win32icon.
11388
11389 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11390
11391         * cs-parser.jay: Add a rule to improve error handling for the
11392         common mistake of placing modifiers after the type.
11393
11394 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11395
11396         * cs-parser.jay (interface_event_declaration): Catch
11397         initialization of events on interfaces, and report cs0068
11398
11399         * cs-parser.jay (interface_event_declaration): Catch
11400         initialization of events. 
11401
11402         * ecore.cs: Better report missing constructors.
11403
11404         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11405         the error reporting done in the wrong place.  Fix.
11406
11407         * expression.cs (Binary.ResolveOperator): Catch the 
11408         operator + (E x, E y) error earlier, and later allow for implicit
11409         conversions in operator +/- (E e, U x) from U to the underlying
11410         type of E.
11411
11412         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11413         52596, if the container class is abstract, the default constructor
11414         is protected otherwise its public (before, we were always public).
11415
11416         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11417         fixed statement.
11418
11419         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11420         Jemlich that fixes bug #52597, MCS was generating invalid code for
11421         idisposable structs.   Thanks to Ben for following up with this
11422         bug as well.
11423
11424 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11425
11426         * driver.cs: Allow assemblies without code to be generated, fixes
11427         52230.
11428
11429 2004-01-07  Nick Drochak <ndrochak@gol.com>
11430
11431         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11432
11433 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11434
11435         * cs-parser.jay: Add rules to improve error reporting if fields or
11436         methods are declared at the namespace level (error 116)
11437
11438         * Add rules to catch event add/remove
11439
11440 2004-01-04  David Sheldon <dave-mono@earth.li>
11441
11442   * expression.cs: Added matching ")" to error message for 
11443   CS0077
11444
11445 2004-01-03 Todd Berman <tberman@gentoo.org>
11446
11447         * ecore.cs, attribute.cs:
11448         Applying fix from #52429.
11449
11450 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11451
11452         * ecore.cs, expression.cs, statement.cs:
11453         Total rewrite of how we handle branching. We
11454         now handle complex boolean expressions with fewer
11455         jumps. As well if (x == 0) no longer emits a ceq.
11456
11457         if (x is Foo) is much faster now, because we generate
11458         better code.
11459
11460         Overall, we get a pretty big improvement on our benchmark
11461         tests. The code we generate is smaller and more readable.
11462
11463         I did a full two-stage bootstrap. The patch was reviewed
11464         by Martin and Miguel.
11465
11466 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11467
11468         * cs-parser.jay: Make primary_expression not take a QI.
11469         we dont need this because the member_access rule covers
11470         us here. So we replace the rule with just IDENTIFIER.
11471
11472         This has two good effects. First, we remove a s/r conflict.
11473         Second, we allocate many fewer QualifiedIdentifier objects.
11474
11475 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11476
11477         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11478         set the correct information via SRE. This prevents
11479         hanging on the MS runtime. Fixes #29374.
11480
11481 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11482
11483         * convert.cs: correctly handle conversions to value types
11484         from Enum and ValueType as unboxing conversions.
11485
11486         Fixes bug #52569. Patch by Benjamin Jemlich.
11487
11488 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11489
11490         * expression.cs (BetterConversion): Prefer int -> uint
11491         over int -> ulong (csc's behaviour). This fixed bug #52046.
11492
11493 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11494
11495         * decl.cs (MemberCache.FindMembers): now returns a
11496         MemberInfo [].
11497
11498         * typemanager.cs: In general, go with with ^^.
11499         (CopyNewMethods): take an IList.
11500         (RealMemberLookup): Only allocate an arraylist
11501         if we copy from two sets of methods.
11502
11503         This change basically does two things:
11504         1) Fewer array lists allocated due to CopyNewMethods.
11505         2) the explicit cast in MemberList costed ALOT.
11506
11507 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11508
11509         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11510         a hashtable to avoid needless string allocations when an identifier is
11511         used more than once (the common case).
11512
11513 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11514
11515         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11516         is broken, it will not return anything. So, we
11517         have to use the information we have in mcs to
11518         do the task.
11519
11520         * typemanager.cs: Add a cache for GetInterfaces,
11521         since this will now be used more often (due to ^^)
11522
11523         (GetExplicitInterfaces) New method that gets the
11524         declared, not effective, interfaces on a type
11525         builder (eg, if you have interface IFoo, interface
11526         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11527         { IBar }.
11528
11529         This patch makes MCS able to bootstrap itself on
11530         Windows again.
11531
11532 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11533
11534         * expression.cs: Remove the Nop's that Miguel put
11535         in by mistake.
11536
11537 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11538
11539         * report.cs, codegen.cs: Give the real stack trace to
11540         the error when an exception is thrown.
11541
11542 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11543
11544         * decl.cs: only allocate hashtables for ifaces if 
11545         it is an iface!
11546
11547 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11548
11549         * expression.cs: fix the error from cs0121-2.cs
11550         (a parent interface has two child interfaces that
11551         have a function with the same name and 0 params
11552         and the function is called through the parent).
11553
11554 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11555
11556         * class.cs, rootcontext.cs, typmanager.cs: do not
11557         leak pointers.
11558
11559 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11560
11561         * codegen.cs: remove stack for the ec flow branching.
11562         It is already a linked list, so no need.
11563
11564 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11565
11566         * Makefile: Allow custom profiler here.
11567
11568 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11569
11570         * typemanager.cs (LookupType):
11571           - Use a static char [], because split takes
11572             a param array for args, so it was allocating
11573             every time.
11574           - Do not store true in a hashtable, it boxes.
11575
11576 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11577
11578         * flowanalysis.cs: bytify common enums.
11579
11580 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11581
11582         * modifiers.cs: Add a new set of flags for the
11583         flags allowed on explicit interface impls.
11584         * cs-parser.jay: catch the use of modifiers in
11585         interfaces correctly.
11586         * class.cs: catch private void IFoo.Blah ().
11587
11588         All related to bug #50572.
11589
11590 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11591
11592         * decl.cs: Rewrite the consistant accessability checking.
11593         Accessability is not linear, it must be implemented in
11594         a tableish way. Fixes #49704.
11595
11596 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11597
11598         * expression.cs: Handle negation in a checked context.
11599         We must use subtraction from zero. Fixes #38674.
11600
11601 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11602
11603         * class.cs: Ignore static void main in DLLs.
11604         * rootcontext.cs: Handle the target type here,
11605         since we are have to access it from class.cs
11606         * driver.cs: account for the above.
11607
11608 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11609
11610         * report.cs: Give line numbers and files if available.
11611
11612 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11613
11614         * driver.cs: Implement /addmodule.
11615
11616         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11617         ModuleBuilders.
11618
11619 2003-12-20  Martin Baulig  <martin@ximian.com>
11620
11621         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11622         (FieldBase.IsAssigned): Removed this field.
11623         (FieldBase.SetAssigned): New public method.
11624         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11625
11626 2003-12-20  Martin Baulig  <martin@ximian.com>
11627
11628         * expression.cs (LocalVariableReference.DoResolve): Don't set
11629         `vi.Used' if we're called from DoResolveLValue().
11630
11631         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11632         returns the usage vector it just merged into the current one -
11633         pass this one to UsageWarning().
11634         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11635         of the `EmitContext', don't call this recursively on our children.
11636
11637 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11638
11639         * driver.cs: Implement /target:module.
11640
11641 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11642
11643         * support.cs (CharArrayHashtable): New helper class.
11644
11645         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11646         char arrays, not strings, so we can avoid creating a string in
11647         consume_identifier if the identifier is a keyword.
11648
11649 2003-12-16  Martin Baulig  <martin@ximian.com>
11650
11651         * statement.cs (LocalInfo.Assigned): Removed this property.
11652         (LocalInfo.Flags): Removed `Assigned'.
11653         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11654         and uses flow analysis.
11655         (Block.UsageWarning): Made this method private.
11656         (Block.Resolve): Call UsageWarning() if appropriate.
11657
11658         * expression.cs (LocalVariableReference.DoResolve): Always set
11659         LocalInfo.Used here.
11660
11661 2003-12-13  Martin Baulig  <martin@ximian.com>
11662
11663         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11664         any value here; we're now using flow analysis to figure out
11665         whether a statement/block returns a value.
11666
11667 2003-12-13  Martin Baulig  <martin@ximian.com>
11668
11669         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11670         working again.
11671         (FlowBranching.MergeFinally): Don't call
11672         `branching.CheckOutParameters()' here, this is called in
11673         MergeTopBlock().
11674         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11675         when adding the `finally' vector.       
11676
11677 2003-12-13  Martin Baulig  <martin@ximian.com>
11678
11679         * flowanalysis.cs
11680         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11681         actually work and also fix #48962.
11682
11683 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11684
11685         * decl.cs: Do not check System.Object for nested types,
11686         since we know it does not have any. Big bang for buck:
11687
11688         BEFORE:
11689            Run 1:   8.35 seconds
11690            Run 2:   8.32 seconds
11691            corlib:  17.99 seconds
11692         AFTER:
11693            Run 1:   8.17 seconds
11694            Run 2:   8.17 seconds
11695            corlib:  17.39 seconds
11696
11697 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11698
11699         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11700         time we are returning 0 members, so we save alot here.
11701
11702 2003-12-11  Martin Baulig  <martin@ximian.com>
11703
11704         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11705         `MergeChild()', also just take the `FlowBranching' as argument;
11706         call Merge() on it and return the result.
11707         (FlowBranching.Merge): We don't need to do anything if we just
11708         have one sibling.
11709
11710 2003-12-11  Martin Baulig  <martin@ximian.com>
11711
11712         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11713         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11714         Maurer for this idea.
11715
11716 2003-12-11  Martin Baulig  <martin@ximian.com>
11717
11718         * flowanalysis.cs (MergeResult): This class is now gone; we now
11719         use the `UsageVector' for this.  The reason for this is that if a
11720         branching just has one sibling, we don't need to "merge" them at
11721         all - that's the next step to do.
11722         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11723         `MergeResult'.
11724
11725 2003-12-11  Martin Baulig  <martin@ximian.com>
11726
11727         Reworked flow analyis and made it more precise and bug-free.  The
11728         most important change is that we're now using a special `Reachability'
11729         class instead of having "magic" meanings of `FlowReturns'.  I'll
11730         do some more cleanups and optimizations and also add some more
11731         documentation this week.
11732
11733         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11734         largely reworked this class.
11735         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11736         the new `Reachability' class instead of having "magic" values here.
11737         (FlowBranching): We're now using an instance of `Reachability'
11738         instead of having separate `Returns', `Breaks' etc. fields.
11739
11740         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11741         based on flow analysis; ignore the return value of block.Emit ().
11742
11743 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11744
11745         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11746         if they are private.
11747
11748 2003-12-09  Martin Baulig  <martin@ximian.com>
11749
11750         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11751         call them directly on the UsageVector.
11752
11753 2003-12-09  Martin Baulig  <martin@ximian.com>
11754
11755         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11756         Changed return type from `FlowReturns' to `Reachability'.
11757
11758 2003-12-09  Martin Baulig  <martin@ximian.com>
11759
11760         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11761         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11762         `Reachable' fields with a single `Reachability' one.
11763
11764 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11765
11766         * class.cs (FindMembers): Remove foreach's.
11767
11768         Bootstrap times:
11769
11770         BEFORE
11771                 Run 1:   8.74 seconds
11772                 Run 2:   8.71 seconds
11773
11774         AFTER
11775                 Run 1:   8.64 seconds
11776                 Run 2:   8.58 seconds
11777
11778
11779 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11780
11781         * cs-parser.jay:
11782         * gen-treedump.cs:
11783         * statement.cs:
11784         This patch does a few things:
11785                 1. EmptyStatement is now a singleton, so it is never reallocated.
11786                 2. All blah is EmptyStatement constructs have been changed to
11787                    blah == EmptyStatement.Value, which is much faster and valid
11788                    now that EmptyStatement is a singleton.
11789                 3. When resolving a block, rather than allocating a new array for
11790                    the non-empty statements, empty statements are replaced with
11791                    EmptyStatement.Value
11792                 4. Some recursive functions have been made non-recursive.
11793         Mainly the performance impact is from (3), however (1) and (2) are needed for
11794         this to work. (4) does not make a big difference in normal situations, however
11795         it makes the profile look saner.
11796
11797         Bootstrap times:
11798
11799         BEFORE
11800         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11801         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11802         Total memory allocated: 56397 KB
11803
11804         AFTER
11805         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11806         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11807         Total memory allocated: 55666 KB
11808
11809 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11810
11811         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11812         than the hashtable in a hashtable version
11813
11814         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11815         we always end up concating a string. This results in a huge perf
11816         loss, because many strings have to be tracked by the GC. In this
11817         patch, we first use a hashtable that works with two keys, so that
11818         the strings do not need to be concat'ed.
11819
11820         Bootstrap times:
11821         BEFORE
11822                 Run 1:   8.74 seconds
11823                 Run 2:   8.71 seconds
11824
11825         AFTER
11826                 Run 1:   8.65 seconds
11827                 Run 2:   8.56 seconds
11828
11829 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11830
11831         * Makefile: Add a new target `do-time' that does a quick and simple
11832         profile, leaving easy to parse output.
11833
11834 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11835
11836         * codegen.cs (Init): Create the dynamic assembly with 
11837         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11838
11839 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11840
11841         * support.cs: Make the PtrHashtable use only one
11842         instance of its comparer.
11843
11844 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11845
11846         * typemanager.cs: Fix lookup of GetNamespaces.
11847
11848 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11849
11850         * expression.cs: Removed redundant line.
11851
11852         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11853         ArrayLists, use for loops with bounds.  
11854
11855         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11856         arraylist.
11857
11858         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11859         arraylists, use for loop with bounds.
11860
11861         The above three changes give us a 0.071 second performance
11862         improvement out of 3.294 seconds down to 3.223.  On my machine
11863         the above changes reduced the memory usage by 1,387 KB during
11864         compiler bootstrap.
11865
11866         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11867         QualifiedIdentifiers.  Before we created a new string through
11868         concatenation, and mostly later on, the result would be
11869         manipulated by DecomposeQI through string manipulation.
11870
11871         This reduced the compiler memory usage for bootstrapping from
11872         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11873         compile times in 0.05 seconds.
11874
11875 2003-11-28  Dick Porter  <dick@ximian.com>
11876
11877         * support.cs: Do string compares with the Invariant culture.
11878
11879         * rootcontext.cs: 
11880         * gen-treedump.cs: 
11881         * expression.cs: 
11882         * driver.cs: 
11883         * decl.cs: 
11884         * codegen.cs: 
11885         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11886         the comparison is done with the Invariant culture.
11887
11888 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11889
11890         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11891         GetEnumerator method.
11892
11893         (ProbeCollectionType): Iterate starting at the most specific type
11894         upwards looking for a GetEnumerator
11895
11896         * expression.cs: Shift count can be up to 31 for int/uint and 63
11897         for long/ulong.
11898
11899 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11900
11901         * statement.cs (Block.LookupLabel): Also look for the label on the
11902         children blocks.  Use a hash table to keep track of visited
11903         nodes. 
11904
11905         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11906         we actually did transform the other operand, otherwise fall back
11907         to the common codepath that casts to long.
11908
11909         * cs-tokenizer.cs: Use the same code pattern as the int case.
11910         Maybe I should do the parsing myself, and avoid depending on the
11911         Parse routines to get this done.
11912
11913 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11914
11915         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11916         which fixes bug 51347.  This time test it.
11917
11918         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11919         attributes for example can not tell the difference between these.
11920         The difference was only a syntax feature of the language. 
11921
11922         * attribute.cs: Apply attributes to delegates.
11923
11924         * delegate.cs: Call the apply attributes method.
11925
11926 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11927
11928         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11929         comparing 0 vs Byte.MinValue, not the value
11930
11931         (ImplicitConversionRequired): When reporting a conversion error,
11932         use error 31 to print out the constant error instead of the
11933         simpler 29.
11934
11935         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11936         which fixes bug 51347.
11937
11938 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11939
11940         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11941         which fixes the -warnaserror command line option.
11942
11943 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11944
11945         * cfold.cs (DoNumericPromotions): During constant folding of
11946         additions on UIntConstant, special case intconstants with
11947         IntConstants like we do on the expression binary operator. 
11948
11949 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11950
11951         * convert.cs (ImplicitReferenceConversion): We were missing a case
11952         (System.Enum are not value types or class types, so we need to
11953         classify them separatedly).
11954
11955         * driver.cs: We do not support error 2007.
11956
11957 2003-11-12 Jackson Harper <jackson@ximian.com>
11958
11959         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11960         system directory. Also use the full file name so users can
11961         libraries names mscorlib-o-tron.dll in a non system dir.
11962
11963 2003-11-10  Martin Baulig  <martin@ximian.com>
11964
11965         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11966         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11967         calling `ResolveType()' on them, directly assign their `Type'.
11968
11969 2003-11-08  Martin Baulig  <martin@ximian.com>
11970
11971         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11972         return value and the `out parent' parameter.
11973         (TypeContainer.DefineType): Moved the CS0644 check into
11974         GetClassBases().  Don't pass the interface types to the
11975         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11976         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11977
11978         * ecore.cs (TypeExpr.IsAttribute): New property.
11979         (TypeExpr.GetInterfaces): New method.
11980
11981         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11982         TypeExpr instead of a Type.
11983         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11984         (Interface.DefineType): Don't pass the interface types to the
11985         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11986         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11987
11988         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11989         instead of a `Type[]'.
11990         (TypeManager.RegisterBuilder): Likewise.
11991         (TypeManager.AddUserInterface): Likewise.
11992         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11993         `Type[]' and also return a `TypeExpr[]'.
11994         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11995
11996 2003-11-08  Martin Baulig  <martin@ximian.com>
11997
11998         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11999         Expression.     
12000
12001 2003-11-08  Martin Baulig  <martin@ximian.com>
12002
12003         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12004         TypeManager.ResolveExpressionTypes().
12005
12006         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12007         instead of an Expression.
12008         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12009         (TypeExpression): New public class; formerly known as `TypeExpr'.
12010
12011         * expression.cs (ComposedCast): Derive from TypeExpr.
12012
12013         * typemanager.cs (TypeManager.system_*_expr): These are now
12014         TypExpr's instead of Expression's.
12015         (TypeManager.ResolveExpressionTypes): New public static function;
12016         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12017         of them.        
12018
12019 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12020
12021         * expression.cs (New.DoResolve): Do not dereference value that
12022         might be a null return.
12023
12024         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12025         sure that the constant value has the right type.  Fixes an
12026         unreported bug, similar to 50425.
12027
12028         * const.cs (Const.LookupConstantValue): Call
12029         ImplicitStandardConversionExists before doing a conversion to
12030         avoid havng the TypeManager.ChangeType do conversions.
12031
12032         Reduced the number of casts used
12033
12034         (Const.ChangeType): New routine to enable reuse of the constant
12035         type changing code from statement.
12036
12037         * typemanager.cs (ChangeType): Move common initialization to
12038         static global variables.
12039
12040         Fixes #50425.
12041
12042         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12043         every value type to go through, even if it was void.  Fix that. 
12044
12045         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12046         character of the define, and the is_identifier_part_character for
12047         the rest of the string.
12048
12049 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * expression.cs (UnaryMutator.EmitCode): When I updated
12052         LocalVariableReference.DoResolve, I overdid it, and dropped an
12053         optimization done on local variable references.
12054
12055 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12056
12057         * ecore.cs: Convert the return from Ldlen into an int.
12058
12059 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12060
12061         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12062         the accessibility, this is a special case for toplevel non-public
12063         classes (internal for instance).
12064
12065 2003-10-20  Nick Drochak <ndrochak@gol.com>
12066
12067         * ecore.cs: Fix typo and build.  Needed another right paren.
12068
12069 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12070
12071         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12072         `internal' case regular and protected, but not allowing protected
12073         to be evaluated later.  Bug 49840
12074
12075 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12076
12077         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12078         to kb.Nlast, and not the kb.nFirst to isolate the switch
12079         statement.
12080
12081         Extract the underlying type, so enumerations of long/ulong are
12082         treated like long/ulong.
12083
12084 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12085
12086         * expression.cs (New): Overload the meaning of RequestedType to
12087         track the possible creation of the NewDelegate type, since
12088         DoResolve is invoked more than once for new constructors on field
12089         initialization.
12090
12091         See bugs: #48800 and #37014
12092
12093         * cs-parser.jay (declare_local_constants): Take an arraylist
12094         instead of a single constant.
12095
12096         (local_constant_declaration): It should take a
12097         constant_declarators, not a constant_declarator.  Fixes 49487
12098
12099         * convert.cs: Fix error report.
12100
12101 2003-10-13 Jackson Harper <jackson@ximian.com>
12102
12103         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12104         bug #49611
12105
12106 2003-10-09  Martin Baulig  <martin@ximian.com>
12107
12108         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12109         to the .ctor.
12110         (MethodCore.DoDefineParameters): Removed the TypeContainer
12111         argument; use the DeclSpace which was passed to the .ctor instead.
12112         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12113         TypeContainer; we only need a DeclSpace here.
12114
12115 2003-10-09  Martin Baulig  <martin@ximian.com>
12116
12117         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12118         to the .ctor.
12119         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12120         EmitContext's .ctor.    
12121
12122 2003-10-09  Martin Baulig  <martin@ximian.com>
12123
12124         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12125         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12126         AsAccessible(), moved them as well.
12127
12128         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12129
12130 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12131
12132         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12133
12134 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12135
12136         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12137         generation for >=, as spotted by Paolo, bug 48679.  
12138         Patch from David Waite.
12139
12140         * cs-tokenizer.cs: Add handling for #pragma.
12141
12142         * cs-parser.jay: Allow for both yield and yield return in the
12143         syntax.  The anti-cobolization of C# fight will go on!
12144
12145         * class.cs (TypeBuilder.DefineType): Catch error condition here
12146         (Parent.DefineType erroring out and returning null).
12147
12148         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12149         coping with enumerations variables, we were mistakenly processing
12150         them as a regular value type instead of built-in types.  Fixes the
12151         bug #48063
12152
12153         * typemanager.cs (IsBuiltinOrEnum): New method.
12154
12155 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12156
12157         * cs-parser.jay: Upgrade: yield now needs the return clause.
12158
12159 2003-09-19  Martin Baulig  <martin@ximian.com>
12160
12161         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12162         `MemberCache parent' argument.  Normally, an interface doesn't
12163         have a parent type except System.Object, but we use this in gmcs
12164         for generic type parameters.
12165
12166 2003-09-18  Martin Baulig  <martin@ximian.com>
12167
12168         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12169         on `type.IsInterface'; don't check whether the type has a parent
12170         to determine whether it's an interface.
12171
12172 2003-09-15  Martin Baulig  <martin@ximian.com>
12173
12174         * class.cs (TypeContainer.DefineType): Added an error flag to
12175         avoid reporting duplicate CS0146's ("class definition is
12176         circular.").
12177
12178         * driver.cs (Driver.MainDriver): Abort if
12179         RootContext.ResolveTree() reported any errors.
12180
12181 2003-09-07  Martin Baulig  <martin@ximian.com>
12182
12183         * report.cs (Error, Warning): Added overloaded versions which take
12184         a `params object[] args' and call String.Format().
12185
12186 2003-09-07  Martin Baulig  <martin@ximian.com>
12187
12188         * decl.cs (DeclSpace..ctor): Don't call
12189         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12190         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12191         (DeclSpace.RecordDecl): New method.
12192
12193         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12194
12195 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12196
12197         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12198         value attributes to be applied to ParameterBuilders.
12199
12200         * class.cs (MethodCore.LabelParameters): Make static and more
12201         generic so that it can be used from other places - like interface
12202         methods, for instance.
12203
12204         * interface.cs (Interface.Emit): Call LabelParameters before
12205         emitting attributes on the InterfaceMethod.
12206
12207 2003-08-26  Martin Baulig  <martin@ximian.com>
12208
12209         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12210         resolving aliases; fixes #47927.
12211
12212 2003-08-26  Martin Baulig  <martin@ximian.com>
12213
12214         * statement.cs (Using.DoResolve): This is internally emitting a
12215         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12216         do not always return.  Fixes #47681.
12217
12218 2003-08-26  Martin Baulig  <martin@ximian.com>
12219
12220         * decl.cs (MemberCore): Moved WarningNotHiding(),
12221         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12222         into MemberBase.
12223         (AdditionResult): Make this nested in DeclSpace.
12224         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12225         argument; call NamespaceEntry.Define() unless we're nested in a
12226         class or struct.
12227
12228         * namespace.cs (Namespace.DefineName): New public function.  This
12229         is called from DeclSpace's .ctor to add 
12230         (Namespace.Lookup): Include DeclSpaces in the lookup.
12231
12232         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12233
12234         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12235
12236 2003-08-25  Martin Baulig  <martin@ximian.com>
12237
12238         * convert.cs (Convert.ExplicitReferenceConversion): When
12239         converting from an interface type to a class, unbox if the target
12240         type is a struct type.  Fixes #47822.
12241
12242 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12243
12244         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12245         #47854.
12246
12247 2003-08-22  Martin Baulig  <martin@ximian.com>
12248
12249         * class.cs (TypeManager.DefineType): When defining a nested type,
12250         call DefineType() on our parent; fixes #47801.
12251
12252 2003-08-22  Martin Baulig  <martin@ximian.com>
12253
12254         * class.cs (MethodData.Define): While checking if a method is an
12255         interface implementation, improve the test a bit more to fix #47654.
12256
12257 2003-08-22  Martin Baulig  <martin@ximian.com>
12258
12259         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12260         correctly; fixes #47722.
12261
12262 2003-08-22  Martin Baulig  <martin@ximian.com>
12263
12264         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12265         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12266
12267         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12268
12269 2003-08-22  Martin Baulig  <martin@ximian.com>
12270
12271         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12272         can only be assigned in static constructors.  Fixes #47161.
12273
12274 2003-08-22  Martin Baulig  <martin@ximian.com>
12275
12276         Rewrote and improved the flow analysis code.
12277
12278         * flowbranching.cs (FlowBranching): Make this class abstract.
12279         (FlowBranching.CreateBranching): New static function to create a
12280         new flow branching.
12281         (FlowBranchingBlock, FlowBranchingException): New classes.
12282         (FlowBranching.UsageVector.Type): New public readonly field.
12283         (FlowBranching.UsageVector.Breaks): Removed the setter.
12284         (FlowBranching.UsageVector.Returns): Removed the setter.
12285         (FlowBranching.UsageVector): Added Break(), Return(),
12286         NeverReachable() and Throw() methods to modify the reachability.
12287         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12288         done by FlowBranching.Merge().
12289         (FlowBranching.UsageVector.MergeChild): New method; merges the
12290         merge result into the current vector.
12291         (FlowBranching.Merge): New abstract method to merge a branching.
12292
12293 2003-08-12  Martin Baulig  <martin@ximian.com>
12294
12295         * expression.cs (Indirection.CacheTemporaries): Create the
12296         LocalTemporary with the pointer type, not its element type.
12297
12298 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12299
12300         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12301         token was a keyword or not.
12302
12303         Add `error' options where an IDENTIFIER was expected;  Provide
12304         CheckToken and CheckIdentifierToken convenience error reporting
12305         functions. 
12306
12307         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12308
12309         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12310         NameSpaceEntry NameSpaceEntry.
12311
12312         (LookupInterfaceOrClass): Avoid creating a full qualified name
12313         from namespace and name: avoid doing lookups when we know the
12314         namespace is non-existant.   Use new Tree.LookupByNamespace which
12315         looks up DeclSpaces based on their namespace, name pair.
12316
12317         * driver.cs: Provide a new `parser verbose' to display the
12318         exception thrown during parsing.  This is turned off by default
12319         now, so the output of a failure from mcs is more graceful.
12320
12321         * namespace.cs: Track all the namespaces defined in a hashtable
12322         for quick lookup.
12323
12324         (IsNamespace): New method
12325
12326 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12327
12328         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12329         we know that we need to concatenate (full typename can never be
12330         null). 
12331
12332         * class.cs: ditto.
12333
12334         * statement.cs: Use a bitfield;  Do not initialize to null things
12335         which are done by the constructor by default.
12336
12337         * cs-parser.jay: bug fix, parameter was 4, not 3.
12338
12339         * expression.cs: Just use the property;
12340
12341         * statement.cs: No need for GetVariableInfo method.
12342
12343 2003-08-08  Martin Baulig  <martin@ximian.com>
12344
12345         * flowanalysis.cs (FlowReturns): This is now nested in the
12346         `FlowBranching' class.
12347         (MyBitVector): Moved this here from statement.cs.
12348         (FlowBranching.SiblingType): New enum type.
12349         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12350
12351 2003-08-07  Martin Baulig  <martin@ximian.com>
12352
12353         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12354         `FlowBranching' class and called `BranchingType'.
12355
12356 2003-08-07  Martin Baulig  <martin@ximian.com>
12357
12358         * flowanalysis.cs: Moved all the control flow analysis code into
12359         its own file.
12360
12361 2003-08-07  Martin Baulig  <martin@ximian.com>
12362
12363         * assign.cs (Assign.DoResolve): `target' must either be an
12364         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12365         #37319.
12366
12367 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12368
12369         * expression.cs (BinaryMethod): This kind of expression is created by the
12370         Binary class if it determines that the operator has to be handled
12371         by a method.
12372
12373         (BinaryDelegate): This kind of expression is created if we are
12374         dealing with a + or - operator on delegates.
12375
12376         (Binary): remove method, argumetns, and DelegateOperator: when
12377         dealing with methods, 
12378
12379         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12380
12381         * statement.cs (Block): use bitfields for the three extra booleans
12382         we had in use.   Remove unused topblock parameter.
12383
12384         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12385
12386         * assign.cs: Drop extra unneeded tests.
12387
12388 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12389
12390         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12391
12392         * statement.cs (Foreach): Use VariableStorage instead of
12393         LocalBuilders.   
12394
12395         * codegen.cs (VariableStorage): New class used by clients that
12396         require a variable stored: locals or fields for variables that
12397         need to live across yield.
12398
12399         Maybe provide a convenience api for EmitThis+EmitLoad?
12400
12401         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12402         these bad boys.
12403
12404 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12405
12406         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12407         RemapParameterLValue): New methods that are used to turn a
12408         precomputed FieldInfo into an expression like this:
12409
12410                 instance.FieldInfo
12411
12412         The idea is to use this instead of making LocalVariableReference
12413         have more than one meaning.
12414
12415         * cs-parser.jay: Add error production to BASE.
12416
12417         * ecore.cs: Deal with TypeManager.GetField returning null, which
12418         is now a valid return value.
12419
12420         (FieldExprNoAddress): New expression for Fields whose address can
12421         not be taken.
12422
12423         * expression.cs (LocalVariableReference): During the resolve
12424         phases, create new expressions if we are in a remapping context.
12425         Remove code that dealt with remapping here.
12426
12427         (ParameterReference): same.
12428
12429         (ProxyInstance): New expression, like the `This' expression, but
12430         it is born fully resolved.  We know what we are doing, so remove
12431         the errors that are targeted to user-provided uses of `this'.
12432
12433         * statement.cs (Foreach): our variable is now stored as an
12434         Expression;  During resolution, follow the protocol, dont just
12435         assume it will return this.
12436
12437 2003-08-06  Martin Baulig  <martin@ximian.com>
12438
12439         * support.cs (SeekableStreamReader.cs): New public class.
12440
12441         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12442         SeekableStreamReader instead of the normal StreamReader.
12443
12444 2003-08-04  Martin Baulig  <martin@ximian.com>
12445
12446         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12447         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12448         deambiguate casts and delegate invocations.
12449         (parenthesized_expression): Use the new tokens to ensure this is
12450         not a cast of method invocation.
12451
12452         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12453         when reading a `)' and Deambiguate_CloseParens () was previously
12454         called.
12455
12456         * expression.cs (ParenthesizedExpression): New class.  This is
12457         just used for the CS0075 test.
12458         (Binary.DoResolve): Check for CS0075.   
12459
12460 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12461
12462         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12463         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12464         reference comparison.
12465
12466         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12467         examine the ReturnType for equality - this is necessary in the
12468         cases of implicit and explicit operators whose signature also
12469         includes the return type.
12470
12471 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * namespace.cs: Cache the result of the namespace computation,
12474         instead of computing it every time.
12475
12476 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12477
12478         * decl.cs: Use a global arraylist that we reuse over invocations
12479         to avoid excesive memory consumption.  Reduces memory usage on an
12480         mcs compile by one meg (45 average).
12481
12482         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12483         private, work around that.
12484
12485 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12486
12487         * literal.cs (IntLiteral): Define Zero and One static literals. 
12488
12489         * cs-parser.jay (integer_literal): use static literals to reduce
12490         memory usage for the most used literals (0, 1 and -1).  211kb
12491         reduced in memory usage.
12492
12493         Replace all calls to `new ArrayList' with `new
12494         ArrayList(4)' which is a good average number for most allocations,
12495         and also requires only 16 bytes of memory for its buffer by
12496         default. 
12497
12498         This reduced MCS memory usage in seven megabytes for the RSS after
12499         bootstrapping.
12500
12501 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12502
12503         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12504         handle params methods the correct way by forming only one
12505         applicable set with params and normal methods in them. Earlier we
12506         were looking at params methods only if we found no normal methods
12507         which was not the correct thing to do.
12508
12509         (Invocation.BetterFunction): Take separate arguments indicating
12510         when candidate and the best method are params methods in their
12511         expanded form.
12512
12513         This fixes bugs #43367 and #46199.
12514
12515         * attribute.cs: Documentation updates.
12516
12517         (CheckAttribute): Rename to CheckAttributeTarget.
12518         (GetValidPlaces): Rename to GetValidTargets.
12519
12520         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12521         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12522
12523         Fixes bug #44468.
12524
12525 2003-07-28  Martin Baulig  <martin@ximian.com>
12526
12527         * class.cs (TypeContainer.DefineMembers): Use the base type's full
12528         name when looking up the base class of a nested class.  Fixes #46977.
12529
12530 2003-07-26  Martin Baulig  <martin@ximian.com>
12531
12532         * expression.cs (Indexers.Indexer): New nested struct; contains
12533         getter, setter and the indexer's type.
12534         (Indexers.Properties): This is now an ArrayList of
12535         Indexers.Indexer's.
12536         (IndexerAccess.DoResolveLValue): Correctly set the type if the
12537         indexer doesn't have any getters.
12538
12539         * assign.cs (Assign.DoResolve): Also do the implicit conversions
12540         for embedded property and indexer assignments.
12541
12542 2003-07-26  Martin Baulig  <martin@ximian.com>
12543
12544         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12545         preprocessor directive is not the first non-whitespace character
12546         on a line.
12547
12548 2003-07-26  Martin Baulig  <martin@ximian.com>
12549
12550         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12551         namespace parsing, follow the spec more closely.
12552
12553         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12554         NamespaceEntry.Lookup().
12555
12556 2003-07-25  Martin Baulig  <martin@ximian.com>
12557
12558         * MethodCore.cs (OverridesSomething): New public field; it's set
12559         from TypeContainer.DefineMembers if this method overrides
12560         something (which doesn't need to be a method).  Fix #39462.
12561
12562 2003-07-25  Ravi Pratap  <ravi@ximian.com>
12563
12564         * typemanager.cs (GetMembers): Ensure that the list of members is
12565         reversed. This keeps things in sync.
12566
12567         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12568         find an AttributeUsage attribute.
12569
12570         * expression.cs (Invocation.OverloadResolve): Perform the check
12571         which disallows Invoke to be directly called on a Delegate.
12572
12573         (Error_InvokeOnDelegate): Report error cs1533.
12574
12575 2003-07-25  Martin Baulig  <martin@ximian.com>
12576
12577         * expression.cs (Indexers.GetIndexersForType): Only look in the
12578         interface hierarchy if the requested type is already an
12579         interface.  Fixes #46788 while keeping #46502 fixed.
12580
12581 2003-07-25  Martin Baulig  <martin@ximian.com>
12582
12583         * class.cs (TypeContainer.DefineMembers): Check whether all
12584         readonly fields have been assigned and report warning CS0649 if
12585         not.
12586
12587         * statement.cs (LocalInfo.IsFixed): Always return true if this is
12588         a valuetype.
12589
12590 2003-07-24  Ravi Pratap  <ravi@ximian.com>
12591
12592         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12593         returned from GetMethods to make things consistent with the
12594         assumptions MCS makes about ordering of methods.
12595
12596         This should comprehensively fix bug #45127 and it does :-)
12597
12598         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12599         ordering is actually reverse.
12600
12601         * Clean up some debug messages I left lying around.
12602
12603         * interface.cs (Populate*): Get rid of code which emits attributes
12604         since the stage in which we emit attributes is the 'Emit' stage,
12605         not the define stage.
12606
12607         (Emit): Move attribute emission for interface members here.
12608
12609 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12610
12611         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12612         closely: we eliminate methods in base types when we have an
12613         applicable method in a top-level type.
12614
12615         Please see section 14.5.5.1 for an exact description of what goes
12616         on. 
12617
12618         This fixes bug #45127 and a host of other related to corlib compilation.
12619
12620         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12621         array is the method corresponding to the top-level type (this is
12622         because of the changes made to icall.c) so we change this
12623         accordingly.
12624
12625         (MethodGroupExpr.Name): This too.
12626
12627         * typemanager.cs (GetElementType): New method which does the right
12628         thing when compiling corlib. 
12629
12630         * everywhere: Make use of the above in the relevant places.
12631
12632 2003-07-22  Martin Baulig  <martin@ximian.com>
12633
12634         * cs-parser.jay (invocation_expression): Moved
12635         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12636         `cast_expression', but create a InvocationOrCast which later
12637         resolves to either an Invocation or a Cast.
12638
12639         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12640         method; call this before EmitStatement() to make sure that this
12641         expression can be used as a statement.
12642
12643         * expression.cs (InvocationOrCast): New class; resolves to either
12644         an Invocation or a Cast.
12645
12646         * statement.cs (StatementExpression): Call ResolveStatement() on
12647         the ExpressionStatement before emitting it.
12648
12649 2003-07-21  Martin Baulig  <martin@ximian.com>
12650
12651         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12652         `ref' and `out' attributes match; fixes #46220.
12653         (MemberAccess.ResolveMemberAccess): You can't reference a type
12654         through an expression; fixes #33180.
12655         (Indexers.GetIndexersForType): Don't return the indexers from
12656         interfaces the class implements; fixes #46502.
12657
12658 2003-07-21  Martin Baulig  <martin@ximian.com>
12659
12660         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12661         CS0661 checks; fixes bug #30442.
12662
12663 2003-07-21  Martin Baulig  <martin@ximian.com>
12664
12665         * decl.cs (AdditionResult): Added `Error'.
12666
12667         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12668
12669         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12670         makes cs0031.cs actually work.
12671
12672 2003-07-20  Martin Baulig  <martin@ximian.com>
12673
12674         * namespace.cs: Fixed that bug which caused a crash when compiling
12675         the debugger's GUI.
12676
12677 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12678
12679         * typemanager.cs (LookupTypeReflection): Never expose types which
12680         are NotPublic, NestedPrivate, NestedAssembly, or
12681         NestedFamANDAssem.  We used to return these, and later do a check
12682         that would report a meaningful error, but the problem is that we
12683         would not get the real match, if there was a name override.
12684
12685 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12686
12687         * namespace.cs (Namespace, Name): Do not compute the namespace
12688         name dynamically, compute it in the constructor.  This reduced
12689         memory usage by 1697 KB.
12690
12691         * driver.cs: Use --pause to pause at the end.
12692
12693 2003-07-17  Peter Williams  <peter@newton.cx>
12694
12695         * Makefile: Change the name of the test target so that it doesn't
12696         conflict with the recursive test target.
12697
12698 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12699
12700         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12701         AddressOf): Do not use EmitThis, that was wrong, use the actual
12702         this pointer.
12703
12704 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12705
12706         * class.cs (MethodData.Define): While checking if a method is an
12707         interface implementation, improve the test: If we are not public
12708         (use new test here: use the computed MethodAttributes directly,
12709         instead of the parsed modifier flags) check if the `implementing'
12710         method comes from an interface or not.
12711
12712         * pending.cs (VerifyPendingMethods): Slightly better error
12713         message.
12714
12715         * makefile: add test target that does the mcs bootstrap.
12716
12717 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12718
12719         * interface.cs (Define): Do nothing here since there are no
12720         members to populate etc. Move the attribute emission out of here
12721         since this was just totally the wrong place to put it. Attribute
12722         application happens during the 'Emit' phase, not in the 'Define'
12723         phase.
12724
12725         (Emit): Add this method and move the attribute emission here
12726
12727         * rootcontext.cs (EmitCode): Call the Emit method on interface
12728         types too.
12729
12730 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12731
12732         * expression.cs (OverloadResolve): Report error only if Location
12733         is not 'Null' which means that there was a probe going on.
12734
12735 2003-07-14  Martin Baulig  <martin@ximian.com>
12736
12737         * expression.cs (ConditionalLogicalOperator): New public class to
12738         implement user defined conditional logical operators.
12739         This is section 14.11.2 in the spec and bug #40505.
12740
12741 2003-07-14  Martin Baulig  <martin@ximian.com>
12742
12743         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12744
12745 2003-07-14  Martin Baulig  <martin@ximian.com>
12746
12747         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12748
12749         * ecore.cs (IVariable.VerifyFixed): New interface method.
12750
12751         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12752         operator, check whether the variable is actually fixed.  Fixes bug
12753         #36055.  Set a variable definitely assigned when taking its
12754         address as required by the spec.
12755
12756         * statement.cs (LocalInfo.IsFixed): New field.
12757         (LocalInfo.MakePinned): Set `IsFixed' to true.
12758
12759 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12760
12761         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12762         for .ctors, ensure that we only ask for members declared in the
12763         attribute type (BindingFlags.DeclaredOnly).
12764
12765         Fixes bug #43632.
12766
12767         * expression.cs (Error_WrongNumArguments): Report error 1501
12768         correctly the way CSC does.
12769
12770 2003-07-13  Martin Baulig  <martin@ximian.com>
12771
12772         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12773         lookup on the fully qualified name, to make things like "X.X" work
12774         where "X.X" is a fully qualified type name, but we also have a
12775         namespace "X" in the using list.  Fixes #41975.
12776
12777 2003-07-13  Martin Baulig  <martin@ximian.com>
12778
12779         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12780         function. If we're a CompoundAssign, we need to create an embedded
12781         CompoundAssign, not an embedded Assign.
12782         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12783         Fixes #45854.
12784
12785 2003-07-13  Martin Baulig  <martin@ximian.com>
12786
12787         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12788         work to fix bug #46088.
12789
12790 2003-07-13  Ravi Pratap <ravi@ximian.com>
12791
12792         * class.cs (Operator.Emit): Do not emit attributes here - it is
12793         taken care of by the Method class that we delegate too. This takes
12794         care of bug #45876.
12795
12796 2003-07-10  Martin Baulig  <martin@ximian.com>
12797
12798         * expression.cs (TypeOfVoid): New class.
12799         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12800
12801 2003-07-10  Martin Baulig  <martin@ximian.com>
12802
12803         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12804         bug #35957.
12805
12806 2003-07-10  Martin Baulig  <martin@ximian.com>
12807
12808         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12809         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12810
12811         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12812
12813         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12814
12815 2003-07-10  Martin Baulig  <martin@ximian.com>
12816
12817         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12818         of decimal.  Fixes #42850.
12819
12820         NOTE: I also fixed the created byte blob, but this doesn't work on
12821         the MS runtime and csc never produces any byte blobs for decimal
12822         arrays.
12823
12824 2003-07-10  Martin Baulig  <martin@ximian.com>
12825
12826         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12827         structs; fixes #32068.
12828         (Block.AddChildVariableNames): Fixed #44302.
12829
12830 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12831
12832         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12833
12834 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12835
12836         * attribute.cs: And this test is onger needed.
12837
12838 2003-07-08  Martin Baulig  <martin@ximian.com>
12839
12840         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12841         inaccessible types.  Fixes #36313.
12842
12843         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12844
12845         * namespace.cs (NamespaceEntry): Create implicit entries for all
12846         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12847         implicit entries for N1.N2 and N1.
12848
12849 2003-07-08  Martin Baulig  <martin@ximian.com>
12850
12851         Rewrote the handling of namespaces to fix a lot of the issues
12852         wrt. `using' aliases etc.
12853
12854         * namespace.cs (Namespace): Splitted this class into a
12855         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12856
12857         * typemanager.cs (TypeManager.IsNamespace): Removed.
12858         (TypeManager.ComputeNamespaces): Only compute namespaces from
12859         loaded assemblies here, not the namespaces from the assembly we're
12860         currently compiling.
12861
12862 2003-07-08  Martin Baulig  <martin@ximian.com>
12863
12864         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12865
12866 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12867
12868         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12869         already fixed it.  
12870
12871         I thought about the memory savings here, but LookupTypeReflection
12872         is used under already very constrained scenarios.  Compiling
12873         corlib or mcs only exposes one hit, so it would not really reduce
12874         any memory consumption.
12875
12876 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12877
12878         * typemanager.cs: fixes bug #45889 by only adding public types from
12879         other assemblies to the list of known types.
12880
12881 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12882
12883         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12884         on the type we resolved.
12885
12886 2003-07-05  Martin Baulig  <martin@ximian.com>
12887
12888         * pending.cs (PendingImplementation.ParentImplements): Don't
12889         create the proxy if the parent is abstract.
12890
12891         * class.cs (TypeContainer.DefineIndexers): Process explicit
12892         interface implementations first.  Fixes #37714.
12893
12894 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12895
12896         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12897         defined recursively;  but since we modify the input parameters
12898         (left is set to `this' temporarily), we reset this value if the
12899         left_is_explicit is false, which gives the original semantics to
12900         the code.  
12901
12902         * literal.cs (NullPointer): new class used to represent a null
12903         literal in a pointer context.
12904
12905         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12906         type is a pointer, use a NullPointer object instead of a
12907         NullLiteral.   Closes 43687
12908
12909         (ExplicitConversion): Convert pointer values using
12910         the conv opcode to the proper type.
12911
12912         * ecore.cs (New): change ValueTypeVariable property into a method,
12913         that returns whether the valuetype is suitable for being used.
12914
12915         * expression.cs (Binary.DoNumericPromotions): Only return if we
12916         the int constant was a valid uint, and we can return both left and
12917         right as uints.  If not, we continue processing, to trigger the
12918         type conversion.  This fixes 39018.
12919
12920         * statement.cs (Block.EmitMeta): During constant resolution, set
12921         the CurrentBlock property on the emitcontext, so that we resolve
12922         constants propertly.
12923
12924 2003-07-02  Martin Baulig  <martin@ximian.com>
12925
12926         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12927         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12928
12929         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12930         than emitting it here.
12931
12932         * statement.cs: Fixed some more flow analysis bugs.
12933
12934 2003-07-02  Martin Baulig  <martin@ximian.com>
12935
12936         * class.cs (MethodData.Define): When implementing interface
12937         methods, set Final unless we're Virtual.
12938
12939         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12940         check work for interface methods.
12941
12942 2003-07-01  Martin Baulig  <martin@ximian.com>
12943
12944         * ecore.cs (EmitContext.This): Replaced this property with a
12945         GetThis() method which takes a Location argument.  This ensures
12946         that we get the correct error location for a CS0188.
12947
12948 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12949
12950         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12951         ImplicitStandardConversion.
12952
12953         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12954
12955 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12956
12957         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12958         optimization.
12959
12960 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12961
12962         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12963         constructors.
12964
12965         (MethodData.Define): Turn off initlocals for unsafe methods.
12966
12967 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12968
12969         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12970         complete;  Fixes #37521.
12971
12972         * delegate.cs: Use Modifiers.TypeAttr to compute the
12973         TypeAttributes, instead of rolling our own.  This makes the flags
12974         correct for the delegates.
12975
12976 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12977
12978         * class.cs (Constructor.Define): Set the private flag for static
12979         constructors as well.
12980
12981         * cs-parser.jay (statement_expression): Set the return value to
12982         null, to avoid a crash when we catch an error.
12983
12984 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12985
12986         * cs-parser.jay: Applied patch from Jackson that adds support for
12987         extern and unsafe modifiers to destructor declarations.
12988
12989         * expression.cs: Report error 21 if the user is trying to index a
12990         System.Array.
12991
12992         * driver.cs: Add an error message, suggested by the bug report.
12993
12994         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12995         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12996
12997 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12998
12999         * namespace.cs: Add some information to reduce FAQs.
13000
13001 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13002
13003         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13004         underlying enumeration types.  Fixes #43915.
13005
13006         * expression.cs: Treat ushort/short as legal values to be used in
13007         bitwise operations.
13008
13009 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13010
13011         * delegate.cs: transfer custom attributes for paramenters from
13012         the delegate declaration to Invoke and BeginInvoke.
13013
13014 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13015
13016         * attribute.cs: handle custom marshalers and emit marshal info
13017         for fields, too.
13018
13019 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13020
13021         * makefile.gnu: Added anonymous.cs to the compiler sources.
13022
13023 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13024
13025         * iterators.cs: Change the name of the proxy class to include two
13026         underscores.
13027
13028         * cs-parser.jay: Update grammar to include anonymous methods.
13029
13030         * anonymous.cs: new file.
13031
13032 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13033
13034         * class.cs (Field.Define): Add missing test for pointers and
13035         safety. 
13036
13037 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13038
13039         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13040         we use the stobj opcode.
13041
13042         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13043         since it wasn't the correct fix. 
13044
13045         It still is puzzling that we are required to use stobj for IntPtr
13046         which seems to be a ValueType.
13047
13048 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13049
13050         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13051         during regular simple name resolution.   Now, the trick is that
13052         instead of returning for processing the simplename, we do a
13053         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13054         contextual lookup type).   If a match is found, return that, if
13055         not, return for further composition.
13056
13057         This fixes long-standing 30485.
13058
13059         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13060         using the address to initialize an object, do an Stobj instead of
13061         using the regular Stelem.
13062
13063         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13064         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13065         Because if we are a BaseIndexerAccess that value will be true.
13066         Fixes 43643.
13067
13068         * statement.cs (GotoCase.Resolve): Return after reporting an
13069         error, do not attempt to continue. 
13070
13071         * expression.cs (PointerArithmetic.Emit): If our operand is a
13072         long, convert our constants to match the operand before
13073         multiplying.  Convert to I type before adding.   Fixes 43670.
13074
13075 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13076
13077         * enum.cs (ImplicitConversionExists) : Rename to
13078         ImplicitEnumConversionExists to remove ambiguity. 
13079
13080         * ecore.cs (NullCast): New type of cast expression class which
13081         basically is very similar to EmptyCast with the difference being
13082         it still is a constant since it is used only to cast a null to
13083         something else
13084         (eg. (string) null)
13085
13086         * convert.cs (ImplicitReferenceConversion): When casting a null
13087         literal, we return a NullCast.
13088
13089         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13090         should be around anymore.
13091
13092         The renaming (reported was slightly wrong). Corrections:
13093
13094         ConvertImplicitStandard -> ImplicitConversionStandard
13095         ConvertExplicitStandard -> ExplicitConversionStandard
13096
13097         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13098         before passing them in !
13099
13100         * convert.cs (ImplicitConversionStandard): When comparing for
13101         equal expr and target types, ensure that expr is not a
13102         NullLiteral.
13103
13104         In general, we must not be checking (expr_type ==
13105         target_type) in the top level conversion methods
13106         (ImplicitConversion, ExplicitConversion etc). This checking is
13107         done in the methods that they delegate to.
13108
13109 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13110
13111         * convert.cs: Move Error_CannotConvertType,
13112         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13113         ImplicitNumericConversion, ImplicitConversionExists,
13114         ImplicitUserConversionExists, StandardConversionExists,
13115         FindMostEncompassedType, FindMostSpecificSource,
13116         FindMostSpecificTarget, ImplicitUserConversion,
13117         ExplicitUserConversion, GetConversionOperators,
13118         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13119         TryImplicitIntConversion, Error_CannotConvertImplicit,
13120         ConvertImplicitRequired, ConvertNumericExplicit,
13121         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13122         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13123         its own file.
13124
13125         Perform the following renames:
13126
13127         StandardConversionExists -> ImplicitStandardConversionExists
13128         ConvertImplicit -> ImplicitConversion
13129         ConvertImplicitStandard -> ImplicitStandardConversion
13130         TryImplicitIntConversion -> ImplicitIntConversion
13131         ConvertImplicitRequired -> ImplicitConversionRequired
13132         ConvertNumericExplicit -> ExplicitNumericConversion
13133         ConvertReferenceExplicit -> ExplicitReferenceConversion
13134         ConvertExplicit -> ExplicitConversion
13135         ConvertExplicitStandard -> ExplicitStandardConversion
13136
13137 2003-05-19  Martin Baulig  <martin@ximian.com>
13138
13139         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13140         (TypeInfo): Added support for structs having structs as fields.
13141
13142         * ecore.cs (FieldExpr): Implement IVariable.
13143         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13144         VariableInfo for the field.
13145
13146 2003-05-18  Martin Baulig  <martin@ximian.com>
13147
13148         * expression.cs (This.DoResolve): Report a CS0027 if we're
13149         emitting a field initializer.
13150
13151 2003-05-18  Martin Baulig  <martin@ximian.com>
13152
13153         * expression.cs (This.ResolveBase): New public function.
13154         (This.DoResolve): Check for CS0188.
13155
13156         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13157         This.Resolve().
13158
13159         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13160         `instance_expression' to null if we don't have any non-static
13161         methods.
13162
13163 2003-05-18  Martin Baulig  <martin@ximian.com>
13164
13165         Reworked the way how local variables and parameters are handled by
13166         the flow analysis code.
13167
13168         * statement.cs (TypeInfo, VariableMap): New public classes.
13169         (VariableInfo): New public class.  This is now responsible for
13170         checking whether a variable has been assigned.  It is used for
13171         parameters and local variables.
13172         (Block.EmitMeta): Take the InternalParameters as argument; compute
13173         the layout of the flow vectors here.
13174         (Block.LocalMap, Block.ParameterMap): New public properties.
13175         (FlowBranching): The .ctor doesn't get the InternalParameters
13176         anymore since Block.EmitMeta() now computes the layout of the flow
13177         vector.
13178         (MyStructInfo): This class is now known as `StructInfo' and nested
13179         in `TypeInfo'; we don't access this directly anymore.
13180
13181         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13182         property and removed IsAssigned(), IsFieldAssigned(),
13183         SetAssigned() and SetFieldAssigned(); we now call them on the
13184         VariableInfo so we don't need to duplicate this code everywhere.
13185
13186         * expression.cs (ParameterReference): Added `Block block' argument
13187         to the .ctor.
13188         (LocalVariableReference, ParameterReference, This): The new
13189         VariableInfo class is now responsible for all the definite
13190         assignment stuff.
13191
13192         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13193         IsParameterAssigned, SetParameterAssigned): Removed.
13194
13195 2003-05-18  Martin Baulig  <martin@ximian.com>
13196
13197         * typemanager.cs (InitCoreTypes): Try calling
13198         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13199         the 3-args-version.  Corlib now also needs our `void_type'.
13200         (GetMethod): Added overloaded version which takes an optional
13201         `bool report_errors' to allow lookups of optional methods.
13202
13203 2003-05-12  Martin Baulig  <martin@ximian.com>
13204
13205         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13206         only used for locals and not for parameters.
13207
13208 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13209
13210         * support.cs (InternalParameters.ParameterType): Return the
13211         ExternalType of the parameter.
13212
13213         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13214         they were unused.
13215
13216 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13217
13218         * class.cs (MethodData.Define): Do not set the `newslot' on
13219         interface members, if they are also flagged as "override".
13220
13221         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13222         better code for ++i and i++.  This only works for static fields
13223         and local variables.
13224
13225         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13226         want to pull the DeclSpace out of the builder_to_declspace instead
13227         of the TypeBuilder (like in TypeContainer.FindMembers).
13228
13229         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13230         instead of LookupTypeContainer.  Fixes the crash on .NET for
13231         looking up interface members.
13232
13233         * const.cs: Create our own emit context during the Definition
13234         stage, so that constants are evaluated in the proper context, when
13235         a recursive definition happens.
13236
13237 2003-05-11  Martin Baulig  <martin@ximian.com>
13238
13239         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13240         new block for a switch section.
13241         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13242         the adding/lookup in the switch block.  Fixes #39828.
13243
13244 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13245
13246         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13247         functionality: I needed to convert the data after I had performed
13248         the add/sub operation into the operands type size.
13249
13250         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13251         pass the type for the box operation, otherwise the resulting
13252         object would have been of type object.
13253
13254         (BoxedCast): Add constructor to specify the type to box as.
13255
13256 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13257
13258         * iterators.cs: I was reusing the `count' variable inadvertently,
13259         take steps to not allow this to happen.
13260
13261 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13262
13263         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13264         by creating an array at the point where the params starts and
13265         putting all those arguments there, then adjusting the size of the
13266         array.
13267
13268 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13269
13270         * expression.cs (New.AddressOf): Implement interface
13271         IMemoryLocation.  This is used when the `new' operator is used in
13272         the context of an invocation to a method on a value type.
13273
13274         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13275         example. 
13276
13277         * namespace.cs: Also check the using aliases here.
13278
13279         * driver.cs: Move the test for using validity after the types have
13280         been entered, so we do a single pass that also includes the using
13281         aliases. 
13282
13283         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13284         in the regular case.   CreateSiblingForFinally is doing extra
13285         error checking.
13286
13287         * attribute.cs (GetAttributeArgumentExpression): Store the result
13288         on an out value, and use the return value to indicate failure
13289         instead of using null (which is a valid return for Constant.GetValue).
13290
13291         * statement.cs: Perform the analysis flow for the increment
13292         portion after the statement, because this will be the real flow of
13293         execution.  Fixes #42385
13294
13295         * codegen.cs (EmitContext.EmitArgument,
13296         EmitContext.EmitStoreArgument): New helper functions when the
13297         RemapToProxy flag is set.
13298
13299         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13300         function.
13301
13302         Add support for remapping parameters. 
13303
13304         * iterators.cs: Propagate parameter values;  Store parameter
13305         values in the proxy classes.
13306
13307 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13308
13309         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13310         need a proxy reference;  I do not know what I was thinking
13311
13312         * cs-parser.jay (constructor_initializer): catch another error,
13313         and display nice message.
13314
13315         (field_declaration): catch void field declaration
13316         to flag a better error. 
13317
13318         * class.cs (MemberBase.CheckBase): Report an error instead of a
13319         warning if a new protected member is declared in a struct. 
13320         (Field.Define): catch the error of readonly/volatile.
13321
13322         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13323
13324         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13325         volatile variable is taken
13326
13327 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13328
13329         * statement.cs (Fixed.Resolve): Report an error if we are not in
13330         an unsafe context.
13331
13332 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13333
13334         * typemanager.cs: reuse the code that handles type clashes for
13335         delegates and enumerations.
13336
13337         * class.cs (Report28): Always report.
13338
13339         * expression.cs (EncodeAsAttribute): Allow nulls here.
13340
13341 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13342
13343         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13344         the functionality for testing whether an expression is valid for
13345         an attribute here.  Also handle the case of arrays of elements
13346         being stored. 
13347
13348         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13349         encoding a linear array into an array of objects that are suitable
13350         to be passed to an CustomAttributeBuilder.
13351
13352         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13353
13354         * ecore.cs: (FieldExpr): Handle field remapping here.
13355
13356         * iteratators.cs: Pass the instance variable (if the method is an
13357         instance method) to the constructors, so we can access the field
13358         variables on the class.
13359
13360         TODO: Test this with structs.  I think the THIS variable on
13361         structs might have to be a pointer, and not a refenrece
13362
13363 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13364
13365         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13366         local variables to fields in a proxy class.
13367
13368         * iterators.cs (PopulateProxy): Rename our internal fields to
13369         <XXX>.  
13370         Create a <THIS> field if we are an instance method, so we can
13371         reference our parent container variables.
13372         (MapVariable): Called back from the EmitContext code to enter a
13373         new variable to field mapping into the proxy class (we just create
13374         a FieldBuilder).
13375
13376         * expression.cs
13377         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13378         for using the remapped locals to fields.
13379
13380         I placed the code here, because that gives the same semantics to
13381         local variables, and only changes the Emit code.
13382
13383         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13384         statements inside iterators.
13385         (VariableInfo): Add a FieldBuilder for the cases when we are
13386         remapping local variables to fields in a proxy class
13387
13388         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13389         current_block != null.
13390
13391         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13392         not cope with strings, as it has been moved to the
13393         TableSwitchEmit.  Fixed bug in switch generation.
13394
13395         * expression.cs (New.DoResolve): Provide more context for the user
13396         when reporting an error.
13397
13398         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13399         pointers. 
13400
13401         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13402         check the permissions for it.  Note than in a type-resolution
13403         context the check was already present in DeclSpace.ResolveType,
13404         but was missing from the MemberAccess.
13405
13406         (ArrayCreation.CheckIndices): warn if the user has
13407         more nested levels of expressions, but there are no more
13408         dimensions specified.  Avoids crash on bug 41906.
13409
13410 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13411
13412         * statement.cs (Block): replace Implicit bool, for a generic
13413         flags.   
13414         New flag: `Unchecked'.  This is used during the EmitMeta phase
13415         (which is out-of-line with the regular Resolve/Emit process for a
13416         statement, as this is done ahead of time, but still gets a chance
13417         to call constant resolve).
13418
13419         (Block.Flags): new enum for adding a new flag.
13420
13421         (Block.EmitMeta): track the state of unchecked.
13422
13423         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13424         to enable constant resolution to work there as well.
13425
13426 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13427
13428         * typemanager.cs (ienumerable_type): Also look up
13429         System.Collections.IEnumerable. 
13430
13431 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13432
13433         TODO: Test more than one conditional per method.
13434
13435         * class.cs (Indexer.Define): Report the location where the user is
13436         referencing the unsupported feature.
13437
13438         (MethodData): Overload the use of `conditionals' to
13439         minimize the creation of needless ArrayLists.   This saves roughly
13440         212kb on my machine.
13441
13442         (Method): Implement the new IIteratorContainer interface.
13443         (Method.SetYields): Implement the method by setting the ModFlags
13444         to contain METHOD_YIELDS.
13445
13446         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13447         which just got set to null.
13448
13449         * iterators.cs: New file.
13450
13451         (Yield, YieldBreak): New statements.
13452
13453         * statement.cs (Return.Resolve): Flag an error if we are used in
13454         an iterator method.
13455
13456         * codegen.cs (InIterator): New flag set if the code is being
13457         compiled in an iterator method.
13458
13459         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13460         internal modifier, and we just use it to avoid adding extra
13461         fields, as this is seldom used.  
13462
13463         * cs-parser.jay: Add yield_statement (yield and yield break).
13464
13465         * driver.cs: New flag -v2 to turn on version 2 features. 
13466
13467         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13468         hashtable when v2 is enabled.
13469
13470 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13471
13472         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13473         there is already a namespace defined with this name.
13474
13475         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13476         people upgraded their corlibs.
13477
13478         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13479         always use fully qualified types, no need to use the compiler
13480         front end.
13481
13482         (TypeManager.IsNamespace): Use binarysearch.
13483
13484         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13485         AddDelegate): I did not quite use the new IsValid API properly: I
13486         have to pass the short-name and the fullname.  I was passing only
13487         the basename instead of the fullname sometimes. 
13488
13489         (TypeContainer.DefineType): call NamespaceClash.
13490
13491         * interface.cs (Interface.DefineType): use NamespaceClash before
13492         defining the type.
13493
13494         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13495         defining the type.
13496
13497         * enum.cs: (Enum.DefineType): use NamespaceClash before
13498         defining the type.
13499
13500         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13501         speed increase.  First, use the negative_hits cache when we get a
13502         negative.  Second, add the type with its full original name
13503         instead of the new . and + encoded name (reflection uses + to
13504         separate type from a nested type).  Use LookupTypeReflection
13505         directly which bypasses the type->name hashtable (that we already
13506         know does not contain the type.
13507
13508         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13509         location/container type. 
13510
13511         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13512
13513 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13514
13515         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13516
13517         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13518         method is being referenced in the method group from a static
13519         context, and report error 120 if so.
13520
13521         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13522         Error118. 
13523
13524         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13525         is created, we create the A namespace).
13526
13527         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13528         Fixes #41591
13529
13530 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13531
13532         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13533         invocation to ModuleBuilder.GetType with the same values will
13534         return a new type instance, so we need to cache its return
13535         values. 
13536
13537         * expression.cs (Binary.ResolveOperator): Only allow the compare
13538         operators on enums if they are of the same type.
13539
13540         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13541         types of ValueType on their own case.  Before we were giving them
13542         the same treatment as objects.
13543
13544         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13545         fullname.  Short name is used to compare against container name.
13546         Fullname is used to check against defined namespace names.
13547
13548         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13549         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13550
13551         (Method.CheckBase): Call parent.
13552         (MemberBase.CheckBase): Check for protected members on sealed
13553         classes.
13554         (PropertyBase.CheckBase): Call parent.
13555         (Field.Define): Call parent.
13556
13557         * report.cs: Negative error codes are now mapped to 8000 - code,
13558         so that the display is render more nicely.
13559
13560         * typemanager.cs: Do not use try/catch, instead report a regular
13561         error. 
13562
13563         (GetPointerType, GetReferenceType): These methods provide
13564         mechanisms to obtain the T* and T& from a T.  We had the code
13565         previously scattered around the code base, and it also used
13566         TypeManager.LookupType that would go through plenty of caches.
13567         This one goes directly to the type source.
13568
13569         In some places we did the Type.GetType followed by
13570         ModuleBuilder.GetType, but not in others, so this unifies the
13571         processing as well.
13572
13573         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13574         statements now that we have namespace information.
13575
13576         * typemanager.cs (IsNamespace): New method, returns whether the
13577         string presented is a namespace or not.
13578
13579         (ComputeNamespaces): New public entry point, computes the list of
13580         available namespaces, using the GetNamespaces API call in Mono, or
13581         the slower version in MS.NET.   
13582
13583         Now before we start the semantic analysis phase, we have a
13584         complete list of namespaces including everything that the user has
13585         provided.
13586
13587         Deleted old code to cache namespaces in .nsc files.
13588
13589 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13590
13591         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13592         class/struct location definition Location for the implicit
13593         constructor location.
13594
13595         (Operator.Define): Use the location of the operator for the
13596         implicit Method definition.
13597
13598         (Constructor.Emit): use the constructor location for the implicit
13599         base initializer constructor.
13600
13601         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13602         and the Expression class now contains two new methods:
13603
13604         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13605         isolate type lookup from the rest of the resolution process.
13606
13607         Since we use Expressions to hold type definitions due to the way
13608         we parse the input we have historically overloaded Resolve to
13609         perform the Type lookups if a special flag is passed.  Now this is
13610         eliminated and two methods take their place. 
13611
13612         The differences in the two methods between xStep and xTerminal is
13613         that xStep is involved in our current lookup system that uses
13614         SimpleNames to compose a name, while xTerminal is used just to
13615         catch the case where the simplename lookup failed.
13616
13617 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13618
13619         * expression.cs (ResolveMemberAccess): Remove redundant code.
13620         TypeExpr expressions are always born fully resolved.
13621
13622         * interface.cs (PopulateMethod): Do not lookup the types twice.
13623         We were doing it once during SemanticAnalysis and once during
13624         PopulateMethod.
13625
13626         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13627         in local variable type definitions, were being returned as a
13628         SimpleName (we decomposed everything into a string), that is
13629         because primary_expression was being used instead of a type in the
13630         grammar (reduce/reduce conflicts).
13631
13632         The part that was wrong is that we converted the expression into a
13633         string (an oversimplification in one hand, compounded with primary
13634         expressions doing string concatenation).
13635
13636         So things like:
13637
13638         A.B.C [] x;
13639
13640         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13641         using clauses from working on this particular context.  And a type
13642         was being matched directly against "A.B.C[]".
13643
13644         We now use the correct approach, and allow for ComposedCast to be
13645         part of the unary expression.  So the "A.B.C []" become a composed
13646         cast of "A.B.C" (as a nested group of MemberAccess with a
13647         SimpleName at the end) plus the rank composition "[]". 
13648
13649         Also fixes 35567
13650
13651 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13652
13653         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13654         for the access level checking.
13655
13656         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13657         `TypeContainer container', because I kept getting confused when I
13658         was debugging this code.
13659
13660         * expression.cs (Indexers): Instead of tracking getters/setters,
13661         we now track them in parallel.  We create one arraylist less, but
13662         most importantly it is possible now for the LValue code to find a
13663         matching get for a set.
13664
13665         (IndexerAccess.DoResolveLValue): Update the code.
13666         GetIndexersForType has been modified already to extract all the
13667         indexers from a type.  The code assumed it did not.
13668
13669         Also make the code set the correct return type for the indexer.
13670         This was fixed a long time ago for properties, but was missing for
13671         indexers.  It used to be void_type.
13672
13673         (Binary.Emit): Test first for doubles instead of
13674         floats, as they are more common.
13675
13676         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13677         when dealing with floats and the <=, >= operators.  This fixes bug
13678         #39314 
13679
13680         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13681         to load the array value by emitting a load on the foreach variable
13682         type.  This was incorrect.  
13683
13684         We now emit the code to load an element using the the array
13685         variable type, and then we emit the conversion operator.
13686
13687         Fixed #40176
13688
13689 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13690
13691         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13692
13693 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13694
13695         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13696         test for protection before we test for signatures. 
13697
13698         (MethodSignature.ToString): implement.
13699
13700         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13701         to the case where we reduced into a LongConstant.
13702
13703         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13704         depend on whether the information is acurrate, because the
13705         Microsoft runtime will always claim that the array type is public,
13706         regardless of the real state.
13707
13708         If the type is a pointer, another problem happens: the type is
13709         reported as non-public in Microsoft.  
13710
13711         In both cases we have to call CheckAccessLevel recursively with
13712         the underlying type as the argument to be tested.
13713
13714 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13715
13716         * assign.cs (Assign.Emit): If we are dealing with a compound
13717         assignment expression, we should use the code path that stores the
13718         intermediate result in a temporary value.  This fixes #40903.
13719
13720         *expression.cs (Indirection.ToString): Provide ToString method for
13721         debugging. 
13722
13723 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13724
13725         * class.cs: Null out fields holding references to Block objects so
13726         they can be garbage collected.
13727
13728         * expression.cs (OverloadResolve): Remove unused local.
13729
13730 2003-04-07  Martin Baulig  <martin@ximian.com>
13731
13732         * codegen.cs (EmitContext.CurrentFile): New public field.
13733         (EmitContext.Mark): Use the CurrentFile to check whether the
13734         location is in the correct file.
13735         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13736
13737 2003-04-07  Martin Baulig  <martin@ximian.com>
13738
13739         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13740
13741         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13742         location.  [FIXME: The location argument which gets passed to this
13743         method is sometimes wrong!]
13744
13745 2003-04-07  Nick Drochak <ndrochak@gol.com>
13746
13747         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13748
13749 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13750
13751         * expression.cs (Indirection.EmitAssign): We were using the
13752         temporary, but returning immediately instead of continuing the
13753         EmitAssing flow.
13754
13755 2003-04-06  Martin Baulig  <martin@ximian.com>
13756
13757         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13758         if it's a nested child, but also deriving from the outer class.
13759         See test 190.cs.
13760
13761         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13762         nested child, but also deriving from the outer class.  See
13763         test-190.cs.
13764         (FilterWithClosure): We may access private members of the outer
13765         class if we're a nested child and deriving from the outer class.
13766         (RealMemberLookup): Only set `closure_private_ok' if the
13767         `original_bf' contained BindingFlags.NonPublic.
13768
13769 2003-04-05  Martin Baulig  <martin@ximian.com>
13770
13771         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13772
13773 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13774
13775         * class.cs (Event.Define): Do not allow abstract events to have
13776         initializers. 
13777
13778 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13779
13780         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13781         block in event declarations.
13782
13783         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13784         value type, get its address.
13785
13786         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13787         leaving a class on the stack instead of a boolean value (int
13788         0/1).  Change the code so we compare against null, and then the
13789         result against zero.
13790
13791         * class.cs (TypeContainer.GetClassBases): We were checking for the
13792         parent class being sealed too late.
13793
13794         * expression.cs (Binary.Emit): For <= and >= when dealing with
13795         floating point values, use cgt.un and clt.un instead of cgt and
13796         clt alone.
13797
13798 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13799
13800         * statement.cs: Apply the same optimization as MS: skip the 
13801         GetEnumerator returning an IEnumerator, and use the one returning a 
13802         CharEnumerator instead. This allows us to avoid the try-finally block 
13803         and the boxing.
13804
13805 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13806
13807         * cs-parser.jay: Attributes cannot be applied to
13808                          namespaces. Fixes #40473
13809
13810 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13811
13812         * class.cs:
13813         (Add*): check if the name is valid using the full name for constants,
13814         fields, properties and events.
13815
13816 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13817
13818         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13819         char constants to be part of the enumeration.
13820
13821         * expression.cs (Conditional.DoResolve): Add support for operator
13822         true. Implements the missing functionality from 14.12
13823
13824         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13825         operator true/false as required by the spec.
13826
13827         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13828         implicit conversion to boolean.
13829
13830         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13831         also one where the type implements `operator true'. 
13832
13833         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13834         get an expression that will invoke operator true based on an
13835         expression.  
13836
13837         (GetConversionOperators): Removed the hack that called op_True
13838         here.  
13839
13840         (Expression.ResolveBoolean): Move this from Statement.
13841
13842 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * ecore.cs (FieldExpr): do not allow initialization of initonly
13845         fields on derived classes
13846
13847 2003-03-13  Martin Baulig  <martin@ximian.com>
13848
13849         * statement.cs (Block.Emit): Call ig.BeginScope() and
13850         ig.EndScope() when compiling with debugging info; call
13851         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13852
13853 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13854
13855         * expression.cs (Indexers): Do not construct immediately, allow
13856         for new members to be appended as we go.  Fixes 38143
13857
13858 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13859
13860         * expression.cs: save/restore context when resolving an unchecked
13861         expression.
13862
13863 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13864
13865         * cfold.cs: Catch division by zero in modulus operator during
13866         constant folding.
13867
13868 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13869
13870         * interface.cs (Interface.DefineMembers): Avoid defining members
13871         twice. 
13872
13873 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * driver.cs: handle the +/- options for -noconfig
13876
13877         * statement.cs (Unckeched.Resolve): Also track the state of
13878         unchecked in the Resolve phase.
13879
13880 2003-02-27  Martin Baulig  <martin@ximian.com>
13881
13882         * ecore.cs (Expression.MemberLookup): Don't create a
13883         MethodGroupExpr for something which is not a method.  Fixes #38291.
13884
13885 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13886
13887         * class.cs (MemberBase.CheckParameters): Also check that the type
13888         is unmanaged if it is a pointer.
13889
13890         * expression.cs (SizeOf.Resolve): Add location information.
13891
13892         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13893         a managed type is declared.
13894
13895         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13896         parameter modifiers as well.  Fixes bug 38606
13897
13898         * class.cs: Very sad.  Am backing out the speed up changes
13899         introduced by the ArrayList -> Array in the TypeContainer, as they
13900         were not actually that much faster, and introduced a bug (no error
13901         reports on duplicated methods).
13902
13903         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13904         source first, this will guarantee that we have a valid expression
13905         before calling in lower levels functions that will require a
13906         resolved object.  Then use this original_source in the
13907         target.ResolveLValue instead of the original source that was
13908         passed to us.
13909
13910         Another change.  Use target.Resolve instead of LValueResolve.
13911         Although we are resolving for LValues, we will let the Assign code
13912         take care of that (it will be called again from Resolve).  This
13913         basically allows code like this:
13914
13915         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13916         class Y { void A (X x) { x [0] += o; }
13917
13918         The problem was that the indexer was trying to resolve for
13919         set_Item (idx, object o) and never finding one.  The real set_Item
13920         was set_Item (idx, X).  By delaying the process we get the right
13921         semantics. 
13922
13923         Fixes bug 36505
13924
13925 2003-02-23  Martin Baulig  <martin@ximian.com>
13926
13927         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13928         while calling DoEmit ().
13929
13930         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13931         source files; if you use the #line directive inside a method, the
13932         compiler stops emitting line numbers for the debugger until it
13933         reaches the end of the method or another #line directive which
13934         restores the original file.
13935
13936 2003-02-23  Martin Baulig  <martin@ximian.com>
13937
13938         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13939
13940 2003-02-23  Martin Baulig  <martin@ximian.com>
13941
13942         * statement.cs (Block.AddChildVariableNames): We need to call this
13943         recursively, not just for our immediate children.
13944
13945 2003-02-23  Martin Baulig  <martin@ximian.com>
13946
13947         * class.cs (Event.Define): Always make the field private, like csc does.
13948
13949         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13950         actually work, fixes bug #37521.
13951
13952 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13953
13954         * delegate.cs: When creating the various temporary "Parameters"
13955         classes, make sure that we call the ComputeAndDefineParameterTypes
13956         on those new parameters (just like we do with the formal ones), to
13957         allow them to be resolved in the context of the DeclSpace.
13958
13959         This fixes the bug that Dick observed in Bugzilla #38530.
13960
13961 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13962
13963         * expression.cs (ResolveMemberAccess): When resolving a constant,
13964         do not attempt to pull a constant if the value was not able to
13965         generate a valid constant.
13966
13967         * const.cs (LookupConstantValue): Do not report more errors than required.
13968
13969 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13970
13971         * expression.cs: fixes bug #38328.
13972
13973 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13974
13975         * class.cs: Changed all the various members that can be part of a
13976         class from being an ArrayList to be an Array of the right type.
13977         During the DefineType type_list, interface_list, delegate_list and
13978         enum_list are turned into types, interfaces, delegates and enums
13979         arrays.  
13980
13981         And during the member population, indexer_list, event_list,
13982         constant_list, field_list, instance_constructor_list, method_list,
13983         operator_list and property_list are turned into their real arrays.
13984
13985         Although we could probably perform this operation earlier, for
13986         good error reporting we need to keep the lists and remove the
13987         lists for longer than required.
13988
13989         This optimization was triggered by Paolo profiling the compiler
13990         speed on the output of `gen-sample-program.pl' perl script. 
13991
13992         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13993         not crash in methods like MemberLookupFailed that use this field.  
13994
13995         This problem arises when the compiler fails to resolve a type
13996         during interface type definition for example.
13997
13998 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13999
14000         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14001         inherit from System.Object, so we have to stop at null, not only
14002         when reaching System.Object.
14003
14004 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14005
14006         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14007         DeclaredOnly because the parent indexer might have had a different
14008         name, but did not loop until the top of the hierarchy was reached.
14009
14010         The problem this one fixes is 35492: when a class implemented an
14011         indexer from an interface, we were getting the interface method
14012         (which was abstract) and we were flagging an error (can not invoke
14013         abstract method).
14014
14015         This also keeps bug 33089 functioning, and test-148 functioning.
14016
14017         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14018         out if a method is special is to see if it is declared in a
14019         property or event, or whether it is one of the predefined operator
14020         names.   This should fix correctly #36804.
14021
14022 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14023
14024         The goal here is to remove the dependency on EmptyCast.Peel ().
14025         Killing it completely.
14026
14027         The problem is that currently in a number of places where
14028         constants are expected, we have to "probe" for an EmptyCast, and
14029         Peel, which is not the correct thing to do, as this will be
14030         repetitive and will likely lead to errors. 
14031
14032         The idea is to remove any EmptyCasts that are used in casts that
14033         can be reduced to constants, so we only have to cope with
14034         constants. 
14035
14036         This bug hunt was triggered by Bug 37363 and the desire to remove
14037         the duplicate pattern where we were "peeling" emptycasts to check
14038         whether they were constants.  Now constants will always be
14039         constants.
14040
14041         * ecore.cs: Use an enumconstant here instead of wrapping with
14042         EmptyCast.  
14043
14044         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14045         throwing me off.  By handling this we can get rid of a few hacks.
14046
14047         * statement.cs (Switch): Removed Peel() code.
14048
14049 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14050
14051         * class.cs: Location information for error 508
14052
14053         * expression.cs (New.DoResolve): Add a guard against double
14054         resolution of an expression.  
14055
14056         The New DoResolve might be called twice when initializing field
14057         expressions (see EmitFieldInitializers, the call to
14058         GetInitializerExpression will perform a resolve on the expression,
14059         and later the assign will trigger another resolution
14060
14061         This leads to bugs (#37014)
14062
14063         * delegate.cs: The signature for EndInvoke should contain any ref
14064         or out parameters as well.  We were not doing this in the past. 
14065
14066         * class.cs (Field.Define): Do not overwrite the type definition
14067         inside the `volatile' group.  Turns out that volatile enumerations
14068         were changing the type here to perform a validity test, which
14069         broke conversions. 
14070
14071 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14072
14073         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14074         and structs, we do not want to load the instance variable
14075
14076         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14077         enum_type has to be handled like an object reference (implicit
14078         conversions exists from this to object), but the regular IsClass
14079         and IsValueType tests will never return true for this one.
14080
14081         Also we use TypeManager.IsValueType instead of type.IsValueType,
14082         just for consistency with the rest of the code (this is only
14083         needed if we ever use the construct exposed by test-180.cs inside
14084         corlib, which we dont today).
14085
14086 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14087
14088         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14089         just InternalCall.
14090
14091 2003-02-09  Martin Baulig  <martin@ximian.com>
14092
14093         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14094         (Namespace.DefineNamespaces): New static public method; this is
14095         called when we're compiling with debugging to add all namespaces
14096         to the symbol file.
14097
14098         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14099         pass it to the Namespace's .ctor.
14100
14101         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14102         and MethodBase arguments; pass the namespace ID to the symwriter;
14103         pass the MethodBase instead of the token to the symwriter.
14104         (SymbolWriter.DefineNamespace): New method to add a namespace to
14105         the symbol file.
14106
14107 2003-02-09  Martin Baulig  <martin@ximian.com>
14108
14109         * symbolwriter.cs: New file.  This is a wrapper around
14110         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14111         methods here in near future.
14112
14113 2003-02-09  Martin Baulig  <martin@ximian.com>
14114
14115         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14116         ILGenerator.MarkSequencePoint() which are actually used by the
14117         symbol writer.
14118
14119 2003-02-09  Martin Baulig  <martin@ximian.com>
14120
14121         * location.cs (SourceFile): New public sealed class.  This
14122         contains the name and an index which is used in the location's token.
14123         (Location): Reserve an appropriate number of bits in the token for
14124         the source file instead of walking over that list, this gives us a
14125         really huge performance improvement when compiling with debugging.
14126
14127         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14128         `SourceFile' argument instead of a string.
14129         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14130         but don't parse/tokenize here, we need to generate the list of all
14131         source files before we do that.
14132         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14133         the files.
14134
14135         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14136         instead of a string.
14137
14138         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14139         of a string.
14140
14141 2003-02-09  Martin Baulig  <martin@ximian.com>
14142
14143         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14144         filename on `#line default'.
14145
14146 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14147
14148         * statement.cs: don't clear the pinned var when the fixed statement
14149         returns from the method (fixes bug#37752).
14150
14151 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14152
14153         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14154         to IsValueType.
14155
14156 2003-02-07  Martin Baulig  <martin@ximian.com>
14157
14158         * driver.cs: Removed the `--debug-args' command line argument.
14159
14160         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14161         automatically by the AsssemblyBuilder.
14162         (CodeGen.InitializeSymbolWriter): We don't need to call any
14163         initialization function on the symbol writer anymore.  This method
14164         doesn't take any arguments.
14165
14166 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14167
14168         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14169         from referenced assemblies as well.
14170
14171 2003-02-02  Martin Baulig  <martin@ximian.com>
14172
14173         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14174
14175 2003-02-02  Martin Baulig  <martin@ximian.com>
14176
14177         * class.cs (Constructor.Emit): Open the symbol writer before
14178         emitting the constructor initializer.
14179         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14180         single-stepping through constructor initializers.
14181
14182 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14183
14184         * class.cs: Handle error 549: do not allow virtual methods in
14185         sealed classes. 
14186
14187 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14188
14189         * decl.cs: Check access levels when resolving types
14190
14191 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14192
14193         * statement.cs: Add parameters and locals set in catch blocks that might 
14194         return to set vector
14195
14196 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14197
14198         * class.cs (Operator): Set the SpecialName flags for operators.
14199
14200         * expression.cs (Invocation.DoResolve): Only block calls to
14201         accessors and operators on SpecialName methods.
14202
14203         (Cast.TryReduce): Handle conversions from char constants.
14204
14205
14206 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14207
14208         * statement.cs: small memory and time optimization in FlowBranching.
14209
14210 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14211
14212         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14213         problem that the last fix but in the other sid (Set).
14214
14215         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14216         access when there is no indexer in the hierarchy.
14217
14218 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14219
14220         * class.cs: Combine some if statements.
14221
14222 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14223
14224         * driver.cs: fixed bug #37187.
14225
14226 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14227
14228         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14229         any indexer, it's needed to build a list with all the indexers in the
14230         hierarchy (AllGetters), else we have problems. Fixes #35653.
14231
14232 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14233
14234         * class.cs (MethodData.Define): It is wrong for an interface
14235         implementation to be static in both cases: explicit and implicit.
14236         We were only handling this in one case.
14237
14238         Improve the if situation there to not have negations.
14239
14240         * class.cs (Field.Define): Turns out that we do not need to check
14241         the unsafe bit on field definition, only on usage.  Remove the test.
14242
14243 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14244
14245         * driver.cs: use assembly.Location instead of Codebase (the latest
14246         patch made mcs fail when using MS assemblies).
14247
14248 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14249
14250         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14251         get the path to *corlib.dll.
14252
14253 2003-01-21  Nick Drochak <ndrochak@gol.com>
14254
14255         * cs-tokenizer.cs:
14256         * pending.cs:
14257         * typemanager.cs: Remove compiler warnings
14258
14259 2003-01-20  Duncan Mak  <duncan@ximian.com>
14260
14261         * AssemblyInfo.cs: Bump the version number to 0.19.
14262
14263 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14264
14265         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14266
14267 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14268
14269         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14270
14271 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14272
14273         * cs-parser.jay: Small fix: we were not comparing the constructor
14274         name correctly.   Thanks to Zoltan for the initial pointer.
14275
14276 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14277
14278         * cs-tokenizer.cs: Set file name when specified with #line
14279
14280 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14281
14282         * cs-parser.jay: Only perform the constructor checks here if we
14283         are named like the class;  This will help provider a better
14284         error.  The constructor path is taken when a type definition is
14285         not found, but most likely the user forgot to add the type, so
14286         report that rather than the constructor error.
14287
14288 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14289
14290         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14291         allocations.
14292
14293 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14294
14295         * cs-parser.jay: Add cleanup call.
14296
14297 2003-01-13  Duncan Mak  <duncan@ximian.com>
14298
14299         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14300         consistent with other methods.
14301
14302 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14303
14304         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14305
14306 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14307
14308         * attribute.cs: only set GuidAttr to true when we have a
14309         GuidAttribute.
14310
14311 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14312
14313         * ecore.cs:
14314         * expression.cs:
14315         * typemanager.cs: fixes to allow mcs compile corlib with the new
14316         Type.IsSubclassOf fix.
14317
14318 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * expression.cs (LocalVariableReference.DoResolve): Classify a
14321         constant as a value, not as a variable.   Also, set the type for
14322         the variable.
14323
14324         * cs-parser.jay (fixed_statement): take a type instead of a
14325         pointer_type, so we can produce a better error message later.
14326
14327         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14328         as an error.  
14329
14330         (For.DoEmit): Make inifinite loops have a
14331         non-conditional branch back.
14332
14333         (Fixed.DoEmit): First populate the pinned variables, then emit the
14334         statement, then clear the variables.  Before I was emitting the
14335         code once for each fixed piece.
14336
14337
14338 2003-01-08  Martin Baulig  <martin@ximian.com>
14339
14340         * statement.cs (FlowBranching.MergeChild): A break in a
14341         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14342
14343 2003-01-08  Martin Baulig  <martin@ximian.com>
14344
14345         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14346         lives in the same number space than `param_map'.  Fixes #36154.
14347
14348 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14349
14350         * cs-parser.jay (constructor_declaration): Set the
14351         Constructor.ModFlags before probing for it.  This makes the
14352         compiler report 514, 515 and 132 (the code was there, but got
14353         broken). 
14354
14355         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14356         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14357         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14358
14359 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14360
14361         * enum.cs: create the enum static fields using the enum type.
14362
14363 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14364
14365         * class.cs: don't try to create the ParamBuilder for the return
14366         type if it's not needed (and handle it breaking for the ms runtime
14367         anyway).
14368
14369 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14370
14371         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14372
14373 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14374
14375         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14376         the command.   This showed up while compiling the JANET source
14377         code, which used \r as its only newline separator.
14378
14379 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14380
14381         * class.cs (Method.Define): If we are an operator (because it
14382         reuses our code), then set the SpecialName and HideBySig.  #36128
14383
14384 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14385
14386         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14387         exception, report error 120 `object reference required'.
14388
14389         * driver.cs: Add --pause option, used during to measure the size
14390         of the process as it goes with --timestamp.
14391
14392         * expression.cs (Invocation.DoResolve): Do not allow methods with
14393         SpecialName to be invoked.
14394
14395 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14396
14397         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14398         number before adding it.
14399
14400 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14401
14402         * ecore.cs (StandardImplicitConversion): When in an unsafe
14403         context, we allow conversion between void * to any other pointer
14404         type. This fixes bug #35973.
14405
14406 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14407
14408         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14409         is not thrown when extensionless outputs are used 
14410
14411 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14412
14413         * rootcontext.cs: fixed compilation of corlib.
14414
14415 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14416
14417         * attribute.cs (Attributes.Contains): Add new method.
14418
14419         * class.cs (MethodCore.LabelParameters): if the parameter is an
14420         `out' parameter, check that no attribute `[In]' has been passed.
14421
14422         * enum.cs: Handle the `value__' name in an enumeration.
14423
14424 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14425
14426         * decl.cs: Added special case to allow overrides on "protected
14427         internal" methods
14428
14429 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14430
14431         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14432         since it makes much more sense.
14433
14434         (Attributes.ctor): Don't require a Location parameter.
14435
14436         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14437
14438         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14439         since we already have that information per attribute.
14440
14441         * everywhere : make appropriate changes.
14442
14443         * class.cs (LabelParameters): Write the code which actually
14444         applies attributes to the return type. We can't do this on the MS
14445         .NET runtime so we flag a warning in the case an exception is
14446         thrown.
14447
14448 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14449
14450         * const.cs: Handle implicit null conversions here too.
14451
14452 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14453
14454         * class.cs (MethodCore.LabelParameters): Remove the extra
14455         Type [] parameter since it is completely unnecessary. Instead
14456         pass in the method's attributes so that we can extract
14457         the "return" attribute.
14458
14459 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14460
14461         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14462         of ignoring it and letting the compile continue.
14463
14464         * typemanager.cs (ChangeType): use an extra argument to return an
14465         error condition instead of throwing an exception.
14466
14467 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14468
14469         * expression.cs (Unary.TryReduce): mimic the code for the regular
14470         code path.  Perform an implicit cast in the cases where we can
14471         implicitly convert to one of the integral types, and then reduce
14472         based on that constant.   This fixes bug #35483.
14473
14474 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14475
14476         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14477
14478 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14479
14480         * namespace.cs: fixed bug #35489.
14481
14482 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14483
14484         * class.cs: Remove some dead code.
14485
14486         * cs-parser.jay: Estimate the number of methods needed
14487         (RootContext.MethodCount);
14488
14489         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14490         numbers instead of StringBuilders.
14491
14492         * support.cs (PtrHashtable): Add constructor with initial size;
14493         We can now reduce reallocations of the method table.
14494
14495 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14496
14497         * attribute.cs (ApplyAttributes): Keep track of the emitted
14498         attributes on a per-target basis. This fixes bug #35413.
14499
14500 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14501
14502         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14503         default to the Windows 1252 encoding.
14504
14505         (UnixParseOption): Support version, thanks to Alp for the missing
14506         pointer. 
14507
14508         * AssemblyInfo.cs: Add nice assembly information.
14509
14510         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14511         (bug 35169).
14512
14513         * cs-parser.jay: Allow a trailing comma before the close bracked
14514         in the attribute_section production.
14515
14516         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14517         address of the instance was being taken, I will take this out,
14518         because we take the address of the object immediately here.
14519
14520 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14521
14522         * typemanager.cs (AreMultipleAllowed): Take care of the most
14523         obvious case where attribute type is not in the current assembly -
14524         stupid me ;-)
14525
14526 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14527
14528         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14529         definitions, instead of doing that afterwards.  
14530
14531         Also we use a nice little hack, depending on the constructor, we
14532         know if we are a "composed" name or a simple name.  Hence, we
14533         avoid the IndexOf test, and we avoid 
14534
14535         * codegen.cs: Add code to assist in a bug reporter to track down
14536         the source of a compiler crash. 
14537
14538 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14539
14540         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14541         types have been emitted for a given element and flag an error
14542         if something which does not have AllowMultiple set is used more
14543         than once.
14544
14545         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14546         attribute types and their corresponding AllowMultiple properties
14547
14548         (AreMultipleAllowed): Check the property for a given type.
14549
14550         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14551         property in the case we have a TypeContainer.
14552
14553         (Attributes.AddAttribute): Detect duplicates and just skip on
14554         adding them. This trivial fix catches a pretty gross error in our
14555         attribute emission - global attributes were being emitted twice!
14556
14557         Bugzilla bug #33187 is now fixed.
14558
14559 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14560
14561         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14562         instead of pp_and).
14563
14564         * expression.cs (Binary.ResolveOperator): I can only use the
14565         Concat (string, string, string) and Concat (string, string,
14566         string, string) if the child is actually a concatenation of
14567         strings. 
14568
14569 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14570
14571         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14572         context where we need a 2-character lookahead.
14573
14574         * pending.cs (PendingImplementation): Rework so we can keep track
14575         of interface types all the time, and flag those which were
14576         implemented by parents as optional.
14577
14578 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14579
14580         * expression.cs (Binary.ResolveOperator): Use
14581         String.Concat(string,string,string) or
14582         String.Concat(string,string,string,string) when possible. 
14583
14584         * typemanager: More helper methods.
14585
14586
14587 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14588
14589         * pending.cs: remove the bogus return from GetMissingInterfaces()
14590         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14591
14592 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14593
14594         * namespace.cs: avoid duplicated 'using xxx' being added to
14595         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14596         when we get more than one 'using' statement for the same namespace.
14597         Report a CS0105 warning for it.
14598
14599 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14600
14601         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14602         of calling getChar/putback, uses internal knowledge of it.    
14603
14604         (xtoken): Reorder tokenizer so most common patterns are checked
14605         first.  This reduces the compilation time in another 5% (from 8.11s
14606         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14607
14608         The parsing time is 22% of the compilation in mcs, and from that
14609         64% is spent on the tokenization process.  
14610
14611         I tried using a binary search for keywords, but this is slower
14612         than the hashtable.  Another option would be to do a couple of
14613         things:
14614
14615                 * Not use a StringBuilder, instead use an array of chars,
14616                   with a set value.  Notice that this way we could catch
14617                   the 645 error without having to do it *afterwards*.
14618
14619                 * We could write a hand-parser to avoid the hashtable
14620                   compares altogether.
14621
14622         The identifier consumption process takes 37% of the tokenization
14623         time.  Another 15% is spent on is_number.  56% of the time spent
14624         on is_number is spent on Int64.Parse:
14625
14626                 * We could probably choose based on the string length to
14627                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14628                   computations. 
14629
14630         Another 3% is spend on wrapping `xtoken' in the `token' function.
14631
14632         Handle 0xa0 as whitespace (#34752)
14633
14634 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14635
14636         * typemanager.cs (IsCLRType): New routine to tell whether a type
14637         is one of the builtin types.  
14638
14639         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14640         typecode in more places instead of doing pointer comparissions.
14641         We could leverage some knowledge about the way the typecodes are
14642         laid out.
14643
14644         New code to cache namespaces in assemblies, it is currently not
14645         invoked, to be used soon.
14646
14647         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14648
14649         * expression.cs (Binary.ResolveOperator): specially handle
14650         strings, and do not perform user-defined operator overloading for
14651         built-in types.
14652
14653 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14654
14655         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14656         internalcall as it is a pretty simple operation;  Avoid whenever
14657         possible to call Char.IsLetter.
14658
14659         (consume_identifier): Cut by half the number of
14660         hashtable calls by merging the is_keyword and GetKeyword behavior.
14661
14662         Do not short-circuit, because if we do, we
14663         report errors (ie, #if false && true would produce an invalid
14664         directive error);
14665
14666
14667 2002-11-24  Martin Baulig  <martin@ximian.com>
14668
14669         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14670         check constant ranges and report a CS0221.  Fixes #33186.
14671
14672 2002-11-24  Martin Baulig  <martin@ximian.com>
14673
14674         * cs-parser.jay: Make this work for uninitialized variable
14675         declarations in the `for' initializer.  Fixes #32416.
14676
14677 2002-11-24  Martin Baulig  <martin@ximian.com>
14678
14679         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14680         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14681
14682 2002-11-24  Martin Baulig  <martin@ximian.com>
14683
14684         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14685         argument; if true, we also check for user-defined conversions.
14686         This is only needed if both arguments are of a user-defined type.
14687         Fixes #30443, added test-175.cs.
14688         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14689
14690         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14691
14692 2002-11-24  Martin Baulig  <martin@ximian.com>
14693
14694         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14695         function to get the store opcode.
14696         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14697         only emit the Ldelema if the store opcode is Stobj.  You must run
14698         both test-34 and test-167 to test this.  Fixes #34529.
14699
14700 2002-11-23  Martin Baulig  <martin@ximian.com>
14701
14702         * ecore.cs (Expression.MemberLookup): Added additional
14703         `qualifier_type' argument which is used when we're being called
14704         from MemberAccess.DoResolve() and null if we're called from a
14705         SimpleName lookup.
14706         (Expression.MemberLookupFailed): New method to report errors; this
14707         does the CS1540 check and reports the correct error message.
14708
14709         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14710         argument for the CS1540 check and redone the way how we're dealing
14711         with private members.  See the comment in the source code for details.
14712         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14713         `closure_start_type' to `closure_qualifier_type' and check whether
14714         it's not null.  It was not this filter being broken, it was just
14715         being called with the wrong arguments.
14716
14717         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14718         and pass it the correct `qualifier_type'; this also does the error
14719         handling for us.
14720
14721 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * expression.cs (Invocation.EmitParams): If the we are dealing
14724         with a non-built-in value type, load its address as well.
14725
14726         (ArrayCreation): Use a a pretty constant instead
14727         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14728         static initializers.  
14729
14730         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14731         because they are not really value types, just glorified integers. 
14732
14733         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14734
14735         * ecore.cs: Remove redundant code for enumerations, make them use
14736         the same code path as everything else, fixes the casting issue
14737         with enumerations in Windows.Forms.
14738
14739         * attribute.cs: Do only cast to string if it is a string, the
14740         validation happens later.
14741
14742         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14743         people upgrade their corlibs.
14744
14745         * ecore.cs: Oops, enumerations were not following the entire code path
14746
14747 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14748
14749         * typemanager.cs (FilterWithClosure): Commented out the test for
14750         1540 in typemanager.cs, as it has problems when accessing
14751         protected methods from a parent class (see test-174.cs). 
14752
14753         * attribute.cs (Attribute.ValidateGuid): new method.
14754         (Attribute.Resolve): Use above.
14755
14756 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14757
14758         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14759
14760         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14761         handling for enumerations, as we only needed the TypeContainer
14762         functionality to begin with (this is required for the fix below to
14763         work for enums that reference constants in a container class for
14764         example). 
14765
14766         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14767
14768         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14769         a valid TypeBuilder to perform lookups on.o
14770
14771         * class.cs (InheritableMemberSignatureCompare): Use true in the
14772         call to GetGetMethod and GetSetMethod, because we are comparing
14773         the signature, and we need to get the methods *even* if they are
14774         private. 
14775
14776         (PropertyBase.CheckBase): ditto.
14777
14778         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14779         GotoCase.Resolve): Use Peel on EmpytCasts.
14780
14781         * ecore.cs (EmptyCast): drop child, add Peel method.
14782
14783 2002-11-17  Martin Baulig  <martin@ximian.com>
14784
14785         * ecore.cs (EmptyCast.Child): New public property.
14786
14787         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14788         label resolved to an EmptyCast.  Fixes #34162.
14789         (GotoCase.Resolve): Likewise.
14790         (Block.EmitMeta): Likewise.
14791
14792 2002-11-17  Martin Baulig  <martin@ximian.com>
14793
14794         * expression.cs (Invocation.BetterConversion): Prefer int over
14795         uint; short over ushort; long over ulong for integer literals.
14796         Use ImplicitConversionExists instead of StandardConversionExists
14797         since we also need to check for user-defined implicit conversions.
14798         Fixes #34165.  Added test-173.cs.
14799
14800 2002-11-16  Martin Baulig  <martin@ximian.com>
14801
14802         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14803         with the `true' and `false' literals.  Fixes #33151.
14804
14805 2002-11-16  Martin Baulig  <martin@ximian.com>
14806
14807         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14808         October 22nd; don't do the cs1540 check for static members.
14809
14810         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14811         now using our own filter here and doing the cs1540 check again.
14812
14813 2002-11-16  Martin Baulig  <martin@ximian.com>
14814
14815         * support.cs (InternalParameters): Don't crash if we don't have
14816         any fixed parameters.  Fixes #33532.
14817
14818 2002-11-16  Martin Baulig  <martin@ximian.com>
14819
14820         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14821         when looking up static methods to make this work on Windows.
14822         Fixes #33773.
14823
14824 2002-11-16  Martin Baulig  <martin@ximian.com>
14825
14826         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14827         a setter rather than using PropertyInfo.CanWrite.
14828
14829 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14830
14831         * class.cs: Allow acces to block member by subclasses. Fixes build
14832         breaker.
14833
14834 2002-11-14  Martin Baulig  <martin@ximian.com>
14835
14836         * class.cs (Constructor.Emit): Added the extern/block check.
14837         Fixes bug #33678.
14838
14839 2002-11-14  Martin Baulig  <martin@ximian.com>
14840
14841         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14842         iteration while looking for indexers, this is needed because the
14843         indexer may have a different name in our base classes.  Fixed the
14844         error reporting (no indexers at all, not get accessor, no
14845         overloaded match).  Fixes bug #33089.
14846         (IndexerAccess.DoResolveLValue): Likewise.
14847
14848 2002-11-14  Martin Baulig  <martin@ximian.com>
14849
14850         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14851         indexers.  Fixes the first part of bug #33089.
14852         (MethodSignature.InheritableMemberSignatureCompare): Added support
14853         for properties.
14854
14855 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14856
14857         * attribute.cs (Attribute.Resolve): Catch the
14858         NullReferenceException and report it since it isn't supposed to
14859         happen. 
14860
14861 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14864         LogicalOr and LogicalAnd that can benefit from recursively
14865         handling EmitBranchable.  The code now should be nice for Paolo.
14866
14867 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14868
14869         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14870         the Type lookups, as we perform quite a number of lookups on
14871         non-Types.  This can be removed once we can deterministically tell
14872         whether we have a type or a namespace in advance.
14873
14874         But this might require special hacks from our corlib.
14875
14876         * TODO: updated.
14877
14878         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14879         and double which avoids a conversion from an integer to a double.
14880
14881         * expression.cs: tiny optimization, avoid calling IsConstant,
14882         because it effectively performs the lookup twice.
14883
14884 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14885
14886         But a bogus return here to keep the semantics of the old code
14887         until the Mono runtime is fixed.
14888
14889         * pending.cs (GetMissingInterfaces): New method used to remove all
14890         the interfaces that are already implemented by our parent
14891         classes from the list of pending methods. 
14892
14893         * interface.cs: Add checks for calls after ResolveTypeExpr.
14894
14895 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14896
14897         * class.cs (Class.Emit): Report warning 67: event not used if the
14898         warning level is beyond 3.
14899
14900         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14901         being a NullLiteral.
14902
14903         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14904         specifiers. 
14905
14906         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14907         path that might fail if a type can not be resolved.
14908
14909         * expression.cs (Binary.Emit): Emit unsigned versions of the
14910         operators. 
14911
14912         * driver.cs: use error 5.
14913
14914 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14915
14916         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14917
14918 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14919
14920         * cs-parser.jay (switch_section): A beautiful patch from Martin
14921         Baulig that fixed 33094.
14922
14923 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14924
14925         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14926         Check whether the base is abstract and report an error if so.
14927
14928         * expression.cs (IndexerAccess.DoResolveLValue,
14929         IndexerAccess.DoResolve): ditto. 
14930
14931         (Invocation.DoResolve): ditto.
14932
14933         (Invocation.FullMethodDesc): Improve the report string.
14934
14935         * statement.cs (Block): Eliminate IsVariableDefined as it is
14936         basically just a wrapper for GetVariableInfo.
14937
14938         * ecore.cs (SimpleName): Use new 
14939
14940         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14941         type, as we return the actual parameter ref/unref state on a
14942         different call.
14943
14944 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14945
14946         * support.cs: Return proper flags REF/OUT fixing the previous
14947         commit.  
14948
14949         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14950         not used to mean `ref' but `ref or out' in ParameterReference
14951
14952         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14953         full type signature instead of calling TypeManger.CSharpName
14954         ourselves. 
14955
14956         * support.cs (InternalParameters.ParameterDesc): Do not compare
14957         directly to the modflags, because REF/OUT will actually be bitsets
14958         if set. 
14959
14960         * delegate.cs (VerifyMethod): Check also the modifiers.
14961
14962         * cs-tokenizer.cs: Fix bug where floating point values with an
14963         exponent where a sign was missing was ignored.
14964
14965         * driver.cs: Allow multiple assemblies to be specified in a single
14966         /r: argument
14967
14968 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14969
14970         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14971         because identifiers after a parenthesis would end up in this kind
14972         of production, and we needed to desamiguate it for having casts
14973         like:
14974
14975                 (UserDefinedType *) xxx
14976
14977 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14978
14979         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14980         we should set on the Bindingflags.NonPublic, but not turn on
14981         private_ok.  private_ok controls whether a Private member is
14982         returned (this is chekced on the filter routine), while the
14983         BindingFlags.NonPublic just controls whether private/protected
14984         will be allowed.   This fixes the problem part of the problem of
14985         private properties being allowed to be used in derived classes.
14986
14987         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14988         so we can call the children DoResolveLValue method (this will
14989         properly signal errors on lvalue assignments to base properties)
14990
14991         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14992         getter are null, and we have a property info, we know that this
14993         happened because the lookup failed, so we report an error 122 for
14994         protection level violation.
14995
14996         We also silently return if setter and getter are null in the
14997         resolve functions, this condition only happens if we have flagged
14998         the error before.  This is the other half of the problem. 
14999
15000         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15001         not have accessibility information, that is why we were returning
15002         true in the filter function in typemanager.cs.
15003
15004         To properly report 122 (property is inaccessible because of its
15005         protection level) correctly, we report this error in ResolveAccess
15006         by failing if both the setter and the getter are lacking (ie, the
15007         lookup failed). 
15008
15009         DoResolve and DoLResolve have been modified to check for both
15010         setter/getter being null and returning silently, the reason being
15011         that I did not want to put the knowledge about this error in upper
15012         layers, like:
15013
15014         int old = Report.Errors;
15015         x = new PropertyExpr (...);
15016         if (old != Report.Errors)
15017                 return null;
15018         else
15019                 return x;
15020
15021         So the property expr is returned, but it is invalid, so the error
15022         will be flagged during the resolve process. 
15023
15024         * class.cs: Remove InheritablePropertySignatureCompare from the
15025         class, as we no longer depend on the property signature to compute
15026         whether it is possible to implement a method or not.
15027
15028         The reason is that calling PropertyInfo.GetGetMethod will return
15029         null (in .NET, in Mono it works, and we should change this), in
15030         cases where the Get Method does not exist in that particular
15031         class.
15032
15033         So this code:
15034
15035         class X { public virtual int A { get { return 1; } } }
15036         class Y : X { }
15037         class Z : Y { public override int A { get { return 2; } } }
15038
15039         Would fail in Z because the parent (Y) would not have the property
15040         defined.  So we avoid this completely now (because the alternative
15041         fix was ugly and slow), and we now depend exclusively on the
15042         method names.
15043
15044         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15045         reference method, instead of using the property.
15046
15047         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15048         routines are gone now.
15049
15050         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15051         names, they were incorrectly named.
15052
15053         * cs-tokenizer.cs: Return are more gentle token on failure. 
15054
15055         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15056         had an out-of-sync index variable, which caused it to remove from
15057         the list of pending methods the wrong method sometimes.
15058
15059 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15060
15061         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15062         CanWrite, because those refer to this particular instance of the
15063         property, and do not take into account the fact that we can
15064         override single members of a property.
15065
15066         Constructor requires an EmitContext.  The resolution process does
15067         not happen here, but we need to compute the accessors before,
15068         because the resolution does not always happen for properties.
15069
15070         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15071         subclass, before we did not update this flag, but we did update
15072         bindingflags. 
15073
15074         (GetAccessors): Drop this routine, as it did not work in the
15075         presence of partially overwritten set/get methods. 
15076
15077         Notice that this broke the cs1540 detection, but that will require
15078         more thinking. 
15079
15080 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15081
15082         * class.cs:
15083         * codegen.cs:
15084         * driver.cs: issue a warning instead of an error if we don't support
15085         debugging for the platform. Also ignore a couple of errors that may
15086         arise when trying to write the symbols. Undo my previous patch.
15087
15088 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15089
15090         * driver.cs: ignore /debug switch except for Unix platforms.
15091
15092 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15093
15094         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15095
15096 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * driver.cs: Do not make mcs-debug conditional, so we do not break
15099         builds that use it.
15100
15101         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15102         review this patch.  But basically after all the children variables
15103         have been merged, the value of "Breaks" was not being set to
15104         new_breaks for Switch blocks.  I think that it should be set after
15105         it has executed.  Currently I set this to the value of new_breaks,
15106         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15107         conservative, but I do not understand this code very well.
15108
15109         I did not break anything in the build, so that is good ;-)
15110
15111         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15112
15113 2002-10-20  Mark Crichton  <crichton@gimp.org>
15114
15115         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15116
15117 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15118
15119         * cfold.cs: Fixed compile blocker.
15120
15121 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * driver.cs: I was chekcing the key, not the file.
15124
15125 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15126
15127         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15128         message that we were generating - we just need to silently return
15129         a null.
15130
15131 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15132
15133         * class.cs (Event.Define): Change my previous commit, as this
15134         breaks the debugger.  This is a temporary hack, as it seems like
15135         the compiler is generating events incorrectly to begin with.
15136
15137         * expression.cs (Binary.ResolveOperator): Added support for 
15138         "U operator - (E x, E y)"
15139
15140         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15141         y)".
15142
15143         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15144         init-only variables, but this path did not take into account that
15145         there might be also instance readonly variables.  Correct this
15146         problem. 
15147
15148         This fixes bug 32253
15149
15150         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15151         delegates as well.
15152
15153         * driver.cs: Change the extension for modules to `netmodule'
15154
15155         * cs-parser.jay: Improved slightly the location tracking for
15156         the debugger symbols.
15157
15158         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15159         modifiers that were specified instead of the hardcoded value
15160         (FamAndAssem).  This was basically ignoring the static modifier,
15161         and others.  Fixes 32429.
15162
15163         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15164         fixed a bug in the process (32476)
15165
15166         * expression.cs (ArrayAccess.EmitAssign): Patch from
15167         hwang_rob@yahoo.ca that fixes bug 31834.3
15168
15169 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15170
15171         * driver.cs: Make the module extension .netmodule.
15172
15173 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * driver.cs: Report an error if the resource file is not found
15176         instead of crashing.
15177
15178         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15179         false, like Emit does.
15180
15181 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15182
15183         * typemanager.cs: Remove unused private member.  Also reported mcs
15184         bug to report this as a warning like csc.
15185
15186 2002-10-15  Martin Baulig  <martin@gnome.org>
15187
15188         * statement.cs (Statement.Emit): Made this a virtual method; emits
15189         the line number info and calls DoEmit().
15190         (Statement.DoEmit): New protected abstract method, formerly knows
15191         as Statement.Emit().
15192
15193         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15194
15195 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15196
15197         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15198         have fixed a remaining problem: not every AddXXXX was adding a
15199         fully qualified name.  
15200
15201         Now everyone registers a fully qualified name in the DeclSpace as
15202         being defined instead of the partial name.  
15203
15204         Downsides: we are slower than we need to be due to the excess
15205         copies and the names being registered this way.  
15206
15207         The reason for this is that we currently depend (on the corlib
15208         bootstrap for instance) that types are fully qualified, because
15209         we dump all the types in the namespace, and we should really have
15210         types inserted into the proper namespace, so we can only store the
15211         basenames in the defined_names array.
15212
15213 2002-10-10  Martin Baulig  <martin@gnome.org>
15214
15215         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15216         from bug #31834, see the bug report for a testcase which is
15217         miscompiled.
15218
15219 2002-10-10  Martin Baulig  <martin@gnome.org>
15220
15221         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15222         flow analysis code for this.
15223
15224         * statement.cs (Do, While, For): Tell the flow analysis code about
15225         infinite loops.
15226         (FlowBranching.UsageVector): Added support for infinite loops.
15227         (Block.Resolve): Moved the dead code elimination here and use flow
15228         analysis to do it.
15229
15230 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15231
15232         * class.cs (Field.Define): Catch cycles on struct type
15233         definitions. 
15234
15235         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15236         fields if the fields are static.  We only need to check instance
15237         fields. 
15238
15239         * expression.cs (As.DoResolve): Test for reference type.
15240
15241         * statement.cs (Using.ResolveExpression): Use
15242         ConvertImplicitRequired, not ConvertImplicit which reports an
15243         error on failture
15244         (Using.ResolveLocalVariableDecls): ditto.
15245
15246         * expression.cs (Binary.ResolveOperator): Report errors in a few
15247         places where we had to.
15248
15249         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15250
15251 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15252
15253         * expression.cs: Use StoreFromPtr instead of extracting the type
15254         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15255
15256         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15257         an enumeration value to a System.Enum, but System.Enum is not a
15258         value type, but an class type, so we need to box.
15259
15260         (Expression.ConvertExplicit): One codepath could return
15261         errors but not flag them.  Fix this.  Fixes #31853
15262
15263         * parameter.cs (Resolve): Do not allow void as a parameter type.
15264
15265 2002-10-06  Martin Baulig  <martin@gnome.org>
15266
15267         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15268         if it's a class type and not a struct.  Fixes #31815.
15269
15270 2002-10-06  Martin Baulig  <martin@gnome.org>
15271
15272         * statement.cs: Reworked the flow analysis code a bit to make it
15273         usable for dead code elimination.
15274
15275 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15276
15277         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15278
15279 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15280
15281         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15282         to fix the test 165, will investigate deeper.
15283
15284 2002-10-04  Martin Baulig  <martin@gnome.org>
15285
15286         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15287         finally blocks actually work.
15288         (Try.Resolve): We don't need to create a sibling for `finally' if
15289         there is no finally block.
15290
15291 2002-10-04  Martin Baulig  <martin@gnome.org>
15292
15293         * class.cs (Constructor.Define): The default accessibility for a
15294         non-default constructor is private, not public.
15295
15296 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15297
15298         * class.cs (Constructor): Make AllowedModifiers public, add
15299         EXTERN.
15300
15301         * cs-parser.jay: Perform the modifiers test here, as the
15302         constructor for the Constructor class usually receives a zero
15303         because of the way we create it (first we create, later we
15304         customize, and we were never checking the modifiers).
15305
15306         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15307         is a version of LookupTypeReflection that includes the type-name
15308         cache.  This can be used as a fast path for functions that know
15309         the fully qualified name and are only calling into *.GetType() to
15310         obtain a composed type.
15311
15312         This is also used by TypeManager.LookupType during its type
15313         composition.
15314
15315         (LookupType): We now also track the real type name, as sometimes
15316         we can get a quey for the real type name from things like
15317         ComposedCast.  This fixes bug 31422.
15318
15319         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15320         complete type fullname, it does not have to go through the type
15321         resolution system to obtain the composed version of the type (for
15322         obtaining arrays or pointers).
15323
15324         (Conditional.Emit): Use the EmitBoolExpression to
15325         generate nicer code, as requested by Paolo.
15326
15327         (ArrayCreation.CheckIndices): Use the patch from
15328         hwang_rob@yahoo.ca to validate the array initializers. 
15329
15330 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15331
15332         * class.cs (ConstructorInitializer.Emit): simplify code by using
15333         Invocation.EmitCall, and at the same time, fix the bugs in calling
15334         parent constructors that took variable arguments. 
15335
15336         * ecore.cs (Expression.ConvertNumericExplicit,
15337         Expression.ImplicitNumericConversion): Remove the code that
15338         manually wrapped decimal (InternalTypeConstructor call is now gone
15339         as well).
15340
15341         * expression.cs (Cast.TryReduce): Also handle decimal types when
15342         trying to perform a constant fold on the type.
15343
15344         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15345
15346         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15347         that only turned off an error report, and did nothing else. 
15348
15349 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15350
15351         * driver.cs: Handle and ignore /fullpaths
15352
15353 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15354
15355         * expression.cs (Binary.ResolveOperator): Catch the case where
15356         DoNumericPromotions returns true, 
15357
15358         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15359
15360 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15361
15362         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15363         report error 70.
15364
15365 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15366
15367         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15368         conversion exists, but it is also required that the conversion be
15369         performed.  This manifested in "(Type64Enum) 2".  
15370
15371         * class.cs (TypeManager.AddMethod): The fix is not to change
15372         AddEnum, because that one was using a fully qualified name (every
15373         DeclSpace derivative does), but to change the AddMethod routine
15374         that was using an un-namespaced name.  This now correctly reports
15375         the duplicated name.
15376
15377         Revert patch until I can properly fix it.  The issue
15378         is that we have a shared Type space across all namespaces
15379         currently, which is wrong.
15380
15381         Options include making the Namespace a DeclSpace, and merge
15382         current_namespace/current_container in the parser.
15383
15384 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15385
15386         * cs-parser.jay: Improve error reporting when we get a different
15387         kind of expression in local_variable_type and
15388         local_variable_pointer_type. 
15389
15390         Propagate this to avoid missleading errors being reported.
15391
15392         * ecore.cs (ImplicitReferenceConversion): treat
15393         TypeManager.value_type as a target just like object_type.   As
15394         code like this:
15395
15396         ValueType v = 1;
15397
15398         Is valid, and needs to result in the int 1 being boxed before it
15399         is assigned to the value type v.
15400
15401         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15402         to validate the enumeration name.
15403
15404         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15405         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15406         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15407
15408         * ecore.cs (TryImplicitIntConversion): When doing an
15409         implicit-enumeration-conversion, check if the type is 64-bits and
15410         perform a conversion before passing to EnumConstant.
15411
15412 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15413
15414         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15415         report ambiguous type references.  Unlike the MS version, we
15416         report what the ambiguity is.   Innovation at work ;-)
15417
15418         (DeclSpace.FindType): Require a location argument to
15419         display when we display an ambiguous error.
15420
15421         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15422
15423         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15424
15425         * expression.cs (EmitDynamicInitializers): Apply patch from
15426         hwang_rob@yahoo.ca that fixes the order in which we emit our
15427         initializers. 
15428
15429 2002-09-21  Martin Baulig  <martin@gnome.org>
15430
15431         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15432         delegate takes no arguments.
15433
15434 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15435
15436         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15437         from integers.
15438
15439         * expression.cs: Extract the underlying type.
15440
15441         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15442
15443         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15444
15445 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15446
15447         * class.cs (TypeContainer.DefineType): We can not use the nice
15448         PackingSize with the size set to 1 DefineType method, because it
15449         will not allow us to define the interfaces that the struct
15450         implements.
15451
15452         This completes the fixing of bug 27287
15453
15454         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15455         means also structs.  This fixes part of the problem. 
15456         (Expresion.ImplicitReferenceConversionExists): ditto.
15457
15458         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15459         error if there were no errors reported during the type lookup
15460         process, to avoid duplicates or redundant errors.  Without this
15461         you would get an ambiguous errors plus a type not found.  We have
15462         beaten the user enough with the first error.  
15463
15464         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15465         reference. 
15466
15467         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15468         during the resolution process, stop the lookup, this avoids
15469         repeated error reports (same error twice).
15470
15471         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15472
15473         * typemanager.cs (LookupType): Redo the type lookup code to match
15474         the needs of System.Reflection.  
15475
15476         The issue is that System.Reflection requires references to nested
15477         types to begin with a "+" sign instead of a dot.  So toplevel
15478         types look like: "NameSpace.TopLevelClass", and nested ones look
15479         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15480         levels. 
15481
15482 2002-09-19  Martin Baulig  <martin@gnome.org>
15483
15484         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15485         says that a method always returns or always throws an exception,
15486         don't report the CS0161.
15487
15488         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15489         set `Returns = new_returns'.
15490
15491 2002-09-19  Martin Baulig  <martin@gnome.org>
15492
15493         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15494         to an enum constant, check for a CS0176.
15495
15496 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15497
15498         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15499         for operators that must be in pairs and report errors.
15500
15501         * ecore.cs (SimpleName.DoResolveType): During the initial type
15502         resolution process, when we define types recursively, we must
15503         check first for types in our current scope before we perform
15504         lookups in the enclosing scopes.
15505
15506         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15507
15508         (Invocation.VerifyArgumentsCompat): Call
15509         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15510         I thought we were supposed to always call this, but there are a
15511         few places in the code where we dont do it.
15512
15513 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15514
15515         * driver.cs: Add support in -linkres and -resource to specify the
15516         name of the identifier.
15517
15518 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15519
15520         * ecore.cs (StandardConversionExists): Sync with the conversion
15521         code: allow anything-* to void* conversions.
15522
15523         (FindMostSpecificSource): Use an Expression argument
15524         instead of a Type, because we might be handed over a Literal which
15525         gets a few more implicit conversions that plain types do not.  So
15526         this information was being lost.
15527
15528         Also, we drop the temporary type-holder expression when not
15529         required.
15530
15531 2002-09-17  Martin Baulig  <martin@gnome.org>
15532
15533         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15534         this is an explicit interface implementation.
15535
15536 2002-09-17  Martin Baulig  <martin@gnome.org>
15537
15538         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15539         different `IndexerName' attributes.
15540
15541         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15542         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15543         virtual CommonResolve().
15544
15545 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15546
15547         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15548         and convert that to the UnderlyingType.
15549
15550         * statement.cs (Foreach.Resolve): Indexers are just like variables
15551         or PropertyAccesses.
15552
15553         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15554         inside quoted strings, we were not doing this before.
15555
15556 2002-09-16  Martin Baulig  <martin@gnome.org>
15557
15558         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15559         resolve it.  This is needed for the definite assignment check of the
15560         instance expression, fixes bug #29846.
15561         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15562
15563 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15564
15565         * parameter.cs: Fix compile error.  Cannot reference static member
15566         from an instance object.  Is this an mcs bug?
15567
15568 2002-09-14  Martin Baulig  <martin@gnome.org>
15569
15570         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15571         multiple times.  Fixes bug #30295, added test-166.cs.
15572
15573 2002-09-14  Martin Baulig  <martin@gnome.org>
15574
15575         * statement.cs (Block.Emit): Don't emit unreachable code.
15576         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15577         `break' statements.
15578         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15579
15580 2002-09-14  Martin Baulig  <martin@gnome.org>
15581
15582         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15583         is set.
15584
15585 2002-09-14  Martin Baulig  <martin@gnome.org>
15586
15587         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15588         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15589         be false on the ms runtime.
15590
15591 2002-09-13  Martin Baulig  <martin@gnome.org>
15592
15593         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15594         the CS0038 error message.
15595
15596 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15597
15598         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15599         constant inside, return it.
15600
15601 2002-09-12  Martin Baulig  <martin@gnome.org>
15602
15603         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15604         implicit conversion can be done between enum types.
15605
15606         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15607         check whether an implicit conversion to the current enum's UnderlyingType
15608         exists and report an error if not.
15609
15610         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15611         without debugging support.
15612
15613         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15614         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15615
15616 2002-09-12  Martin Baulig  <martin@gnome.org>
15617
15618         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15619
15620         * ecore.cs (IMemberExpr.DeclaringType): New property.
15621         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15622         nonstatic member of an outer type (CS0038).
15623
15624 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15625
15626         * driver.cs: Activate the using-error detector at warning level
15627         4 (at least for MS-compatible APIs).
15628
15629         * namespace.cs (VerifyUsing): Small buglett fix.
15630
15631         * pending.cs (PendingImplementation): pass the container pointer. 
15632
15633         * interface.cs (GetMethods): Allow for recursive definition.  Long
15634         term, I would like to move every type to support recursive
15635         definitions, not the current ordering mechanism that we have right
15636         now.
15637
15638         The situation is this: Attributes are handled before interfaces,
15639         so we can apply attributes to interfaces.  But some attributes
15640         implement interfaces, we will now handle the simple cases
15641         (recursive definitions will just get an error).  
15642
15643         * parameter.cs: Only invalidate types at the end if we fail to
15644         lookup all types.  
15645
15646 2002-09-09  Martin Baulig  <martin@gnome.org>
15647
15648         * ecore.cs (PropertyExpr.Emit): Also check for
15649         TypeManager.system_int_array_get_length so this'll also work when
15650         compiling corlib.  Fixes #30003.
15651
15652 2002-09-09  Martin Baulig  <martin@gnome.org>
15653
15654         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15655         and throw an exception if we can't get the type's size.  Fixed #30040,
15656         added test-165.cs.
15657
15658 2002-09-09  Martin Baulig  <martin@gnome.org>
15659
15660         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15661
15662         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15663         context.  Fixes bug #30027.
15664
15665         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15666         virtual functions.  Fixes bug #30043, added test-164.cs.
15667
15668 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15669
15670         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15671
15672 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15673
15674         * driver.cs: Use an object to get the windows codepage since it's not a
15675         static property.
15676
15677 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15678
15679         * statement.cs (For.Emit): for infinite loops (test == null)
15680         return whether there is a break inside, not always "true".
15681
15682         * namespace.cs (UsingEntry): New struct to hold the name of the
15683         using definition, the location where it is defined, and whether it
15684         has been used in a successful type lookup.
15685
15686         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15687         strings.
15688
15689         * decl.cs: ditto.
15690
15691 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15692
15693         * attribute.cs : Fix incorrect code which relied on catching
15694         a NullReferenceException to detect a null being passed in
15695         where an object was expected.
15696
15697 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15698
15699         * statement.cs (Try): flag the catch variable as assigned
15700
15701         * expression.cs (Cast): Simplified by using ResolveType instead of
15702         manually resolving.
15703
15704         * statement.cs (Catch): Fix bug by using ResolveType.
15705
15706 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15707
15708         * expression.cs (BetterConversion): Special case for when we have
15709         a NullLiteral as the argument and we have to choose between string
15710         and object types - we choose string the way csc does.
15711
15712         * attribute.cs (Attribute.Resolve): Catch the
15713         NullReferenceException and report error #182 since the Mono
15714         runtime no more has the bug and having this exception raised means
15715         we tried to select a constructor which takes an object and is
15716         passed a null.
15717
15718 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15719
15720         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15721         message (1502, 1503) when we can't locate a method after overload
15722         resolution. This is much more informative and closes the bug
15723         Miguel reported.
15724
15725         * interface.cs (PopulateMethod): Return if there are no argument
15726         types. Fixes a NullReferenceException bug.
15727
15728         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15729         expressions too. Previously we were checking only in one place for
15730         positional arguments leaving out named arguments.
15731
15732         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15733         type to the enum type is not allowed. Remove code corresponding to
15734         that.
15735
15736         (ConvertNumericExplicit): Allow explicit conversions from
15737         the underlying type to enum type. This precisely follows the spec
15738         and closes a bug filed by Gonzalo.
15739
15740 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15741
15742         * compiler.csproj:
15743         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15744
15745 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15746
15747         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15748         it was important that we stored the right value after the
15749         reduction in `converted'.
15750
15751 2002-09-04  Martin Baulig  <martin@gnome.org>
15752
15753         * location.cs (Location.SymbolDocument): Use full pathnames for the
15754         source files.
15755
15756 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15757
15758         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15759         of the expression resolve mechanism, because that will catch the
15760         SimpleName error failures.
15761
15762         (Conditional): If we can not resolve the
15763         expression, return, do not crash.
15764
15765 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15766
15767         * cs-tokenizer.cs:
15768         (location): display token name instead of its number.
15769
15770 2002-08-28  Martin Baulig  <martin@gnome.org>
15771
15772         * expression.cs (Binary.ResolveOperator): Don't silently return
15773         but return an error if an operator cannot be applied between two
15774         enum types.
15775
15776 2002-08-28  Martin Baulig  <martin@gnome.org>
15777
15778         * class.cs (Constructor.Define): Set the permission attributes
15779         correctly instead of making all constructors public.
15780
15781 2002-08-28  Martin Baulig  <martin@gnome.org>
15782
15783         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15784         for private members before reporting a CS0103; if we find anything,
15785         it's a CS0122.
15786
15787 2002-08-28  Martin Baulig  <martin@gnome.org>
15788
15789         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15790         to check whether `closure_start_type == closure_invocation_type',
15791         we also need to check whether `m.DeclaringType == closure_invocation_type'
15792         before bypassing the permission checks.  We might be accessing
15793         protected/private members from the base class.
15794         (TypeManager.RealMemberLookup): Only set private_ok if private
15795         members were requested via BindingFlags.NonPublic.
15796
15797         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15798
15799         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15800         MethodGroupExpr.IsExplicitImpl if appropriate.
15801         (Invocation.DoResolve): Don't report the CS0120 for explicit
15802         interface implementations.
15803
15804 2002-08-27  Martin Baulig  <martin@gnome.org>
15805
15806         * expression.cs (Invocation.DoResolve): If this is a static
15807         method and we don't have an InstanceExpression, we must report
15808         a CS0120.
15809
15810 2002-08-25  Martin Baulig  <martin@gnome.org>
15811
15812         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15813         `==' between a valuetype and an object.
15814
15815 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15816
15817         * ecore.cs (TypeExpr): Provide a ToString method.
15818
15819 2002-08-24  Martin Baulig  <martin@gnome.org>
15820
15821         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15822         now called proggie.dbg and it's a binary file.
15823
15824 2002-08-23  Martin Baulig  <martin@gnome.org>
15825
15826         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15827
15828 2002-08-23  Martin Baulig  <martin@gnome.org>
15829
15830         * struct.cs (MyStructInfo.ctor): Make this work with empty
15831         structs; it's not allowed to use foreach() on null.
15832
15833 2002-08-23  Martin Baulig  <martin@gnome.org>
15834
15835         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15836         writer the full pathname of the generated assembly.
15837
15838 2002-08-23  Martin Baulig  <martin@gnome.org>
15839
15840         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15841         A `finally' block never returns or breaks; improved handling of
15842         unreachable code.
15843
15844 2002-08-23  Martin Baulig  <martin@gnome.org>
15845
15846         * statement.cs (Throw.Resolve): Allow `throw null'.
15847
15848 2002-08-23  Martin Baulig  <martin@gnome.org>
15849
15850         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15851         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15852         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15853         MemberLookup would return a wrong event if this is an explicit
15854         interface implementation and the class has an event with the same
15855         name.
15856
15857 2002-08-23  Martin Baulig  <martin@gnome.org>
15858
15859         * statement.cs (Block.AddChildVariableNames): New public method.
15860         (Block.AddChildVariableName): Likewise.
15861         (Block.IsVariableNameUsedInChildBlock): Likewise.
15862         (Block.AddVariable): Check whether a variable name has already
15863         been used in a child block.
15864
15865         * cs-parser.jay (declare_local_variables): Mark all variable names
15866         from the current block as being used in a child block in the
15867         implicit block.
15868
15869 2002-08-23  Martin Baulig  <martin@gnome.org>
15870
15871         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15872         find the symbol writer.
15873
15874         * driver.cs: csc also allows the arguments to /define being
15875         separated by commas, not only by semicolons.
15876
15877 2002-08-23  Martin Baulig  <martin@gnome.org>
15878
15879         * interface.cs (Interface.GetMembers): Added static check for events.
15880
15881 2002-08-15  Martin Baulig  <martin@gnome.org>
15882
15883         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15884         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15885
15886         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15887         why the MethodData.EmitDestructor() change was necessary.
15888
15889 2002-08-20  Martin Baulig  <martin@gnome.org>
15890
15891         * class.cs (TypeContainer.FindMembers): Added static check for events.
15892
15893         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15894
15895         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15896         use Type.GetEvents(), not Type.FindMembers().
15897
15898 2002-08-20  Martin Baulig  <martin@gnome.org>
15899
15900         * decl.cs (MemberCache): Added a special method cache which will
15901         be used for method-only searched.  This ensures that a method
15902         search will return a MethodInfo with the correct ReflectedType for
15903         inherited methods.      
15904
15905 2002-08-20  Martin Baulig  <martin@gnome.org>
15906
15907         * decl.cs (DeclSpace.FindMembers): Made this public.
15908
15909 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15910
15911         * delegate.cs: fixed build on windows.
15912         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15913
15914 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15915
15916         * ecore.cs (StandardConversionExists): Return a false
15917         if we are trying to convert the void type to anything else
15918         since that is not allowed.
15919
15920         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15921         we flag error 70 in the event an event is trying to be accessed
15922         directly from outside the declaring type.
15923
15924 2002-08-20  Martin Baulig  <martin@gnome.org>
15925
15926         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15927         MemberCache from typemanager.cs to decl.cs.
15928
15929 2002-08-19  Martin Baulig  <martin@gnome.org>
15930
15931         * class.cs (TypeContainer): Implement IMemberContainer.
15932         (TypeContainer.DefineMembers): Create the MemberCache.
15933         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15934         return public members if BindingFlags.Public was given, check
15935         whether members are static.
15936
15937 2002-08-16  Martin Baulig  <martin@gnome.org>
15938
15939         * decl.cs (DeclSpace.Define): Splitted this in Define and
15940         DefineMembers.  DefineMembers is called first and initializes the
15941         MemberCache.
15942
15943         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15944         DefineMembers() on all our DeclSpaces.
15945
15946         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15947         but call DefineMembers() on all nested interfaces.  We call their
15948         Define() in our new Define() function.
15949
15950         * interface.cs (Interface): Implement IMemberContainer.
15951         (Interface.Define): Moved all code except the attribute stuf to
15952         DefineMembers().
15953         (Interface.DefineMembers): Initialize the member cache.
15954
15955         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15956         need this anymore since we can use MemberCache.FindMembers directly.
15957
15958 2002-08-19  Martin Baulig  <martin@gnome.org>
15959
15960         * typemanager.cs (MemberCache): When creating the cache for an
15961         interface type, add all inherited members.
15962         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15963         to `out bool used_cache' and documented it.
15964         (TypeManager.MemberLookup): If we already used the cache in the first
15965         iteration, we don't need to do the interfaces check.
15966
15967 2002-08-19  Martin Baulig  <martin@gnome.org>
15968
15969         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15970         here from IMemberFinder and don't implement this interface anymore.
15971         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15972
15973         * typemanager.cs (IMemberFinder): This interface is now only used by
15974         classes which actually support the member cache.
15975         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15976         since we only put DeclSpaces into this Hashtable.
15977         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15978         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15979
15980 2002-08-16  Martin Baulig  <martin@gnome.org>
15981
15982         * typemanager.cs (ICachingMemberFinder): Removed.
15983         (IMemberFinder.MemberCache): New property.
15984         (TypeManager.FindMembers): Merged this with RealFindMembers().
15985         This function will never be called from TypeManager.MemberLookup()
15986         so we can't use the cache here, just the IMemberFinder.
15987         (TypeManager.MemberLookup_FindMembers): Check whether the
15988         IMemberFinder has a MemberCache and call the cache's FindMembers
15989         function.
15990         (MemberCache): Rewrote larger parts of this yet another time and
15991         cleaned it up a bit.
15992
15993 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15994
15995         * driver.cs (LoadArgs): Support quoting.
15996
15997         (Usage): Show the CSC-like command line arguments.
15998
15999         Improved a few error messages.
16000
16001 2002-08-15  Martin Baulig  <martin@gnome.org>
16002
16003         * typemanager.cs (IMemberContainer.Type): New property.
16004         (IMemberContainer.IsInterface): New property.
16005
16006         The following changes are conditional to BROKEN_RUNTIME, which is
16007         defined at the top of the file.
16008
16009         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16010         class'es members, but add all members from TypeHandle.ObjectType
16011         if we're an interface.
16012         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16013         is the current type.
16014         (MemberCache.CacheEntry.Container): Removed this field.
16015         (TypeHandle.GetMembers): Include inherited members.
16016
16017 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16018
16019         * typemanager.cs: fixed compilation and added a comment on a field that
16020         is never used.
16021
16022 2002-08-15  Martin Baulig  <martin@gnome.org>
16023
16024         * class.cs (ConstructorInitializer.Resolve): In the
16025         Expression.MemberLookup call, use the queried_type as
16026         invocation_type.
16027
16028         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16029         declared' attribute, it's always true.
16030         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16031         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16032         temporary wrapper for FindMembers which tells MemberLookup whether
16033         members from the base classes are included in the return value.
16034         This will go away soon.
16035         (TypeManager.MemberLookup): Use this temporary hack here; once the
16036         new MemberCache is completed, we don't need to do the DeclaredOnly
16037         looping here anymore since the MemberCache will take care of this.
16038         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16039         (MemberCache): When creating the MemberCache for a class, get
16040         members from the current class and all its base classes.
16041         (MemberCache.CacheEntry.Container): New field.  This is a
16042         temporary hack until the Mono runtime is fixed to distinguish
16043         between ReflectedType and DeclaringType.  It allows us to use MCS
16044         with both the MS runtime and the unfixed Mono runtime without
16045         problems and without accecting performance.
16046         (MemberCache.SearchMembers): The DeclaredOnly looping from
16047         TypeManager.MemberLookup is now done here.      
16048
16049 2002-08-14  Martin Baulig  <martin@gnome.org>
16050
16051         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16052         Type.GetFields on dynamic types but get the fields from the
16053         corresponding TypeContainer.
16054         (MyStructInfo.GetStructInfo): Added check for enum types.
16055
16056         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16057         (MemberList.SyncRoot): Implemented.
16058         (TypeManager.FilterWithClosure): No need to check permissions if
16059         closure_start_type == closure_invocation_type, don't crash if
16060         closure_invocation_type is null.
16061
16062 2002-08-13  Martin Baulig  <martin@gnome.org>
16063
16064         Rewrote TypeContainer.FindMembers to use a member cache.  This
16065         gives us a speed increase of about 35% for the self-hosting MCS
16066         build and of about 15-20% for the class libs (both on GNU/Linux).
16067
16068         * report.cs (Timer): New class to get enhanced profiling.  This
16069         whole class is "TIMER" conditional since it remarkably slows down
16070         compilation speed.
16071
16072         * class.cs (MemberList): New class.  This is an IList wrapper
16073         which we're now using instead of passing MemberInfo[]'s around to
16074         avoid copying this array unnecessarily.
16075         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16076         (ICachingMemberFinder, IMemberContainer): New interface.
16077         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16078         has already been checked, otherwise use it for the name comparision.
16079         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16080         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16081         if possible.  Returns a MemberList, not a MemberInfo [].
16082         (TypeHandle): New class, implements IMemberContainer.  We create
16083         one instance of this class per type, it contains a MemberCache
16084         which is used to do the member lookups.
16085         (MemberCache): New class.  Each instance of this class contains
16086         all members of a type and a name-based hash table.
16087         (MemberCache.FindMembers): This is our new member lookup
16088         function.  First, it looks up all members of the requested name in
16089         the hash table.  Then, it walks this list and sorts out all
16090         applicable members and returns them.
16091
16092 2002-08-13  Martin Baulig  <martin@gnome.org>
16093
16094         In addition to a nice code cleanup, this gives us a performance
16095         increase of about 1.4% on GNU/Linux - not much, but it's already
16096         half a second for the self-hosting MCS compilation.
16097
16098         * typemanager.cs (IMemberFinder): New interface.  It is used by
16099         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16100         Enum, Delegate or Interface.
16101         (TypeManager.finder_to_member_finder): New PtrHashtable.
16102         (TypeManager.finder_to_container): Removed.
16103         (TypeManager.finder_to_delegate): Removed.
16104         (TypeManager.finder_to_interface): Removed.
16105         (TypeManager.finder_to_enum): Removed.
16106
16107         * interface.cs (Interface): Implement IMemberFinder.
16108
16109         * delegate.cs (Delegate): Implement IMemberFinder.
16110
16111         * enum.cs (Enum): Implement IMemberFinder.
16112
16113         * class.cs (TypeContainer): Implement IMemberFinder.
16114
16115 2002-08-12  Martin Baulig  <martin@gnome.org>
16116
16117         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16118
16119 2002-08-12  Martin Baulig  <martin@gnome.org>
16120
16121         * ecore.cs (ITypeExpression): New interface for expressions which
16122         resolve to a type.
16123         (TypeExpression): Renamed to TypeLookupExpression.
16124         (Expression.DoResolve): If we're doing a types-only lookup, the
16125         expression must implement the ITypeExpression interface and we
16126         call DoResolveType() on it.
16127         (SimpleName): Implement the new ITypeExpression interface.
16128         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16129         hack, the situation that we're only looking up types can't happen
16130         anymore when this method is called.  Moved the type lookup code to
16131         DoResolveType() and call it.
16132         (SimpleName.DoResolveType): This ITypeExpression interface method
16133         is now doing the types-only lookup.
16134         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16135         (ResolveFlags): Added MaskExprClass.
16136
16137         * expression.cs (MemberAccess): Implement the ITypeExpression
16138         interface.
16139         (MemberAccess.DoResolve): Added support for a types-only lookup
16140         when we're called via ITypeExpression.DoResolveType().
16141         (ComposedCast): Implement the ITypeExpression interface.
16142
16143         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16144         Expression.Resolve() with ResolveFlags.Type instead.
16145
16146 2002-08-12  Martin Baulig  <martin@gnome.org>
16147
16148         * interface.cs (Interface.Define): Apply attributes.
16149
16150         * attribute.cs (Attribute.ApplyAttributes): Added support for
16151         interface attributes.
16152
16153 2002-08-11  Martin Baulig  <martin@gnome.org>
16154
16155         * statement.cs (Block.Emit): Only check the "this" variable if we
16156         do not always throw an exception.
16157
16158         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16159         whether the property has a set accessor.
16160
16161 2002-08-11  Martin Baulig  <martin@gnome.org>
16162
16163         Added control flow analysis support for structs.
16164
16165         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16166         with control flow analysis turned off.
16167         (IVariable): New interface.
16168         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16169         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16170         (FieldExpr.DoResolve): Resolve the instance expression with flow
16171         analysis turned off and do the definite assignment check after the
16172         resolving when we know what the expression will resolve to.
16173
16174         * expression.cs (LocalVariableReference, ParameterReference):
16175         Implement the new IVariable interface, only call the flow analysis
16176         code if ec.DoFlowAnalysis is true.
16177         (This): Added constructor which takes a Block argument.  Implement
16178         the new IVariable interface.
16179         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16180         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16181         This does the definite assignment checks for struct members.
16182
16183         * class.cs (Constructor.Emit): If this is a non-static `struct'
16184         constructor which doesn't have any initializer, call
16185         Block.AddThisVariable() to tell the flow analysis code that all
16186         struct elements must be initialized before control returns from
16187         the constructor.
16188
16189         * statement.cs (MyStructInfo): New public class.
16190         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16191         argument to this indexer.  If non-zero, check an individual struct
16192         member, not the whole struct.
16193         (FlowBranching.CheckOutParameters): Check struct members.
16194         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16195         overloaded versions of these methods which take an additional
16196         `int field_idx' argument to check struct members.
16197         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16198         overloaded versions of these methods which take an additional
16199         `string field_name' argument to check struct member.s
16200         (VariableInfo): Implement the IVariable interface.
16201         (VariableInfo.StructInfo): New public property.  Returns the
16202         MyStructInfo instance of the variable if it's a struct or null.
16203         (Block.AddThisVariable): New public method.  This is called from
16204         Constructor.Emit() for non-static `struct' constructor which do
16205         not have any initializer.  It creates a special variable for the
16206         "this" instance variable which will be checked by the flow
16207         analysis code to ensure that all of the struct's fields are
16208         initialized before control returns from the constructor.
16209         (UsageVector): Added support for struct members.  If a
16210         variable/parameter is a struct with N members, we reserve a slot
16211         in the usage vector for each member.  A struct is considered fully
16212         initialized if either the struct itself (slot 0) or all its
16213         members are initialized.
16214
16215 2002-08-08  Martin Baulig  <martin@gnome.org>
16216
16217         * driver.cs (Driver.MainDriver): Only report an error CS5001
16218         if there were no compilation errors.
16219
16220         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16221         `UnsafeContext' property to determine whether the parent is in
16222         unsafe context rather than checking the parent's ModFlags:
16223         classes nested in an unsafe class are unsafe as well.
16224
16225 2002-08-08  Martin Baulig  <martin@gnome.org>
16226
16227         * statement.cs (UsageVector.MergeChildren): Distinguish between
16228         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16229         we return.  Added test17() and test18() to test-154.cs.
16230
16231 2002-08-08  Martin Baulig  <martin@gnome.org>
16232
16233         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16234         Family access, make sure the invoking type isn't a subclass of the
16235         queried type (that'd be a CS1540).
16236
16237         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16238         this method which takes an additional `Type invocation_type'.
16239
16240         * expression.cs (BaseAccess.DoResolve): Use the base type as
16241         invocation and query type.
16242         (MemberAccess.DoResolve): If the lookup failed and we're about to
16243         report a CS0122, try a lookup with the ec.ContainerType - if this
16244         succeeds, we must report a CS1540.
16245
16246 2002-08-08  Martin Baulig  <martin@gnome.org>
16247
16248         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16249         (MethodGroupExpr): Implement the IMemberExpr interface.
16250
16251         * expression (MemberAccess.ResolveMemberAccess): No need to have
16252         any special code for MethodGroupExprs anymore, they're now
16253         IMemberExprs.   
16254
16255 2002-08-08  Martin Baulig  <martin@gnome.org>
16256
16257         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16258         Family, FamANDAssem and FamORAssem permissions.
16259         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16260
16261 2002-08-08  Martin Baulig  <martin@gnome.org>
16262
16263         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16264         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16265         or loop block.
16266
16267 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16268
16269         * driver.cs: implemented /resource option to embed managed resources.
16270
16271 2002-08-07  Martin Baulig  <martin@gnome.org>
16272
16273         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16274         (FieldBase.HasFieldInitializer): New public property.
16275         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16276         returns the field initializer and makes sure it is only resolved once.
16277         (TypeContainer.EmitFieldInitializers): Call
16278         FieldBase.GetInitializerExpression to get the initializer, this ensures
16279         that it isn't resolved multiple times.
16280
16281         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16282         the resolving process (SimpleName/MemberLookup) that we're currently
16283         emitting a field initializer (which must not access any instance members,
16284         this is an error CS0236).
16285
16286         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16287         argument, if the `IsFieldInitializer' flag is set, we must report and
16288         error CS0236 and not an error CS0120.   
16289
16290 2002-08-07  Martin Baulig  <martin@gnome.org>
16291
16292         * ecore.cs (IMemberExpr): New public interface.
16293         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16294         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16295         if the expression is an IMemberExpr.
16296
16297         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16298         to be null, implicitly default to `this' if we're non-static in
16299         this case.  Simplified the code a lot by using the new IMemberExpr
16300         interface.  Also fixed bug #28176 here.
16301
16302 2002-08-06  Martin Baulig  <martin@gnome.org>
16303
16304         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16305         ParameterReferences during semantic analysis so that we can do a
16306         type-only search when resolving Cast, TypeOf and SizeOf.
16307         (block): Pass the `current_local_parameters' to the Block's
16308         constructor.
16309
16310         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16311         argument to the constructor.
16312         (ConstructorInitializer.Resolve): Create a temporary implicit
16313         block with the parameters.
16314
16315         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16316         references here if we aren't doing a type-only search.
16317
16318         * statement.cs (Block): Added constructor which takes a
16319         `Parameters parameters' argument.
16320         (Block.Parameters): New public property.
16321
16322         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16323         to `Parameters' and made it public readonly.
16324
16325 2002-08-06  Martin Baulig  <martin@gnome.org>
16326
16327         * ecore.cs (Expression.Warning): Made this public as well.
16328
16329         * report.cs (Report.Debug): Print the contents of collections.
16330
16331 2002-08-06  Martin Baulig  <martin@gnome.org>
16332
16333         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16334         used to tell Resolve() which kinds of expressions it may return.
16335         (Expression.Resolve): Added overloaded version of this method which
16336         takes a `ResolveFlags flags' argument.  This can be used to tell
16337         Resolve() which kinds of expressions it may return.  Reports a
16338         CS0118 on error.
16339         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16340         ResolveFlags.SimpleName.
16341         (Expression.Error118): Added overloaded version of this method which
16342         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16343         which kinds of expressions are allowed.
16344
16345         * expression.cs (Argument.ResolveMethodGroup): New public method.
16346         Resolves an argument, but allows a MethodGroup to be returned.
16347         This is used when invoking a delegate.
16348
16349         * TODO: Updated a bit.
16350
16351 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16352
16353         Fixed compilation with csc.
16354
16355         * ecore.cs: Expression.Error made public. Is this correct? Should
16356         Warning be made public too?
16357
16358         * expression.cs: use ea.Location instead of ea.loc.
16359         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16360
16361 2002-08-06  Martin Baulig  <martin@gnome.org>
16362
16363         * ecore.cs (Expression.loc): Moved the location here instead of
16364         duplicating it in all derived classes.
16365         (Expression.Location): New public property.
16366         (Expression.Error, Expression.Warning): Made them non-static and
16367         removed the location argument.
16368         (Expression.Warning): Added overloaded version which takes an
16369         `int level' argument.
16370         (Expression.Error118): Make this non-static and removed the
16371         expression and location arguments.
16372         (TypeExpr): Added location argument to the constructor.
16373
16374         * expression.cs (StaticCallExpr): Added location argument to
16375         the constructor.
16376         (Indirection, PointerArithmetic): Likewise.
16377         (CheckedExpr, UnCheckedExpr): Likewise.
16378         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16379         (StringPtr): Likewise.
16380
16381
16382 2002-08-05  Martin Baulig  <martin@gnome.org>
16383
16384         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16385
16386         * assign.cs (Assign.DoResolve): Check whether the source
16387         expression is a value or variable.
16388
16389         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16390         while resolving the corresponding blocks.
16391
16392         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16393         an error, don't silently return null.
16394
16395         * statement.cs (Block.AddVariable): Do the error reporting here
16396         and distinguish between CS0128 and CS0136.
16397         (Block.DoResolve): Report all unused labels (warning CS0164).
16398         (LabeledStatement): Pass the location to the constructor.
16399         (LabeledStatement.HasBeenReferenced): New property.
16400         (LabeledStatement.Resolve): Set it to true here.
16401
16402         * statement.cs (Return.Emit): Return success even after reporting
16403         a type mismatch error (CS0126 or CS0127), this is what csc does and
16404         it avoids confusing the users with any consecutive errors.
16405
16406 2002-08-05  Martin Baulig  <martin@gnome.org>
16407
16408         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16409
16410         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16411
16412         * expression.cs (MemberAccess.DoResolve): Silently return if an
16413         error has already been reported.
16414
16415         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16416         error has already been reported.
16417
16418 2002-08-05  Martin Baulig  <martin@gnome.org>
16419
16420         * statement.cs (UsageVector): Only initialize the `parameters'
16421         vector if we actually have any "out" parameters.
16422
16423 2002-08-05  Martin Baulig  <martin@gnome.org>
16424
16425         * expression.cs (Binary.ResolveOperator): When combining delegates,
16426         they must have the same type.
16427
16428 2002-08-05  Martin Baulig  <martin@gnome.org>
16429
16430         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16431         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16432         work with the ms runtime and we also don't need it: if we're a
16433         PropertyBuilder and not in the `indexer_arguments' hash, then we
16434         are a property and not an indexer.
16435
16436         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16437         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16438         since the latter one doesn't work with the ms runtime.
16439
16440 2002-08-03  Martin Baulig  <martin@gnome.org>
16441
16442         Fixed bugs #27998 and #22735.
16443
16444         * class.cs (Method.IsOperator): New public field.
16445         (Method.CheckBase): Report CS0111 if there's already a method
16446         with the same parameters in the current class.  Report CS0508 when
16447         attempting to change the return type of an inherited method.
16448         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16449         and it's not marked abstract or extern.
16450         (PropertyBase): New abstract base class for Property and Indexer.
16451         (PropertyBase.CheckBase): Moved here from Property and made it work
16452         for indexers.
16453         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16454         the same so we can reuse it there.
16455         (Property, Indexer): Derive from PropertyBase.
16456         (MethodSignature.inheritable_property_signature_filter): New delegate
16457         to find properties and indexers.
16458
16459         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16460         argument and improved error reporting.
16461
16462         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16463         EmptyReadOnlyParameters and made it a property.
16464
16465         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16466         version of this method which takes a `PropertyInfo indexer'.
16467         (TypeManager.RegisterIndexer): New method.
16468
16469         * class.cs: Added myself as author of this file :-)
16470
16471 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16472
16473         * class.cs: fixed compilation on windoze.
16474
16475 2002-08-03  Martin Baulig  <martin@gnome.org>
16476
16477         * interface.cs (Interface.GetInterfaceBases): Check whether all
16478         base interfaces are at least as accessible than the current one.
16479
16480         * class.cs (TypeContainer.GetClassBases): Check whether base types
16481         are at least as accessible than the current type.
16482         (TypeContainer.AsAccessible): Implemented and made non-static.
16483         (MemberBase.CheckParameters): Report errors if the accessibility
16484         checks fail.
16485
16486         * delegate.cs (Delegate.Delegate): The default visibility is
16487         internal for top-level types and private for nested types.
16488         (Delegate.Define): Report errors if the accessibility checks fail.
16489
16490         * enum.cs (Enum.Enum): The default visibility is internal for
16491         top-level types and private for nested types.
16492         (Enum.DefineType): Compute the correct visibility.
16493
16494         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16495         function which takes a `bool is_toplevel' instead of a TypeContainer.
16496
16497         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16498         builtin type.
16499
16500 2002-08-02  Martin Baulig  <martin@gnome.org>
16501
16502         * expression.cs (LocalVariableReferenc): Added constructor which
16503         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16504         (LocalVariableReference.IsReadOnly): New property.
16505         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16506         variable is readonly, use our own readonly flag to do this; you can
16507         use the new constructor to get a writable reference to a read-only
16508         variable.
16509
16510         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16511         reference to the local variable.
16512
16513 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16514
16515         * rootcontext.cs (ResolveCore): Also include System.Exception
16516
16517         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16518         we reach an EmptyStatement.
16519
16520         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16521         is also fine.
16522
16523         * expression.cs (Binary.ResolveOperator): Check error result in
16524         two places.
16525
16526         use brtrue/brfalse directly and avoid compares to null.
16527
16528 2002-08-02  Martin Baulig  <martin@gnome.org>
16529
16530         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16531         Fixes bug #28407, added test-155.cs.
16532
16533 2002-08-01  Martin Baulig  <martin@gnome.org>
16534
16535         * class.cs (Event.EmitDefaultMethod): Make this work with static
16536         events.  Fixes #28311, added verify-3.cs.
16537
16538 2002-08-01  Martin Baulig  <martin@gnome.org>
16539
16540         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16541         `is_disposable' fields.
16542         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16543         `hm.is_disposable' if we're using the collection pattern.
16544         (Foreach.EmitCollectionForeach): Use the correct type for the
16545         enumerator's local variable, only emit the try/finally block if
16546         necessary (fixes #27713).
16547
16548 2002-08-01  Martin Baulig  <martin@gnome.org>
16549
16550         * ecore.cs (Expression.report118): Renamed to Error118 and made
16551         it public static.
16552
16553         * statement.cs (Throw.Resolve): Check whether the expression is of
16554         the correct type (CS0118) and whether the type derives from
16555         System.Exception (CS0155).
16556         (Catch.Resolve): New method.  Do the type lookup here and check
16557         whether it derives from System.Exception (CS0155).
16558         (Catch.CatchType, Catch.IsGeneral): New public properties.
16559
16560         * typemanager.cs (TypeManager.exception_type): Added.
16561
16562 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16563
16564         * driver.cs: Updated About function.
16565
16566 2002-07-31  Martin Baulig  <martin@gnome.org>
16567
16568         Implemented Control Flow Analysis.
16569
16570         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16571         (EmitContext.CurrentBranching): Added.
16572         (EmitContext.StartFlowBranching): Added.
16573         (EmitContext.EndFlowBranching): Added.
16574         (EmitContext.KillFlowBranching): Added.
16575         (EmitContext.IsVariableAssigned): Added.
16576         (EmitContext.SetVariableAssigned): Added.
16577         (EmitContext.IsParameterAssigned): Added.
16578         (EmitContext.SetParameterAssigned): Added.
16579         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16580         Added control flow analysis stuff here.
16581
16582         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16583         resolve the expression as lvalue.
16584         (LocalVariableReference.DoResolve): Check whether the variable has
16585         already been assigned.
16586         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16587         the parameter as assigned here.
16588         (ParameterReference.DoResolve): Check whether the parameter has already
16589         been assigned.
16590         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16591         expression as lvalue.
16592
16593         * statement.cs (FlowBranching): New class for the flow analysis code.
16594         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16595         (LabeledStatement.IsDefined): New public property.
16596         (LabeledStatement.AddUsageVector): New public method to tell flow
16597         analyis that the label may be reached via a forward jump.
16598         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16599         flow analysis.
16600         (VariableInfo.Number): New public field.  This is used by flow analysis
16601         to number all locals of a block.
16602         (Block.CountVariables): New public property.  This is the number of
16603         local variables in this block (including the locals from all parent
16604         blocks).
16605         (Block.EmitMeta): Number all the variables.
16606
16607         * statement.cs: Added flow analysis support to all classes.
16608
16609 2002-07-31  Martin Baulig  <martin@gnome.org>
16610
16611         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16612         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16613         then use this argument.
16614
16615         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16616
16617         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16618         use this to specify /define options.
16619
16620 2002-07-29  Martin Baulig  <martin@gnome.org>
16621
16622         * statement.cs (Fixed): Moved all code that does variable lookups
16623         and resolvings from Emit to Resolve.
16624
16625         * statement.cs (For): Moved all code that does variable lookups
16626         and resolvings from Emit to Resolve.
16627
16628         * statement.cs (Using): Moved all code that does variable lookups
16629         and resolvings from Emit to Resolve.
16630
16631 2002-07-29  Martin Baulig  <martin@gnome.org>
16632
16633         * attribute.cs (Attribute.Resolve): Explicitly catch a
16634         System.NullReferenceException when creating the
16635         CustromAttributeBuilder and report a different warning message.
16636
16637 2002-07-29  Martin Baulig  <martin@gnome.org>
16638
16639         * support.cs (ParameterData.ParameterName): Added method to
16640         get the name of a parameter.
16641
16642         * typemanager.cs (TypeManager.IsValueType): New public method.
16643
16644 2002-07-29  Martin Baulig  <martin@gnome.org>
16645
16646         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16647         is a flag which specifies that it's either ref or out.
16648         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16649         the out parameter to `out Parameter.Modifier mod', also set the
16650         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16651
16652         * support.cs (InternalParameters.ParameterModifier): Distinguish
16653         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16654         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16655
16656         * expression.cs (Argument.GetParameterModifier): Distinguish
16657         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16658         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16659
16660 2002-07-29  Martin Baulig  <martin@gnome.org>
16661
16662         * expression.cs (ParameterReference.ParameterReference): Added
16663         `Location loc' argument to the constructor.
16664
16665         * cs-parser.jay: Pass location to ParameterReference.
16666
16667 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * statement.cs (Try): Initialize the location.
16670
16671         * cs-parser.jay: pass location to Try.
16672
16673         * expression.cs (Unary.Reduce): Change the prototype to return
16674         whether a constant fold could be performed or not.  The result is
16675         returned in an out parameters.  In the case of Indirection and
16676         AddressOf, we want to perform the full tests.
16677
16678 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16679
16680         * statement.cs (Statement.Emit): Flag dead code.
16681
16682 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16683
16684         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16685
16686 2002-07-27  Martin Baulig  <martin@gnome.org>
16687
16688         * class.cs (MethodData.Define): Put back call to
16689         TypeManager.AddMethod(), accidentally commented this out.
16690
16691         * report.cs (Debug): New public method to print debugging information,
16692         this is `[Conditional ("DEBUG")]'.
16693
16694 2002-07-26  Martin Baulig  <martin@gnome.org>
16695
16696         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16697         (switch_statement): Push the current_block to the switch_stack and
16698         pop it again when we're done with the switch.
16699         (switch_section): The new block is a child of the current_block.
16700         Fixes bug #24007, added test-152.cs.
16701
16702 2002-07-27  Martin Baulig  <martin@gnome.org>
16703
16704         * expression.cs (Invocation.EmitArguments): When calling a varargs
16705         function with only its fixed arguments, we need to pass an empty
16706         array.
16707
16708 2002-07-27  Martin Baulig  <martin@gnome.org>
16709
16710         Mono 0.13 has been released.
16711
16712 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16713
16714         * driver.cs: Rename --resource to --linkres, because that is what
16715         we do currently, we dont support --resource yet.
16716
16717         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16718
16719 2002-07-25  Martin Baulig  <martin@gnome.org>
16720
16721         * class.cs (MethodData): New public class.  This is a `method builder'
16722         class for a method or one accessor of a Property/Indexer/Event.
16723         (MethodData.GetMethodFlags): Moved here from MemberBase.
16724         (MethodData.ApplyAttributes): Likewise.
16725         (MethodData.ApplyObsoleteAttribute): Likewise.
16726         (MethodData.ApplyConditionalAttribute): Likewise.
16727         (MethodData.ApplyDllImportAttribute): Likewise.
16728         (MethodData.CheckAbstractAndExternal): Likewise.
16729         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16730         (MethodData.Emit): Formerly known as Method.Emit().
16731         (MemberBase): Moved everything which was specific to a single
16732         accessor/method to MethodData.
16733         (Method): Create a new MethodData and call Define() and Emit() on it.
16734         (Property, Indexer, Event): Create a new MethodData objects for each
16735         accessor and call Define() and Emit() on them.
16736
16737 2002-07-25  Martin Baulig  <martin@gnome.org>
16738
16739         Made MethodCore derive from MemberBase to reuse the code from there.
16740         MemberBase now also checks for attributes.
16741
16742         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16743         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16744         as virtual.
16745         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16746         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16747         (MemberBase.ApplyAttributes): New virtual method; applies the
16748         attributes to a method or accessor.
16749         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16750         (MemberBase.ApplyConditionalAttribute): Likewise.
16751         (MemberBase.ApplyDllImportAttribute): Likewise.
16752         (MemberBase.CheckAbstractAndExternal): Likewise.
16753         (MethodCore.ParameterTypes): This is now a property instead of a
16754         method, it's initialized from DoDefineParameters().
16755         (MethodCore.ParameterInfo): Removed the set accessor.
16756         (MethodCore.DoDefineParameters): New protected virtual method to
16757         initialize ParameterTypes and ParameterInfo.
16758         (Method.GetReturnType): We can now simply return the MemberType.
16759         (Method.GetMethodFlags): Override the MemberBase version and add
16760         the conditional flags.
16761         (Method.CheckBase): Moved some code from Define() here, call
16762         DoDefineParameters() here.
16763         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16764         here to avoid some larger code duplication.
16765         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16766         ensure that abstract and external accessors don't declare a body.
16767
16768         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16769         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16770         lookup in the attribute's parent classes, so we need to abort as soon
16771         as we found the first match.
16772         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16773         the attribute has no arguments.
16774
16775         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16776         of a Method.
16777
16778 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16779
16780         * cs-parser.jay: reverted previous patch.
16781
16782 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16783
16784         * cs-parser.jay: fixed bug #22119.
16785
16786 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16787
16788         * attribute.cs: fixed compilation. The error was:
16789         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16790         be assigned to before control leaves the current method."
16791         [FIXME:  Filed as bug #28186: MCS must report this error.]
16792
16793 2002-07-25  Martin Baulig  <martin@gnome.org>
16794
16795         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16796         method to pull the condition name ouf of a Conditional attribute.
16797         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16798         the obsolete message and error flag out of an Obsolete attribute.
16799
16800         * class.cs (Method.GetMethodFlags): New public method to get the
16801         TypeManager.MethodFlags for this method.
16802         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16803         private methods.
16804         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16805         if we're overriding a virtual function, set the new private variable
16806         `parent_method'; call the new TypeManager.AddMethod().
16807
16808         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16809         the MethodBuilder and the Method in a PtrHashtable.
16810         (TypeManager.builder_to_method): Added for this purpose.
16811         (TypeManager.MethodFlags): Added IsObsoleteError.
16812         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16813         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16814         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16815         the message from the attribute.
16816
16817 2002-07-24  Martin Baulig  <martin@gnome.org>
16818
16819         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16820         preprocessor directives, ensure that the argument to #define/#undef is
16821         exactly one identifier and that it's actually an identifier.
16822
16823         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16824         did not work ....
16825
16826 2002-07-24  Martin Baulig  <martin@gnome.org>
16827
16828         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16829         initialize it to TypeManager.object_type in the constructor.
16830         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16831         of the `hm.get_current' method if we're using the collection pattern.
16832         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16833         for the explicit conversion to make it work when we're using the collection
16834         pattern and the `Current' property has a different return type than `object'.
16835         Fixes #27713.
16836
16837 2002-07-24  Martin Baulig  <martin@gnome.org>
16838
16839         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16840         does not match, but don't report any errors.  This method is called in
16841         order for all methods in a MethodGroupExpr until a matching method is
16842         found, so we don't want to bail out if the first method doesn't match.
16843         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16844         matches, report the 123.  Fixes #28070.
16845
16846 2002-07-24  Martin Baulig  <martin@gnome.org>
16847
16848         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16849         TypeManager.TypeToCoreType() to the top of the method so the
16850         following equality checks will work.  Fixes #28107.
16851
16852 2002-07-24  Martin Baulig  <martin@gnome.org>
16853
16854         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16855         operand is of type uint, and the other operand is of type sbyte,
16856         short or int, the operands are converted to type long." -
16857         Actually do what this comment already told us.  Fixes bug #28106,
16858         added test-150.cs.
16859
16860 2002-07-24  Martin Baulig  <martin@gnome.org>
16861
16862         * class.cs (MethodBase): New abstract class.  This is now a base
16863         class for Property, Indexer and Event to avoid some code duplication
16864         in their Define() and DefineMethods() methods.
16865         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16866         generic methods for Define() and DefineMethods().
16867         (FieldBase): Derive from MemberBase, not MemberCore.
16868         (Property): Derive from MemberBase, not MemberCore.
16869         (Property.DefineMethod): Moved all the code from this method to the
16870         new MethodBase.DefineAccessor(), just call it with appropriate
16871         argumetnts.
16872         (Property.Define): Call the new Property.DoDefine(), this does some
16873         sanity checks and we don't need to duplicate the code everywhere.
16874         (Event): Derive from MemberBase, not MemberCore.
16875         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16876         accessors, this will also make them work with interface events.
16877         (Indexer): Derive from MemberBase, not MemberCore.
16878         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16879         (Indexer.Define): Use the new MethodBase functions.
16880
16881         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16882         argument to the constructor.
16883         (Interface.FindMembers): Added support for interface events.
16884         (Interface.PopluateEvent): Implemented.
16885
16886         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16887
16888 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16889
16890         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16891         but this is required to check for a method name being the same as
16892         the containing class.  
16893
16894         Handle this now.
16895
16896 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16897
16898         * interface.cs: initialize variable.
16899
16900 2002-07-23  Martin Baulig  <martin@gnome.org>
16901
16902         Implemented the IndexerName attribute in interfaces.
16903
16904         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16905         name if this is an explicit interface implementation.
16906         (Indexer.InterfaceIndexerName): New public variable.  If we're
16907         implementing an interface indexer, this is the IndexerName in that
16908         interface.  Otherwise, it's the IndexerName.
16909         (Indexer.DefineMethod): If we're implementing interface indexer,
16910         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16911         and Pending.ImplementIndexer methods.
16912         (Indexer.Define): Also define the PropertyBuilder if we're
16913         implementing an interface indexer and this is neither an explicit
16914         interface implementation nor do the IndexerName match the one in
16915         the interface.
16916
16917         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16918         If a method is defined here, then we always need to create a proxy
16919         for it.  This is used when implementing interface indexers.
16920         (Pending.IsInterfaceIndexer): New public method.
16921         (Pending.ImplementIndexer): New public method.
16922         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16923         This is used when implementing interface indexers to define a proxy
16924         if necessary.
16925         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16926         define a proxy if necessary.
16927
16928         * interface.cs (Interface.IndexerName): New public variable.
16929         (Interface.PopulateIndexer): Set the IndexerName.
16930         (Interface.DefineIndexers): New private method.  Populate all the
16931         indexers and make sure their IndexerNames match.
16932
16933         * typemanager.cs (IndexerPropertyName): Added support for interface
16934         indexers.
16935
16936 2002-07-22  Martin Baulig  <martin@gnome.org>
16937
16938         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16939         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16940         ret if HasReturnLabel.
16941         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16942         variables.
16943
16944         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16945         and set the ec.LoopBeginTryCatchLevel.
16946         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16947         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16948         the current ec.TryCatchLevel, the branch goes out of an exception
16949         block.  In this case, we need to use Leave and not Br.
16950
16951 2002-07-22  Martin Baulig  <martin@gnome.org>
16952
16953         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16954         block unless the block does not always return or it is contained in
16955         another try { ... } catch { ... } block.  Fixes bug #26506.
16956         Added verify-1.cs to the test suite.
16957
16958 2002-07-22  Martin Baulig  <martin@gnome.org>
16959
16960         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16961         then we do not always return.  Fixes bug #24985.
16962
16963 2002-07-22  Martin Baulig  <martin@gnome.org>
16964
16965         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16966         lookup on a per-class level; ie. walk up the class hierarchy until we
16967         found at least one applicable method, then choose the best among them.
16968         Fixes bug #24463 and test-29.cs.
16969
16970 2002-07-22  Martin Baulig  <martin@gnome.org>
16971
16972         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16973         return types of the methods.  The return type is not part of the
16974         signature and we must not check it to make the `new' modifier work.
16975         Fixes bug #27999, also added test-147.cs.
16976         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16977
16978         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16979         on the method's return type.
16980
16981 2002-07-21  Martin Baulig  <martin@gnome.org>
16982
16983         * assign.cs: Make this work if the rightmost source is a constant and
16984         we need to do an implicit type conversion.  Also adding a few more tests
16985         to test-38.cs which should have caught this.
16986
16987         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16988         target in the makefile for this.  The makefile.gnu is primarily intended
16989         for end-users who don't want to debug the compiler.
16990
16991 2002-07-21  Martin Baulig  <martin@gnome.org>
16992
16993         * assign.cs: Improved the Assign class so it can now handle embedded
16994         assignments (X = Y = Z = something).  As a side-effect this'll now also
16995         consume less local variables.  test-38.cs now passes with MCS, added
16996         a few new test cases to that test.
16997
16998 2002-07-20  Martin Baulig  <martin@gnome.org>
16999
17000         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17001         instructions.  Fixes bug #27977, also added test-146.cs.
17002
17003 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17004
17005         * cs-tokenizer.cs: fixed getHex ().
17006
17007 2002-07-19  Martin Baulig  <martin@gnome.org>
17008
17009         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17010         not Type.GetType() to lookup the array type.  This is needed when
17011         we're constructing an array of a user-defined type.
17012         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17013         single-dimensional arrays, but also for single-dimensial arrays of
17014         type decimal.
17015
17016 2002-07-19  Martin Baulig  <martin@gnome.org>
17017
17018         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17019         this function is called, it's not allowed to share LocalBuilders
17020         among ILGenerators.
17021
17022 2002-07-19  Martin Baulig  <martin@gnome.org>
17023
17024         * expression.cs (Argument.Resolve): Report an error 118 when trying
17025         to pass a type as argument.
17026
17027 2002-07-18  Martin Baulig  <martin@gnome.org>
17028
17029         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17030         Conv_R_Un for the signed `long' type.
17031
17032 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17033
17034         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17035         `expr' for the temporary result, as that will fail if we do
17036         multiple resolves on the same expression.
17037
17038 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17039
17040         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17041         ec.TypeContainer for looking up aliases. 
17042
17043         * class.cs (TypeContainer): Remove LookupAlias from here.
17044
17045         * decl.cs (DeclSpace); Move here.
17046
17047 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17048
17049         * class.cs (FindMembers): Only call filter if the constructor
17050         bulider is not null.
17051
17052         Also handle delegates in `NestedTypes' now.  Now we will perform
17053         type lookups using the standard resolution process.  This also
17054         fixes a bug.
17055
17056         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17057         This uses Expressions (the limited kind that can be parsed by the
17058         tree) instead of strings.
17059
17060         * expression.cs (ComposedCast.ToString): Implement, used to flag
17061         errors since now we have to render expressions.
17062
17063         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17064         FormArrayType. 
17065
17066         * ecore.cs (SimpleName.ToString): ditto.
17067
17068         * cs-parser.jay: Instead of using strings to assemble types, use
17069         Expressions to assemble the type (using SimpleName, ComposedCast,
17070         MemberAccess).  This should fix the type lookups in declarations,
17071         because we were using a different code path for this.
17072
17073         * statement.cs (Block.Resolve): Continue processing statements
17074         even when there is an error.
17075
17076 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17077
17078         * class.cs (Event.Define): Also remove the `remove' method from
17079         the list of pending items.
17080
17081         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17082         generate more compact code. 
17083
17084 2002-07-17  Martin Baulig  <martin@gnome.org>
17085
17086         * const.cs (Const.LookupConstantValue): Add support for constant
17087         `unchecked' and `checked' expressions.
17088         Also adding test case test-140.cs for this.
17089
17090 2002-07-17  Martin Baulig  <martin@gnome.org>
17091
17092         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17093         check whether mi.ReturnType implements the IEnumerator interface; the
17094         `==' and the IsAssignableFrom() will fail in this situation.
17095
17096 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17097
17098         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17099         here too.
17100
17101 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17102
17103         * expression.cs: fixed bug #27811.
17104
17105 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17106
17107         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17108         Molaro: when we are a ref, the value already contains a pointer
17109         value, do not take the address of it.
17110
17111 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17112         * removed mb-parser.jay and mb-tokenizer.cs
17113
17114 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17115
17116         * expression.cs: check against the building corlib void type.
17117
17118 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17119
17120         * ecore.cs: fix for valuetype static readonly fields: when 
17121         initializing them, we need their address, not the address of a copy.
17122
17123 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17124
17125         * typemanager.cs: register also enum_type in corlib.
17126
17127 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17128
17129         * class.cs: allow calling this (but not base) initializers in structs.
17130
17131 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17132
17133         * ecore.cs: make sure we compare against the building base types
17134         in GetTypeSize ().
17135
17136 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17137
17138         * typemanager.cs: fix TypeToCoreType() to handle void and object
17139         (corlib gets no more typerefs after this change).
17140
17141 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17142
17143         * expression.cs (ArrayCreation.EmitArrayArguments): use
17144         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17145
17146         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17147         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17148         array indexes, the runtime actually forbids them.
17149
17150         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17151         for array arguments here.
17152
17153         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17154         instead of the default for ValueTypes.
17155
17156         (New.DoEmit): Use IsValueType instead of
17157         IsSubclassOf (value_type)
17158         (New.DoResolve): ditto.
17159         (Invocation.EmitCall): ditto.
17160
17161         * assign.cs (Assign): ditto.
17162
17163         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17164         Statements *are* currently doing part of their resolution during
17165         Emit.  
17166
17167         Expressions do always resolve during resolve, but statements are
17168         only required to propagate resolution to their children.
17169
17170 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17171
17172         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17173
17174         (LoadAssembly): Do not add the dll if it is already specified
17175
17176         (MainDriver): Add the System directory to the link path at the end,
17177         after all the other -L arguments. 
17178
17179         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17180         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17181         ldelem.u1) and using the opposite for sbytes.
17182
17183         This fixes Digger, and we can finally run it.
17184
17185         * driver.cs (UnixParseOption): Move the option parsing here.  
17186         (CSCParseOption): Implement CSC-like parsing of options.
17187
17188         We now support both modes of operation, the old Unix way, and the
17189         new CSC-like way.  This should help those who wanted to make cross
17190         platform makefiles.
17191
17192         The only thing broken is that /r:, /reference: and /lib: are not
17193         implemented, because I want to make those have the same semantics
17194         as the CSC compiler has, and kill once and for all the confussion
17195         around this.   Will be doing this tomorrow.
17196
17197         * statement.cs (Unsafe.Resolve): The state is checked during
17198         resolve, not emit, so we have to set the flags for IsUnsfe here.
17199
17200 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17201
17202         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17203         not catch the Error_ObjectRefRequired in SimpleName (as it is
17204         possible to have a class/instance variable name that later gets
17205         deambiguated), we have to check this here.      
17206
17207 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17208
17209         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17210         make static and put into Expression.
17211
17212         (Event.Define): Register the private field of the event with the 
17213         TypeManager so that GetFieldFromEvent can get at it.
17214
17215         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17216         keep track of the private field associated with an event which
17217         has no accessors.
17218
17219         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17220         private field.
17221
17222         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17223
17224 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17225
17226         * expression.cs (Binary.EmitBranchable): this routine emits the
17227         Binary expression in a branchable context.  This basically means:
17228         we need to branch somewhere, not just get the value on the stack.
17229
17230         This works together with Statement.EmitBoolExpression.
17231
17232         * statement.cs (Statement.EmitBoolExpression): Use
17233         EmitBranchable. 
17234
17235 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17236
17237         * statement.cs (For): Reduce the number of jumps in loops.
17238
17239         (For): Implement loop inversion for the For statement.
17240
17241         (Break): We can be breaking out of a Try/Catch controlled section
17242         (foreach might have an implicit try/catch clause), so we need to
17243         use Leave instead of Br.
17244
17245         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17246         now).  If the instace expression supports IMemoryLocation, we use
17247         the AddressOf method from the IMemoryLocation to extract the
17248         address instead of emitting the instance.
17249
17250         This showed up with `This', as we were emitting the instance
17251         always (Emit) instead of the Address of This.  Particularly
17252         interesting when This is a value type, as we dont want the Emit
17253         effect (which was to load the object).
17254
17255 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17256
17257         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17258
17259         * statement.cs (Checked): Set the CheckedState during the resolve
17260         process too, as the ConvCast operations track the checked state on
17261         the resolve process, and not emit.
17262
17263         * cs-parser.jay (namespace_member_declaration): Flag that we have
17264         found a declaration when we do.  This is used to flag error 1529
17265
17266         * driver.cs: Report ok when we display the help only.
17267
17268 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17269
17270         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17271
17272 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17273
17274         * cs-tokenizer.cs (define): We also have to track locally the
17275         defines.  AllDefines is just used for the Conditional Attribute,
17276         but we also need the local defines for the current source code. 
17277
17278 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17279
17280         * statement.cs (While, For, Do): These loops can exit through a
17281         Break statement, use this information to tell whether the
17282         statement is the last piece of code.
17283
17284         (Break): Flag that we break.
17285
17286         * codegen.cs (EmitContexts): New `Breaks' state variable.
17287
17288 2002-07-03  Martin Baulig  <martin@gnome.org>
17289
17290         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17291         modifiers in method declarations in structs.  Otherwise, you won't
17292         be able to override things like Object.Equals().
17293
17294 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17295
17296         * class.cs (Method, Property, Indexer): Do not allow the public
17297         modifier to be used in explicit interface implementations.
17298
17299         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17300         override modifiers in method declarations in structs
17301
17302 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17303
17304         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17305         integer or real overflow, report an error
17306
17307 2002-07-02  Martin Baulig  <martin@gnome.org>
17308
17309         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17310         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17311         to tell the runtime about our newly created System.Object and
17312         System.ValueType types.
17313
17314 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17315
17316         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17317         struct instead of Ldarg/Starg.
17318
17319 2002-07-02  Martin Baulig  <martin@gnome.org>
17320
17321         * expression.cs (Indirection.Indirection): Call
17322         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17323
17324 2002-07-02  Martin Baulig  <martin@gnome.org>
17325
17326         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17327         ValueType, call TypeManager.TypeToCoreType() on it.
17328         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17329         the OpCodes.Newarr argument.
17330
17331 2002-07-02  Martin Baulig  <martin@gnome.org>
17332
17333         * expression.cs (Invocation.EmitCall): When compiling corlib,
17334         replace all calls to the system's System.Array type to calls to
17335         the newly created one.
17336
17337         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17338         System.Array methods.
17339         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17340         from the system's System.Array type which must be replaced.
17341
17342 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17343
17344         * typemanager.cs: load unverifiable_code_ctor so we can build
17345         corlib using the correct type. Avoid using GetTypeCode() with
17346         TypeBuilders.
17347         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17348         TypeManager.object_type to allow building corlib.
17349
17350 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17351
17352         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17353
17354 2002-07-01  Martin Baulig  <martin@gnome.org>
17355
17356         * class.cs: Make the last change actually work, we need to check
17357         whether `ifaces != null' to avoid a crash.
17358
17359 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17360
17361         * class.cs: when we build structs without fields that implement
17362         interfaces, we need to add the interfaces separately, since there is
17363         no API to both set the size and add the interfaces at type creation
17364         time.
17365
17366 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17367
17368         * expression.cs: the dimension arguments to the array constructors
17369         need to be converted if they are a long.
17370
17371 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17372
17373         * class.cs: don't emit ldarg.0 if there is no parent constructor
17374         (fixes showstopper for corlib).
17375
17376 2002-06-29  Martin Baulig  <martin@gnome.org>
17377
17378         MCS now compiles corlib on GNU/Linux :-)
17379
17380         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17381         ie. check for MethodImplOptions.InternalCall.
17382
17383         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17384         and TypeManager.attribute_type are null, so we must explicitly check
17385         whether parent is not null to find out whether it's an attribute type.
17386         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17387         and SetBuilder, not only if the property is neither abstract nor external.
17388         This is necessary to set the MethodImplOptions on the accessor methods.
17389         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17390         SetBuilder, see Property.Emit().
17391
17392         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17393         populate "System.Object", "System.ValueType" and "System.Attribute" since
17394         they've already been populated from BootCorlib_PopulateCoreTypes().
17395
17396 2002-06-29  Martin Baulig  <martin@gnome.org>
17397
17398         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17399         is the NullLiteral, we also need to make sure that target_type is not
17400         an enum type.   
17401
17402 2002-06-29  Martin Baulig  <martin@gnome.org>
17403
17404         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17405         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17406         before calling BootstrapCorlib_ResolveDelegate ().
17407
17408 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17409
17410         * statement.cs: fixed build-breaker. All tests passed ok.
17411
17412 2002-06-27  Martin Baulig  <martin@gnome.org>
17413
17414         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17415         for System.Decimal when compiling corlib.
17416
17417 2002-06-27  Martin Baulig  <martin@gnome.org>
17418
17419         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17420         switch blocks which contain nothing but a default clause.
17421
17422 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17423
17424        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17425
17426 2002-06-27  Martin Baulig  <martin@gnome.org>
17427
17428         * ecore.cs (PropertyExpr.PropertyExpr): Call
17429         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17430
17431         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17432         is already a TypeBuilder.
17433
17434 2002-06-27  Martin Baulig  <martin@gnome.org>
17435
17436         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17437         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17438         the "from an array-type to System.Array" case.  This makes it work
17439         when compiling corlib.
17440
17441 2002-06-27  Martin Baulig  <martin@gnome.org>
17442
17443         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17444         non-static PropertyExpr, set its InstanceExpression.  This makes
17445         the `ICollection.Count' property work in System/Array.cs.
17446
17447 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17448
17449         * driver.cs: Made error handling more consistent.  Errors now
17450         tracked by Report class, so many methods which used to return int
17451         now return void.  Main() now prints success/failure and 
17452         errors/warnings message.
17453
17454         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17455         the magic number return values (123 and 124).  Now, if the
17456         expected error occurs, the compiler exits with success (exit value
17457         0).  If the compilation completes without seeing that particular
17458         error, the compiler exits with failure (exit value 1).  The
17459         makefile in mcs/errors has been changed to handle the new behaviour.
17460
17461         * report.cs: Made 'expected error' number a property and renamed
17462         it from 'Probe' to 'ExpectedError'.
17463
17464         * genericparser.cs: Removed error handling support, since it is
17465         now all done by Report class.
17466
17467         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17468         class, so parse() no longer returns an int.
17469
17470         * namespace.cs: Use Report.Error instead of GenericParser.error
17471
17472 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17473
17474         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17475         TypeContainer.AddOperator): At the front of the list put the
17476         explicit implementations, so they get resolved/defined first. 
17477
17478 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17479
17480         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17481         interface type is implemented by this TypeContainer.  Used during
17482         explicit interface implementation.
17483
17484         (Property.Define, Indexer.Define, Method.Define): Validate that
17485         the given interface in the explicit implementation is one of the
17486         base classes for the containing type.
17487
17488         Also if we are explicitly implementing an interface, but there is
17489         no match in the pending implementation table, report an error.
17490
17491         (Property.Define): Only define the property if we are
17492         not explicitly implementing a property from an interface.  Use the
17493         correct name also for those properties (the same CSC uses,
17494         although that is really not needed).
17495
17496         (Property.Emit): Do not emit attributes for explicitly implemented
17497         properties, as there is no TypeBuilder.
17498
17499         (Indexer.Emit): ditto.
17500
17501         Hiding then means that we do not really *implement* a pending
17502         implementation, which makes code fail.
17503
17504 2002-06-22  Martin Baulig  <martin@gnome.org>
17505
17506         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17507         the return value of Object.GetType().  [FIXME: we need to do this whenever
17508         we get a type back from the reflection library].
17509
17510 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17511
17512         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17513
17514 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17515
17516         * attribute.cs: Return null if we can not look up the type.
17517
17518         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17519         the interface types found.
17520
17521         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17522         interface types found.
17523
17524         * typemanager.cs (GetInterfaces): Make this routine returns alll
17525         the interfaces and work around the lame differences between
17526         System.Type and System.Reflection.Emit.TypeBuilder in the results
17527         result for GetInterfaces.
17528
17529         (ExpandInterfaces): Given an array of interface types, expand and
17530         eliminate repeated ocurrences of an interface.  This expands in
17531         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17532         be IA, IB, IC.
17533
17534 2002-06-21  Martin Baulig  <martin@gnome.org>
17535
17536         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17537         on System.Enum.
17538
17539 2002-06-21  Martin Baulig  <martin@gnome.org>
17540
17541         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17542         and called with one of the core types, return the corresponding typebuilder for
17543         that type.
17544
17545         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17546         element type.
17547
17548 2002-06-21  Martin Baulig  <martin@gnome.org>
17549
17550         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17551         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17552         (Expression.ConvertReferenceExplicit): Likewise.
17553
17554         * expression.cs (ElementAccess.DoResolve): Likewise.
17555         (ElementAccess.DoResolveLValue): Likewise.
17556
17557 2002-06-10  Martin Baulig  <martin@gnome.org>
17558
17559         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17560         add the "value" parameter to the parameter list.
17561
17562         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17563         to our caller.
17564
17565 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17566
17567         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17568         the argument to an int, uint, long or ulong, per the spec.  Also
17569         catch negative constants in array creation.
17570
17571 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17572
17573         * class.cs: do not allow the same interface to appear twice in
17574         the definition list.
17575
17576 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17577
17578         * ecore.cs: don't use ldlen with System.Array.
17579
17580 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17581
17582         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17583
17584 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17585
17586         * modifiers.cs: produce correct field attributes for protected
17587         internal. Easy fix so miguel can work on ther harder stuff:-)
17588
17589 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17590
17591         * pending.cs: New file.  Move the code from class.cs here.
17592         Support clearning the pending flag for all methods (when not doing
17593         explicit interface implementation).
17594
17595 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17596
17597         * rootcontext.cs: added a couple more types needed to bootstrap.
17598
17599 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17600
17601         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17602         constructor in the type, instead of any constructor in the type
17603         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17604         a bug in the Mono runtime when applying the params attribute). 
17605
17606 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17607         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17608
17609 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17610
17611         * expression.cs (Unary.ResolveOperator): Use TypeManager
17612         to resolve the type.
17613
17614 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17615
17616         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17617         attached.
17618
17619         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17620         with each member too.
17621
17622         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17623         field builders too - this takes care of the enum member case.
17624
17625 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17626
17627         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17628         address-of operator on both value types and pointers.
17629
17630 2002-06-10  Martin Baulig  <martin@gnome.org>
17631
17632         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17633         PropertyBuilder to the `property_builders' list.
17634
17635         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17636         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17637         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17638         find any indexers which are inherited from an interface.
17639
17640 2002-06-09  Martin Baulig  <martin@gnome.org>
17641
17642         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17643         the same type as the constant if necessary.  There's also a test-130.cs
17644         for this.
17645
17646         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17647
17648         * typemanager.cs (TypeManager.ChangeType): Previously known as
17649         Enum.ChangeEnumType().
17650
17651 2002-06-09  Martin Baulig  <martin@gnome.org>
17652
17653         * expression.cs (Cast.TryReduce): Added support for consts.
17654
17655 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17656
17657         * class.cs (Accessor): Hold attributes information so we can pass
17658         it along.
17659
17660         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17661         Modify to pass in attributes attached to the methods.
17662
17663         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17664
17665         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17666         to handle the Accessor kind :-)
17667
17668         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17669
17670 2002-06-08  Martin Baulig  <martin@gnome.org>
17671
17672         * expression.cs (Unary.TryReduceNegative): Added support for
17673         ULongConstants.
17674
17675 2002-06-08  Martin Baulig  <martin@gnome.org>
17676
17677         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17678         name can't be found in the `defined_names' - the caller will do a
17679         MemberLookup in this case and thus find methods in System.Enum
17680         such as Enum.IsDefined().
17681
17682 2002-06-08  Martin Baulig  <martin@gnome.org>
17683
17684         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17685         Convert.ChangeType() which works with TypeBuilder created types.
17686         (Enum.LookupEnumValue, Enum.Define): Use it here.
17687
17688         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17689         `TypeBuilder.BaseType != null' check.
17690         (TypeContainer.FindMembers): Only lookup parent members if we
17691         actually have a parent.
17692         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17693         (ConstructorInitializer.Resolve): Likewise.
17694
17695         * interface.cs (Interface.FindMembers): Added
17696         `TypeBuilder.BaseType != null' check.
17697
17698         * rootcontext.cs (RootContext.ResolveCore): Added
17699         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17700         classes_second_stage.
17701
17702         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17703         debug_type and trace_type when compiling with --nostdlib.       
17704
17705 2002-06-07  Martin Baulig  <martin@gnome.org>
17706
17707         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17708         (AddField): Set it to true when adding a non-static field.
17709         (DefineType): Use `have_nonstatic_fields' to find out whether we
17710         have non-static fields, not `Fields != null'.
17711
17712 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17713
17714         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17715         dereferencing a null on the static-field code path)
17716
17717 2002-05-30  Martin Baulig  <martin@gnome.org>
17718
17719         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17720         to take command line arguments.  Use reflection to call the new
17721         custom `Initialize' function on the symbol writer and pass it the
17722         command line arguments.
17723
17724         * driver.cs (--debug-args): New command line argument to pass command
17725         line arguments to the symbol writer.
17726
17727 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17728
17729         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17730         the target type for indexers and properties.  Thanks to Joe for
17731         catching this.
17732
17733 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17734
17735         * typemanager.cs (MethodFlags): returns the method flags
17736         (Obsolete/ShouldIgnore) that control warning emission and whether
17737         the invocation should be made, or ignored. 
17738
17739         * expression.cs (Invocation.Emit): Remove previous hack, we should
17740         not do this on matching a base type, we should do this based on an attribute
17741
17742         Only emit calls to System.Diagnostics.Debug and
17743         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17744         on the command line.
17745
17746         * rootcontext.cs: Global settings for tracing and debugging.
17747
17748         * cs-tokenizer.cs (define): New utility function to track
17749         defines.   Set the global settings for TRACE and DEBUG if found.
17750
17751 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17752
17753         * interface.cs (Populate*): Pass in the TypeContainer as well as
17754         the DeclSpace as parameters so that we can create EmitContexts and
17755         then use that to apply attributes etc.
17756
17757         (PopulateMethod, PopulateEvent, PopulateProperty)
17758         (PopulateIndexer): Apply attributes everywhere.
17759
17760         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17761         etc.
17762
17763         (ApplyAttributes): Update accordingly.
17764
17765         We now apply interface attributes for all members too.
17766
17767 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17768
17769         * class.cs (Indexer.Define); Correctly check if we are explicit
17770         implementation (instead of checking the Name for a ".", we
17771         directly look up if the InterfaceType was specified).
17772
17773         Delay the creation of the PropertyBuilder.
17774
17775         Only create the PropertyBuilder if we are not an explicit
17776         interface implementation.   This means that explicit interface
17777         implementation members do not participate in regular function
17778         lookups, and hence fixes another major ambiguity problem in
17779         overload resolution (that was the visible effect).
17780
17781         (DefineMethod): Return whether we are doing an interface
17782         implementation. 
17783
17784         * typemanager.cs: Temporary hack until we get attributes in
17785         interfaces (Ravi is working on that) and we get IndexerName
17786         support in interfaces.
17787
17788         * interface.cs: Register the indexers as properties.
17789
17790         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17791         warning, I have verified that this is a bug in the .NET runtime
17792         (JavaScript suffers of the same problem).
17793
17794         * typemanager.cs (MemberLookup): When looking up members for
17795         interfaces, the parent of an interface is the implicit
17796         System.Object (so we succeed in searches of Object methods in an
17797         interface method invocation.  Example:  IEnumerable x;  x.ToString
17798         ()) 
17799
17800 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * class.cs (Event): Events should also register if they do
17803         implement the methods that an interface requires.
17804
17805         * typemanager.cs (MemberLookup); use the new GetInterfaces
17806         method. 
17807
17808         (GetInterfaces): The code used to lookup interfaces for a type is
17809         used in more than one place, factor it here. 
17810
17811         * driver.cs: Track the errors at the bottom of the file, we kept
17812         on going.
17813
17814         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17815         instance if the method we are calling is static!
17816
17817 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17818
17819         * attribute.cs (ApplyAttributes): Make this function filter out
17820         the IndexerName attribute (as that attribute in reality is never
17821         applied) and return the string constant for the IndexerName
17822         attribute. 
17823
17824         * class.cs (TypeContainer.Emit): Validate that all the indexers
17825         have the same IndexerName attribute, and if so, set the
17826         DefaultName attribute on the class. 
17827
17828         * typemanager.cs: The return value might contain other stuff (not
17829         only methods).  For instance, consider a method with an "Item"
17830         property and an Item method.
17831
17832         * class.cs: If there is a problem with the parameter types,
17833         return. 
17834
17835 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17836
17837         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17838         looks at user defined conversion after making a call to 
17839         StandardConversionExists - we need this for overload resolution.
17840
17841         * expression.cs : Update accordingly the various method calls.
17842
17843         This fixes 2 bugs filed against implicit user defined conversions 
17844
17845 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17846
17847         * statement.cs: Track the result of the assignment.
17848
17849 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17850
17851         * expression.cs (MemberAccess): Improved error reporting for
17852         inaccessible members.
17853
17854 2002-05-22  Martin Baulig  <martin@gnome.org>
17855
17856         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17857         itself with debugging support.
17858
17859 2002-05-22  Martin Baulig  <martin@gnome.org>
17860
17861         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17862         Removed, this isn't needed anymore.
17863
17864 2002-05-20  Martin Baulig  <martin@gnome.org>
17865
17866         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17867         be underlying type for an enum.
17868
17869 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17870
17871         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17872         that splits out the loading of just the core types.
17873
17874         * rootcontext.cs (ResolveCore): Split the struct resolution in
17875         two, so we can load the enumeration underlying types before any
17876         enums are used.
17877
17878         * expression.cs (Is): Bandaid until we fix properly Switch (see
17879         bug #24985 for details).
17880
17881         * typemanager.cs (ImplementsInterface): The hashtable will contain
17882         a null if there are no interfaces implemented.
17883
17884 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17885
17886         * cs-parser.jay (indexer_declarator): It is fine to have array
17887         parameters
17888
17889 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17890
17891         * typemanager.cs: (RegisterBuilder): New function used to register
17892         TypeBuilders that implement interfaces.  Since
17893         TypeBuilder.GetInterfaces (as usual) does not work with lame
17894         Reflection.Emit. 
17895         (AddUserType): register interfaces.
17896
17897         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17898         dealing with TypeBuilder.  Also, arrays are showing up as
17899         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17900         methods can not be invoked on them!
17901
17902         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17903         (ImplicitReferenceConversionExists): Split out from
17904         StandardConversionExists. 
17905
17906         * expression.cs (As): We were only implementing one of the three
17907         cases for the as operator.  We now implement them all.
17908         (Is): Implement the various other cases for Is as well.
17909
17910         * typemanager.cs (CACHE): New define used to control if we want or
17911         not the FindMembers cache.  Seems to have a negative impact on
17912         performance currently
17913
17914         (MemberLookup): Nested types have full acess to
17915         enclosing type members
17916
17917         Remove code that coped with instance/static returns for events, we
17918         now catch this in RealFindMembers.
17919
17920         (RealFindMembers): only perform static lookup if the instance
17921         lookup did not return a type or an event.  
17922
17923 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17924
17925         * assign.cs (CompoundAssign): We pass more semantic information
17926         now to Compound Assignments than we did before: now we have all
17927         the information at hand, and now we resolve the target *before* we
17928         do the expression expansion, which allows the "CacheValue" method
17929         to have the effect we intended (before, a [x] += 1 would generate
17930         two differen ArrayAccess expressions from the ElementAccess,
17931         during the resolution process).
17932
17933         (CompoundAssign.DoResolve): Resolve target and original_source here.
17934
17935 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17936
17937         * expression.cs (ArrayAccess): dropped debugging information. 
17938
17939         * typemanager.cs: Small bug fix: I was always returning i_members,
17940         instead of one of i_members or s_members (depending on which had
17941         the content).
17942
17943         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17944         method is invoked before any code generation takes place, and it
17945         is a mechanism to inform that the expression will be invoked more
17946         than once, and that the method should use temporary values to
17947         avoid having side effects
17948
17949         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17950
17951         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17952         implementation.
17953
17954         * expression.cs (Indirection, ArrayAccess): Add support for
17955         CacheTemporaries in these two bad boys. 
17956
17957         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17958         ldobj or ldind_ref.  
17959         (StoreFromPtr): Handle stobj as well.
17960
17961         * expression.cs (UnaryMutator): Share more code.
17962
17963         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17964         down: I was not tracking the Filter function as well, which
17965         was affecting the results of the cache.
17966
17967 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17968
17969         * attribute.cs: Remove the hack to handle the CharSet property on
17970         StructLayouts. 
17971
17972 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17973
17974         * attribute.cs (DoResolve): More uglyness, we now only try to
17975         resolve the attribute partially, to extract the CharSet
17976         information (only if we are a StructLayout attribute).  Otherwise 
17977
17978         (GetExtraTypeInfo): Add some code to conditionally kill in the
17979         future this.   I am more and more convinced that the .NET
17980         framework has special code to handle the attribute setting on
17981         certain elements.
17982
17983         * expression.cs (IsParamsMethodApplicable): Revert my previous
17984         foreach change here, it was wrong.
17985
17986 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17987
17988         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17989         (pp_expr): do not abort on unknown input, just return.
17990         (eval): abort if there are pending chars.
17991
17992         * attribute.cs (Attribute.Resolve): Positional parameters are
17993         optional.  Deal with that case.
17994
17995         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17996         the Ansi/Unicode/Auto information for the type.
17997
17998         (TypeContainer.DefineType): instantiate the EmitContext here, as
17999         we will be using it during the type definition (to resolve
18000         attributes) and during the emit phase.
18001
18002         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18003         to pull type information out of the attributes
18004
18005         (Attribute.Resolve): track the constructor builder, and allow for
18006         multiple invocations (structs and classes will use this).
18007
18008         * ecore.cs (MemberLookupFinal): new version with all the
18009         parameters customizable.
18010
18011         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18012         constructors.  Return if the result value is null (as the error
18013         would have been flagged already by MemberLookupFinal)
18014
18015         Do not allow instances of abstract classes or interfaces to be
18016         created.
18017
18018         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18019         We have to compare the assembly property here when dealing with
18020         FamANDAssem and Assembly access modifiers, because we might be
18021         creating an assembly from *modules* (that means that we are not
18022         getting TypeBuilders for types defined in other modules that are
18023         part of this assembly).
18024
18025         (Method.Emit): If the method is marked abstract and has a body,
18026         emit an error. 
18027
18028         (TypeContainer.DefineMembers): If both the defined member and the
18029         parent name match are methods, then do not emit any warnings: let
18030         the Method.Define routine take care of flagging warnings.  But if
18031         there is a mismatch (method overrides something else, or method is
18032         overriwritten by something, then emit warning).
18033
18034         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18035         set to null, this means `do not check for the return type on the
18036         signature'. 
18037
18038         (Method.Define): set the return type for the method signature to
18039         null, so that we get methods with the same name and parameters and
18040         different return types.  This is used to flag warning 114 (you are
18041         hiding a method, and you probably want to use the new/override
18042         keywords instead).
18043
18044         * typemanager.cs (MemberLookup): Implemented proper access
18045         control, closing a long standing set of bug reports.  The problem
18046         was that the Framework only has two bits: Public and NonPublic,
18047         and NonPublic includes private and protected methods, but we need
18048         to enforce the FamANDAssem, FamOrAssem and Family. 
18049
18050 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18051
18052         * statement.cs (GotoCase): Return true: Ammounts to giving up
18053         knowledge on whether we return or not, and letting the other case
18054         be responsible for it.
18055
18056 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18057
18058         * driver.cs: Do not load directories for each file processed, only
18059         do it if there is a pattern.
18060
18061         * ecore.cs: Report readonly assigns here as well, as we might have
18062         been resolved only by MemberAccess.
18063
18064         (SimpleName.SimpleNameResolve): Also be useful for LValue
18065         resolution.   We need this to propagate assign to local readonly variables
18066
18067         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18068         do not want to reuse potential criteria memory.
18069
18070         * class.cs (MyEventBuilder): Set reflected_type;
18071
18072         * ecore.cs (Constantify): Added support for constifying bools.
18073
18074         (RootContext.LookupType): Added a cache for values looked up in
18075         the declaration space.
18076
18077         * typemanager.cs (FindMembers): Now is a front-end to
18078         RealFindMembers, and provides a two-level hashtable-based cache to
18079         the request.  
18080
18081         15% performance improvement: from 22.5 to 19.2 seconds.
18082
18083         * expression.cs (IsParamsMethodApplicable): use foreach.
18084         (Invocation.DoResolve): ditto.
18085         (New.DoResolve): ditto.
18086         (ArrayCreation.DoResolve): ditto.
18087
18088         * ecore.cs (FindMostEncompassingType): use foreach.
18089
18090         * delegate.cs (NewDelegate.DoResolve): Use foreach
18091
18092         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18093         (RemoveMethods): use foreach.
18094
18095         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18096         nested foreach statements instead of for, and also break out of
18097         the inner loop once a match is found.
18098
18099         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18100
18101 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18102
18103         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18104         we actually unwrap the expression to allow for extra information
18105         to be extracted. 
18106
18107         * expression.cs: Use Shr_Un on unsigned operations. 
18108
18109 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18110
18111         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18112         applicable operators was not being considered correctly. This closes
18113         the bug Miguel reported.
18114
18115 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18116
18117         * attribute.cs: check that the type derives from System.Attribute
18118         and report the correct error in that case (moved the duplicate code to
18119         its own method, too).
18120
18121 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18122
18123         * attribute.cs: lookup attribute type name as the spec says: first the
18124         bare attribute name and then name + "Attribute" (nant compiles with
18125         mcs after this fix).
18126
18127 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18128
18129         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18130         Because of the way we parse things, we should try to see if a
18131         UIntConstant can fit in an integer.
18132
18133 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18134
18135         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18136         when we are in an explicit context.
18137
18138         (ConvertReferenceExplicit): When converting from Iface type S to Class
18139         T make sure the rules are implemented as an OR.
18140
18141         * parameter.cs (ParameterType): Make it a property for now although the
18142         purpose really isn't anything immediate.
18143
18144         * expression.cs (Is*Applicable): Do better checking on the parameter type
18145         of a ref/out parameter. The ones from the system assemblies are already 
18146         marked with the correct type so we don't need to do any correction.
18147
18148         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18149         the object type is standard too so include that.
18150
18151 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18152
18153         * ecore.cs (StandardConversionExists): Augment with missing code:
18154         deal with IntConstant, LongConstants and Enumerations.
18155
18156         * assign.cs: Report the error, instead of failing silently
18157
18158         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18159         typecontainer that they are declared, because the
18160         typecontainer/namespace will have the list of using clauses that
18161         need to be applied.
18162
18163         Assembly Attributes were escaping the normal registration
18164         mechanism. 
18165
18166         (EmitCode): Apply attributes within an EmitContext that represents
18167         the container they were declared on.
18168
18169         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18170
18171 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18172
18173         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18174         Revamp completely - make much cleaner as we now operate only
18175         on a set of Types.
18176
18177         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18178         to implement the logic detailed in the spec more correctly.
18179
18180         (UserDefinedConversion): Update accordingly.
18181
18182 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18183
18184         * statement.cs: Return flow analysis information up.
18185
18186         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18187         and the default.
18188
18189         (token): Do not consume an extra character before calling
18190         decimal_digits.
18191
18192 2002-05-06  Piers Haken <piersh@friskit.com>
18193
18194         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18195
18196 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18197
18198         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18199         EmitContext during the instance constructor initializer
18200         resolution, to stop access to instance variables.
18201
18202         This is mandated by the spec, last paragraph of the `constructor
18203         initializers' section. 
18204
18205 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18206
18207         * cs-parser.jay, class.cs (Accessor): new class used to represent
18208         an accessor (get or set).  In the past we used `null' to represent
18209         a missing accessor.  But this is ambiguous because there was no
18210         way to tell in abstract indexers/properties if one of them was
18211         specified.
18212
18213         Now there is a way of addressing that.
18214
18215         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18216         instead of FindMembers.
18217
18218         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18219         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18220
18221         * attribute.cs: Treat indexers and properties as the same in terms
18222         of applying attributes
18223
18224         * ecore.cs (FindMostEncompassedType): Use statically initialized
18225         EmptyExpressions()s like we do elsewhere to avoid creating useless
18226         objects (and we take this out of the tight loop).
18227
18228         (GetConversionOperators): Move the code to extract the actual
18229         operators to a separate routine to clean things up.
18230
18231 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18232
18233         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18234         events are always registered FieldBuilders.
18235
18236         * class.cs (FieldBase): New class shared by Fields 
18237
18238         * delegate.cs: If we are a toplevel delegate, use our full name.
18239         If we are a nested delegate, then only use our tail name.
18240
18241 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18242
18243         * expression.cs (IsApplicable): Ensure that we add the "&" to
18244         ref/out types before comparing it with the type of the argument.
18245
18246         (IsParamsMethodApplicable): Ditto.
18247
18248         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18249         silly me ;-)
18250
18251         * delegate.cs : Handle the case when we have more than one applicable
18252         method. Flag an error only when we finish checking all.
18253
18254 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18255
18256         * expression.cs: Add support for boolean static initializers.
18257
18258 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18259
18260         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18261
18262         * parameter.cs (ComputeParameterTypes,
18263         ComputeAndDefineParameterTypes): Better error handling: now we
18264         clear the `types' cache if we fail during any of the type lookups.
18265         We also return the status code correctly to our caller
18266
18267         * delegate.cs: If we fail to define a delegate, abort the extra
18268         steps. 
18269
18270         * expression.cs (Binary.ResolveOperator): for
18271         operator==(object,object) and operator !=(object, object) we also
18272         have to verify that there is an implicit conversion from one to
18273         the other.
18274
18275         (ArrayAccess.DoResolve): Array Access can operate on
18276         non-variables. 
18277
18278 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18279
18280         * assign.cs (CompoundAssign): A new class used as a "flag" that
18281         the assignment actually is happening as part of a compound
18282         assignment operator.
18283
18284         During compound assignment, a few new rules exist to enable things
18285         like:
18286
18287         byte b |= 1 + 2
18288
18289         From the spec:
18290
18291         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18292         to the type of x) if y is implicitly convertible to the type of x,
18293         and the operator is a builtin operator and the return type of the
18294         operator is explicitly convertible to the type of x. 
18295
18296         * rootcontext.cs: Reset warning level to 2.  4 catches various
18297         "interesting" features in mcs, we must clean this up at some
18298         point, but currently am trying to kill other bugs ;-)
18299
18300         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18301         in container classes as well.  
18302
18303         * expression.cs (Binary.ResolveOperator): Handle string case
18304         before anything else (as operator overloading does emit an error
18305         before doing anything else).
18306
18307         This code could go away when we move to a table driven model, but
18308         i could not come up with a good plan last night.
18309
18310 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18311
18312         * typemanager.cs (CSharpName): reimplementation using regex.
18313         * class.cs: added null check for fields in Emit
18314         * rootcontext.cs: set warninglevel to 4
18315
18316 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18317
18318         * typemanager.cs (CSharpName): reimplemented with Lupus
18319         suggestion.
18320
18321 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18322
18323         * statement.cs (If): correclty implement Resolve, because we were
18324         not catching sem errors in there.  The same process is needed
18325         everywhere else. 
18326         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18327
18328
18329         (Statement.Warning_DeadCodeFound): Factorize code.
18330         (While): Report dead code here too.
18331
18332         (Statement): Added Resolve virtual method to allow
18333         for resolution split from the emit code.
18334
18335 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18336
18337         * statement.cs (EmitBoolExpression): No longer try to resolve the
18338         expression here.    
18339         (MakeBoolean): New utility function that resolve, implicitly
18340         converts to boolean and tags the expression. 
18341
18342
18343         (If, Do): Implement dead code elimination.
18344         (While): Implement loop inversion
18345
18346         (Do, While, For, If): Resolve the expression prior to calling our
18347         code generation.
18348
18349 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18350
18351         * class.cs:
18352           - added method Report28 (warning: program has more than one entry point)
18353           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18354           - modified method Method.Define, the part at the end of the method
18355
18356         * rootcontext.cs: added static public Location EntryPointLocation;
18357           
18358         * ../errors/cs0028.cs : Add test case for the above warning.              
18359
18360         * typemanager.cs:
18361           - modified method CSharpName to allow arrays of primitive type to
18362             be printed nicely (e.g. instead of System.Int32[][] it now prints
18363             int[][])
18364           - added method CSharpSignature: returns the signature of a method
18365             in string format to be used in reporting errors, warnings, etc.
18366
18367         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18368         with String.Empty.
18369
18370 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18371
18372         * delegate.cs (Define): Fix extremely silly bug where I was
18373         setting the type of the 'object' parameter of the BeginInvoke
18374         method to System.IAsyncResult instead of System.Object ;-)
18375
18376 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18377
18378         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18379         here. 
18380
18381         (Constructor.Emit): return if we fail to initialize the
18382         constructor.  Another door closed!  
18383
18384         * expression.cs (New.DoResolve): Improve error message (from -6 to
18385         1501).  Use DeclaredOnly lookup to find the exact constructor.
18386
18387         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18388         loop.  This is useful.
18389
18390         * cs-parser.jay: Adjust the default parameters so that destructors
18391         have the proper signature.
18392
18393 2002-04-26  Martin Baulig  <martin@gnome.org>
18394
18395         * driver.cs (LoadAssembly): If `assembly' contains any characters
18396         which are only valid in path names and not in assembly names
18397         (currently slash, backslash and point), use Assembly.LoadFrom ()
18398         instead of Assembly.Load () on the `assembly' (before iteration
18399         over the link_paths).
18400
18401 2002-04-26  Martin Baulig  <martin@gnome.org>
18402
18403         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18404
18405 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18406
18407         * class.cs (Property): use the new typemanager.MemberLookup
18408
18409         (TypeContainer.MemberLookup): Implement using the
18410         TypeManager.MemberLookup now. 
18411
18412         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18413         and return MemberInfos, so that these can be used without an
18414         EmitContext (what we had before).
18415
18416 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18417
18418         * expression.cs: Fix the case where the argument to params if the
18419         type of the params.  I omitted handling this before.   Fixed
18420
18421 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18422
18423         * driver.cs: Call BootCorlib_PopulateCoreType
18424
18425         * class.cs (Property.CheckBase): Check for properties only, not
18426         for all members. 
18427
18428         * interface.cs: Temporary hack: try/catch around the
18429         CustomAttributeBuilder, because I am getting an exception that I
18430         do not understand.
18431
18432         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18433         types whose definitions are required to be there (attributes are
18434         defined before standard types).
18435
18436         Compute definitions as we boot the various types, as they are used
18437         immediately (value_type class will need object_type, but if we do
18438         not initialize object_type, we will pass a null, which will let
18439         the runtime pick the System.Object from the existing corlib, which
18440         is not what we want).
18441
18442 2002-04-22  Patrik Torstensson <totte@labs2.com>
18443
18444         * cs-tokenizer.cs: fixed a number of trim() issues.
18445
18446 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18447
18448         * expression.cs (Argument.Type): Ensure that we return the correct
18449         type when we have out or ref parameters [in which case we 
18450         append a "&"].
18451
18452 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18453
18454         * class.cs (Property, Indexer): Allow extern modifier in there. 
18455
18456         * typemanager.cs (InitBaseTypes): Initializes object_type and
18457         value_type, since those will be used early on during the bootstrap
18458         process to compile corlib.
18459
18460         (InitCoreTypes): Move code from here to InitBaseTypes.
18461
18462 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18463
18464         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18465         single-dimension arrays as using the ldlen opcode.  
18466
18467         Daniel Lewis discovered this optimization.  
18468
18469         * typemanager.cs: Add signature for System.Array::get_Length
18470
18471 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18472
18473         * statement.cs: report the error when the foreach does not apply to an
18474         array nor a collection.
18475
18476 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18477
18478         * expression.cs: Add implicit conversions to the operator ~.
18479
18480         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18481
18482         * typemanager.cs: Locate the decimal constructor.
18483
18484 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18485
18486         * attribute.cs: use the new property of TypeOf.
18487         * expression.cs: added 'get' property around typearg.
18488
18489         These changes fix a build breaker reported by NickD. Is this the
18490         correct way to fix?  If not, please, revert my changes and make it
18491         work :-).
18492
18493 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18494
18495         * attribute.cs: Add support for typeof in attribute invocations.
18496         I am not sure that this is right though.
18497
18498 2002-04-14  Duncan Mak  <duncan@ximian.com>
18499
18500         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18501         Binary.Operator.Division case.
18502
18503 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18504
18505         * class.cs (DefineType): Ensure that we do a proper check on
18506         attribute types and also register it with the TypeManager.
18507
18508         (TypeContainer.Targets): The default for attribute types is
18509         AttributeTargets.All.
18510
18511         * attribute.cs (ApplyAttributes): Registering the attribute type
18512         is done elsewhere, not when we discover we have a Usage attribute.
18513
18514 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18515
18516         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18517         and get rid of is_delegate parameter.
18518
18519         * everywhere : update.
18520
18521 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18522
18523         * cs-parser.jay (compilation_unit): Revamp completely to use
18524         some new ideas that I got from Rhys' grammar to solve the problems
18525         with assembly level attributes.
18526
18527         (outer_declaration): New grammar production.
18528
18529         (attribute_sections): Add.
18530
18531         (opt_attributes): Base on attribute_sections
18532
18533         (namespace_declaration): Allow opt_attributes to tackle the case
18534         when we have assembly level attributes - we are clever in this
18535         regard now ;-)
18536
18537         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18538         attributes in the non-global context.
18539
18540         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18541         instead of SetGlobalAttributes.
18542
18543         * class.cs, rootcontext.cs : Ensure we define and generate 
18544         attribute types before anything else.
18545
18546         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18547         and flag the new error -20 for the case when the attribute type
18548         does not have valid targets specified. csc does not catch this.
18549
18550         * ../errors/errors.txt : update for error # -20
18551
18552 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18553
18554         * support.cs (InternalParameters.ParameterModifier): Do some null
18555         checking and return sane values.
18556
18557         * class.cs (Method.Define): If we are a PInvoke method, ensure
18558         that we are static and extern. Report error # 601
18559
18560         * ../errors/cs0601.cs : Add test case for the above error.
18561
18562 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18563
18564         * rootcontext.cs (attribute_types): We need to keep type of
18565         all attribute types separately and emit code for them first.
18566
18567         (RegisterAttribute) : Implement.
18568
18569         * class.cs (DefineType): Check if the current Type is a custom
18570         attribute type and register it accordingly.
18571
18572         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18573         adding the first attribute twice and rename to
18574
18575         (SetGlobalAttributes): this.
18576
18577         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18578         lookups.
18579
18580         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18581         if we are processing global arguments. Hmm, I am unsure of this.
18582
18583 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18584
18585         * expression.cs: added static array of strings to avoid calling
18586         Enum.ToString () for Operator in Binary. Significant recover of
18587         performance.
18588
18589 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18590
18591         * class.cs (FindMembers): Allow the Builders of the various
18592         members to be null.  If they are skip them.  This only happens
18593         during the PInvoke declaration.
18594
18595 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18596
18597         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18598         failure, so we do not keep going afterwards.
18599
18600         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18601         wanted to pass `false' as the `is_delegate' argument.  If this is
18602         the case, why not use delegate_type == null to mean `is_delegate =
18603         false' and anything else as is_delegate = true.
18604
18605 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18606
18607         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18608         code for the section, not the beginning of the tests.
18609
18610 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18611
18612         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18613
18614         * expression.cs (Binary): same.  Warn about errors where we have
18615         Enum/Enum in operator + as well.
18616
18617 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18618
18619         * statement.cs:
18620                 - added support for switch(bool)
18621                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18622                 - add TableSwitchEmit() to handle table-based switch statements
18623
18624 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18625
18626         * expression.cs (Invocation.OverloadResolve): Factor out code which
18627         does parameter compatibility checking with arguments so that we can 
18628         re-use the code even from Delegate.VerifyApplicability
18629
18630         (VerifyArgumentsCompat): Move above code here.
18631
18632         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18633         and instead make a call to the above method.
18634
18635 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18636
18637         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18638         We use it to keep track of classes which are attribute types.
18639
18640 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18641
18642         * delegate.cs (Delegate.Define): Correctly define the types in the
18643         presence of fixed and array parameters.
18644
18645         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18646         doing FindMembers.
18647
18648         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18649         include NonPublic after the first iteration.
18650
18651         * class.cs (Indexer.CheckBase): Only check if both parents are
18652         non-null. 
18653
18654         * cs-parser.jay (accessor_body): If empty, set to null.
18655
18656         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18657         same code path here to resolve constants names that we did have in
18658         MemberAccess.DoResolve.  There is too much code duplicated here.
18659
18660 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18661
18662         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18663
18664         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18665         to MakeUnionSet.
18666
18667         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18668         tokens, numbers and strings.
18669
18670         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18671         parenthesis.
18672
18673         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18674         asyncronous parameters and the regular parameters.  
18675
18676         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18677         specify the target directory.
18678
18679         * expression.cs: (This.DoResolve): Simplify
18680         (As.Emit): Optimize, do not generate IsInst if the expression is
18681         always of the given type.
18682
18683         (Is.DoResolve): Bug fix, we were reporting both always/never for
18684         the is expression.
18685
18686         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18687         creating too many unnecessary arrays.
18688
18689 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18690
18691         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18692         fields instead of rolling our own initializer.   Takes care of all
18693         implicit conversions, and drops unnecessary static checks/argument.
18694
18695 2002-03-31  Dick Porter  <dick@ximian.com>
18696
18697         * driver.cs: use the GetDirectories() return values properly, and
18698         use "/" as path separator.
18699
18700 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18701
18702         * expression.cs (Unary): Optimize - - expr into expr.
18703         (Binary): Optimize a + (-b) into a -b.
18704
18705         * codegen.cs (CodeGen): Made all methods static.
18706
18707 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * rootcontext.cs: 
18710
18711         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18712         TypeBuilder property.
18713
18714         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18715         instead. 
18716
18717         * tree.cs: Removed the various RecordXXXX, and replaced with a
18718         single RecordDecl.  Removed all the accessor methods, and just
18719         left a single access point Type 
18720
18721         * enum.cs: Rename DefineEnum to DefineType.
18722
18723         * decl.cs: New abstract method `DefineType' used to unify the
18724         Defines for Enumerations, Interfaces, TypeContainers and
18725         Delegates.
18726
18727         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18728         LookupBaseClasses method that used to live in class.cs and
18729         interface.cs here, and renamed to FindType.
18730
18731         * delegate.cs: Implement DefineType.  Take advantage of the
18732         refactored pattern for locating the parent builder without taking
18733         the parent_builder argument (which we know does not work if we are
18734         nested, and triggering a toplevel definition).
18735
18736 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18737
18738         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18739         accessibility of a member has changed during override and report
18740         an error if so.
18741
18742         * class.cs (Method.Define, Property.Define): Only complain on
18743         overrides if the method is private, any other accessibility is
18744         fine (and since we just checked the permission is the same, we are
18745         good to go).
18746
18747         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18748         and elif are processed always.  The other pre-processing
18749         directives are only processed if we are "taking" the path
18750
18751 2002-03-29  Martin Baulig  <martin@gnome.org>
18752
18753         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18754         current location is not Null.
18755
18756         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18757         a separate method so we can profile it.
18758
18759         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18760         `span.Seconds' are just seconds, but no minutes or hours.
18761         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18762
18763 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18764
18765         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18766         Remove the gratuitous set of Final:
18767
18768                                 // If an interface implementation, then we can set Final.
18769                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18770                                     implementing.DeclaringType.IsInterface)
18771                                         flags |= MethodAttributes.Final;
18772
18773         I do not know what I was smoking when I used that.
18774
18775
18776         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18777         step into fixing the name resolution issues for delegates and
18778         unifying the toplevel name resolution.
18779
18780 2002-03-28  Martin Baulig  <martin@gnome.org>
18781
18782         * class.cs (Method.Emit): If we have a symbol writer, call its
18783         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18784         tell it about the current method.
18785
18786         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18787         writer that we're going to emit the first byte of IL code for a new
18788         statement (a new source line).
18789         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18790         EmitContext.Mark() before emitting any code.
18791
18792         * location.cs (SymbolDocument): Return null when we're Null.
18793
18794         * statement.cs (Statement): Moved the `Location loc' variable here.
18795         (Statement.EmitBoolExpression): If we have a symbol writer, call
18796         ec.Mark() before emitting any code to tell it that we're at the
18797         beginning of a new statement.
18798         (StatementExpression): Added `Location' argument to the constructor.
18799         (Block): Added public readonly variable `StartLocation' and public
18800         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18801         (Block): Added constructor which takes a start and end location.
18802         (Block.SetEndLocation): New method. This sets the end location.
18803         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18804         local variables we create.
18805         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18806         each statement and do also mark the begin and end of the block.
18807
18808         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18809         tell it the current lexer.Location, use Location.Null for the end of the
18810         block.
18811         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18812         current block, set its end location using SetEndLocation().
18813         (statement_expression): StatementExpression constructor now takes the
18814         lexer.Location as additional argument.
18815         (for_statement, declare_local_variables): Likewise.
18816         (declare_local_variables): When creating a new implicit block, use the
18817         new Block constructor and pass it the lexer.Location.
18818
18819 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18820
18821         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18822         members also on the parent interfaces recursively.
18823
18824 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18825
18826         * report.cs: Use new formats, since Gonzalo finished the missing
18827         bits. 
18828
18829         * expression.cs (Binary.ResolveOperator): added missing operator|
18830         operator& and operator^ for bool/bool.
18831
18832         * cs-parser.jay: CheckDef now takes a Location argument that is
18833         used to report errors more precisly (instead of reporting the end
18834         of a definition, we try to track something which is a lot closer
18835         to the source of the problem).
18836
18837         * cs-tokenizer.cs: Track global token use, so we can properly flag
18838         the use of #define/#undef after the first token has been seen.
18839
18840         Also, rename the reportXXXX to Error_DescriptiveName
18841
18842         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18843         TypeContainer, so that Enum and Interface can use this too.
18844
18845         * class.cs (TypeContainer.LookupInterfaceOrClass,
18846         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18847         `builder' argument.  Typically this was used to pass the parent
18848         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18849         the definition).  
18850
18851         The problem is that a nested class could trigger the definition of
18852         a toplevel class, and the builder would be obviously wrong in that
18853         case. 
18854
18855         So we drop this argument, and we compute dynamically the
18856         TypeBuilder/ModuleBuilder (the correct information was available
18857         to us anyways from DeclSpace.Parent)
18858
18859         * interface.cs (Interface.DefineInterface): Drop builder
18860         parameter cleanup like class.cs
18861
18862         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18863         like class.cs
18864
18865         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18866         values. 
18867
18868         (Try.Emit): Propagate the returns value from the statement.
18869
18870         (Return.Emit): Even if we are leavning 
18871
18872         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18873
18874         * modifiers.cs: Fix the computation of MethodAttributes flags.
18875
18876 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18877
18878         * driver.cs: allow compilation of files that start with '/'.
18879         Add a default case when checking the argument of --target.
18880
18881 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18882
18883         * interface.cs: Implement the same search algorithm for types in
18884         the interface code.
18885
18886         * delegate.cs: Do not allow multiple definition.
18887
18888         * Recovered ChangeLog that got accidentally amputated
18889
18890         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18891
18892         * rootcontext.cs: Load manually enum to allow core classes to
18893         contain enumerations.
18894
18895         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18896         Update to new static methods in TypeManager.
18897
18898         * typemanager.cs (GetMethod, GetConstructor): Use our
18899         implementation of FindMembers to find the members, since during
18900         corlib compilation, the types are TypeBuilders and GetMethod and
18901         GetConstructor do not work.
18902
18903         Make all methods in TypeManager static.
18904
18905         (InitCodeHelpers): Split the functionality from
18906         the InitCodeTypes function.
18907
18908         * driver.cs: Call InitCodeHelpers after we have populated the
18909         types. 
18910
18911         * cs-parser.jay (delegate_declaration): we did not used to compute
18912         the delegate name correctly for void delegates.
18913
18914 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18915
18916         * rootcontext.cs (RootContext): Init the interface_resolve_order
18917         and type_container_resolve_order always.
18918
18919         (ResolveCore, BootstrapCorlib_ResolveClass,
18920         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18921         compiler when compiling with --nostdlib
18922
18923         * class.cs (TypeContainer.DefineType): Check that our parent is
18924         not null.  This test is most important when we are bootstraping
18925         the core types.
18926
18927         * codegen.cs: Split out the symbol writing code.
18928
18929 2002-03-25  Martin Baulig  <martin@gnome.org>
18930
18931         * driver.cs (-g): Made -g an alias for --debug.
18932
18933 2002-03-24  Martin Baulig  <martin@gnome.org>
18934
18935         * codegen.cs (SymbolWriter): New public variable. Returns the
18936         current symbol writer.
18937         (CodeGen): Added `bool want_debugging_support' argument to the
18938          constructor. If true, tell the ModuleBuild that we want debugging
18939         support and ask it for the ISymbolWriter.
18940         (Save): If we have a symbol writer, call it's Close() method after
18941         saving the assembly.
18942
18943         * driver.c (--debug): New command line argument to create a
18944         debugger information file.
18945
18946         * location.cs (SymbolDocument): New public property. Returns an
18947         ISymbolDocumentWriter object for the current source file or null
18948         if we don't have a symbol writer.
18949
18950 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18951
18952         * driver.cs (LoadAssembly): Correctly return when all the paths
18953         have been tried and not before.
18954
18955         * statement.cs (Switch.Emit): return the actual coverage for this
18956         statement (returns/not-returns)
18957
18958         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18959         switch of the statement if we are the last switch section.  That
18960         kills two problems: try/catch problems (we used to emit an empty
18961         nop at the end) and switch statements where all branches would
18962         return. 
18963
18964 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18965
18966         * driver.cs: Add default assemblies (the equivalent to the
18967         Microsoft CSC.RSP file)
18968
18969         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18970         also update tokens_seen and set it to false.
18971
18972         * driver.cs: Implement --recurse for Mike.
18973
18974         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18975         correctly splitting out the paths.
18976
18977 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18978
18979         * interface.cs (Interface.PopulateProperty): Instead of using
18980         `parent' as the declaration space for the set parameters, use
18981         `this' 
18982
18983         * support.cs (InternalParameters): InternalParameters constructor
18984         takes a DeclSpace instead of a TypeContainer.
18985
18986         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18987         types are being initialized, load the address of it before calling
18988         the function.  
18989
18990         (New): Provide a mechanism to disable the generation of local
18991         value type temporaries when the caller will be providing us with
18992         an address to store it.
18993
18994         (ArrayCreation.EmitDynamicInitializers): Use it.
18995
18996 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18997
18998         * expression.cs (Invocation.EmitArguments): Only probe for array
18999         property if there is more than one argument.  Sorry about that.
19000
19001         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19002         empty param arrays.
19003
19004         * class.cs (Method.LabelParameters): Fix incorrect code path that
19005         prevented the `ParamArrayAttribute' from being applied to the
19006         params attribute.
19007
19008 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19009
19010         * support.cs (ReflectionParameters): Correctly compute whether the
19011         last argument is a params array.  Fixes the problem with
19012         string.Split ('a')
19013
19014         * typemanager.cs: Make the assemblies array always be non-null
19015         (empty, but non-null)
19016
19017         * tree.cs (RecordDecl): New function that abstracts the recording
19018         of names.  This reports error 101, and provides a pointer to the
19019         previous declaration.  Fixes a crash in the compiler.
19020
19021         * cs-parser.jay (constructor_declaration): Update to new grammar,
19022         and provide a constructor_body that can be empty.
19023
19024 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19025
19026         * driver.cs: Add support for --resources.
19027
19028         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19029         Make all types for the various array helper methods be integer.
19030
19031         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19032         CheckState to ConvCast.
19033
19034         (ConvCast): Now it takes a `checked' state argument, to avoid
19035         depending on the emit context for the conversion, and just using
19036         the resolve time setting.
19037
19038         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19039         instead of Invocation.EmitArguments.  We do not emit the original
19040         arguments, instead we emit those which have been converted to
19041         unsigned int expressions.
19042
19043         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19044
19045         * codegen.cs: ditto.
19046
19047         * expression.cs (LocalVariableReference): Drop the use of the
19048         Store function that depended on the variable index.
19049
19050         * statement.cs (VariableInfo): Drop the `Idx' property from this
19051         class, as this is not taking into account the indexes for
19052         temporaries tat we generate during the execution, getting the
19053         indexes wrong.
19054
19055         * class.cs: First emit class initializers, then call the parent
19056         constructor. 
19057
19058         * expression.cs (Binary): Fix opcode emision.
19059         (UnaryMutator.EmitCode): Support checked code generation
19060
19061         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19062         matches for events for both the Static and Instance scans,
19063         pointing to the same element.   Fix that.
19064
19065 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19066
19067         * rootcontext.cs (ResolveTree): Always set the
19068         interface_resolve_order, because nested interfaces will be calling
19069         into us.
19070
19071         * class.cs (GetInterfaceOrClass): Track the same resolution
19072         process used by TypeManager.LookupType.  This fixes the nested
19073         type lookups in class declarations (separate path from
19074         LookupType). 
19075
19076         (TypeContainer.DefineType): Also define nested interfaces.
19077         (TypeContainer.RegisterOrder): New public function used to
19078         register the order in which child interfaces need to be closed.
19079
19080         Nested interfaces need to be closed after their parents have been
19081         created. 
19082
19083         * interface.cs (InterfaceAttr): Put all the logic for computing
19084         the interface attribute here. 
19085
19086         (DefineInterface): Register our interface order with the
19087         RootContext or with the TypeContainer depending on the case.
19088
19089 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19090
19091         * cs-parser.jay: rework foreach statement to work with the new
19092         changes to the policy on SimpleNames.
19093
19094         * report.cs: support Stacktrace on warnings as well.
19095
19096         * makefile: drop --unsafe and /unsafe from the compile.
19097
19098 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19099
19100         * ecore.cs (StandardConversionExists): Modify to take an Expression
19101         as the first parameter. Ensure we do null -> reference type conversion
19102         checking.
19103
19104         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19105         temporary Expression objects.
19106
19107 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19108
19109         * interface.cs: workaround bug in method overloading resolution
19110         (there is already a bugzilla bug for it).
19111
19112 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19113
19114         We could also solve this problem by having a separate path for
19115         performing type lookups, instead of DoResolve, we could have a
19116         ResolveType entry point, and only participating pieces of the
19117         production (simplename, deref, array) would implement this. 
19118
19119         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19120         signal SimpleName to only resolve type names and not attempt to
19121         resolve anything else.
19122
19123         * expression.cs (Cast): Set the flag.
19124
19125         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19126
19127         * class.cs: Only report 108 if there is no `new' modifier.
19128
19129         * cs-parser.jay: rework foreach statement to work with the new
19130         changes to the policy on SimpleNames.
19131
19132         * report.cs: support Stacktrace on warnings as well.
19133
19134         * makefile: drop --unsafe and /unsafe from the compile.
19135
19136 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19137
19138         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19139         lookups here, instead of doing that at parse time.  This means
19140         that our grammar will not introduce `LocalVariableReferences' as
19141         expressions at this point.  That solves the problem of code like
19142         this:
19143
19144         class X {
19145            static void Main ()
19146            { int X = 1;
19147             { X x = null }}}
19148
19149         This is only half the fix.  The full fix requires parameters to
19150         also be handled in this way.
19151
19152         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19153         makes the use more obvious of the DeclSpace.  The
19154         ec.TypeContainer.TypeBuilder is now only used to pull the
19155         TypeBuilder for it.
19156
19157         My theory is that I can get rid of the TypeBuilder completely from
19158         the EmitContext, and have typecasts where it is used (from
19159         DeclSpace to where it matters).  
19160
19161         The only pending problem is that the code that implements Aliases
19162         is on TypeContainer, and probably should go in DeclSpace.
19163
19164         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19165         lookups here, instead of doing that at parse time.  This means
19166         that our grammar will not introduce `LocalVariableReferences' as
19167         expressions at this point.  That solves the problem of code like
19168         this:
19169
19170         class X {
19171            static void Main ()
19172            { int X = 1;
19173             { X x = null }}}
19174
19175         This is only half the fix.  The full fix requires parameters to
19176         also be handled in this way.
19177
19178         * class.cs (Property.DefineMethod): When implementing an interface
19179         method, set newslot, when implementing an abstract method, do not
19180         set the flag (before we tried never setting it, or always setting
19181         it, which is the difference).
19182         (Indexer.DefineMethod): same.
19183         (Method.DefineMethod): same.
19184
19185         * ecore.cs: Only set the status used flag if we get back a Field.
19186
19187         * attribute.cs: Temporary hack, so Paolo can keep working.
19188
19189 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19190
19191         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19192         the unmanaged type in the case we have a MarshalAs attribute.
19193
19194         (Resolve): Handle the case when we are parsing the special MarshalAs
19195         attribute [we need to store the unmanaged type to use later]
19196
19197         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19198         MarshalAs Attribute.
19199
19200         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19201         on parameters and accordingly set the marshalling info.
19202
19203 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19204
19205         * class.cs: Optimizing slightly by removing redundant code after
19206         we switched to the `NoTypes' return value.
19207         (Property.DefineMethod): use NoTypes here too.
19208
19209         This fixes the bug I introduced in my last batch of changes.
19210
19211 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19212
19213         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19214
19215         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19216         Enums since those are types too. 
19217
19218         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19219
19220         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19221         thanks to a call during the lookup process.
19222
19223 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19224
19225         * statement.cs (Foreach): Lots of work to accomodate a particular
19226         kind of foreach statement that I had not kept in mind.  It is
19227         possible to have foreachs on classes that provide a GetEnumerator
19228         method that return objects that implement the "pattern" for using
19229         a foreach, there is no need to support GetEnumerator
19230         specifically. 
19231
19232         This is needed to compile nant.
19233
19234         * decl.cs: Only report 114 if the member is not `Finalize' and if
19235         the warning level is at least 2.
19236
19237         * class.cs: Moved the compare function from Method to
19238         MethodSignature. 
19239
19240         (MethodSignature.InheritableMemberSignatureCompare): Add new
19241         filter function that is used to extract inheritable methods from a
19242         class. 
19243
19244         (Method.Define): Use the new `inheritable_method_signature_filter'
19245         delegate
19246
19247         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19248         command. 
19249
19250 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19251
19252         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19253
19254         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19255
19256         * expression.cs: Pass location information to
19257         ConvertImplicitStandard. 
19258
19259         * class.cs: Added debugging code to track return values from
19260         interfaces. 
19261
19262 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19263
19264         * expression.cs (Is.DoResolve): If either side of the `is' is an
19265         interface, do not flag the warning.
19266
19267         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19268         for interfaces
19269
19270         * report.cs: Allow for --fatal to be used with --probe.
19271
19272         * typemanager.cs (NoTypes): Move the definition for the empty Type
19273         array here. 
19274
19275         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19276         properties. 
19277         (TypeContainer.DefineProxy): New function used to proxy to parent
19278         implementations when implementing interfaces.
19279         (TypeContainer.ParentImplements): used to lookup if our parent
19280         implements a public function that is required by an interface.
19281         (TypeContainer.VerifyPendingMethods): Hook this up.
19282
19283         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19284         `modules' and `assemblies' arraylists into arrays.  We only grow
19285         these are the very early start up of the program, so this improves
19286         the speedof LookupType (nicely measured).
19287
19288         * expression.cs (MakeByteBlob): Replaced unsafe code with
19289         BitConverter, as suggested by Paolo.
19290
19291         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19292         folding of string concatenation, but if either side is a string,
19293         and the other is not, then return null, and let the runtime use
19294         the concatenation on the string plus the object (using
19295         `Object.ToString'). 
19296
19297 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19298
19299         Constant Folding has been implemented now.
19300
19301         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19302         the error instead on types that are not supported in one's
19303         complement. 
19304
19305         * constant.cs (Constant and all children): New set of functions to
19306         perform implict and explicit conversions.
19307
19308         * ecore.cs (EnumConstant): Implement the new functions to perform
19309         conversion by proxying to the child expression.
19310
19311         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19312         own separate setting that can not be turned off from the command
19313         line using --unchecked or --checked and is only controlled using
19314         the checked/unchecked statements and expressions.  This setting is
19315         used by the constant folder to flag errors.
19316
19317         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19318         ConstantCheckState as well.   
19319
19320         During Resolve, they also have to flag the state, because the
19321         constant folder runs completely in the Resolve phase.
19322
19323         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19324         well.
19325
19326 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19327
19328         * cfold.cs: New file, this file contains the constant folder.
19329
19330         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19331         argument to track whether we are using the resulting address to
19332         load or store a value and provide better error messages. 
19333
19334         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19335         new AddressOf arguments.
19336
19337         * statement.cs (Foreach.EmitCollectionForeach): Update
19338
19339         * expression.cs (Argument.Emit): Call AddressOf with proper
19340         arguments to track usage.
19341
19342         (New.DoEmit): Call AddressOf with new arguments.
19343
19344         (Unary.Emit): Adjust AddressOf call.
19345
19346 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19347
19348         * cs-parser.jay (member_access): Change the case for pre-defined types
19349         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19350         this suggestion.
19351
19352         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19353         a method body.
19354
19355         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19356         essentially like methods and apply attributes like MethodImplOptions to them too.
19357
19358         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19359         not being null.
19360
19361         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19362         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19363         is the DeclSpace.
19364
19365         * Update code everywhere accordingly.
19366
19367         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19368
19369         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19370
19371 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19372
19373         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19374         try performing lookups against those instead of jumping straight into using
19375         the 'using' clauses.
19376
19377         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19378
19379         (LookupType): Perform lookups in implicit parents too.
19380
19381         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19382         sequence as RootContext.LookupType. 
19383
19384         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19385         the various cases of namespace lookups into this method.
19386
19387 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19388
19389         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19390         in positional arguments)
19391
19392         * class.cs (Operator): Update the AllowedModifiers to contain
19393         extern. 
19394
19395         * cs-parser.jay: Update operator declaration to allow for the
19396         operator body to be empty.
19397
19398         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19399         values. 
19400
19401 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19402
19403         * class.cs (Method.Emit): Label parameters.
19404
19405         * driver.cs: Return 1 or 0 as the program exit code.
19406
19407 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19408
19409         * expression.cs: Special case the `null' object when trying to
19410         auto-compute the type, as anything can be explicitly converted to
19411         that. 
19412
19413         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19414         spotting this Paolo.
19415
19416         (Expression.ImplicitNumericConversion): Perform comparissions of
19417         the type using the underlying type in the case of an enumeration
19418         rather than using the enumeration type for the compare.
19419
19420         Cope with the underlying == type case, which is not possible to
19421         catch before. 
19422
19423         (Expression.ConvertNumericExplicit): Perform comparissions of
19424         the type using the underlying type in the case of an enumeration
19425         rather than using the enumeration type for the compare.
19426
19427         * driver.cs: If the user does not supply an extension, assume .exe
19428
19429         * cs-parser.jay (if_statement): Rewrote so that we can track the
19430         location for the if statement.
19431
19432         * expression.cs (Binary.ConstantFold): Only concat strings when
19433         the operation is "+", not everything ;-)
19434
19435         * statement.cs (Statement.EmitBoolExpression): Take a location
19436         argument. 
19437         (If, While, Do): Track location.
19438
19439         * expression.cs (Binary.ResolveOperator): In the object + string
19440         case, I was missing a call to ConvertImplicit
19441
19442 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19443
19444         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19445         Location arguments. Ensure we use RootContext.LookupType to do our work
19446         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19447
19448         * interface.cs (PopulateMethod): Handle the type of the parameter being
19449         null gracefully.
19450
19451         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19452         have a params method with no fixed arguments and a call is made with no
19453         arguments.
19454
19455 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19456
19457         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19458         the verbatim-string-literal
19459
19460         * support.cs (InternalParameters.ParameterModifier): handle null
19461         fixed parameters.
19462         (InternalParameters.ParameterType): ditto.
19463
19464         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19465         duplicating the name of the variable parameter.
19466         (GetParameterByName): Fix bug where we were not looking up array
19467         paramters if they were the only present (thanks Paolo!).
19468         (GetParameterInfo): We only have an empty set of types if both
19469         fixed and array are set to null.
19470         (GetParameterInfo-idx): Handle FixedParameter == null
19471
19472         * cs-parser.jay: Handle the case where there is no catch
19473         statements (missing null test).
19474
19475 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19476
19477         * driver.cs (MainDriver): Be conservative on our command line
19478         handling.
19479
19480         Catch DirectoryNotFoundException when calling GetFiles.
19481
19482         (SplitPathAndPattern): Used to split the input specification into
19483         a path and a pattern that we can feed to Directory.GetFiles.
19484
19485 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19486
19487         * statement.cs (Fixed): Implement the last case of the Fixed
19488         statement (string handling).
19489
19490         * expression.cs (StringPtr): New class used to return a char * to
19491         a string;  Used by the Fixed statement.
19492
19493         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19494
19495         * expression.cs (Binary.ResolveOperator): Remove redundant
19496         MemberLookup pn parent type.
19497         Optimize union call, we do not need a union if the types are the same.
19498         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19499         type.
19500
19501         Specialize the use of MemberLookup everywhere, instead of using
19502         the default settings. 
19503
19504         (StackAlloc): Implement stackalloc keyword.
19505
19506         * cs-parser.jay: Add rule to parse stackalloc.
19507
19508         * driver.cs: Handle /h, /help, /?
19509
19510         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19511         before we supported unsafe code.
19512
19513         * makefile: add --unsafe to the self compilation of mcs.
19514
19515 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * expression.cs (PointerArithmetic): New class that is used to
19518         perform pointer arithmetic.
19519         (Binary.Resolve): Handle pointer arithmetic
19520         Handle pointer comparission.
19521         (ArrayPtr): Utility expression class that is used to take the
19522         address of an array.
19523
19524         (ElementAccess): Implement array access for pointers
19525
19526         * statement.cs (Fixed): Implement fixed statement for arrays, we
19527         are missing one more case before we are done.
19528
19529         * expression.cs (Indirection): Implement EmitAssign and set the
19530         ExprClass to Variable.  This allows pointer dereferences to be
19531         treated as variables, and to have values assigned to them.
19532
19533         * ecore.cs (Expression.StoreFromPtr): New utility function to
19534         store values dereferencing.
19535
19536 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19537
19538         * expression.cs (Binary.ResolveOperator): Ensure that we are
19539         not trying to operate on a void type - this fixes the reported
19540         bug.
19541
19542         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19543         the parent implementation is sealed.
19544
19545         * ../errors/cs0239.cs : Add.
19546
19547         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19548
19549         * typemanager.cs (unverifiable_code_type): Corresponds to 
19550         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19551         which have unsafe code in them.
19552
19553         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19554         unsafe context.
19555
19556 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19557
19558         * cs-tokenizer.cs: Add support for @"litreal strings"
19559
19560         Make tokenizer accept pre-processor directives
19561         on any column (remove the old C-like limitation). 
19562
19563         * rootcontext.cs (EmitCode): Emit any global attributes.
19564         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19565
19566         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19567
19568         * cs-parser.jay: Add support for global attributes.  
19569
19570 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * expression.cs (Indirection): New helper class.  Unary will
19573         create Indirection classes to be able to implement the
19574         IMemoryLocation interface on it.
19575
19576 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19577
19578         * cs-parser.jay (fixed_statement): reference the right statement.
19579
19580         * statement.cs (Fixed.Emit): Finish implementing the fixed
19581         statement for the &x case.
19582
19583 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19584
19585         * class.cs (Property.Define, Method.Define): Remove newslot when
19586         `implementing'.  
19587
19588         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19589         wrong.  NewSlot should only be used if the `new' keyword is present.
19590
19591         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19592         locating our system dir.  Sorry about this.
19593
19594 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19595
19596         * driver.cs (GetSystemDir): Compute correctly the location of our
19597         system assemblies.  I was using the compiler directory instead of
19598         the library directory.
19599
19600 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19601
19602         * expression.cs (BetterFunction): Put back in what Miguel commented out
19603         since it is the correct fix. The problem is elsewhere ;-)
19604
19605         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19606         parameters of the parms method are themselves compatible or not !
19607
19608         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19609         to check that a class implements an interface before saying that an implicit
19610         conversion was allowed. Use ImplementsInterface to do the checking.
19611
19612 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19613
19614         * class.cs (Method.Define): Track whether we are an explicit
19615         implementation or not.  And only call DefineMethodOverride if we
19616         are an explicit implementation.
19617
19618         (Property.DefineMethod): Ditto.
19619
19620 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19621
19622         * expression.cs (BetterFunction): Catch hideous bug which was
19623          preventing us from detecting ambiguous calls due to implicit casts i.e
19624         cs0121.
19625
19626 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19627
19628         * support.cs (Pair): Remove un-needed method.  I figured why I was
19629         getting the error in cs-parser.jay, the variable in a foreach loop
19630         is readonly, and the compiler does not really treat this as a variable.
19631
19632         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19633         instead of EQUALS in grammar.  
19634
19635         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19636
19637         * expression.cs (Unary.DoResolve): Check whether the argument is
19638         managed or not.
19639
19640 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19641
19642         * support.cs: Api for Pair to set a value.  Despite the fact that
19643         the variables are public the MS C# compiler refuses to compile
19644         code that accesses the field if the variable is part of a foreach
19645         statement. 
19646
19647         * statement.cs (Fixed): Begin implementation of the fixed
19648         statement.
19649
19650         (Block.AddVariable): Return the VariableInfo on success and null
19651         on failure instead of true/false. 
19652
19653         * cs-parser.jay (foreach): Catch errors on variables already
19654         defined (we were ignoring this value before) and properly unwind
19655         the block hierarchy
19656
19657         (fixed_statement): grammar for the fixed statement.
19658
19659 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19660
19661         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19662         pointer types to be incretemented.
19663
19664         (SizeOf): Implement.
19665
19666         * cs-parser.jay (pointer_member_access): Implement
19667         expr->IDENTIFIER production.
19668
19669         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19670         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19671         on safe contexts.
19672
19673         (Unary): Implement indirection.
19674
19675         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19676         use in non-unsafe context).
19677
19678         (SimpleName.DoResolve): Check for pointers in field access on safe
19679         contexts. 
19680
19681         (Expression.LoadFromPtr): Factor the load-indirect code in this
19682         function.  This was duplicated in UnboxCast and ParameterReference
19683
19684 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19685
19686         * expression.cs (ComposedCast): report an error if a pointer cast
19687         is used in a safe region.
19688
19689         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19690         pointer type casts in unsafe context.
19691
19692         * codegen.cs (EmitContext): Set up IsUnsafe.
19693
19694         * cs-parser.jay (non_expression_type): Add productions for pointer
19695         casts. 
19696
19697         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19698         code.  We should not use force into static mode if the method is
19699         not virtual.  Fixes bug in MIS
19700
19701         * statement.cs (Do.Emit, While.Emit, For.Emit,
19702         Statement.EmitBoolExpression): Add support to Do and While to
19703         propagate infinite loop as `I do return' semantics.
19704
19705         Improve the For case to also test for boolean constants.
19706
19707         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19708         to the list of attributes we can add.
19709
19710         Remove `EmitContext' argument.
19711
19712         * class.cs (Method.Define): Apply parameter attributes.
19713         (Constructor.Define): Apply parameter attributes.
19714         (MethodCore.LabelParameters): Move here the core of labeling
19715         parameters. 
19716
19717         * support.cs (ReflectionParameters.ParameterModifier,
19718         InternalParameters.ParameterModifier): Use IsByRef on the type and
19719         only return the OUT bit for these parameters instead of in/out/ref
19720         flags.
19721
19722         This is because I miss-understood things.  The ParameterInfo.IsIn
19723         and IsOut represent whether the parameter has the [In] and [Out]
19724         attributes set.  
19725
19726 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19727
19728         * ecore.cs (FieldExpr.Emit): Release temporaries.
19729
19730         * assign.cs (LocalTemporary.Release): new function.
19731
19732         * codegen.cs (EmitContext.GetTemporaryStorage,
19733         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19734         temporary storage.  Now we can "put back" localbuilders when we
19735         are done with them
19736
19737 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19738
19739         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19740         need to make a copy of the variable to generate verifiable code.
19741
19742 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19743
19744         * driver.cs: Compute dynamically the system directory.
19745
19746         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19747         Slower, but more generally useful.  Used by the abstract
19748         registering implementation. 
19749
19750         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19751         the rules for the special rule on Type/instances.  First check if
19752         we have the same name, and if so, try that special static path
19753         rather than the instance path.
19754
19755 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19756
19757         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19758         for, while and if.
19759
19760         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19761         Enum, ValueType, Delegate or Array for non-corlib compiles.
19762
19763         * cs-tokenizer.cs: Catch long identifiers (645)
19764
19765         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19766         piece of code.
19767
19768         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19769         fix, we were returning too early, so we were not registering
19770         pending methods from abstract classes.
19771
19772         Do not register pending methods if the class is abstract.
19773
19774         * expression.cs (Conditional.DoResolve): Report circular implicit
19775         conversions when we neecd to compute it for conditional
19776         expressions. 
19777
19778         (Is.DoResolve): If the expression is always of the provided type,
19779         flag warning 183.  If the expression can not ever be of the
19780         provided type flag warning 184.
19781
19782         * class.cs: Catch 169 as well.
19783
19784         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19785         read. 
19786
19787 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19788
19789         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19790
19791 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19792
19793         * interface.cs: (PopulateMethod): Check for pointers being defined
19794         only if the unsafe context is active.
19795         (PopulateProperty): ditto.
19796         (PopulateIndexer): ditto.
19797
19798         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19799         specified.  If pointers are present, make sure that they are
19800         present in an unsafe context.
19801         (Constructor, Constructor.Define): ditto.
19802         (Field, Field.Define): ditto.
19803         (Property, Property.Define): ditto.
19804         (Event, Event.Define): ditto.
19805
19806         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19807         hashtable if there are classes or structs defined.
19808
19809         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19810         code, as the constant resolution moved.
19811
19812         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19813         the metadata, so we can flag error 133. 
19814
19815         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19816         pointer is being declared in an unsafe context.
19817
19818 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19819
19820         * modifiers.cs (Modifiers.Check): Require a Location argument.
19821         Report error 227 for Unsafe use.
19822
19823         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19824
19825         * statement.cs (For.Emit): If the test is null, then report that
19826         we do `return', as we wont reach anything afterwards.
19827
19828         (Switch.SwitchGoverningType): Track the expression that matched
19829         the conversion.
19830
19831         * driver.cs: Allow negative numbers as an error code to flag.
19832
19833         * cs-parser.jay: Handle 1551.
19834
19835         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19836
19837 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19838
19839         * cs-parser.jay: Report 1518 (type declaration can only contain
19840         class, struct, interface, enum or delegate)
19841
19842         (switch_label): Report 1523 (keywords `case' or `default' must
19843         preced code)
19844
19845         (opt_switch_sections): Report 1522 (empty switch)
19846
19847         * driver.cs: Report 1515 (response file specified multiple times)
19848         Report 1516 (Source file specified multiple times).
19849
19850         * expression.cs (Argument.Resolve): Signal 1510
19851
19852         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19853         access not allowed in static code)
19854
19855 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19856
19857         * typemanager.cs (IsPointerType): Utility method which we are going
19858         to need a lot.
19859
19860         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19861         the object type, so we take care of that.
19862
19863         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19864
19865         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19866         added to non-params parameters :-)
19867
19868         * typemanager.cs (CSharpName): Include 'void' type too. 
19869
19870         (void_ptr_type): Include in the set of core types.
19871
19872         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19873         duplicating code.
19874
19875         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19876         an unsafe context.
19877
19878         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19879         completely forgotten about it.
19880
19881 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19882
19883         * cs-parser.jay (pointer_type): Add. This begins our implementation
19884         of parsing rules for unsafe code.
19885
19886         (unsafe_statement): Implement.
19887
19888         (embedded_statement): Modify to include the above.
19889
19890         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19891
19892         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19893         if the current context is an unsafe one.
19894
19895         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19896         are handled differently, we need separate rules for them.
19897
19898         (local_variable_declaration): Update to use local_variable_pointer_type
19899         to allow variable declarations of unmanaged pointer types.
19900
19901         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19902         in unsafe contexts.
19903
19904         * ../errors/cs0214.cs : Add.
19905
19906 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19907
19908         * makefile: remove 'response' file when cleaning.
19909
19910 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19911
19912         * cs-parser.jay: Report 1524.
19913
19914 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19915
19916         * typemanager.cs (RegisterMethod): drop checking if we have
19917         registered this from here
19918
19919 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19920
19921         * class.cs (Method.EmitDestructor): Implement calling our base
19922         destructor. 
19923
19924         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19925         value of InFinally.
19926
19927         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19928         this routine and will wrap the call in a try/catch block.  Deal
19929         with the case.
19930
19931 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19932
19933         * ecore.cs (Expression.MemberLookup): instead of taking a
19934         parameter `same_type' that was used to tell whether we could
19935         access private members we compute our containing type from the
19936         EmitContext.
19937
19938         (FieldExpr): Added partial support for volatile fields.  This does
19939         not work for volatile fields exposed from assemblies, as I can not
19940         figure out how to extract the modreq from it.
19941
19942         Updated all the source files to use this.
19943
19944         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19945         because it is referenced by MemberLookup very often. 
19946
19947 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19948
19949         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19950         TypeBuilder.GetCustomAttributes to retrieve what we need.
19951
19952         Get rid of redundant default_member_attr_type as this is the same as
19953         default_member_type which already exists.
19954
19955         * interface.cs, attribute.cs : Update accordingly.
19956
19957 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19958
19959         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19960         work for TYpeBuilders though.  Ravi, can you please fix this?
19961
19962         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19963
19964         * expression.cs (Argument.Emit): Handle the case of ref objects
19965         being passed to ref functions;  
19966
19967         (ParameterReference.EmitLoad): Loads the content of the pointer
19968         without dereferencing.
19969
19970 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19971
19972         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19973
19974 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19975
19976         * class.cs (Indexer.DefineMethod): Incorporate the interface
19977         type in the name of the method if we are doing explicit interface
19978         implementation.
19979
19980         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19981
19982         (BetterConversion): Fix extremely trivial bug where we were referring to
19983         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19984         again !
19985
19986         * ../errors/bug16.cs : Add although we have fixed it.
19987
19988 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19989
19990         * expression.cs (BaseIndexer): Begin implementation.
19991
19992         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19993
19994         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19995         production directly to remove a shift/reduce, and implement
19996         explicit interface implementation.
19997
19998         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19999         after a floating point suffix.
20000
20001         * expression.cs (DoNumericPromotions): Improved the conversion for
20002         uint/uint.  If we have a constant, we avoid doing a typecast to a
20003         larger type.
20004
20005         * class.cs (Indexer): Implement explicit interface implementation
20006         for indexers.
20007
20008 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20009
20010         * class.cs: make the default instance constructor public and hidebysig.
20011
20012 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20013
20014         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20015         so we can call it from elsewhere.
20016
20017         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20018         we emit it internally if the class has a defined indexer; otherwise the user
20019         emits it by decorating the class definition with the DefaultMemberAttribute.
20020
20021         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20022         attribute is not used on a type which defines an indexer.
20023
20024         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20025         character when we skip whitespace.
20026
20027         * ../errors/cs0646.cs : Add.
20028
20029 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20030
20031         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20032         again. 
20033
20034         * makefile: Add practical target `mcs3.exe' which builds the third
20035         generation compiler. 
20036
20037         * expression.cs (New): Fix structures constructor calling.
20038
20039         * class.cs (Property, Method, Indexer): Emit Final flag on the
20040         method if we are an interface implementation and we are not
20041         abstract. 
20042
20043         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20044         whether this property is referencing a `base' method.
20045
20046         * expression.cs (Invocation.EmitCall): take an extra argument:
20047         is_base, this is used to determine whether the `call' or
20048         `callvirt' opcode should be used.
20049
20050
20051         * delegate.cs: update EmitCall.
20052
20053         * class.cs (Method.Define): Set NewSlot for the cases where we are
20054         not implementing an interface method.
20055
20056         (Property.Define): ditto.
20057
20058 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20059
20060         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20061         'r'.  Allows mcs to parse itself fully.
20062
20063 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20064
20065         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20066         of the number of initializers that require the InitializeArray method.
20067
20068         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20069         update the above field where necessary.
20070
20071         (MakeByteBlob): Update accordingly.
20072
20073         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20074         greater than 2.
20075
20076         (EmitDynamicInitializers): Update in accordance with the new optimization.
20077
20078         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20079         same OpCode applies.
20080
20081         * cs-parser.jay : Fix some glaring errors I introduced.
20082
20083 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20084
20085         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20086         so that we can check for name clashes there too.
20087
20088         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20089         for interface indexers.
20090
20091         * interfaces.cs (Define): Emit the default member attribute.
20092
20093         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20094         variable was being referred to while setting the value ;-)
20095
20096 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20097
20098         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20099         byte-by-byte information when we know the data is zero.
20100
20101         Make the block always a multiple of 4, because
20102         DefineInitializedData has a bug.
20103
20104         * assign.cs: Fix, we should assign from the temporary, not from
20105         the source. 
20106
20107         * expression.cs (MakeByteBlob): Fix my incorrect code.
20108
20109 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20110
20111         * typemanager.cs (EnumToUnderlying): This function is used to get
20112         the underlying type from an enumeration, because it does not
20113         always work. 
20114
20115         * constant.cs: Use the I4_S form for values between -128 and 127.
20116
20117         * statement.cs (Block.LookupLabel): Looks up a label.
20118         (Block): Drop support for labeled blocks.
20119
20120         (LabeledStatement): New kind of statement that represents a label
20121         only.
20122
20123         (Goto): Finally implement this bad boy.
20124
20125         * cs-parser.jay: Update to reflect new mechanism to implement
20126         labels.
20127
20128 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20129
20130         * codegen.cs (EmitContext.This): a codegen property that keeps the
20131         a single instance of this instead of creating many different this
20132         instances. 
20133
20134         * delegate.cs (Delegate.DoResolve): Update to use the property;
20135
20136         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20137
20138         * expression.cs (BaseAccess.DoResolve): Ditto.
20139
20140 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20141
20142         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20143         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20144
20145         (InitCoreTypes): Update accordingly.
20146
20147         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20148         so we can quickly store the state.
20149
20150         (ApplyAttributes): Set the correct implementation flags
20151         for InternalCall methods.
20152
20153 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20154
20155         * expression.cs (EmitCall): if a method is not virtual, then do
20156         not use callvirt on it.
20157
20158         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20159         user defined stuff) requires the use of stobj, which takes an
20160         address on the stack instead of an array and an index.  So emit
20161         the Ldelema operation for it.
20162
20163         (EmitStoreOpcode): Use stobj for valuetypes.
20164
20165         (UnaryMutator.EmitCode): Use the right 1 value depending on
20166         whether we are dealing with int64/uint64, float or doubles.
20167
20168         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20169         constructors that I implemented last night.
20170
20171         (Constructor.IsDefault): Fix to work properly for static
20172         constructors.
20173
20174         * cs-parser.jay (CheckDef): report method signature errors.
20175         Update error number 103 to be 132.
20176
20177         * decl.cs: New AdditionResult enumeration value: MethodExists.
20178         Although we do this check for methods later on in the semantic
20179         analysis, catching repeated default constructors is so easy that
20180         we catch these here. 
20181
20182         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20183         promotions code.
20184
20185         (ParameterReference.EmitAssign, Emit): handle
20186         bools as bytes.
20187
20188         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20189         (ArrayAccess.EmitStoreOpcode): ditto.
20190
20191         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20192
20193         * expression.cs (MakeByteBlob): Complete all the missing types
20194         (uint, short, ushort, byte, sbyte)
20195
20196         * class.cs: Only init instance field initializers on instance
20197         constructors. 
20198
20199         Rename `constructors' to instance_constructors. 
20200
20201         (TypeContainer.AddConstructor): Only add constructors to the list
20202         if it is not static.
20203
20204         Make sure that we handle default_static_constructor independently
20205         everywhere where we handle instance_constructors
20206
20207 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20208
20209         * class.cs: Do not lookup or create a base initializer for a
20210         static constructor.
20211
20212         (ConstructorInitializer.Resolve): use the proper type to lookup
20213         for constructors.
20214
20215         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20216
20217         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20218         in DeclSpace. 
20219
20220         * decl.cs: CloseType is now an virtual method, the default
20221         implementation just closes this type.
20222
20223 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20224
20225         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20226         to PreserveSig by default. Also emit HideBySig on such methods.
20227
20228         Basically, set the defaults to standard values.
20229
20230         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20231         argument, if candidate is better, it can't be worse than the best !
20232
20233         (Invocation): Re-write bits to differentiate between methods being
20234         applicable in their expanded form and their normal form - for params
20235         methods of course.
20236
20237         Get rid of use_standard everywhere as only standard conversions are allowed
20238         in overload resolution. 
20239
20240         More spec conformance.
20241
20242 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20243
20244         * driver.cs: Add --timestamp, to see where the compiler spends
20245         most of its time.
20246
20247         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20248         `this' in static code.
20249
20250         (SimpleName.DoResolve): Implement in terms of a helper function
20251         that allows static-references to be passed upstream to
20252         MemberAccess.
20253
20254         (Expression.ResolveWithSimpleName): Resolve specially simple
20255         names when called by MemberAccess to implement the special
20256         semantics. 
20257
20258         (Expression.ImplicitReferenceConversion): Handle conversions from
20259         Null to reference types before others, as Null's type is
20260         System.Object. 
20261
20262         * expression.cs (Invocation.EmitCall): Handle the special case of
20263         calling methods declared on a reference type from a ValueType
20264         (Base classes System.Object and System.Enum)
20265
20266         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20267         the left hand side is a TypeExpr, not on every enumeration. 
20268
20269         (Binary.Resolve): If types are reference types, then do a cast to
20270         object on operators != and == of both arguments.
20271
20272         * typemanager.cs (FindMembers): Extract instance and static
20273         members if requested.
20274
20275         * interface.cs (PopulateProperty): Use void_type instead of null
20276         as the return type for the setter method.
20277
20278         (PopulateIndexer): ditto.
20279
20280 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20281
20282         * support.cs (ReflectionParameters): Fix minor bug where we
20283         were examining the wrong parameter for the ParamArray attribute.
20284
20285         Cope with requests for the type of the parameter at position
20286         greater than the params parameter's. We now return the element
20287         type of the params array as that makes more sense.
20288
20289         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20290         accordingly as we no longer have to extract the element type
20291         ourselves.
20292
20293         (Invocation.OverloadResolve): Update.
20294
20295 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20296
20297         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20298         against IEnumerator, test whether the return value is a descendant
20299         of the IEnumerator interface.
20300
20301         * class.cs (Indexer.Define): Use an auxiliary method to implement
20302         the other bits of the method definition.  Begin support for
20303         explicit interface implementation.
20304
20305         (Property.DefineMethod): Use TypeManager.void_type instead of null
20306         for an empty return value.
20307
20308 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20309
20310         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20311         dealing with a FieldExpr which is composed of a FieldBuilder, in
20312         the code path we did extract the constant, but we should have
20313         obtained the underlying value to be able to cast it (otherwise we
20314         end up in an infinite loop, this is what Ravi was running into).
20315
20316         (ArrayCreation.UpdateIndices): Arrays might be empty.
20317
20318         (MemberAccess.ResolveMemberAccess): Add support for section
20319         14.5.4.1 that deals with the special case of E.I when E is a type
20320         and something else, that I can be a reference to a static member.
20321
20322         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20323         handle a particular array type to create byte blobs, it is just
20324         something we dont generate byteblobs for.
20325
20326         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20327         arguments. 
20328
20329         * location.cs (Push): remove the key from the hashtable that we
20330         are about to add.   This happens for empty files.
20331
20332         * driver.cs: Dispose files after we have parsed them.
20333
20334         (tokenize): new function that only runs the tokenizer on its
20335         input, for speed testing.
20336
20337 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20338
20339         * class.cs (Event.Define): Define the private field only if there
20340         are no accessors defined.
20341
20342         * expression.cs (ResolveMemberAccess): If there is no associated
20343         field with the event, that means we have an event defined with its
20344         own accessors and we should flag error cs0070 since transforming
20345         ourselves into a field is not valid in that case.
20346
20347         * ecore.cs (SimpleName.DoResolve): Same as above.
20348
20349         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20350         and charset to sane values.
20351
20352 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20353
20354         * assign.cs (DoResolve): Perform check on events only if they 
20355         are being accessed outside the declaring type.
20356
20357         * cs-parser.jay (event_declarations): Update rules to correctly
20358         set the type of the implicit parameter etc.
20359
20360         (add_accessor, remove_accessor): Set current local parameters.
20361
20362         * expression.cs (Binary): For delegate addition and subtraction,
20363         cast the return value from the method into the appropriate delegate
20364         type.
20365
20366 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20367
20368         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20369         of these as the workaround is unnecessary.
20370
20371         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20372         delegate data - none of that is needed at all.
20373
20374         Re-write bits to extract the instance expression and the delegate method
20375         correctly.
20376
20377         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20378         on delegates too.
20379
20380         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20381         of attaching attributes instead of duplicating code everywhere.
20382
20383         * everywhere : Update code to do attribute emission using the above method.
20384
20385 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20386
20387         * expression.cs (IsParamsMethodApplicable): if there are not
20388         parameters, return immediately.
20389
20390         * ecore.cs: The 0 literal can be implicity converted to an enum
20391         type. 
20392
20393         (SimpleName.DoResolve): First lookup the type, then lookup the
20394         members. 
20395
20396         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20397         want to get its address.  If the InstanceExpression is not
20398         addressable, store the result in a temporary variable, then get
20399         the address of it.
20400
20401         * codegen.cs: Only display 219 errors on warning level or above. 
20402
20403         * expression.cs (ArrayAccess): Make it implement the
20404         IMemoryLocation interface.
20405
20406         (Binary.DoResolve): handle the operator == (object a, object b)
20407         and operator != (object a, object b) without incurring into a
20408         BoxedCast (because 5 != o should never be performed).
20409
20410         Handle binary enumerator operators.
20411
20412         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20413         value type, otherwise use Ldelem_ref.
20414
20415         Use precomputed names;
20416
20417         (AddressOf): Implement address of
20418
20419         * cs-parser.jay (labeled_statement): Fix recursive block
20420         addition by reworking the production.
20421
20422         * expression.cs (New.DoEmit): New has a special case:
20423                 
20424                  If we are dealing with a ValueType, we have a few
20425                  situations to deal with:
20426                 
20427                     * The target of New is a ValueType variable, that is
20428                       easy, we just pass this as the variable reference
20429                 
20430                     * The target of New is being passed as an argument,
20431                       to a boxing operation or a function that takes a
20432                       ValueType.
20433                 
20434                       In this case, we need to create a temporary variable
20435                       that is the argument of New.
20436
20437
20438 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20439
20440         * rootcontext.cs (LookupType): Check that current_type is not null before
20441         going about looking at nested types.
20442
20443         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20444         not implement the IAssignMethod interface any more.
20445
20446         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20447         where we tranform them into FieldExprs if they are being resolved from within
20448         the declaring type.
20449
20450         * ecore.cs (SimpleName.DoResolve): Do the same here.
20451
20452         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20453
20454         * ../errors/bug10.cs : Add.
20455
20456         * ../errors/cs0070.cs : Add.
20457
20458         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20459
20460         * assign.cs : Get rid of EventIsLocal everywhere.
20461
20462 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20463
20464         * ecore.cs (ConvertIntLiteral): finished the implementation.
20465
20466         * statement.cs (SwitchLabel): Convert the value we are using as a
20467         key before looking up the table.
20468
20469 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20470
20471         * codegen.cs (EmitTopBlock): Require a Location argument now.
20472
20473         * cs-parser.jay (constructor_declarator): We need to setup
20474         current_local_parameters before we parse the
20475         opt_constructor_initializer, to allow the variables to be bound
20476         to the constructor arguments.
20477
20478         * rootcontext.cs (LookupType): First lookup nested classes in our
20479         class and our parents before we go looking outside our class.
20480
20481         * expression.cs (ConstantFold): Extract/debox the values at the
20482         beginnning. 
20483
20484         * rootcontext.cs (EmitCode): Resolve the constants first before we
20485         resolve the types.  This is not really needed, but it helps debugging.
20486
20487         * statement.cs: report location.
20488
20489         * cs-parser.jay: pass location to throw statement.
20490
20491         * driver.cs: Small bug fix.
20492
20493         * report.cs: Updated format to be 4-zero filled digits.
20494
20495 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20496
20497         * expression.cs (CheckIndices): Fix minor bug where the wrong
20498         variable was being referred to ;-)
20499
20500         (DoEmit): Do not call EmitStaticInitializers when the 
20501         underlying type is System.Object.
20502
20503 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20504
20505         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20506         and do the usual workaround for SRE.
20507
20508         * class.cs (MyEventBuilder.EventType): New member to get at the type
20509         of the event, quickly.
20510
20511         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20512
20513         * assign.cs (Assign.DoResolve): Handle the case when the target
20514         is an EventExpr and perform the necessary checks.
20515
20516         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20517         interface.
20518
20519         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20520
20521         (EventExpr): Set the type in the constructor itself since we 
20522         are meant to be born fully resolved.
20523
20524         (EventExpr.Define): Revert code I wrote earlier.
20525                 
20526         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20527         instance expression is null. The instance expression is a This in that case
20528         or a null, depending on whether it is a static method or not.
20529
20530         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20531         refers to more than one method.
20532
20533         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20534         and accordingly flag errors.
20535
20536 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20537
20538         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20539
20540 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20541
20542         * location.cs (ToString): Provide useful rutine.
20543
20544 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20545
20546         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20547         objects, return the actual integral boxed.
20548
20549         * statement.cs (SwitchLabel): define an ILLabel for each
20550         SwitchLabel. 
20551
20552         (Switch.CheckSwitch): If the value is a Literal, extract
20553         the underlying literal.
20554
20555         Also in the unused hashtable we had, add the SwitchLabel so we can
20556         quickly look this value up.
20557
20558         * constant.cs: Implement a bunch of new constants.  Rewrite
20559         Literal based on this.  Made changes everywhere to adapt to this.
20560
20561         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20562         dereferencing array only once, and also copes with enumrations.
20563
20564         bytes are two bytes wide, not one.
20565
20566         (Cast): Perform constant conversions.
20567
20568         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20569         wrappers to the literals here.
20570
20571         * expression.cs (DoNumericPromotions): long literals can converted
20572         to ulong implicity (this is taken care of elsewhere, but I was
20573         missing this spot).
20574
20575         * ecore.cs (Expression.Literalize): Make the return type Literal,
20576         to improve type checking.
20577
20578         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20579
20580 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20581
20582         * literal.cs: Revert code from ravi that checked the bounds.  The
20583         bounds are sane by the definition of the type itself. 
20584
20585         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20586         need to actually look up in our parent hierarchy for interfaces
20587         implemented. 
20588
20589         * const.cs: Use the underlying type for enumerations
20590
20591         * delegate.cs: Compute the basename for the delegate creation,
20592         that should fix the delegate test case, and restore the correct
20593         Type Lookup semantics in rootcontext
20594
20595         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20596         referencing a nested type with the Reflection API is using the "+"
20597         sign. 
20598
20599         * cs-parser.jay: Do not require EOF token at the end.
20600
20601 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20602
20603         * rootcontext.cs (LookupType): Concatenate type names with
20604         a '.' instead of a '+' The test suite passes again.
20605
20606         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20607         field of the enumeration.
20608
20609         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20610         the case when the member is an EventExpr.
20611
20612         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20613         static has an associated instance expression.
20614
20615         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20616
20617         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20618
20619         * class.cs (Event.Define): Register event and perform appropriate checks
20620         for error #111.
20621
20622         We define the Add and Remove methods even if the use provides none because
20623         in that case, we provide default implementations ourselves.
20624
20625         Define a private field of the type of the event. This is done by the CSC compiler
20626         and we should be doing it too ;-)
20627
20628         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20629         More methods we use in code we generate.
20630
20631         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20632         is important.
20633
20634         (InitCoreTypes): Update accordingly for the above.
20635
20636         * class.cs (Event.Emit): Generate code for default accessors that we provide
20637
20638         (EmitDefaultMethod): Do the job in the above.
20639
20640         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20641         appropriate place.
20642
20643 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20644
20645         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20646         builders even if we were missing one.
20647
20648         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20649         pass the Basename as our class name instead of the Name.  The
20650         basename will be correctly composed for us.
20651
20652         * parameter.cs (Paramters): Now takes a Location argument.
20653
20654         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20655         make all the code call directly LookupType in RootContext and take
20656         this chance to pass the Location information everywhere.
20657
20658         * Everywhere: pass Location information.
20659
20660 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20661
20662         * class.cs (Constructor.Define): Updated way of detecting the
20663         length of the parameters.
20664
20665         (TypeContainer.DefineType): Use basename as the type name for
20666         nested types.
20667
20668         (TypeContainer.Define): Do not recursively define types here, as
20669         definition is taken care in order by the RootContext.
20670
20671         * tree.cs: Keep track of namespaces in a per-file basis.
20672
20673         * parameter.cs (Parameter.ComputeSignature): Update to use
20674         DeclSpace. 
20675
20676         (Parameters.GetSignature): ditto.
20677
20678         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20679         instead of a TypeContainer.
20680
20681         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20682         resolve names.  Because we need to be resolve in our context, not
20683         our parents.
20684
20685         * driver.cs: Implement response files.
20686
20687         * class.cs (TypeContainer.DefineType): If we are defined, do not
20688         redefine ourselves.
20689
20690         (Event.Emit): Emit the code for add/remove handlers.
20691         (Event.Define): Save the MethodBuilders for add/remove.
20692
20693         * typemanager.cs: Use pair here too.
20694
20695         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20696         DictionaryEntry requires the first argument to be non-null.  
20697
20698         (enum_declaration): Compute full name for registering the
20699         enumeration.
20700
20701         (delegate_declaration): Instead of using
20702         formal_parameter_list, use opt_formal_parameter_list as the list
20703         can be empty.
20704
20705         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20706         (EventParsing): New property that controls whether `add' and
20707         `remove' are returned as tokens or identifiers (for events);
20708
20709 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20710
20711         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20712         use MyEventBuilder only and let it wrap the real builder for us.
20713
20714         (MyEventBuilder): Revamp constructor etc.
20715
20716         Implement all operations that we perform on EventBuilder in precisely the same
20717         way here too.
20718
20719         (FindMembers): Update to use the EventBuilder member.
20720
20721         (Event.Emit): Update accordingly.
20722
20723 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20724
20725         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20726         by calling the appropriate methods.
20727
20728         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20729         useful.
20730
20731         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20732
20733 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20734
20735         * delegate.cs (Delegate.Populate): Check that the return type
20736         and various parameters types are indeed accessible.
20737
20738         * class.cs (Constructor.Define): Same here.
20739
20740         (Field.Define): Ditto.
20741
20742         (Event.Define): Ditto.
20743
20744         (Operator.Define): Check that the underlying Method defined itself
20745         correctly - so it's MethodBuilder should not be null.
20746
20747         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20748         expression happens to be null.
20749
20750         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20751         members but as of now we don't seem to be able to do anything really useful with it.
20752
20753         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20754         not the EventBuilder.
20755
20756 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20757
20758         * cs-tokenizer.cs: Add support for defines.
20759         Add support for #if, #elif, #else, #endif
20760
20761         (eval_var): evaluates a variable.
20762         (eval): stubbed for evaluating functions.
20763
20764         * cs-parser.jay: Pass the defines information
20765
20766         * driver.cs: Add --define command line option.
20767
20768         * decl.cs: Move MemberCore here.
20769
20770         Make it the base class for DeclSpace.  This allows us to catch and
20771         report 108 and 109 for everything now.
20772
20773         * class.cs (TypeContainer.Define): Extract all the members
20774         before populating and emit the warning 108 (new keyword required
20775         to override) instead of having each member implement this.
20776
20777         (MemberCore.Define): New abstract method, we will be using this in
20778         the warning reporting engine in Populate.
20779
20780         (Operator.Define): Adjust to new MemberCore protocol. 
20781
20782         * const.cs (Const): This does not derive from Expression, it is a
20783         temporary object we use to create fields, it is a MemberCore. 
20784
20785         * class.cs (Method.Define): Allow the entry point to be in a
20786         specific class.
20787
20788         * driver.cs: Rewrite the argument handler to clean it up a bit.
20789
20790         * rootcontext.cs: Made it just an auxiliary namespace feature by
20791         making everything static.
20792
20793         * driver.cs: Adapt code to use RootContext type name instead of
20794         instance variable.
20795
20796         * delegate.cs: Remove RootContext argument.
20797
20798         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20799         argument. 
20800
20801         * class.cs (Event.Define): The lookup can fail.
20802
20803         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20804
20805         * expression.cs: Resolve the this instance before invoking the code.
20806
20807 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20808
20809         * cs-parser.jay: Add a production in element_access that allows
20810         the thing to become a "type" reference.  This way we can parse
20811         things like "(string [])" as a type.
20812
20813         Note that this still does not handle the more complex rules of
20814         casts. 
20815
20816
20817         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20818
20819         * ecore.cs: (CopyNewMethods): new utility function used to
20820         assemble the list of methods from running FindMembers.
20821
20822         (MemberLookup): Rework FindMembers so that 
20823
20824 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20825
20826         * class.cs (TypeContainer): Remove Delegates who fail to be
20827         defined.
20828
20829         * delegate.cs (Populate): Verify that we dont get null return
20830         values.   TODO: Check for AsAccessible.
20831
20832         * cs-parser.jay: Use basename to emit error 574 (destructor should
20833         have the same name as container class), not the full name.
20834
20835         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20836         possible representation.  
20837
20838         Also implements integer type suffixes U and L.
20839
20840 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20841
20842         * expression.cs (ArrayCreation.DoResolve): We need to do the
20843         argument resolution *always*.
20844
20845         * decl.cs: Make this hold the namespace.  Hold the root context as
20846         well.
20847         (LookupType): Move here.
20848
20849         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20850
20851         * location.cs (Row, Name): Fixed the code, it was always returning
20852         references to the first file.
20853
20854         * interface.cs: Register properties defined through interfaces.
20855
20856         * driver.cs: Add support for globbing on the command line
20857
20858         * class.cs (Field): Make it derive from MemberCore as well.
20859         (Event): ditto.
20860
20861 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20862
20863         * class.cs (Event::Define): Check that the type of the event is a delegate
20864         type else flag error #66.
20865
20866         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20867         same.
20868
20869         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20870         values of EntryPoint, CharSet etc etc.
20871
20872         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20873
20874         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20875         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20876         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20877         which needs this to do its work.
20878
20879         * ../errors/cs0066.cs : Add.
20880
20881 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20882
20883         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20884         helper functions.
20885
20886         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20887         clears out the parameters field.
20888         (MemberSignatureCompare): Cleanup
20889
20890         (MemberCore): New base class used to share code between MethodCore
20891         and Property.
20892
20893         (RegisterRequiredImplementations) BindingFlags.Public requires
20894         either BindingFlags.Instace or Static.  Use instance here.
20895
20896         (Property): Refactored code to cope better with the full spec.
20897
20898         * parameter.cs (GetParameterInfo): Return an empty array instead
20899         of null on error.
20900
20901         * class.cs (Property): Abstract or extern properties have no bodies.
20902
20903         * parameter.cs (GetParameterInfo): return a zero-sized array.
20904
20905         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20906         method modifier validation to the typecontainer so we can reuse
20907         this on properties.
20908
20909         (MethodCore.ParameterTypes): return an empty sized array of types.
20910
20911         (Property.Define): Test property modifier validity.
20912
20913         Add tests for sealed/override too.
20914
20915         (Method.Emit): abstract or extern methods have no bodies.
20916
20917 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20918
20919         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20920         thing.
20921
20922         (Method::Define, ::Emit): Modify accordingly.
20923
20924         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20925
20926         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20927
20928         * makefile: Pass in /unsafe.
20929
20930 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20931
20932         * class.cs (MakeKey): Kill routine.
20933
20934         * class.cs (TypeContainer.Define): Correctly define explicit
20935         method implementations (they require the full interface name plus
20936         the method name).
20937
20938         * typemanager.cs: Deply the PtrHashtable here and stop using the
20939         lame keys.  Things work so much better.
20940
20941         This of course broke everyone who depended on `RegisterMethod' to
20942         do the `test for existance' test.  This has to be done elsewhere.
20943
20944         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20945         the object stupid Equals method (because, that like fails all over
20946         the place).  We still do not use it.
20947
20948         * class.cs (TypeContainer.SetRequiredInterface,
20949         TypeContainer.RequireMethods): Killed these two routines and moved
20950         all the functionality to RegisterRequiredImplementations.
20951
20952         (TypeContainer.RegisterRequiredImplementations): This routine now
20953         registers all the implementations required in an array for the
20954         interfaces and abstract methods.  We use an array of structures
20955         which can be computed ahead of time to reduce memory usage and we
20956         also assume that lookups are cheap as most classes will not
20957         implement too many interfaces.
20958
20959         We also avoid creating too many MethodSignatures.
20960
20961         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20962         clear the "pending" bit if we find that there are problems with
20963         the declaration.
20964
20965         (TypeContainer.VerifyPendingMethods): Update to report errors of
20966         methods that look like implementations but are not.
20967
20968         (TypeContainer.Define): Add support for explicit interface method
20969         implementation. 
20970
20971 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20972
20973         * typemanager.cs: Keep track of the parameters here instead of
20974         being a feature of the TypeContainer.
20975
20976         * class.cs: Drop the registration of parameters here, as
20977         InterfaceMethods are also interface declarations.
20978
20979         * delegate.cs: Register methods with the TypeManager not only with
20980         the TypeContainer.  This code was buggy.
20981
20982         * interface.cs: Full registation here.
20983
20984 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20985
20986         * expression.cs: Remove reducer for binary expressions, it can not
20987         be done this way.
20988
20989         * const.cs: Put here the code that used to go into constant.cs
20990
20991         * constant.cs: Put here the code for constants, this is a new base
20992         class for Literals.
20993
20994         * literal.cs: Make Literal derive from Constant.
20995
20996 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20997
20998         * statement.cs (Return.Emit): Report error 157 if the user
20999         attempts to return from a finally block.
21000
21001         (Return.Emit): Instead of emitting a return, jump to the end of
21002         the function.
21003
21004         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21005         LocalBuilder to store the result of the function.  ReturnLabel is
21006         the target where we jump.
21007
21008
21009 2001-12-09  Radek Doulik  <rodo@ximian.com>
21010
21011         * cs-parser.jay: remember alias in current namespace
21012
21013         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21014         namespaces
21015
21016         * class.cs (LookupAlias): lookup alias in my_namespace
21017
21018         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21019         aliases hashtable
21020         (LookupAlias): lookup alias in this and if needed in parent
21021         namespaces
21022
21023 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21024
21025         * support.cs: 
21026
21027         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21028         making things static.  I need this to avoid passing the
21029         TypeContainer when calling ParameterType.
21030
21031         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21032         that did string manipulation to compute the type and then call
21033         GetType.  Use Parameter.ParameterType instead.
21034
21035         * cs-tokenizer.cs: Consume the suffix for floating values.
21036
21037         * expression.cs (ParameterReference): figure out whether this is a
21038         reference parameter or not.  Kill an extra variable by computing
21039         the arg_idx during emission.
21040
21041         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21042         function that returns whether a parameter is an out/ref value or not.
21043
21044         (Parameter.ParameterType): The type of the parameter (base,
21045         without ref/out applied).
21046
21047         (Parameter.Resolve): Perform resolution here.
21048         (Parameter.ExternalType): The full type (with ref/out applied).
21049
21050         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21051         support for expressions on the using statement.
21052
21053 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21054
21055         * statement.cs (Using.EmitLocalVariableDecls): Split the
21056         localvariable handling of the using statement.
21057
21058         (Block.EmitMeta): Keep track of variable count across blocks.  We
21059         were reusing slots on separate branches of blocks.
21060
21061         (Try.Emit): Emit the general code block, we were not emitting it. 
21062
21063         Check the type of the declaration to be an IDisposable or
21064         something that can be implicity converted to it. 
21065
21066         Emit conversions if required.
21067
21068         * ecore.cs (EmptyExpression): New utility class.
21069         (Expression.ImplicitConversionExists): New utility function.
21070
21071 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21072
21073         * statement.cs (Using): Implement.
21074
21075         * expression.cs (LocalVariableReference): Support read only variables.
21076
21077         * statement.cs: Remove the explicit emit for the Leave opcode.
21078         (VariableInfo): Add a readonly field.
21079
21080 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21081
21082         * ecore.cs (ConvCast): new class used to encapsulate the various
21083         explicit integer conversions that works in both checked and
21084         unchecked contexts.
21085
21086         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21087         properly generate the overflow opcodes.
21088
21089 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21090
21091         * statement.cs: The correct type for the EmptyExpression is the
21092         element_type, not the variable type.  Ravi pointed this out.
21093
21094 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21095
21096         * class.cs (Method::Define): Handle PInvoke methods specially
21097         by using DefinePInvokeMethod instead of the usual one.
21098
21099         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21100         above to do the task of extracting information and defining the method.
21101
21102 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21103
21104         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21105         of the condition for string type.
21106
21107         (Emit): Move that here. 
21108
21109         (ArrayCreation::CheckIndices): Keep string literals in their expression
21110         form.
21111
21112         (EmitDynamicInitializers): Handle strings appropriately.
21113
21114 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21115
21116         * codegen.cs (EmitContext): Replace multiple variables with a
21117         single pointer to the current Switch statement.
21118
21119         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21120         EmitContext.
21121
21122 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21123
21124         * statement.cs 
21125
21126         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21127         default'.
21128
21129         (Foreach.Emit): Foreach on arrays was not setting
21130         up the loop variables (for break/continue).
21131
21132         (GotoCase): Semi-implented.
21133
21134 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21135
21136         * attribute.cs (CheckAttribute): Handle system attributes by using
21137         Attribute.GetAttributes to examine information we need.
21138
21139         (GetValidPlaces): Same here.
21140
21141         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21142
21143         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21144
21145         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21146
21147         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21148
21149         (Method::Emit): Handle the case when we are a PInvoke method.
21150
21151 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21152
21153         * expression.cs: Use ResolveWithSimpleName on compound names.
21154
21155 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21156
21157         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21158         before trying to reduce it.
21159
21160         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21161
21162         * constant.cs (LookupConstantValue): Implement.
21163
21164         (EmitConstant): Use the above in emitting the constant.
21165
21166         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21167         that are user-defined by doing a LookupConstantValue on them.
21168
21169         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21170         too, like above.
21171
21172 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21173
21174         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21175
21176         (BaseAccess.DoResolve): Implement.
21177
21178         (MemberAccess.DoResolve): Split this routine into a
21179         ResolveMemberAccess routine that can be used independently
21180
21181 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21182
21183         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21184         As that share bits of the implementation.  Is returns a boolean,
21185         while As returns the Type that is being probed.
21186
21187 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21188
21189         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21190         instead of a Literal - much easier.
21191
21192         (EnumInTransit): Remove - utterly useless :-)
21193
21194         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21195
21196         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21197
21198         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21199         chain when we have no associated expression.
21200
21201 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21202
21203         * constant.cs (Define): Use Location while reporting the errror.
21204
21205         Also emit a warning when 'new' is used and there is no inherited
21206         member to hide.
21207
21208         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21209         populated.
21210
21211         (LookupEnumValue): Implement to lookup an enum member's value and define it
21212         if necessary.
21213
21214         (Populate): Re-write accordingly to use the above routine.
21215
21216 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21217
21218         * expression.cs (This): Fix prototype for DoResolveLValue to
21219         override the base class DoResolveLValue.
21220
21221         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21222         declarations) 
21223
21224         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21225         (we need to load the address of the field here).  This fixes
21226         test-22. 
21227
21228         (FieldExpr.DoResolveLValue): Call the DoResolve
21229         function to initialize the Instance expression.
21230
21231         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21232         correctly the GetEnumerator operation on a value type.
21233
21234         * cs-parser.jay: Add more simple parsing error catches.
21235
21236         * statement.cs (Switch): Add support for string switches.
21237         Handle null specially.
21238
21239         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21240
21241 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21242
21243         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21244
21245         (declare_local_constant): New helper function.
21246
21247         * statement.cs (AddConstant): Keep a separate record of constants
21248
21249         (IsConstant): Implement to determine if a variable is a constant.
21250
21251         (GetConstantExpression): Implement.
21252
21253         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21254
21255         * statement.cs (IsVariableDefined): Re-write.
21256
21257 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21258
21259         * class.cs (TypeContainer::FindMembers): Look for constants
21260         in the case when we are looking for MemberTypes.Field
21261
21262         * expression.cs (MemberAccess::DoResolve): Check that in the
21263         case we are a FieldExpr and a Literal, we are not being accessed
21264         by an instance reference.
21265
21266         * cs-parser.jay (local_constant_declaration): Implement.
21267
21268         (declaration_statement): Implement for constant declarations.
21269
21270 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21271
21272         * statement.cs (Switch): Catch double defaults.
21273
21274         (Switch): More work on the switch() statement
21275         implementation.  It works for integral values now, need to finish
21276         string support.
21277
21278
21279 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21280
21281         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21282         integer literals into other integer literals.  To be used by
21283         switch. 
21284
21285 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21286
21287         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21288         some memory.
21289
21290         (EmitDynamicInitializers): Cope with the above since we extract data
21291         directly from ArrayData now.
21292
21293         (ExpectInitializers): Keep track of whether initializers are mandatory
21294         or not.
21295
21296         (Bounds): Make it a hashtable to prevent the same dimension being 
21297         recorded for every element in that dimension.
21298
21299         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21300         from being found.
21301
21302         Also fix bug which was causing the indices to be emitted in the reverse
21303         order.
21304
21305 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21306
21307         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21308         unfinished.  They do not work, because the underlying code is
21309         sloppy.
21310
21311 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21312
21313         * cs-parser.jay: Remove bogus fixme.
21314
21315         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21316         on Switch statement.
21317
21318 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21319
21320         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21321         the same. 
21322
21323         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21324         parameter. Apparently, any expression is allowed. 
21325
21326         (ValidateInitializers): Update accordingly.
21327
21328         (CheckIndices): Fix some tricky bugs thanks to recursion.
21329
21330         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21331         I was being completely brain-dead.
21332
21333         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21334         and re-write acordingly.
21335
21336         (DelegateInvocation): Re-write accordingly.
21337
21338         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21339
21340         (MakeByteBlob): Handle types more correctly.
21341
21342         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21343         initialization from expressions but it is incomplete because I am a complete
21344         Dodo :-|
21345
21346 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21347
21348         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21349         on If.  Basically, we have to return `true' (ie, we do return to
21350         our caller) only if both branches of the if return.
21351
21352         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21353         short-circuit operators, handle them as short circuit operators. 
21354
21355         (Cast.DoResolve): Resolve type.
21356         (Cast.Cast): Take an expression as the target type.
21357
21358         * cs-parser.jay (cast_expression): Remove old hack that only
21359         allowed a limited set of types to be handled.  Now we take a
21360         unary_expression and we resolve to a type during semantic
21361         analysis.
21362
21363         Use the grammar productions from Rhys to handle casts (this is
21364         not complete like Rhys syntax yet, we fail to handle that corner
21365         case that C# has regarding (-x), but we will get there.
21366
21367 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21368
21369         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21370         field which is an array type.
21371
21372         * cs-parser.jay (declare_local_variables): Support array initialization too.
21373
21374         * typemanager.cs (MakeKey): Implement.
21375
21376         (everywhere): Use the above appropriately.
21377
21378         * cs-parser.jay (for_statement): Update for array initialization while
21379         declaring variables.
21380
21381         * ecore.cs : The error message was correct, it's the variable's names that
21382         were misleading ;-) Make the code more readable.
21383
21384         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21385         the correct type etc.
21386
21387         (ConvertExplicit): Handle Enum types by examining the underlying type.
21388
21389 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21390
21391         * parameter.cs (GetCallingConvention): Always return
21392         CallingConventions.Standard for now.
21393
21394 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21395
21396         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21397         and `r' after calling DoNumericPromotions.
21398
21399         * ecore.cs: Fix error message (the types were in the wrong order).
21400
21401         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21402         BindingFlags.Instance as well 
21403
21404         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21405         implicit int literal conversion in an empty cast so that we
21406         propagate the right type upstream.
21407
21408         (UnboxCast): new class used to unbox value types.
21409         (Expression.ConvertExplicit): Add explicit type conversions done
21410         by unboxing.
21411
21412         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21413         the target type before applying the implicit LongLiterals to ULong
21414         literal cast.
21415
21416 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21417
21418         * cs-parser.jay (for_statement): Reworked the way For works: now
21419         we declare manually any variables that are introduced in
21420         for_initializer to solve the problem of having out-of-band code
21421         emition (that is what got for broken).
21422
21423         (declaration_statement): Perform the actual variable declaration
21424         that used to be done in local_variable_declaration here.
21425
21426         (local_variable_declaration): Do not declare anything, just pass
21427         the information on a DictionaryEntry
21428
21429 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21430
21431         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21432         re-write of the logic to now make it recursive.
21433
21434         (UpdateIndices): Re-write accordingly.
21435
21436         Store element data in a separate ArrayData list in the above methods.
21437
21438         (MakeByteBlob): Implement to dump the array data into a byte array.
21439
21440 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21441
21442         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21443         into CheckIndices.
21444
21445         * constant.cs (Define): Implement.
21446
21447         (EmitConstant): Re-write fully.
21448
21449         Pass in location info.
21450
21451         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21452         respectively.
21453
21454         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21455         DictionaryEntry since we need location info too.
21456
21457         (constant_declaration): Update accordingly.
21458
21459         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21460         code into another method : UpdateIndices.
21461
21462 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21463
21464         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21465         some type checking etc.
21466
21467 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21468
21469         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21470         bits to provide dimension info if the user skips doing that.
21471
21472         Update second constructor to store the rank correctly.
21473
21474 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21475
21476         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21477         and try to implement.
21478
21479         * ../errors/cs0150.cs : Add.
21480
21481         * ../errors/cs0178.cs : Add.
21482
21483 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21484
21485         * statement.cs: Implement foreach on multi-dimensional arrays. 
21486
21487         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21488         name of the params argument.
21489
21490         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21491         initializing the array.
21492
21493         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21494         we can use this elsewhere.
21495
21496         * statement.cs: Finish implementation of foreach for single
21497         dimension arrays.
21498
21499         * cs-parser.jay: Use an out-of-band stack to pass information
21500         around, I wonder why I need this.
21501
21502         foreach_block: Make the new foreach_block the current_block.
21503
21504         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21505         function used to return a static Parameters structure.  Used for
21506         empty parameters, as those are created very frequently.
21507
21508         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21509
21510 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21511
21512         * interface.cs : Default modifier is private, not public. The
21513         make verify test passes again.
21514
21515 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21516
21517         * support.cs (ReflectionParameters): Fix logic to determine
21518         whether the last parameter is a params one. Test 9 passes again.
21519
21520         * delegate.cs (Populate): Register the builders we define with
21521         RegisterParameterForBuilder. Test 19 passes again.
21522
21523         * cs-parser.jay (property_declaration): Reference $6 instead
21524         of $$ to get at the location.
21525
21526         (indexer_declaration): Similar stuff.
21527
21528         (attribute): Ditto.
21529
21530         * class.cs (Property): Register parameters for the Get and Set methods
21531         if they exist. Test 23 passes again.
21532
21533         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21534         call to EmitArguments as we are sure there aren't any params arguments. 
21535         Test 32 passes again.
21536
21537         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21538         IndexOutOfRangeException. 
21539
21540         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21541         Test 33 now passes again.
21542
21543 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21544
21545         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21546         broke a bunch of things.  Will have to come up with a better way
21547         of tracking locations.
21548
21549         * statement.cs: Implemented foreach for single dimension arrays.
21550
21551 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21552
21553         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21554         an error.  This removes the lookup from the critical path.
21555
21556         * cs-parser.jay: Removed use of temporary_loc, which is completely
21557         broken. 
21558
21559 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21560
21561         * support.cs (ReflectionParameters.ParameterModifier): Report
21562         whether the argument is a PARAMS argument or not.
21563
21564         * class.cs: Set the attribute `ParamArrayAttribute' on the
21565         parameter argument.
21566
21567         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21568         and cons_param_array_attribute (ConstructorInfo for
21569         ParamArrayAttribute)., 
21570
21571         * codegen.cs: Emit the return using the `Return' statement, that
21572         way we can report the error correctly for missing return values. 
21573
21574         * class.cs (Method.Emit): Clean up.
21575
21576         * expression.cs (Argument.Resolve): Take another argument: the
21577         location where this argument is used.  Notice that this is not
21578         part of the "Argument" class as to reduce the size of the
21579         structure (we know the approximate location anyways).
21580
21581         Test if the argument is a variable-reference, if not, then
21582         complain with a 206.
21583
21584         (Argument.Emit): Emit addresses of variables.
21585
21586         (Argument.FullDesc): Simplify.
21587
21588         (Invocation.DoResolve): Update for Argument.Resolve.
21589
21590         (ElementAccess.DoResolve): ditto.
21591
21592         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21593         method should be virtual, as this method is always virtual.
21594
21595         (NewDelegate.DoResolve): Update for Argument.Resolve.
21596
21597         * class.cs (ConstructorInitializer.DoResolve): ditto.
21598
21599         * attribute.cs (Attribute.Resolve): ditto.
21600
21601 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21602
21603         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21604
21605         * expression.cs (ParameterReference): Drop IStackStorage and implement
21606         IAssignMethod instead. 
21607
21608         (LocalVariableReference): ditto.
21609
21610         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21611         IAssignMethod instead. 
21612
21613 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21614
21615         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21616         enumerations that are used in heavily used structures derive from
21617         byte in a laughable and pathetic attempt to reduce memory usage.
21618         This is the kind of pre-optimzations that you should not do at
21619         home without adult supervision.
21620
21621         * expression.cs (UnaryMutator): New class, used to handle ++ and
21622         -- separatedly from the other unary operators.  Cleans up the
21623         code, and kills the ExpressionStatement dependency in Unary.
21624
21625         (Unary): Removed `method' and `Arguments' from this class, making
21626         it smaller, and moving it all to SimpleCall, so I can reuse this
21627         code in other locations and avoid creating a lot of transient data
21628         strucutres when not required.
21629
21630         * cs-parser.jay: Adjust for new changes.
21631
21632 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21633
21634         * enum.cs (Enum.Populate): If there is a failure during
21635         definition, return
21636
21637         * cs-parser.jay (opt_enum_base): we used to catch type errors
21638         here, but this is really incorrect.  The type error should be
21639         catched during semantic analysis.
21640
21641 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21642
21643         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21644         current_local_parameters as expected since I, in my stupidity, had forgotten
21645         to do this :-)
21646
21647         * attribute.cs (GetValidPlaces): Fix stupid bug.
21648
21649         * class.cs (Method::Emit): Perform check on applicability of attributes.
21650
21651         (Constructor::Emit): Ditto.
21652
21653         (Field::Emit): Ditto.
21654
21655         (Field.Location): Store location information.
21656
21657         (Property, Event, Indexer, Operator): Ditto.
21658
21659         * cs-parser.jay (field_declaration): Pass in location for each field.
21660
21661         * ../errors/cs0592.cs : Add.
21662
21663 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21664
21665         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21666
21667         (InitCoreTypes): Update accordingly.
21668
21669         (RegisterAttrType, LookupAttr): Implement.
21670
21671         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21672         info about the same.
21673
21674         (Resolve): Update to populate the above as necessary.
21675
21676         (Error592): Helper.
21677
21678         (GetValidPlaces): Helper to the above.
21679
21680         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21681
21682         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21683
21684 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21685
21686         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21687
21688         * ../errors/cs0617.cs : Add.
21689
21690 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21691
21692         * enum.cs (Emit): Rename to Populate to be more consistent with what
21693         we expect it to do and when exactly it is called.
21694
21695         * class.cs, rootcontext.cs : Update accordingly.
21696
21697         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21698         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21699
21700         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21701
21702         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21703         of a fieldinfo using the above, when dealing with a FieldBuilder.
21704
21705 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21706
21707         * ../errors/cs0031.cs : Add.
21708
21709         * ../errors/cs1008.cs : Add.
21710
21711         * ../errrors/cs0543.cs : Add.
21712
21713         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21714         enum type.
21715
21716         (FindMembers): Implement.
21717
21718         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21719         enums and delegates too.
21720
21721         (enum_types): Rename to builder_to_enum.
21722
21723         (delegate_types): Rename to builder_to_delegate.
21724
21725         * delegate.cs (FindMembers): Implement.
21726
21727 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21728
21729         * typemanager.cs (IsEnumType): Implement.
21730
21731         * enum.cs (Emit): Re-write parts to account for the underlying type
21732         better and perform checking etc.
21733
21734         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21735         of the underlying type.
21736
21737         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21738         value
21739
21740         * enum.cs (error31): Helper to report error #31.
21741
21742         * cs-parser.jay (enum_declaration): Store location of each member too.
21743
21744         * enum.cs (member_to_location): New hashtable. 
21745
21746         (AddEnumMember): Update location hashtable.
21747
21748         (Emit): Use the location of each member while reporting errors.
21749
21750 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21751
21752         * cs-parser.jay: A for_initializer if is a
21753         local_variable_declaration really ammount to have an implicit
21754         block with the variable declaration and no initializer for for.
21755
21756         * statement.cs (For.Emit): Cope with null initializers.
21757
21758         This fixes the infinite loop on for initializers.
21759
21760 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21761
21762         * enum.cs: More cleanup.
21763
21764         * ecore.cs: Remove dead code.
21765
21766         * class.cs (Property.Emit): More simplification.
21767         (Event.Emit): ditto.
21768
21769         Reworked to have less levels of indentation.
21770
21771 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21772
21773         * class.cs (Property): Emit attributes.
21774
21775         (Field): Ditto.
21776
21777         (Event): Ditto.
21778
21779         (Indexer): Ditto.
21780
21781         (Operator): Ditto.
21782
21783         * enum.cs (Emit): Ditto.
21784
21785         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21786         Enums too.
21787
21788         * class.cs (Field, Event, etc.): Move attribute generation into the
21789         Emit method everywhere.
21790
21791         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21792         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21793         as we had no way of defining nested enums !
21794
21795         * rootcontext.cs : Adjust code accordingly.
21796
21797         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21798
21799 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21800
21801         * expression.cs (EvalConstantExpression): Move into ecore.cs
21802
21803         * enum.cs (Enum): Rename some members and make them public and readonly
21804         according to our convention.
21805
21806         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21807         nothing else.
21808
21809         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21810
21811         (Enum::Emit): Write a simple version for now which doesn't try to compute
21812         expressions. I shall modify this to be more robust in just a while.
21813
21814         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21815
21816         (TypeContainer::CloseType): Create the Enum types too.
21817
21818         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21819
21820         * expression.cs (EvalConstantExpression): Get rid of completely.
21821
21822         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21823         user-defined values and other cases.
21824
21825         (IsValidEnumLiteral): Helper function.
21826
21827         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21828         out there in the case we had a literal FieldExpr.
21829
21830         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21831
21832         (Literalize): Revamp a bit to take two arguments.
21833
21834         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21835
21836 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21837
21838         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21839
21840         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21841
21842         (Resolve): Use the above to ensure we have proper initializers.
21843
21844 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21845
21846         * expression.cs (Expression::EvalConstantExpression): New method to 
21847         evaluate constant expressions.
21848
21849         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21850
21851 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21852
21853         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21854         in an array.
21855
21856         (Binary.ResolveOperator): Handle operator != (object a, object b)
21857         and operator == (object a, object b);
21858
21859         (Binary.DoNumericPromotions): Indicate whether the numeric
21860         promotion was possible.
21861
21862         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21863         Implement.  
21864
21865         Made the ArrayAccess implement interface IAssignMethod instead of
21866         IStackStore as the order in which arguments are passed reflects
21867         this.
21868
21869         * assign.cs: Instead of using expr.ExprClass to select the way of
21870         assinging, probe for the IStackStore/IAssignMethod interfaces.
21871
21872         * typemanager.cs: Load InitializeArray definition.
21873
21874         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21875         static data that can be used to initialize arrays. 
21876
21877 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21878
21879         * expression.cs: Handle operator== and operator!= for booleans.
21880
21881         (Conditioal.Reduce): Implement reducer for the ?: operator.
21882
21883         (Conditional.Resolve): Implement dead code elimination.
21884
21885         (Binary.Resolve): Catch string literals and return a new
21886         concatenated string.
21887
21888         (Unary.Reduce): Implement reduction of unary expressions.
21889
21890         * ecore.cs: Split out the expression core handling here.
21891
21892         (Expression.Reduce): New method used to perform constant folding
21893         and CSE.  This is needed to support constant-expressions. 
21894
21895         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21896         targets, and optimize for !x.
21897
21898 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21899
21900         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21901         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21902         set custom atttributes.
21903
21904         * literal.cs (Literal::GetValue): New abstract method to return the actual
21905         value of the literal, cast as an object.
21906
21907         (*Literal): Implement GetValue method.
21908
21909         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21910         expressions to the arraylist but objects of type Argument.
21911
21912         * class.cs (TypeContainer::Emit): Emit our attributes too.
21913
21914         (Method::Emit, Constructor::Emit): Ditto.
21915
21916         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21917         to be ignoring earlier.
21918
21919 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21920
21921         * attribute.cs (AttributeSection::Define): Implement to do the business
21922         of constructing a CustomAttributeBuilder.
21923
21924         (Attribute): New trivial class. Increases readability of code.  
21925
21926         * cs-parser.jay : Update accordingly.
21927
21928         (positional_argument_list, named_argument_list, named_argument): New rules
21929
21930         (attribute_arguments): Use the above so that we are more correct.
21931
21932 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21933
21934         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21935         to perform all checks for a method with a params parameter.
21936
21937         (Invocation::OverloadResolve): Update to use the above method and therefore
21938         cope correctly with params method invocations.
21939
21940         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21941         params too.
21942
21943         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21944         constructors in our parent too because we can't afford to miss out on 
21945         protected ones ;-)
21946
21947         * attribute.cs (AttributeSection): New name for the class Attribute
21948
21949         Other trivial changes to improve readability.
21950
21951         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21952         use the new class names.
21953
21954 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21955
21956         * class.cs (Method::Define): Complete definition for params types too
21957
21958         (Indexer::Define): Ditto.
21959
21960         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21961         Cope everywhere with a request for info about the array parameter.
21962
21963 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21964
21965         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21966
21967         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21968         local_variable_type to extract the string corresponding to the type.
21969
21970         (local_variable_type): Fixup the action to use the new helper method.
21971
21972         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21973         go.
21974
21975         * expression.cs : Clean out code which uses the above.
21976
21977 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21978
21979         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21980         and bale out if necessary by returning a false.
21981
21982         (RegisterProperty): Ditto.
21983
21984         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21985         and print out appropriate error messages.
21986
21987         * interface.cs (everywhere): Ditto.
21988
21989         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21990         location to constructor.
21991
21992         * class.cs (Property, Event, Indexer): Update accordingly.
21993
21994         * ../errors/cs111.cs : Added.
21995
21996         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21997         of a method, as laid down by the spec.
21998
21999         (Invocation::OverloadResolve): Use the above method.
22000
22001 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22002
22003         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22004         now take a TypeContainer and a Parameters object.
22005
22006         (ParameterData): Modify return type of ParameterModifier method to be 
22007         Parameter.Modifier and not a string.
22008
22009         (ReflectionParameters, InternalParameters): Update accordingly.
22010
22011         * expression.cs (Argument::GetParameterModifier): Same here.
22012
22013         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22014         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22015         symbol in it at all so maybe this is only for now.
22016
22017 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22018
22019         * support.cs (InternalParameters): Constructor now takes an extra argument 
22020         which is the actual Parameters class.
22021
22022         (ParameterDesc): Update to provide info on ref/out modifiers.
22023
22024         * class.cs (everywhere): Update call to InternalParameters to pass in
22025         the second argument too.
22026
22027         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22028         to return the modifier info [ref/out etc]
22029
22030         (InternalParameters, ReflectionParameters): Implement the above.
22031
22032         * expression.cs (Argument::ParameterModifier): Similar function to return
22033         info about the argument's modifiers.
22034
22035         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22036         too.
22037
22038         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22039         a new SetFormalParameters object which we pass to InternalParameters.
22040
22041 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22042
22043         * expression.cs (NewArray): Merge into the ArrayCreation class.
22044
22045 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22046
22047         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22048         NewUserdefinedArray into one as there wasn't much of a use in having
22049         two separate ones.
22050
22051         * expression.cs (Argument): Change field's name to ArgType from Type.
22052
22053         (Type): New readonly property which returns the proper type, taking into 
22054         account ref/out modifiers.
22055
22056         (everywhere): Adjust code accordingly for the above.
22057
22058         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22059         whether we are emitting for a ref or out parameter.
22060
22061         * expression.cs (Argument::Emit): Use the above field to set the state.
22062
22063         (LocalVariableReference::Emit): Update to honour the flag and emit the
22064         right stuff.
22065
22066         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22067
22068         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22069
22070         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22071
22072         (ReflectionParameters, InternalParameters): Implement the above method.
22073
22074         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22075         reporting errors.
22076
22077         (Invocation::FullMethodDesc): Ditto. 
22078
22079 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22080
22081         * cs-parser.jay: Add extra production for the second form of array
22082         creation. 
22083
22084         * expression.cs (ArrayCreation): Update to reflect the above
22085         change. 
22086
22087         * Small changes to prepare for Array initialization.
22088
22089 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22090
22091         * typemanager.cs (ImplementsInterface): interface might be null;
22092         Deal with this problem;
22093
22094         Also, we do store negative hits on the cache (null values), so use
22095         this instead of calling t.GetInterfaces on the type everytime.
22096
22097 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22098
22099         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22100
22101         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22102         split functionality out into different classes.
22103
22104         (New::FormArrayType): Move into NewBuiltinArray.
22105
22106         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22107         quite useless.
22108
22109         (NewBuiltinArray): New class to handle creation of built-in arrays.
22110
22111         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22112         account creation of one-dimensional arrays.
22113
22114         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22115
22116         (NewUserdefinedArray::DoResolve): Implement.
22117
22118         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22119
22120         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22121         we maintain inside the TypeManager. This is necessary to perform lookups on the
22122         module builder.
22123
22124         (LookupType): Update to perform GetType on the module builders too.     
22125
22126         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22127
22128         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22129
22130 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22131
22132         * expression.cs (New::DoResolve): Implement guts of array creation.
22133
22134         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22135
22136 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22137
22138         * expression.cs: Fix bug I introduced lsat night that broke
22139         Delegates. 
22140
22141         (Expression.Resolve): Report a 246 error (can not resolve name)
22142         if we find a SimpleName in the stream.
22143
22144         (Expression.ResolveLValue): Ditto.
22145
22146         (Expression.ResolveWithSimpleName): This function is a variant of
22147         ResolveName, this one allows SimpleNames to be returned without a
22148         warning.  The only consumer of SimpleNames is MemberAccess
22149
22150 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22151
22152         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22153         might arrive here.  I have my doubts that this is correct.
22154
22155         * statement.cs (Lock): Implement lock statement.
22156
22157         * cs-parser.jay: Small fixes to support `lock' and `using'
22158
22159         * cs-tokenizer.cs: Remove extra space
22160
22161         * driver.cs: New flag --checked, allows to turn on integer math
22162         checking. 
22163
22164         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22165         Threading.Monitor.Exit 
22166
22167 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22168
22169         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22170         Expression Class to be IndexerAccess.
22171
22172         Notice that Indexer::DoResolve sets the eclass to Value.
22173
22174 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * class.cs (TypeContainer::Emit): Emit code for indexers.
22177
22178         * assign.cs (IAssignMethod): New interface implemented by Indexers
22179         and Properties for handling assignment.
22180
22181         (Assign::Emit): Simplify and reuse code. 
22182
22183         * expression.cs (IndexerAccess, PropertyExpr): Implement
22184         IAssignMethod, clean up old code. 
22185
22186 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22187
22188         * typemanager.cs (ImplementsInterface): New method to determine if a type
22189         implements a given interface. Provides a nice cache too.
22190
22191         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22192         method.
22193
22194         (ConvertReferenceExplicit): Ditto.
22195
22196         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22197         various methods, with correct names etc.
22198
22199         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22200         Operator.UnaryNegation.
22201
22202         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22203         we have a unary plus or minus operator.
22204
22205         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22206         UnaryMinus.
22207
22208         * everywhere : update accordingly.
22209
22210         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22211         respectively.
22212
22213         * class.cs (Method::Define): For the case where we are implementing a method
22214         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22215         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22216
22217 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22218
22219         * interface.cs (FindMembers): Implement to work around S.R.E
22220         lameness.
22221
22222         * typemanager.cs (IsInterfaceType): Implement.
22223
22224         (FindMembers): Update to handle interface types too.
22225
22226         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22227         use IsAssignableFrom as that is not correct - it doesn't work.
22228
22229         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22230         and accordingly override EmitStatement.
22231
22232         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22233         using the correct logic :-)
22234
22235 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22236
22237         * ../errors/cs-11.cs : Add to demonstrate error -11 
22238
22239 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22240
22241         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22242         then pass this as a hint to ResolveLValue.
22243
22244         * expression.cs (FieldExpr): Add Location information
22245
22246         (FieldExpr::LValueResolve): Report assignment to readonly
22247         variable. 
22248
22249         (Expression::ExprClassFromMemberInfo): Pass location information.
22250
22251         (Expression::ResolveLValue): Add new method that resolves an
22252         LValue. 
22253
22254         (Expression::DoResolveLValue): Default invocation calls
22255         DoResolve. 
22256
22257         (Indexers): New class used to keep track of indexers in a given
22258         Type. 
22259
22260         (IStackStore): Renamed from LValue, as it did not really describe
22261         what this did.  Also ResolveLValue is gone from this interface and
22262         now is part of Expression.
22263
22264         (ElementAccess): Depending on the element access type
22265
22266         * typemanager.cs: Add `indexer_name_type' as a Core type
22267         (System.Runtime.CompilerServices.IndexerNameAttribute)
22268
22269         * statement.cs (Goto): Take a location.
22270
22271 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22272
22273         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22274         if two delegates are compatible.
22275
22276         (NewDelegate::DoResolve): Update to take care of the case when
22277         we instantiate a delegate from another delegate.
22278
22279         * typemanager.cs (FindMembers): Don't even try to look up members
22280         of Delegate types for now.
22281
22282 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22283
22284         * delegate.cs (NewDelegate): New class to take care of delegate
22285         instantiation.
22286
22287         * expression.cs (New): Split the delegate related code out into 
22288         the NewDelegate class.
22289
22290         * delegate.cs (DelegateInvocation): New class to handle delegate 
22291         invocation.
22292
22293         * expression.cs (Invocation): Split out delegate related code into
22294         the DelegateInvocation class.
22295
22296 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22297
22298         * expression.cs (New::DoResolve): Implement delegate creation fully
22299         and according to the spec.
22300
22301         (New::DoEmit): Update to handle delegates differently.
22302
22303         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22304         because of which we were printing out arguments in reverse order !
22305
22306         * delegate.cs (VerifyMethod): Implement to check if the given method
22307         matches the delegate.
22308
22309         (FullDelegateDesc): Implement.
22310
22311         (VerifyApplicability): Implement.
22312
22313         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22314         delegate invocations too.
22315
22316         (Invocation::Emit): Ditto.
22317
22318         * ../errors/cs1593.cs : Added.
22319
22320         * ../errors/cs1594.cs : Added.
22321
22322         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22323
22324 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22325
22326         * typemanager.cs (intptr_type): Core type for System.IntPtr
22327
22328         (InitCoreTypes): Update for the same.
22329
22330         (iasyncresult_type, asynccallback_type): Ditto.
22331
22332         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22333         correct.
22334
22335         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22336         too.
22337
22338         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22339         the builders for the 4 members of a delegate type :-)
22340
22341         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22342         type.
22343
22344         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22345
22346         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22347
22348 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22349
22350         * statement.cs (Break::Emit): Implement.   
22351         (Continue::Emit): Implement.
22352
22353         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22354         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22355         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22356         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22357         end loop
22358
22359         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22360         properties that track the label for the current loop (begin of the
22361         loop and end of the loop).
22362
22363 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22364
22365         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22366         use of emitting anything at all.
22367
22368         * class.cs, rootcontext.cs : Get rid of calls to the same.
22369
22370         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22371
22372         (Populate): Define the constructor correctly and set the implementation
22373         attributes.
22374
22375         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22376         have been defined.
22377
22378         (AddDelegateType): Implement.
22379
22380         (IsDelegateType): Implement helper method.
22381
22382         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22383
22384         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22385         and accordingly handle it.
22386
22387         * delegate.cs (Populate): Take TypeContainer argument.
22388         Implement bits to define the Invoke method. However, I still haven't figured out
22389         how to take care of the native int bit :-(
22390
22391         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22392         Qualify the name of the delegate, not its return type !
22393
22394         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22395         conversion.
22396
22397         (StandardConversionExists): Checking for array types turns out to be recursive.
22398
22399         (ConvertReferenceExplicit): Implement array conversion.
22400
22401         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22402
22403 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22404
22405         * cs-parser.jay (delegate_declaration): Store the fully qualified
22406         name as it is a type declaration.
22407
22408         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22409         readonly.
22410
22411         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22412         as TypeContainer::DefineType.
22413
22414         (Populate): Method in which all the definition of the various methods (Invoke)
22415         etc is done.
22416
22417         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22418         see.
22419
22420         (CloseDelegate): Finally creates the delegate.
22421
22422         * class.cs (TypeContainer::DefineType): Update to define delegates.
22423         (Populate, Emit and CloseType): Do the same thing here too.
22424
22425         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22426         delegates in all these operations.
22427
22428 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22429
22430         * expression.cs: LocalTemporary: a new expression used to
22431         reference a temporary that has been created.
22432
22433         * assign.cs: Handle PropertyAccess back here, so that we can
22434         provide the proper semantic access to properties.
22435
22436         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22437         a few more explicit conversions. 
22438
22439         * modifiers.cs: `NEW' modifier maps to HideBySig.
22440
22441         * expression.cs (PropertyExpr): Make this into an
22442         ExpressionStatement, and support the EmitStatement code path. 
22443
22444         Perform get/set error checking, clean up the interface.
22445
22446         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22447         them into toplevel access objects.
22448
22449 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22450
22451         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22452         SRE.
22453
22454         * typemanager.cs: Keep track here of our PropertyBuilders again to
22455         work around lameness in SRE.
22456
22457 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22458
22459         * expression.cs (LValue::LValueResolve): New method in the
22460         interface, used to perform a second resolution pass for LValues. 
22461
22462         (This::DoResolve): Catch the use of this in static methods.
22463
22464         (This::LValueResolve): Implement.
22465
22466         (This::Store): Remove warning, assigning to `this' in structures
22467         is 
22468
22469         (Invocation::Emit): Deal with invocation of
22470         methods on value types.  We need to pass the address to structure
22471         methods rather than the object itself.  (The equivalent code to
22472         emit "this" for structures leaves the entire structure on the
22473         stack instead of a pointer to it). 
22474
22475         (ParameterReference::DoResolve): Compute the real index for the
22476         argument based on whether the method takes or not a `this' pointer
22477         (ie, the method is static).
22478
22479         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22480         value types returned from functions when we need to invoke a
22481         method on the sturcture.
22482
22483
22484 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22485
22486         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22487         defining the type in the Modulebuilder or Typebuilder. This is to take
22488         care of nested types which need to be defined on the TypeBuilder using
22489         DefineNestedMethod.
22490
22491         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22492         methods in RootContext, only ported to be part of TypeContainer.
22493
22494         (TypeContainer::GetInterfaceOrClass): Ditto.
22495
22496         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22497
22498         * interface.cs (Interface::DefineInterface): New method. Does exactly
22499         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22500         too.
22501
22502         (Interface::GetInterfaces): Move from RootContext here and port.
22503
22504         (Interface::GetInterfaceByName): Same here.
22505
22506         * rootcontext.cs (ResolveTree): Re-write.
22507
22508         (PopulateTypes): Re-write.
22509
22510         * class.cs (TypeContainer::Populate): Populate nested types too.
22511         (TypeContainer::Emit): Emit nested members too.
22512
22513         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22514         instead just use the name argument passed in as it is already fully
22515         qualified.
22516
22517         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22518         to TypeContainer mapping to see if a type is user-defined.
22519
22520         * class.cs (TypeContainer::CloseType): Implement. 
22521
22522         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22523         the default constructor.
22524
22525         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22526         twice.
22527
22528         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22529
22530         * interface.cs (CloseType): Create the type here.
22531
22532         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22533         the hierarchy.
22534
22535         Remove all the methods which are now in TypeContainer.
22536
22537 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22538
22539         * delegate.cs (Define): Re-write bits to define the delegate
22540         correctly.
22541
22542 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22543
22544         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22545
22546         * expression.cs (ImplicitReferenceConversion): handle null as well
22547         as a source to convert to any reference type.
22548
22549         * statement.cs (Return): Perform any implicit conversions to
22550         expected return type.  
22551
22552         Validate use of return statement.  
22553
22554         * codegen.cs (EmitContext): Pass the expected return type here.
22555
22556         * class.cs (Method, Constructor, Property): Pass expected return
22557         type to EmitContext.
22558
22559 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22560
22561         * expression.cs: Make DoResolve take an EmitContext instead of a
22562         TypeContainer.
22563
22564         Replaced `l' and `location' for `loc', for consistency.
22565
22566         (Error, Warning): Remove unneeded Tc argument.
22567
22568         * assign.cs, literal.cs, constant.cs: Update to new calling
22569         convention. 
22570
22571         * codegen.cs: EmitContext now contains a flag indicating whether
22572         code is being generated in a static method or not.
22573
22574         * cs-parser.jay: DecomposeQI, new function that replaces the old
22575         QualifiedIdentifier.  Now we always decompose the assembled
22576         strings from qualified_identifier productions into a group of
22577         memberaccesses.
22578
22579 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22580
22581         * rootcontext.cs: Deal with field-less struct types correctly now
22582         by passing the size option to Define Type.
22583
22584         * class.cs: Removed hack that created one static field. 
22585
22586 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22587
22588         * statement.cs: Moved most of the code generation here. 
22589
22590 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22591
22592         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22593         seem very right.
22594
22595         (ElementAccess): Remove useless bits for now - keep checks as the spec
22596         says.
22597
22598 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22599
22600         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22601         and start performing checks according to the spec.
22602
22603 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22604
22605         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22606         rank_specifiers instead.
22607
22608         (rank_specifiers): Change the order in which the rank specifiers are stored
22609
22610         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22611
22612         * expression.cs (ElementAccess): Implement the LValue interface too.
22613
22614 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22615
22616         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22617         except that user defined conversions are not included.
22618
22619         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22620         perform the conversion of the return type, if necessary.
22621
22622         (New::DoResolve): Check whether we are creating an array or an object
22623         and accordingly do the needful.
22624
22625         (New::Emit): Same here.
22626
22627         (New::DoResolve): Implement guts of array creation.
22628
22629         (New::FormLookupType): Helper function.
22630
22631 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22632
22633         * codegen.cs: Removed most of the code generation here, and move the
22634         corresponding code generation bits to the statement classes. 
22635
22636         Added support for try/catch/finalize and throw.
22637
22638         * cs-parser.jay: Added support for try/catch/finalize.
22639
22640         * class.cs: Catch static methods having the flags override,
22641         virtual or abstract.
22642
22643         * expression.cs (UserCast): This user cast was not really doing
22644         what it was supposed to do.  Which is to be born in fully resolved
22645         state.  Parts of the resolution were being performed at Emit time! 
22646
22647         Fixed this code.
22648
22649 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22650
22651         * expression.cs: Implicity convert the result from UserCast.
22652
22653 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22654
22655         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22656         prevented it from working correctly. 
22657
22658         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22659         merely ConvertImplicit.
22660
22661 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22662
22663         * typemanager.cs: Make the LookupTypeContainer function static,
22664         and not per-instance.  
22665
22666         * class.cs: Make static FindMembers (the one that takes a Type
22667         argument). 
22668
22669         * codegen.cs: Add EmitForeach here.
22670
22671         * cs-parser.jay: Make foreach a toplevel object instead of the
22672         inline expansion, as we need to perform semantic analysis on it. 
22673
22674 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22675
22676         * expression.cs (Expression::ImplicitUserConversion): Rename to
22677         UserDefinedConversion.
22678
22679         (Expression::UserDefinedConversion): Take an extra argument specifying 
22680         whether we look for explicit user conversions too.
22681
22682         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22683
22684         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22685
22686         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22687         with the appropriate arguments.
22688
22689         * cs-parser.jay (cast_expression): Record location too.
22690
22691         * expression.cs (Cast): Record location info.
22692
22693         (Expression::ConvertExplicit): Take location argument.
22694
22695         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22696         to determine if we are doing explicit conversions.
22697
22698         (UserCast::Emit): Update accordingly.
22699
22700         (Expression::ConvertExplicit): Report an error if everything fails.
22701
22702         * ../errors/cs0030.cs : Add.
22703
22704 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22705
22706         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22707         virtual and newslot bits. 
22708
22709         * class.cs (TypeContainer::RegisterRequiredImplementations):
22710         Record methods we need.
22711
22712         (TypeContainer::MakeKey): Helper function to make keys for
22713         MethodBases, since the Methodbase key is useless.
22714
22715         (TypeContainer::Populate): Call RegisterRequiredImplementations
22716         before defining the methods.   
22717
22718         Create a mapping for method_builders_to_methods ahead of time
22719         instead of inside a tight loop.
22720
22721         (::RequireMethods):  Accept an object as the data to set into the
22722         hashtable so we can report interface vs abstract method mismatch.
22723
22724 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22725
22726         * report.cs: Make all of it static.
22727
22728         * rootcontext.cs: Drop object_type and value_type computations, as
22729         we have those in the TypeManager anyways.
22730
22731         Drop report instance variable too, now it is a global.
22732
22733         * driver.cs: Use try/catch on command line handling.
22734
22735         Add --probe option to debug the error reporting system with a test
22736         suite. 
22737
22738         * report.cs: Add support for exiting program when a probe
22739         condition is reached.
22740
22741 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22742
22743         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22744         we do a forcible conversion regardless of type, to check if 
22745         ForceConversion returns a null.
22746
22747         (Binary::error19): Use location to report error.
22748
22749         (Unary::error23): Use location here too.
22750
22751         * ../errors/cs0019.cs : Check in.
22752
22753         * ../errors/cs0023.cs : Check in.
22754
22755         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22756         case of a non-null MethodInfo object with a length of 0 !
22757
22758         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22759         an applicable member - according to the spec :-)
22760         Also fix logic to find members in base types.
22761
22762         (Unary::ResolveOperator): Same here.
22763
22764         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22765         as I was getting thoroughly confused between this and error19 :-)
22766
22767         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22768         (::FindMostEncompassedType): Implement.
22769         (::FindMostEncompassingType): Implement.
22770         (::StandardConversionExists): Implement.
22771
22772         (UserImplicitCast): Re-vamp. We now need info about most specific
22773         source and target types so that we can do the necessary conversions.
22774
22775         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22776         mathematical union with no duplicates.
22777
22778 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22779
22780         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22781         in order from base classes to child classes, so that we can in
22782         child classes look up in our parent for method names and
22783         attributes (required for handling abstract, virtual, new, override
22784         constructs: we need to instrospect our base class, and if we dont
22785         populate the classes in order, the introspection might be
22786         incorrect.  For example, a method could query its parent before
22787         the parent has any methods and would determine that the parent has
22788         no abstract methods (while it could have had them)).
22789
22790         (RootContext::CreateType): Record the order in which we define the
22791         classes.
22792
22793 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22794
22795         * class.cs (TypeContainer::Populate): Also method definitions can
22796         fail now, keep track of this.
22797
22798         (TypeContainer::FindMembers): Implement support for
22799         DeclaredOnly/noDeclaredOnly flag.
22800
22801         (Constructor::Emit) Return the ConstructorBuilder.
22802
22803         (Method::Emit) Return the MethodBuilder. 
22804         Check for abstract or virtual methods to be public.
22805
22806         * rootcontext.cs (RootContext::CreateType): Register all the
22807         abstract methods required for the class to be complete and the
22808         interface methods that must be implemented. 
22809
22810         * cs-parser.jay: Report error 501 (method requires body if it is
22811         not marked abstract or extern).
22812
22813         * expression.cs (TypeOf::Emit): Implement.
22814
22815         * typemanager.cs: runtime_handle_type, new global type.
22816
22817         * class.cs (Property::Emit): Generate code for properties.
22818
22819 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22820
22821         * expression.cs (Unary::ResolveOperator): Find operators on base type
22822         too - we now conform exactly to the spec.
22823
22824         (Binary::ResolveOperator): Same here.
22825
22826         * class.cs (Operator::Define): Fix minor quirk in the tests.
22827
22828         * ../errors/cs0215.cs : Added.
22829
22830         * ../errors/cs0556.cs : Added.
22831
22832         * ../errors/cs0555.cs : Added.
22833
22834 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22835
22836         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22837         single integer which is really efficient
22838
22839 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22840
22841         *  expression.cs (Expression::ImplicitUserConversion): Use location
22842         even in the case when we are examining True operators.
22843  
22844         * class.cs (Operator::Define): Perform extensive checks to conform
22845         with the rules for operator overloading in the spec.
22846
22847         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22848         some of the other conversions mentioned in the spec.
22849
22850         * typemanager.cs (array_type): New static member for the System.Array built-in
22851         type.
22852
22853         (cloneable_interface): For System.ICloneable interface.
22854
22855         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22856         we start resolving the tree and populating types.
22857
22858         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22859  
22860 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22861
22862         * expression.cs (Expression::ExprClassFromMemberInfo,
22863         Expression::Literalize): Create literal expressions from
22864         FieldInfos which are literals.
22865
22866         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22867         type casts, because they were wrong.  The test suite in tests
22868         caught these ones.
22869
22870         (ImplicitNumericConversion): ushort to ulong requires a widening
22871         cast. 
22872
22873         Int32 constant to long requires widening cast as well.
22874
22875         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22876         for integers because the type on the stack is not i4.
22877
22878 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22879
22880         * expression.cs (report118): require location argument. 
22881
22882         * parameter.cs: Do not dereference potential null value.
22883
22884         * class.cs: Catch methods that lack the `new' keyword when
22885         overriding a name.  Report warnings when `new' is used without
22886         anything being there to override.
22887
22888         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22889
22890         * class.cs: Only add constructor to hashtable if it is non-null
22891         (as now constructors can fail on define).
22892
22893         (TypeManager, Class, Struct): Take location arguments.
22894
22895         Catch field instance initialization in structs as errors.
22896
22897         accepting_filter: a new filter for FindMembers that is static so
22898         that we dont create an instance per invocation.
22899
22900         (Constructor::Define): Catch errors where a struct constructor is
22901         parameterless 
22902
22903         * cs-parser.jay: Pass location information for various new
22904         constructs. 
22905
22906         * delegate.cs (Delegate): take a location argument.
22907
22908         * driver.cs: Do not call EmitCode if there were problesm in the
22909         Definition of the types, as many Builders wont be there. 
22910
22911         * decl.cs (Decl::Decl): Require a location argument.
22912
22913         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22914         into integers, and find the most appropiate integer for it.
22915
22916         * literal.cs: Implement ULongLiteral.
22917
22918         * rootcontext.cs: Provide better information about the location of
22919         failure when CreateType fails.
22920
22921 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22922
22923         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22924         as well.
22925
22926         * expression.cs (Binary::CheckShiftArguments): Add missing type
22927         computation.
22928         (Binary::ResolveOperator): Add type to the logical and and logical
22929         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22930         before.
22931
22932         (Binary::DoNumericPromotions): In the case where either argument
22933         is ulong (and most signed types combined with ulong cause an
22934         error) perform implicit integer constant conversions as well.
22935
22936 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22937
22938         * expression.cs (UserImplicitCast): Method should always be
22939         non-null. 
22940         (Invocation::BetterConversion): Simplified test for IntLiteral.
22941
22942         (Expression::ImplicitNumericConversion): Split this routine out.
22943         Put the code that performs implicit constant integer conversions
22944         here. 
22945
22946         (Expression::Resolve): Become a wrapper around DoResolve so we can
22947         check eclass and type being set after resolve.
22948
22949         (Invocation::Badness): Remove this dead function
22950
22951         (Binary::ResolveOperator): Do not compute the expensive argumnets
22952         unless we have a union for it.
22953
22954         (Probe::Emit): Is needs to do an isinst and then
22955         compare against null.
22956
22957         (::CanConvert): Added Location argument.  If the Location argument
22958         is null (Location.Null), then we do not report errors.  This is
22959         used by the `probe' mechanism of the Explicit conversion.  We do
22960         not want to generate an error for something that the user
22961         explicitly requested to be casted.  But the pipeline for an
22962         explicit cast first tests for potential implicit casts.
22963
22964         So for now, if the Location is null, it means `Probe only' to
22965         avoid adding another argument.   Might have to revise this
22966         strategy later.
22967
22968         (ClassCast): New class used to type cast objects into arbitrary
22969         classes (used in Explicit Reference Conversions).
22970
22971         Implement `as' as well.
22972
22973         Reverted all the patches from Ravi below: they were broken:
22974
22975                 * The use of `level' as a mechanism to stop recursive
22976                   invocations is wrong.  That was there just to catch the
22977                   bug with a strack trace but not as a way of addressing
22978                   the problem.
22979
22980                   To fix the problem we have to *understand* what is going
22981                   on and the interactions and come up with a plan, not
22982                   just get things going.
22983
22984                 * The use of the type conversion cache that I proposed
22985                   last night had an open topic: How does this work across
22986                   protection domains.  A user defined conversion might not
22987                   be public in the location where we are applying the
22988                   conversion, a different conversion might be selected
22989                   (ie, private A->B (better) but public B->A (worse),
22990                   inside A, A->B applies, but outside it, B->A will
22991                   apply).
22992
22993                 * On top of that (ie, even if the above is solved),
22994                   conversions in a cache need to be abstract.  Ie, `To
22995                   convert from an Int to a Short use an OpcodeCast', not
22996                   `To convert from an Int to a Short use the OpcodeCast on
22997                   the variable 5' (which is what this patch was doing).
22998
22999 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23000
23001         * expression.cs (Invocation::ConversionExists): Re-write to use
23002         the conversion cache
23003
23004         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23005         cache all conversions done, not just user-defined ones.
23006
23007         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23008         to determine if a conversion exists instead of acutually trying to 
23009         perform the conversion. It's faster too.
23010
23011         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23012         and only then attempt the implicit conversion.
23013
23014 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23015
23016         * expression.cs (ConvertImplicit): Use a cache for conversions
23017         already found. Check level of recursion and bail out if necessary.
23018
23019 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23020
23021         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23022         Export standard methods that we expect for string operations.
23023
23024         * statement.cs (Block::UsageWarning): Track usage of variables and
23025         report the errors for not used variables.
23026
23027         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23028         operator. 
23029
23030 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23031
23032         * codegen.cs: remove unnneded code 
23033
23034         * expression.cs: Removed BuiltinTypeAccess class
23035
23036         Fix the order in which implicit conversions are
23037         done.  
23038
23039         The previous fixed dropped support for boxed conversions (adding a
23040         test to the test suite now)
23041
23042         (UserImplicitCast::CanConvert): Remove test for source being null,
23043         that code is broken.  We should not feed a null to begin with, if
23044         we do, then we should track the bug where the problem originates
23045         and not try to cover it up here.
23046
23047         Return a resolved expression of type UserImplicitCast on success
23048         rather than true/false.  Ravi: this is what I was talking about,
23049         the pattern is to use a static method as a "constructor" for
23050         objects. 
23051
23052         Also, do not create arguments until the very last minute,
23053         otherwise we always create the arguments even for lookups that
23054         will never be performed. 
23055
23056         (UserImplicitCast::Resolve): Eliminate, objects of type
23057         UserImplicitCast are born in a fully resolved state. 
23058
23059         * typemanager.cs (InitCoreTypes): Init also value_type
23060         (System.ValueType). 
23061
23062         * expression.cs (Cast::Resolve): First resolve the child expression.
23063
23064         (LValue): Add new method AddressOf to be used by
23065         the `&' operator.  
23066
23067         Change the argument of Store to take an EmitContext instead of an
23068         ILGenerator, because things like FieldExpr need to be able to call
23069         their children expression to generate the instance code. 
23070
23071         (Expression::Error, Expression::Warning): Sugar functions for
23072         reporting errors.
23073
23074         (Expression::MemberLookup): Accept a TypeContainer instead of a
23075         Report as the first argument.
23076
23077         (Expression::ResolvePrimary): Killed.  I still want to improve
23078         this as currently the code is just not right.
23079
23080         (Expression::ResolveMemberAccess): Simplify, but it is still
23081         wrong. 
23082
23083         (Unary::Resolve): Catch errors in AddressOf operators.
23084
23085         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23086         index to a byte for the short-version, or the compiler will choose
23087         the wrong Emit call, which generates the wrong data.
23088
23089         (ParameterReference::Emit, ::Store): same.
23090
23091         (FieldExpr::AddressOf): Implement.
23092
23093         * typemanager.cs: TypeManager: made public variable instead of
23094         property.
23095
23096         * driver.cs: document --fatal.
23097
23098         * report.cs (ErrorMessage, WarningMessage): new names for the old
23099         Error and Warning classes.
23100
23101         * cs-parser.jay (member_access): Turn built-in access to types
23102         into a normal simplename
23103
23104 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23105
23106         * expression.cs (Invocation::BetterConversion): Fix to cope
23107         with q being null, since this was introducing a bug.
23108
23109         * expression.cs (ConvertImplicit): Do built-in conversions first.
23110
23111 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23112
23113         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23114
23115 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23116
23117         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23118         I had introduced long ago (what's new ?).
23119
23120         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23121         the work of all the checking. 
23122         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23123         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23124
23125         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23126         that is the right way. 
23127
23128         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23129         overloading resolution. Use everywhere instead of cutting and pasting code.
23130
23131         (Binary::ResolveOperator): Use MakeUnionSet.
23132
23133         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23134         we have to convert to bool types. Not complete yet.
23135
23136 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23137
23138         * typemanager.cs (TypeManager::CSharpName): support ushort.
23139
23140         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23141         to provide an expression that performsn an implicit constant int
23142         conversion (section 6.1.6).
23143         (Expression::ConvertImplicitRequired): Reworked to include
23144         implicit constant expression conversions.
23145
23146         (Expression::ConvertNumericExplicit): Finished.
23147
23148         (Invocation::Emit): If InstanceExpression is null, then it means
23149         that we perform a call on this.
23150
23151 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23152
23153         * expression.cs (Unary::Emit): Remove some dead code.
23154         (Probe): Implement Resolve and Emit for `is'.
23155         (Expression::ConvertImplicitRequired): Attempt to do constant
23156         expression conversions here.  Maybe should be moved to
23157         ConvertImplicit, but I am not sure.
23158         (Expression::ImplicitLongConstantConversionPossible,
23159         Expression::ImplicitIntConstantConversionPossible): New functions
23160         that tell whether is it possible to apply an implicit constant
23161         expression conversion.
23162
23163         (ConvertNumericExplicit): Started work on explicit numeric
23164         conversions.
23165
23166         * cs-parser.jay: Update operator constants.
23167
23168         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23169         (Parameters::GetSignature): Hook up VerifyArgs here.
23170         (Parameters::VerifyArgs): Verifies that no two arguments have the
23171         same name. 
23172
23173         * class.cs (Operator): Update the operator names to reflect the
23174         ones that the spec expects (as we are just stringizing the
23175         operator names).
23176
23177         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23178         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23179         previous usage did only work for our methods.
23180         (Expression::ConvertImplicit): Handle decimal implicit numeric
23181         conversions as well.
23182         (Expression::InternalTypeConstructor): Used to invoke constructors
23183         on internal types for default promotions.
23184
23185         (Unary::Emit): Implement special handling for the pre/post
23186         increment/decrement for overloaded operators, as they need to have
23187         the same semantics as the other operators.
23188
23189         (Binary::ResolveOperator): ditto.
23190         (Invocation::ConversionExists): ditto.
23191         (UserImplicitCast::Resolve): ditto.
23192
23193 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23194
23195         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23196         operator, return after emitting body. Regression tests pass again !
23197
23198         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23199         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23200         (Invocation::OverloadResolve): Ditto.
23201         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23202
23203         * everywhere : update calls to the above methods accordingly.
23204
23205 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23206
23207         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23208
23209         * expression.cs (ExpressionStatement): New base class used for
23210         expressions that can appear in statements, so that we can provide
23211         an alternate path to generate expression that do not leave a value
23212         on the stack.
23213
23214         (Expression::Emit, and all the derivatives): We no longer return
23215         whether a value is left on the stack or not.  Every expression
23216         after being emitted leaves a single value on the stack.
23217
23218         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23219         facilties of ExpressionStatement if possible.
23220
23221         * cs-parser.jay: Update statement_expression.
23222
23223 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23224
23225         * driver.cs: Change the wording of message
23226
23227 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23228
23229         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23230         the type of the expression to the return type of the method if
23231         we have an overloaded operator match ! The regression tests pass again !
23232         (Unary::ResolveOperator): Ditto.
23233
23234         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23235         to find "op_Implicit", not "implicit" ;-)
23236         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23237         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23238
23239         * everywhere : Correct calls to the above accordingly.
23240
23241         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23242         (ConvertImplicit): Do user-defined conversion if it exists.
23243
23244 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23245
23246         * assign.cs: track location.
23247         (Resolve): Use implicit conversions on assignment.
23248
23249         * literal.cs: Oops.  Not good, Emit of short access values should
23250         pass (Bytes) or the wrong argument will be selected.
23251
23252         * expression.cs (Unary::Emit): Emit code for -expr.
23253
23254         (Unary::ResolveOperator): Handle `Substract' for non-constants
23255         (substract from zero from the non-constants).
23256         Deal with Doubles as well. 
23257
23258         (Expression::ConvertImplicitRequired): New routine that reports an
23259         error if no implicit conversion exists. 
23260
23261         (Invocation::OverloadResolve): Store the converted implicit
23262         expressions if we make them
23263
23264 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23265
23266         * class.cs (ConstructorInitializer): Take a Location argument.
23267         (ConstructorBaseInitializer): Same here.
23268         (ConstructorThisInitializer): Same here.
23269
23270         * cs-parser.jay : Update all calls accordingly.
23271
23272         * expression.cs (Unary, Binary, New): Take location argument.
23273         Update accordingly everywhere.
23274
23275         * cs-parser.jay : Update all calls to the above to take a location
23276         argument.
23277
23278         * class.cs : Ditto.
23279
23280 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23281
23282         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23283         (Invocation::BetterConversion): Same here
23284         (Invocation::ConversionExists): Ditto.
23285
23286         (Invocation::ConversionExists): Implement.
23287
23288 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23289
23290         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23291         Also take an additional TypeContainer argument.
23292
23293         * All over : Pass in TypeContainer as argument to OverloadResolve.
23294
23295         * typemanager.cs (CSharpName): Update to check for the string type and return
23296         that too.
23297
23298         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23299         a given method.
23300
23301 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23302
23303         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23304         (Invocation::BetterFunction): Implement.
23305         (Invocation::BetterConversion): Implement.
23306         (Invocation::ConversionExists): Skeleton, no implementation yet.
23307
23308         Okay, things work fine !
23309
23310 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23311
23312         * typemanager.cs: declare and load enum_type, delegate_type and
23313         void_type. 
23314
23315         * expression.cs (Expression::Emit): Now emit returns a value that
23316         tells whether a value is left on the stack or not.  This strategy
23317         might be reveted tomorrow with a mechanism that would address
23318         multiple assignments.
23319         (Expression::report118): Utility routine to report mismatches on
23320         the ExprClass.
23321
23322         (Unary::Report23): Report impossible type/operator combination
23323         utility function.
23324
23325         (Unary::IsIncrementableNumber): Whether the type can be
23326         incremented or decremented with add.
23327         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23328         complemented. 
23329         (Unary::ResolveOperator): Implement ++, !, ~,
23330
23331         (Invocation::Emit): Deal with new Emit convetion.
23332
23333         * All Expression derivatives: Updated their Emit method to return
23334         whether they leave values on the stack or not.
23335
23336         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23337         stack for expressions that are statements. 
23338
23339 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23340
23341         * expression.cs (LValue): New interface.  Must be implemented by
23342         LValue objects.
23343         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23344         LValue interface.
23345
23346         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23347         interface for generating code, simplifies the code.
23348
23349 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23350
23351         * expression.cs (everywhere): Comment out return statements in ::Resolve
23352         methods to avoid the warnings.
23353
23354 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23355
23356         * driver.cs (parse): Report error 2001 if we can not open the
23357         source file.
23358
23359         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23360         not resolve it.
23361
23362         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23363         object. 
23364
23365         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23366         otherwise nested blocks end up with the same index.
23367
23368         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23369
23370         * expression.cs:  Instead of having FIXMEs in the Resolve
23371         functions, throw exceptions so it is obvious that we are facing a
23372         bug. 
23373
23374         * cs-parser.jay (invocation_expression): Pass Location information.
23375
23376         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23377         Use a basename for those routines because .NET does not like paths
23378         on them. 
23379
23380         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23381         already defined.
23382
23383 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23384
23385         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23386         are loading the correct data types (throws an exception if not).
23387         (TypeManager::InitCoreTypes): Use CoreLookupType
23388
23389         * expression.cs (Unary::ResolveOperator): return the child
23390         expression for expressions which are just +expr.
23391         (Unary::ResolveOperator): Return negative literals for -LITERAL
23392         expressions (otherwise they are Unary {Literal}).
23393         (Invocation::Badness): Take into account `Implicit constant
23394         expression conversions'.
23395
23396         * literal.cs (LongLiteral): Implement long literal class.
23397         (IntLiteral): export the `Value' of the intliteral. 
23398
23399 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23400
23401         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23402
23403         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23404         instead of 'Operator'
23405
23406         * expression.cs (Binary::ResolveOperator): Update accordingly.
23407         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23408         and 'Minus'
23409
23410         * cs-parser.jay (unary_expression): Update to use the new names.
23411
23412         * gen-treedump.cs (GetUnary): Same here.
23413
23414         * expression.cs (Unary::Resolve): Implement.
23415         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23416         operators are found instead of making noise ;-)
23417         (Unary::ResolveOperator): New method to do precisely the same thing which
23418         Binary::ResolveOperator does for Binary expressions.
23419         (Unary.method, .Arguments): Add.
23420         (Unary::OperName): Implement.   
23421         (Unary::ForceConversion): Copy and Paste !
23422
23423         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23424         a unary operator.
23425
23426         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23427         for the inbuilt operators. Only overloading works for now ;-)
23428
23429 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23430
23431         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23432         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23433
23434         * expression.cs (This::Emit): Implement. 
23435         (This::Resolve): Implement.
23436         (TypeOf:Resolve): Implement.
23437         (Expression::ResolveSimpleName): Add an implicit this to instance
23438         field references. 
23439         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23440         Bind instance variable to Field expressions.
23441         (FieldExpr::Instance): New field used to track the expression that
23442         represents the object instance.
23443         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23444         binding 
23445         (FieldExpr::Emit): Implement.
23446
23447         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23448         the last instruction contains a return opcode to avoid generating
23449         the last `ret' instruction (this generates correct code, and it is
23450         nice to pass the peverify output).
23451
23452         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23453         initializer for static and instance variables.
23454         (Constructor::Emit): Allow initializer to be null in the case of
23455         static constructors.  Only emit initializer for instance
23456         constructors. 
23457
23458         (TypeContainer::FindMembers): Return a null array if there are no
23459         matches.
23460
23461         Also fix the code for the MemberTypes.Method branch, as it was not
23462         scanning that for operators (or tried to access null variables before).
23463
23464         * assign.cs (Assign::Emit): Handle instance and static fields. 
23465
23466         * TODO: Updated.
23467
23468         * driver.cs: Stop compilation if there are parse errors.
23469
23470         * cs-parser.jay (constructor_declaration): Provide default base
23471         initializer for non-static constructors.
23472         (constructor_declarator): Do not provide a default base
23473         initializers if none was specified.
23474         Catch the fact that constructors should not have parameters.
23475
23476         * class.cs: Do not emit parent class initializers for static
23477         constructors, that should be flagged as an error.
23478
23479 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23480
23481         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23482         Move back code into TypeContainer::Populate.
23483
23484 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23485
23486         * class.cs (TypeContainer::AddConstructor): Fix the check to
23487         compare against Name, not Basename. 
23488         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23489
23490         * cs-parser.jay : Update accordingly.
23491
23492         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23493         for methods, don't forget to look into the operators too.
23494         (RegisterMethodBuilder): Helper method to take care of this for
23495         methods, constructors and operators.
23496         (Operator::Define): Completely revamp.
23497         (Operator.OperatorMethod, MethodName): New fields.
23498         (TypeContainer::Populate): Move the registering of builders into
23499         RegisterMethodBuilder.
23500         (Operator::Emit): Re-write.
23501
23502         * expression.cs (Binary::Emit): Comment out code path to emit method
23503         invocation stuff for the case when we have a user defined operator. I am
23504         just not able to get it right !
23505
23506 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23507
23508         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23509         argument. 
23510
23511         (Expression::MemberLookup): Provide a version that allows to
23512         specify the MemberTypes and BindingFlags. 
23513
23514         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23515         so it was not fetching variable information from outer blocks.
23516
23517         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23518         Beforefieldinit as it was buggy.
23519
23520         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23521         that Ravi put here.  
23522
23523         * class.cs (Constructor::Emit): Only emit if block is not null.
23524         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23525         deal with this by semantically definining it as if the user had
23526         done it.
23527
23528         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23529         constructors as we now "emit" them at a higher level.
23530
23531         (TypeContainer::DefineDefaultConstructor): Used to define the
23532         default constructors if none was provided.
23533
23534         (ConstructorInitializer): Add methods Resolve and Emit. 
23535
23536         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23537
23538 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23539
23540         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23541         the default constructor builder with our hashtable for methodbuilders
23542         to methodcores.
23543
23544         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23545         and argument_count is 0 in which case we have a match.
23546         (Binary::ResolveOperator): More null checking and miscellaneous coding
23547         style cleanup.
23548
23549 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23550
23551         * rootcontext.cs (IsNameSpace): Compare against null.
23552
23553         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23554
23555         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23556         and Unary::Operator.
23557
23558         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23559         accordingly.
23560
23561         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23562         we have overloaded operators.
23563         (Binary::ResolveOperator): Implement the part which does the operator overload
23564         resolution.
23565
23566         * class.cs (Operator::Emit): Implement.
23567         (TypeContainer::Emit): Emit the operators we have too.
23568
23569         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23570         the case when we have a user-defined operator.
23571
23572 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23573
23574         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23575
23576 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23577
23578         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23579         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23580         (Constructor::Emit): Implement.
23581         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23582         if we have no work to do. 
23583         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23584         Emit method.
23585
23586         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23587         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23588
23589         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23590         of parent.parent.
23591
23592 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23593
23594         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23595         in the source.
23596         (Tree::RecordNamespace): Method to do what the name says ;-)
23597         (Tree::Namespaces): Property to get at the namespaces hashtable.
23598
23599         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23600         keep track.
23601
23602         * rootcontext.cs (IsNamespace): Fixed it :-)
23603
23604 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23605
23606         * class.cs (TypeContainer::FindMembers): Add support for
23607         constructors. 
23608         (MethodCore): New class that encapsulates both the shared aspects
23609         of a Constructor and a Method.  
23610         (Method, Constructor): Factored pieces into MethodCore.
23611
23612         * driver.cs: Added --fatal which makes errors throw exceptions.
23613         Load System assembly as well as part of the standard library.
23614
23615         * report.cs: Allow throwing exceptions on errors for debugging.
23616
23617         * modifiers.cs: Do not use `parent', instead use the real type
23618         container to evaluate permission settings.
23619
23620         * class.cs: Put Ravi's patch back in.  He is right, and we will
23621         have to cope with the
23622
23623 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23624
23625         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23626         FamORAssem, not FamANDAssem.
23627
23628 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23629
23630         * driver.cs: Added --parse option that only parses its input files
23631         and terminates.
23632
23633         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23634         incorrect.  IsTopLevel is not used to tell whether an object is
23635         root_types or not (that can be achieved by testing this ==
23636         root_types).  But to see if this is a top-level *class* (not
23637         necessarly our "toplevel" container). 
23638
23639 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23640
23641         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23642         parent instead of a direct call to GetType.
23643
23644 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23645
23646         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23647         Modifiers.TypeAttr. This should just be a call to that method.
23648
23649         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23650         object so that we can determine if we are top-level or not.
23651
23652         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23653         TypeContainer too.
23654
23655         * enum.cs (Enum::Define): Ditto.
23656
23657         * modifiers.cs (FieldAttr): Re-write.
23658
23659         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23660         (TypeContainer::HaveStaticConstructor): New property to provide access
23661         to precisely that info.
23662
23663         * modifiers.cs (MethodAttr): Re-write.
23664         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23665
23666         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23667         of top-level types as claimed.
23668
23669 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23670
23671         * expression.cs (MemberLookup): Fruitless attempt to lookup
23672         constructors.  Maybe I need to emit default constructors?  That
23673         might be it (currently .NET emits this for me automatically).
23674         (Invocation::OverloadResolve): Cope with Arguments == null.
23675         (Invocation::EmitArguments): new function, shared by the new
23676         constructor and us.
23677         (Invocation::Emit): Handle static and instance methods.  Emit
23678         proper call instruction for virtual or non-virtual invocations.
23679         (New::Emit): Implement.
23680         (New::Resolve): Implement.
23681         (MemberAccess:Resolve): Implement.
23682         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23683         to track instances.
23684         (FieldExpr::Resolve): Set type.
23685
23686         * support.cs: Handle empty arguments.
23687                 
23688         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23689         SimpleLookup): Auxiliary routines to help parse a qualifier
23690         identifier.  
23691
23692         Update qualifier_identifier rule.
23693
23694         * codegen.cs: Removed debugging messages.
23695
23696         * class.cs: Make this a global thing, this acts just as a "key" to
23697         objects that we might have around.
23698
23699         (Populate): Only initialize method_builders_to_methods once.
23700
23701         * expression.cs (PropertyExpr): Initialize type from the
23702         PropertyType. 
23703
23704         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23705         Resolve pattern.  Attempt to implicitly convert value to boolean.
23706         Emit code.
23707
23708         * expression.cs: Set the type for the int32/int32 argument case.
23709         (Binary::ResolveOperator): Set the return type to boolean for
23710         comparission operators
23711
23712         * typemanager.cs: Remove debugging print code.
23713
23714         (Invocation::Resolve): resolve type.
23715
23716         * class.cs: Allocate a MemberInfo of the correct size, as the code
23717         elsewhere depends on the test to reflect the correct contents.
23718
23719         (Method::) Keep track of parameters, due to System.Reflection holes
23720
23721         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23722         mapping here.
23723
23724         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23725         of the exact size and return that.
23726
23727         (Class::LookupMethodByBuilder): New function that maps
23728         MethodBuilders to its methods.  Required to locate the information
23729         on methods because System.Reflection bit us again.
23730
23731         * support.cs: New file, contains an interface ParameterData and
23732         two implementations: ReflectionParameters and InternalParameters
23733         used to access Parameter information.  We will need to grow this
23734         as required.
23735
23736         * expression.cs (Invocation::GetParameterData): implement a cache
23737         and a wrapper around the ParameterData creation for methods. 
23738         (Invocation::OverloadResolve): Use new code.
23739
23740 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23741
23742         * class.cs (TypeContainer::EmitField): Remove and move into 
23743         (Field::Define): here and modify accordingly.
23744         (Field.FieldBuilder): New member.
23745         (TypeContainer::Populate): Update accordingly.
23746         (TypeContainer::FindMembers): Implement.
23747
23748 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23749
23750         * statement.cs: (VariableInfo::VariableType): New field to be
23751         initialized with the full type once it is resolved. 
23752
23753 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23754
23755         * parameter.cs (GetParameterInfo): Use a type cache to compute
23756         things only once, and to reuse this information
23757
23758         * expression.cs (LocalVariableReference::Emit): Implement.
23759         (OpcodeCast::Emit): fix.
23760
23761         (ParameterReference::Resolve): Implement.
23762         (ParameterReference::Emit): Implement.
23763
23764         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23765         that are expressions need to stay as Expressions.
23766
23767         * typemanager.cs (CSharpName): Returns the C# name of a type if
23768         possible. 
23769
23770         * expression.cs (Expression::ConvertImplicit): New function that
23771         implements implicit type conversions.
23772
23773         (Expression::ImplicitReferenceConversion): Implements implicit
23774         reference conversions.
23775
23776         (EmptyCast): New type for transparent casts.
23777
23778         (OpcodeCast): New type for casts of types that are performed with
23779         a sequence of bytecodes.
23780
23781         (BoxedCast): New type used for casting value types into reference
23782         types.  Emits a box opcode.
23783
23784         (Binary::DoNumericPromotions): Implements numeric promotions of
23785         and computation of the Binary::Type.
23786
23787         (Binary::EmitBranchable): Optimization.
23788
23789         (Binary::Emit): Implement code emission for expressions.
23790
23791         * typemanager.cs (TypeManager): Added two new core types: sbyte
23792         and byte.
23793
23794 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23795
23796         * class.cs (TypeContainer::FindMembers): Method which does exactly
23797         what Type.FindMembers does, only we don't have to use reflection. No
23798         implementation yet.
23799
23800         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23801         typecontainer objects as we need to get at them.
23802         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23803
23804         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23805         typecontainer object.
23806
23807         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23808         of just a Report object.
23809
23810 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23811
23812         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23813         "remove_"
23814         (TypeContainer::Populate): Now define the delegates of the type too.
23815         (TypeContainer.Delegates): Property to access the list of delegates defined
23816         in the type.
23817
23818         * delegates.cs (Delegate::Define): Implement partially.
23819
23820         * modifiers.cs (TypeAttr): Handle more flags.
23821
23822 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23823
23824         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23825         and not <=
23826         (Operator::Define): Re-write logic to get types by using the LookupType method
23827         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23828         (Indexer::Define): Ditto.
23829         (Event::Define): Ditto.
23830         (Property::Define): Ditto.
23831
23832 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23833
23834         * class.cs (TypeContainer::Populate): Now define operators too. 
23835         (TypeContainer.Operators): New property to access the list of operators
23836         in a type.
23837         (Operator.OperatorMethodBuilder): New member to hold the method builder
23838         for the operator we are defining.
23839         (Operator::Define): Implement.
23840
23841 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23842
23843         * class.cs (Event::Define): Make the prefixes of the accessor methods
23844         addOn_ and removeOn_ 
23845
23846         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23847         of the location being passed in too. Ideally, this should go later since all
23848         error reporting should be done through the Report object.
23849
23850         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23851         (Populate): Iterate thru the indexers we have and define them too.
23852         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23853         for the get and set accessors.
23854         (Indexer::Define): Implement.
23855
23856 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23857
23858         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23859         my previous implementation, did not work.
23860
23861         * typemanager.cs: Add a couple of missing types (the longs).
23862
23863         * literal.cs: Use TypeManager.bool_type instead of getting it.
23864
23865         * expression.cs (EventExpr): New kind of expressions.
23866         (Expressio::ExprClassFromMemberInfo): finish
23867
23868 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23869
23870         * assign.cs: Emit stores to static fields differently.
23871
23872 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23873
23874         * Merge in changes and adjust code to tackle conflicts. Backed out my
23875         code in Assign::Resolve ;-) 
23876
23877 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23878
23879         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23880         instead Report.Error and also pass in the location.
23881         (CSharpParser::Lexer): New readonly property to return the reference
23882         to the Tokenizer object.
23883         (declare_local_variables): Use Report.Error with location instead of plain 
23884         old error.
23885         (CheckDef): Ditto.
23886
23887         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23888         (Operator.CheckBinaryOperator): Ditto.
23889
23890         * cs-parser.jay (operator_declarator): Update accordingly.
23891
23892         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23893         (CheckBinaryOperator): Same here.
23894
23895         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23896         on the name without any prefixes of namespace names etc. This is because we
23897         already might have something already fully qualified like 
23898         'System.Console.WriteLine'
23899
23900         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23901
23902 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23903
23904         * cs-tokenizer.cs (location): Return a string which also contains
23905         the file name.
23906
23907         * expression.cs (ElementAccess): New class for expressions of the
23908         type 'element access.'
23909         (BaseAccess): New class for expressions of the type 'base access.'
23910         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23911         respectively.
23912
23913         * cs-parser.jay (element_access): Implement action.
23914         (base_access): Implement actions.
23915         (checked_expression, unchecked_expression): Implement.
23916
23917         * cs-parser.jay (local_variable_type): Correct and implement.
23918         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23919
23920         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23921
23922         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23923         name and the specifiers.
23924
23925         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23926
23927         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23928         making them all public ;-)
23929
23930         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23931         class anyways.
23932
23933 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23934
23935         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23936         PropertyExprs.
23937         (FieldExpr, PropertyExprs): New resolved expressions.
23938         (SimpleName::MemberStaticCheck): Perform static checks for access
23939         to non-static fields on static methods. Maybe this should be
23940         generalized for MemberAccesses. 
23941         (SimpleName::ResolveSimpleName): More work on simple name
23942         resolution. 
23943
23944         * cs-parser.jay (primary_expression/qualified_identifier): track
23945         the parameter index.
23946
23947         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23948         (EmitContext::EmitBoolExpression): Chain to expression generation
23949         instead of temporary hack.
23950         (::EmitStatementExpression): Put generic expression code generation.
23951
23952         * assign.cs (Assign::Emit): Implement variable assignments to
23953         local variables, parameters and fields.
23954
23955 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23956
23957         * statement.cs (Block::GetVariableInfo): New method, returns the
23958         VariableInfo for a variable name in a block.
23959         (Block::GetVariableType): Implement in terms of GetVariableInfo
23960
23961         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23962         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23963
23964 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23965
23966         * cs-parser.jay (operator_declaration): Continue on my quest : update
23967         to take attributes argument.
23968         (event_declaration): Ditto.
23969         (enum_declaration): Ditto.
23970         (indexer_declaration): Ditto.
23971
23972         * class.cs (Operator::Operator): Update constructor accordingly.
23973         (Event::Event): Ditto.
23974
23975         * delegate.cs (Delegate::Delegate): Same here.
23976
23977         * enum.cs (Enum::Enum): Same here.
23978
23979 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23980
23981         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23982
23983         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23984
23985         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23986         being passed around as an arraylist.
23987         (Attributes::AddAttribute): Method to add attribute sections.
23988
23989         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23990         (struct_declaration): Update accordingly.
23991         (constant_declaration): Update.
23992         (field_declaration): Update.
23993         (method_header): Update.
23994         (fixed_parameter): Update.
23995         (parameter_array): Ditto.
23996         (property_declaration): Ditto.
23997         (destructor_declaration): Ditto.
23998
23999         * class.cs (Struct::Struct): Update constructors accordingly.
24000         (Class::Class): Ditto.
24001         (Field::Field): Ditto.
24002         (Method::Method): Ditto.
24003         (Property::Property): Ditto.
24004         (TypeContainer::OptAttribute): update property's return type.
24005
24006         * interface.cs (Interface.opt_attributes): New member.
24007         (Interface::Interface): Update to take the extra Attributes argument.
24008
24009         * parameter.cs (Parameter::Parameter): Ditto.
24010
24011         * constant.cs (Constant::Constant): Ditto.
24012
24013         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24014         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24015         the attributes as a parameter.
24016         (InterfaceProperty): Update constructor call.
24017         (InterfaceEvent): Ditto.
24018         (InterfaceMethod): Ditto.
24019         (InterfaceIndexer): Ditto.
24020
24021         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24022         pass the attributes too.
24023         (interface_event_declaration): Ditto.
24024         (interface_property_declaration): Ditto.
24025         (interface_method_declaration): Ditto.
24026         (interface_declaration): Ditto.
24027
24028 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24029
24030         * class.cs (Method::Define): Track the "static Main" definition to
24031         create an entry point. 
24032
24033         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24034         EntryPoint if we find it. 
24035
24036         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24037         (EmitContext::ig): Make this variable public.
24038
24039         * driver.cs: Make the default output file be the first file name
24040         with the .exe extension.  
24041
24042         Detect empty compilations
24043
24044         Handle various kinds of output targets.  Handle --target and
24045         rename -t to --dumper.
24046
24047         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24048         methods inherited from Expression return now an Expression.  This
24049         will is used during the tree rewriting as we resolve them during
24050         semantic analysis.
24051
24052         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24053         the spec.  Missing entirely is the information about
24054         accessability of elements of it.
24055
24056         (Expression::ExprClassFromMemberInfo): New constructor for
24057         Expressions that creates a fully initialized Expression based on
24058         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24059         a Type.
24060
24061         (Invocation::Resolve): Begin implementing resolution of invocations.
24062
24063         * literal.cs (StringLiteral):  Implement Emit.
24064
24065 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24066
24067         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24068         member.
24069
24070 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24071
24072         * cs-parser.jay (attribute_arguments): Implement actions.
24073         (attribute): Fix bug in production. Implement action.
24074         (attribute_list): Implement.
24075         (attribute_target): Implement.
24076         (attribute_target_specifier, opt_target_specifier): Implement
24077         (CheckAttributeTarget): New method to check if the attribute target
24078         is valid.
24079         (attribute_section): Implement.
24080         (opt_attributes): Implement.
24081
24082         * attribute.cs : New file to handle attributes.
24083         (Attribute): Class to hold attribute info.
24084
24085         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24086         (attribute_section): Modify production to use 2 different rules to 
24087         achieve the same thing. 1 s/r conflict down !
24088         Clean out commented, useless, non-reducing dimension_separator rules.
24089
24090         * class.cs (TypeContainer.attributes): New member to hold list
24091         of attributes for a type.
24092         (Struct::Struct): Modify to take one more argument, the attribute list.
24093         (Class::Class): Ditto.
24094         (Field::Field): Ditto.
24095         (Method::Method): Ditto.
24096         (Property::Property): Ditto.
24097
24098         * cs-parser.jay (struct_declaration): Update constructor call to
24099         pass in the attributes too.
24100         (class_declaration): Ditto.
24101         (constant_declaration): Ditto.
24102         (field_declaration): Ditto.
24103         (method_header): Ditto.
24104         (fixed_parameter): Ditto.
24105         (parameter_array): Ditto.
24106         (property_declaration): Ditto.
24107
24108         * constant.cs (Constant::Constant): Update constructor similarly.
24109         Use System.Collections.
24110
24111         * parameter.cs (Parameter::Parameter): Update as above.
24112
24113 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24114
24115         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24116         (TypeContainer.delegates): New member to hold list of delegates.
24117
24118         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24119         this time as I seem to be on crack ;-)
24120
24121 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24122
24123         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24124         tell whether an identifier represents a namespace.
24125
24126         * expression.cs (NamespaceExpr): A namespace expression, used only
24127         temporarly during expression resolution.
24128         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24129         utility functions to resolve names on expressions.
24130
24131 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24132
24133         * codegen.cs: Add hook for StatementExpressions. 
24134
24135         * class.cs: Fix inverted test for static flag in methods.
24136
24137 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24138
24139         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24140         to make it coincide with MS' number.
24141         (Operator::CheckBinaryOperator): Ditto.
24142
24143         * ../errors/errors.txt : Remove error numbers added earlier.
24144
24145         * ../errors/cs1019.cs : Test case for error # 1019
24146
24147         * ../errros/cs1020.cs : Test case for error # 1020
24148
24149         * cs-parser.jay : Clean out commented cruft.
24150         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24151         used anywhere - non-reducing rule.
24152         (namespace_declarations): Non-reducing rule - comment out.
24153
24154         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24155         with TypeContainer::AddEnum.
24156
24157         * delegate.cs : New file for delegate handling classes.
24158         (Delegate): Class for declaring delegates.
24159
24160         * makefile : Update.
24161
24162         * cs-parser.jay (delegate_declaration): Implement.
24163
24164 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24165
24166         * class.cs (Event::Define): Implement.
24167         (Event.EventBuilder): New member.
24168
24169         * class.cs (TypeContainer::Populate): Update to define all enums and events
24170         we have.
24171         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24172         readonly fields for all these cases ?
24173
24174 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24175
24176         * class.cs (Property): Revamp to use the convention of making fields readonly.
24177         Accordingly modify code elsewhere.
24178
24179         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24180         the Define method of the Property class.
24181
24182         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24183         trivial bug.
24184         (TypeContainer::Populate): Update to define all the properties we have. Also
24185         define all enumerations.
24186
24187         * enum.cs (Define): Implement.
24188
24189 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24190
24191         * cs-parser.jay (overloadable_operator): The semantic value is an
24192         enum of the Operator class.
24193         (operator_declarator): Implement actions.
24194         (operator_declaration): Implement.
24195
24196         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24197         validity of definitions.
24198         (Operator::CheckBinaryOperator): Static method to check for binary operators
24199         (TypeContainer::AddOperator): New method to add an operator to a type.
24200
24201         * cs-parser.jay (indexer_declaration): Added line to actually call the
24202         AddIndexer method so it gets added ;-)
24203
24204         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24205         already taken care of by the MS compiler ?  
24206
24207 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24208
24209         * class.cs (Operator): New class for operator declarations.
24210         (Operator::OpType): Enum for the various operators.
24211
24212 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24213
24214         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24215         ostensibly handle this in semantic analysis.
24216
24217         * cs-parser.jay (general_catch_clause): Comment out
24218         (specific_catch_clauses, specific_catch_clause): Ditto.
24219         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24220         (catch_args, opt_catch_args): New productions.
24221         (catch_clause): Rewrite to use the new productions above
24222         (catch_clauses): Modify accordingly.
24223         (opt_catch_clauses): New production to use in try_statement
24224         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24225         and re-write the code in the actions to extract the specific and
24226         general catch clauses by being a little smart ;-)
24227
24228         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24229         Hooray, try and catch statements parse fine !
24230
24231 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24232
24233         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24234         string from the hashtable of variables.
24235
24236         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24237         I end up making that mistake ;-)
24238         (catch_clauses): Fixed gross error which made Key and Value of the 
24239         DictionaryEntry the same : $1 !!
24240
24241 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24242
24243         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24244
24245         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24246         when the add and remove accessors are specified. 
24247
24248 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24249
24250         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24251         information about indexer_declarator.
24252         (indexer_declarator): Implement actions.
24253         (parsing_indexer): New local boolean used to keep track of whether
24254         we are parsing indexers or properties. This is necessary because 
24255         implicit_parameters come into picture even for the get accessor in the 
24256         case of an indexer.
24257         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24258
24259         * class.cs (Indexer): New class for indexer declarations.
24260         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24261         (TypeContainer::indexers): New member to hold list of indexers for the
24262         type.
24263
24264 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24265
24266         * cs-parser.jay (add_accessor_declaration): Implement action.
24267         (remove_accessor_declaration): Implement action.
24268         (event_accessors_declaration): Implement
24269         (variable_declarators): swap statements for first rule - trivial.
24270
24271         * class.cs (Event): New class to hold information about event
24272         declarations.
24273         (TypeContainer::AddEvent): New method to add an event to a type
24274         (TypeContainer::events): New member to hold list of events.
24275
24276         * cs-parser.jay (event_declaration): Implement actions.
24277
24278 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24279
24280         * cs-parser.jay (dim_separators): Implement. Make it a string
24281         concatenating all the commas together, just as they appear.
24282         (opt_dim_separators): Modify accordingly
24283         (rank_specifiers): Update accordingly. Basically do the same
24284         thing - instead, collect the brackets here.
24285         (opt_rank_sepcifiers): Modify accordingly.
24286         (array_type): Modify to actually return the complete type string
24287         instead of ignoring the rank_specifiers.
24288         (expression_list): Implement to collect the expressions
24289         (variable_initializer): Implement. We make it a list of expressions
24290         essentially so that we can handle the array_initializer case neatly too.
24291         (variable_initializer_list): Implement.
24292         (array_initializer): Make it a list of variable_initializers
24293         (opt_array_initializer): Modify accordingly.
24294
24295         * expression.cs (New::NType): Add enumeration to help us
24296         keep track of whether we have an object/delegate creation
24297         or an array creation.
24298         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24299         members to hold data about array creation.
24300         (New:New): Modify to update NewType
24301         (New:New): New Overloaded contructor for the array creation
24302         case.
24303
24304         * cs-parser.jay (array_creation_expression): Implement to call
24305         the overloaded New constructor.
24306
24307 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24308
24309         * class.cs (TypeContainer::Constructors): Return member
24310         constructors instead of returning null.
24311
24312 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24313
24314         * typemanager.cs (InitCoreTypes): Initialize the various core
24315         types after we have populated the type manager with the user
24316         defined types (this distinction will be important later while
24317         compiling corlib.dll)
24318
24319         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24320         on Expression Classification.  Now all expressions have a method
24321         `Resolve' and a method `Emit'.
24322
24323         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24324         generation from working.     Also add some temporary debugging
24325         code. 
24326
24327 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24328
24329         * codegen.cs: Lots of code generation pieces.  This is only the
24330         beginning, will continue tomorrow with more touches of polish.  We
24331         handle the fundamentals of if, while, do, for, return.  Others are
24332         trickier and I need to start working on invocations soon.
24333
24334         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24335         s.InitStatement. 
24336
24337         * codegen.cs (EmitContext): New struct, used during code
24338         emission to keep a context.   Most of the code generation will be
24339         here. 
24340
24341         * cs-parser.jay: Add embedded blocks to the list of statements of
24342         this block.  So code generation proceeds in a top down fashion.
24343
24344 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24345
24346         * statement.cs: Add support for multiple child blocks.
24347
24348 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24349
24350         * codegen.cs (EmitCode): New function, will emit the code for a
24351         Block of code given a TypeContainer and its ILGenerator. 
24352
24353         * statement.cs (Block): Standard public readonly optimization.
24354         (Block::Block constructors): Link children. 
24355         (Block::Child): Child Linker.
24356         (Block::EmitVariables): Emits IL variable declarations.
24357
24358         * class.cs: Drop support for MethodGroups here, delay until
24359         Semantic Analysis.
24360         (Method::): Applied the same simplification that I did before, and
24361         move from Properties to public readonly fields.
24362         (Method::ParameterTypes): Returns the parameter types for the
24363         function, and implements a cache that will be useful later when I
24364         do error checking and the semantic analysis on the methods is
24365         performed.
24366         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24367         and made a method, optional argument tells whether this is a class
24368         or a structure to apply the `has-this' bit.
24369         (Method::GetCallingConvention): Implement, returns the calling
24370         convention. 
24371         (Method::Define): Defines the type, a second pass is performed
24372         later to populate the methods.
24373
24374         (Constructor::ParameterTypes): implement a cache similar to the
24375         one on Method::ParameterTypes, useful later when we do semantic
24376         analysis. 
24377
24378         (TypeContainer::EmitMethod):  New method.  Emits methods.
24379
24380         * expression.cs: Removed MethodGroup class from here.
24381
24382         * parameter.cs (Parameters::GetCallingConvention): new method.
24383
24384 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24385
24386         * class.cs (TypeContainer::Populate): Drop RootContext from the
24387         argument. 
24388
24389         (Constructor::CallingConvention): Returns the calling convention.
24390         (Constructor::ParameterTypes): Returns the constructor parameter
24391         types. 
24392
24393         (TypeContainer::AddConstructor): Keep track of default constructor
24394         and the default static constructor.
24395
24396         (Constructor::) Another class that starts using `public readonly'
24397         instead of properties. 
24398
24399         (Constructor::IsDefault): Whether this is a default constructor. 
24400
24401         (Field::) use readonly public fields instead of properties also.
24402
24403         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24404         track of static constructors;  If none is used, turn on
24405         BeforeFieldInit in the TypeAttributes. 
24406
24407         * cs-parser.jay (opt_argument_list): now the return can be null
24408         for the cases where there are no arguments. 
24409
24410         (constructor_declarator): If there is no implicit `base' or
24411         `this', then invoke the default parent constructor. 
24412
24413         * modifiers.cs (MethodAttr): New static function maps a set of
24414         modifiers flags into a MethodAttributes enum
24415         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24416         MethodAttr, TypeAttr to represent the various mappings where the
24417         modifiers are used.
24418         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24419
24420 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24421
24422         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24423         method arguments.
24424
24425         * interface.cs (PopulateIndexer): Implemented the code generator
24426         for interface indexers.
24427
24428 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24429
24430         * interface.cs (InterfaceMemberBase): Now we track the new status
24431         here.  
24432
24433         (PopulateProperty): Implement property population.  Woohoo!  Got
24434         Methods and Properties going today. 
24435
24436         Removed all the properties for interfaces, and replaced them with
24437         `public readonly' fields. 
24438
24439 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24440
24441         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24442         initialize their hashtables/arraylists only when they are needed
24443         instead of doing this always.
24444
24445         * parameter.cs: Handle refs and out parameters.
24446
24447         * cs-parser.jay: Use an ArrayList to construct the arguments
24448         instead of the ParameterCollection, and then cast that to a
24449         Parameter[] array.
24450
24451         * parameter.cs: Drop the use of ParameterCollection and use
24452         instead arrays of Parameters.
24453
24454         (GetParameterInfo): Use the Type, not the Name when resolving
24455         types. 
24456
24457 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24458
24459         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24460         and instead use public readonly fields.
24461
24462         * class.cs: Put back walking code for type containers.
24463
24464 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24465
24466         * class.cs (MakeConstant): Code to define constants.
24467
24468         * rootcontext.cs (LookupType): New function.  Used to locate types 
24469
24470
24471 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24472
24473         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24474         this System.Reflection code is.  Kudos to Microsoft
24475
24476         * typemanager.cs: Implement a type cache and avoid loading all
24477         types at boot time.  Wrap in LookupType the internals.  This made
24478         the compiler so much faster.  Wow.  I rule!
24479
24480         * driver.cs: Make sure we always load mscorlib first (for
24481         debugging purposes, nothing really important).
24482
24483         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24484         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24485
24486         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24487         on namespaces that have been imported using the `using' keyword.
24488
24489         * class.cs (TypeContainer::TypeAttr): Virtualize.
24490         (Class::TypeAttr): Return attributes suitable for this bad boy.
24491         (Struct::TypeAttr): ditto.
24492         Handle nested classes.
24493         (TypeContainer::) Remove all the type visiting code, it is now
24494         replaced with the rootcontext.cs code
24495
24496         * rootcontext.cs (GetClassBases): Added support for structs. 
24497
24498 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24499
24500         * interface.cs, statement.cs, class.cs, parameter.cs,
24501         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24502         Drop use of TypeRefs, and use strings instead.
24503
24504 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24505
24506         * rootcontext.cs: 
24507
24508         * class.cs (Struct::Struct): set the SEALED flags after
24509         checking the modifiers.
24510         (TypeContainer::TypeAttr): new property, returns the
24511         TypeAttributes for a class.  
24512
24513         * cs-parser.jay (type_list): Oops, list production was creating a
24514         new list of base types.
24515
24516         * rootcontext.cs (StdLib): New property.
24517         (GetInterfaceTypeByName): returns an interface by type name, and
24518         encapsulates error handling here.
24519         (GetInterfaces): simplified.
24520         (ResolveTree): Encapsulated all the tree resolution here.
24521         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24522         types. 
24523
24524         * driver.cs: Add support for --nostdlib, to avoid loading the
24525         default assemblies.
24526         (Main): Do not put tree resolution here. 
24527
24528         * rootcontext.cs: Beginning of the class resolution.
24529
24530 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24531
24532         * rootcontext.cs: Provide better error reporting. 
24533
24534         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24535
24536         * rootcontext.cs (CreateInterface): Handle the case where there
24537         are no parent interfaces.
24538
24539         (CloseTypes): Routine to flush types at the end.
24540         (CreateInterface): Track types.
24541         (GetInterfaces): Returns an array of Types from the list of
24542         defined interfaces.
24543
24544         * typemanager.c (AddUserType): Mechanism to track user types (puts
24545         the type on the global type hash, and allows us to close it at the
24546         end). 
24547
24548 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24549
24550         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24551         RecordInterface instead.
24552
24553         * cs-parser.jay: Updated to reflect changes above.
24554
24555         * decl.cs (Definition): Keep track of the TypeBuilder type that
24556         represents this type here.  Not sure we will use it in the long
24557         run, but wont hurt for now.
24558
24559         * driver.cs: Smaller changes to accomodate the new code.
24560
24561         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24562         when done. 
24563
24564         * rootcontext.cs (CreateInterface):  New method, used to create
24565         the System.TypeBuilder type for interfaces.
24566         (ResolveInterfaces): new entry point to resolve the interface
24567         hierarchy. 
24568         (CodeGen): Property, used to keep track of the code generator.
24569
24570 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24571
24572         * cs-parser.jay: Add a second production for delegate_declaration
24573         with `VOID'.
24574
24575         (enum_body): Put an opt_comma here instead of putting it on
24576         enum_body or enum_member_declarations so we can handle trailing
24577         commas on enumeration members.  Gets rid of a shift/reduce.
24578
24579         (type_list): Need a COMMA in the middle.
24580
24581         (indexer_declaration): Tell tokenizer to recognize get/set
24582
24583         * Remove old targets.
24584
24585         * Re-add the parser target.
24586
24587 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24588
24589         * cs-parser.jay: Add precendence rules for a number of operators
24590         ot reduce the number of shift/reduce conflicts in the grammar.
24591
24592 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24593
24594         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24595         and put it here.
24596
24597         Get rid of old crufty code.
24598
24599         * rootcontext.cs: Use this to keep track of the parsed
24600         representation and the defined types available to the program. 
24601
24602         * gen-treedump.cs: adjust for new convention.
24603
24604         * type.cs: Split out the type manager, and the assembly builder
24605         from here. 
24606
24607         * typemanager.cs: the type manager will live here now.
24608
24609         * cil-codegen.cs: And the code generator here. 
24610
24611 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24612
24613         * makefile: Fixed up for easy making.
24614
24615 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24616
24617         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24618         the 
24619
24620         (unary_expression): Expand pre_increment_expression and
24621         post_decrement_expression to reduce a shift/reduce.
24622
24623 2001-07-11  Simon Cozens
24624
24625         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24626
24627         Improve allow_keyword_as_indent name.
24628
24629 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24630
24631         * Adjustments for Beta2. 
24632
24633 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24634
24635         * decl.cs: Added `Define' abstract method.
24636         (InTransit): new property, used to catch recursive definitions. 
24637
24638         * interface.cs: Implement `Define'. 
24639
24640         * modifiers.cs: Map Modifiers.constants to
24641         System.Reflection.TypeAttribute flags.
24642
24643         * class.cs: Keep track of types and user-defined types.
24644         (BuilderInit): New method for creating an assembly
24645         (ResolveType): New function to launch the resolution process, only
24646         used by interfaces for now.
24647
24648         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24649         that are inserted into the name space. 
24650
24651 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24652
24653         * ARGH.  I have screwed up my tree so many times due to the use of
24654         rsync rather than using CVS.  Going to fix this at once. 
24655
24656         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24657         load types.
24658
24659 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24660
24661         * Experiment successful: Use System.Type rather that our own
24662         version of Type.  
24663
24664 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24665
24666         * cs-parser.jay: Removed nsAliases from here.
24667
24668         Use new namespaces, handle `using XXX;' 
24669
24670         * namespace.cs: Reimplemented namespace handling, use a recursive
24671         definition of the class.  Now we can keep track of using clauses
24672         and catch invalid using clauses.
24673
24674 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24675
24676         * gen-treedump.cs: Adapted for all the renaming.
24677
24678         * expression.cs (Expression): this class now has a Type property
24679         which returns an expression Type.
24680
24681         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24682         `Type', as this has a different meaning now in the base
24683
24684 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24685
24686         * interface.cs, class.cs: Removed from all the sources the
24687         references to signature computation, as we can not do method
24688         signature computation during the parsing time, as we are not
24689         trying to solve at that point distinguishing:
24690
24691         class X {
24692                 void a (Blah x) {}
24693                 void a (NS.Blah x) {}
24694         }
24695
24696         Which depending on the context might be valid or not, as we do not
24697         know if Blah is the same thing as NS.Blah at that point.
24698
24699         * Redid everything so the code uses TypeRefs now instead of
24700         Types.  TypeRefs are just temporary type placeholders, that need
24701         to be resolved.  They initially have a pointer to a string and the
24702         current scope in which they are used.  This is used later by the
24703         compiler to resolve the reference to an actual Type. 
24704
24705         * DeclSpace is no longer a CIR.Type, and neither are
24706         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24707         are all DeclSpaces, but no Types. 
24708
24709         * type.cs (TypeRefManager): This implements the TypeRef manager,
24710         which keeps track of all the types that need to be resolved after
24711         the parsing has finished. 
24712
24713 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24714
24715         * ARGH.  We are going to have to store `foreach' as a class rather
24716         than resolving it, as we need to verify error 1579 after name
24717         resolution.   *OR* we could keep a flag that says `This request to
24718         IEnumerator comes from a foreach statement' which we can then use
24719         to generate the error.
24720
24721 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24722
24723         * class.cs (TypeContainer.AddMethod): we now add methods to the
24724         MethodGroup instead of the method hashtable.  
24725
24726         * expression.cs: Add MethodGroup abstraction, which gets us one
24727         step closer to the specification in the way we handle method
24728         declarations.  
24729
24730         * cs-parser.jay (primary_expression): qualified_identifier now
24731         tried to match up an identifier to a local variable reference or
24732         to a parameter reference.
24733
24734         current_local_parameters is now a parser global variable that
24735         points to the current parameters for the block, used during name
24736         lookup.
24737
24738         (property_declaration): Now creates an implicit `value' argument to
24739         the set accessor.
24740
24741 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24742
24743         * parameter.cs: Do not use `param' arguments as part of the
24744         signature, per the spec.
24745
24746 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24747
24748         * decl.cs: Base class for classes, structs and interfaces.  This
24749         is the "Declaration Space" 
24750
24751         * cs-parser.jay: Use CheckDef for checking declaration errors
24752         instead of having one on each function.
24753
24754         * class.cs: Factor out some code for handling error handling in
24755         accordance to the "Declarations" section in the "Basic Concepts"
24756         chapter in the ECMA C# spec.
24757
24758         * interface.cs: Make all interface member classes derive from
24759         InterfaceMemberBase.
24760
24761 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24762
24763         * Many things: all interfaces are parsed and generated in
24764         gen-treedump.  Support for member variables, constructors,
24765         destructors, properties, constants is there.
24766
24767         Beginning of the IL backend, but very little done, just there for
24768         testing purposes. 
24769
24770 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24771
24772         * cs-parser.jay: Fix labeled statement.
24773
24774         * cs-tokenizer.cs (escape): Escape " and ' always.
24775         ref_line, ref_name: keep track of the line/filename as instructed
24776         by #line by the compiler.
24777         Parse #line.
24778
24779 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24780
24781         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24782         to match the values in System.CodeDOM.
24783
24784         Divid renamed to Divide.
24785
24786         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24787         statements. 
24788         (Statements.set): remove.
24789
24790         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24791         statements. 
24792
24793         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24794         falseStatements always have valid values. 
24795
24796         * cs-parser.jay: Use System.CodeDOM now.
24797